Yahiro025 opened a new pull request, #21763:
URL: https://github.com/apache/echarts/pull/21763

   <!-- 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?
   
   Clear leftover `selectedOffset` x/y translation on pie sectors after 
`setOption` replaces data so layout stays centered.
   
   ### Fixed issues
   
   - #21756: Pie selected slice x/y offset persists after setOption with fewer 
data items
   
   
   
   ## Details
   
   ### Before: What was the problem?
   
   With `selectedMode: 'multiple'` and `selectedOffset`, selecting pie slices 
applies a graphic translation. After `setOption` replaces `series[0].data` with 
fewer items (`notMerge: true`) and `resize()`, those x/y offsets can remain on 
sector (and labelLine) elements even when the item is no longer selected. 
`dispatchAction({ type: 'unselect' })` alone does not clear them, so the pie 
can look shifted or misaligned relative to the series layout box.
   
   Repro: https://jsfiddle.net/ma_ss_ai/0kozdxfy/5/
   
   ### After: How does it behave after the fixing?
   
   In `PieView` / `PiePiece`, when updating select-state geometry, if the 
series item is not selected, reset the sector (and labelLine) translation to `{ 
x: 0, y: 0 }` before applying select offset. That drops stale select-state 
translation left from a previous selection when data is replaced, so a 
following `resize()` no longer leaves slices shifted.
   
   Added:
   - unit test `test/ut/spec/series/pie-selectedOffset.test.ts`
   - manual HTML case `test/pie-selectedOffset-setOption.html`
   
   
   
   ## 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.
   
   ### ZRender Changes
   
   - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
   
   ### Related test cases or examples to use the new APIs
   
   See `test/ut/spec/series/pie-selectedOffset.test.ts` and 
`test/pie-selectedOffset-setOption.html`.
   
   ### Merging options
   
   - [x] Please squash the commits into a single one when merging.
   
   ### Other information
   
   AI assistance was used while preparing this change; the commit is authored 
solely as Yahiro025 (Bennett Payoyo).
   


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