yqtian-se opened a new issue, #21854:
URL: https://github.com/apache/echarts/issues/21854

   ### Version
   6.1.0 (also current `master` 34f4d927e)
   
   ### Link to Minimal Reproduction
   
https://echarts.apache.org/examples/en/editor.html?code=dZJNS8NAEIbv-RXvrRVCTKsItiho8aiCepMepsmarCa7YXeiBOl_d3Zj1aJews7M885nbMfaGpzhPQHI6JaCvcATNV6l4vPKaeUXeAwAwEOnFpgUtXXlJMSBkphCHIbaELuYYJviy7zcN1dirkdho42656ER9zsK21gn8cpRqZXhSQrbUaF5WCDPTiXHTvMSuokGROdt74qxbAomVymORVO8UtNL4DjfaffwQHzhq298_je-l_0HPhM80mv5btfJdpkcHmIG6bGoyVQKXKu4ogx3erOxxkOSBK92MOoNvqZOpdj00Ynd_B7klGyl7XpWJZ6cbWPcNuUoyRKv-EG3yvY8nR7g7DzecDxoNp7tMV9ncWPhETuWS8-X_2Pzb-wkD1w7rGpyLCDfRsl0VB4sE7nqLM9zecnER3Fiahr5YT5JUEXa4E1zHTu_v7i-2tXFjeVam-pzST7FMC7lx_zPfduBbfQW1jlVMDrrdUzwe_h_O01xFNv8AA&enc=deflate
   
   ```js
   option = {
     animation: false,
     series: [{
       type: 'chord',
       data: [{ name: 'A' }, { name: 'B' }, { name: 'C' }],
       lineStyle: { color: 'gradient', opacity: 0.9 },
       links: [
         { source: 'A', target: 'B', value: 40 },
         { source: 'B', target: 'C', value: 20 },
         { source: 'A', target: 'C', value: 10 }
       ]
     }]
   };
   // 1 s: change the data. Ribbons get their new shape, but the gradients are 
computed from the old shape.
   setTimeout(() => {
     option.series[0].links[0].value = 2;
     option.series[0].links[2].value = 60;
     myChart.setOption(option);
   }, 1000);
   // 3 s: call setOption again with the SAME option. Nothing changes, yet the 
gradients jump to the correct position.
   setTimeout(() => myChart.setOption(option), 3000);
   ```
   
   ### Steps to Reproduce
   1. Create the chord chart above with `lineStyle.color: 'gradient'`.
   2. Update the data so the layout changes (resizing the chart triggers it 
too).
   3. Compare with a chart created directly with the final size or data.
   4. Calling `setOption` again with the same option makes the gradients jump 
to the correct position.
   
   ### Current Behavior
   The ribbons have the new shape, but the source→target gradient is still 
positioned for the old shape. The colour transition is
   offset from the ribbons. Each update uses the shape from one layout earlier.
   
   ### Expected Behavior
   The gradient follows the current ribbon shape, as in a fresh chart.
   
   ### Environment
   - OS: any (also reproduced with the SVG renderer in Node.js SSR)
   - Browser: any
   - Framework: none
   
   ### Any additional comments?
   Cause: in `ChordEdge.updateData`, for an existing element `applyEdgeFill()` 
runs **before** `graphic.updateProps(el, { shape })`.
   `applyEdgeFill` builds the `LinearGradient` from `el.shape`, which still 
holds the old shape. `'source'` and `'target'` colours are not
   affected. I can send a PR.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to