yqtian-se opened a new pull request, #21855:
URL: https://github.com/apache/echarts/pull/21855

   <!-- Please fill in the following information to help us review your PR more 
efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [x] bug fixing
   - [ ] new feature
   - [ ] others
   
   
   
   ### What does this PR do?
   
   Build the `lineStyle.color: 'gradient'` fill of chord edges from the new 
edge shape instead of the element's current (old) shape.
   
   
   
   ### Fixed issues
   
   - #21854: chord `lineStyle.color: 'gradient'` uses the previous layout after 
resize or setOption
   
   
   ## Details
   
   ### Before: What was the problem?
   
   In `ChordEdge.updateData`, when an existing edge element is updated, 
`applyEdgeFill()` is called before
   `graphic.updateProps(el, { shape })`. For `'gradient'`, `applyEdgeFill` 
computes the gradient endpoints from `edgeShape.shape`, i.e.
   the **previous** layout. After `resize()` or a data update, the gradient is 
misplaced relative to the ribbon.
   
   <!-- before/after image -->
   
   ### After: How does it behave after the fixing?
   
   `applyEdgeFill` takes the target `shape` as a parameter (both call sites 
pass the shape just computed from the layout). After `resize()` and
   after a data update the chart is identical to a fresh chart. `'source'` and 
`'target'` colours are unchanged.
   
   
   
   ## Document Info
   
   One of the following should be checked.
   
   - [x] This PR doesn't relate to document changes
   - [ ] The document should be updated later
   - [ ] The document changes have been made in apache/echarts-doc#xxx
   
   
   
   ## Misc
   
   ### Security Checking
   
   - [ ] This PR uses security-sensitive Web APIs.
   
   <!-- PLEASE CHECK IT AGAINST: 
<https://github.com/apache/echarts/wiki/Security-Checklist-for-Code-Contributors>
 -->
   
   ### ZRender Changes
   
   - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
   
   ### Related test cases or examples to use the new APIs
   
   `test/ut/spec/series/chord.test.ts` (new): after `resize()` and after a data 
update, the gradient endpoints of every edge equal a fresh
   chart's. Both tests fail on master and pass with this change.
   
   ### Merging options
   
   - [x] Please squash the commits into a single one when merging.
   
   ### Other information
   
   The open PR #21597 also adds `test/ut/spec/series/chord.test.ts`. Whichever 
lands second should append its `describe` to the
   other's file. #21497 touches `ChordEdge.buildPath`/`ChordPathShape` only and 
does not overlap.
   


-- 
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