Repository navigation
fix(radar): animate symbols from the center on enter - #21792
Open
SahinurDEV wants to merge 1 commit into
Open
SahinurDEV wants to merge 1 commit into
SahinurDEV wants to merge 1 commit into
Conversation
|
Thanks for your contribution! Please DO NOT commit the files in dist, i18n, and ssr/client/dist folders in a non-release pull request. These folders are for release use only. |
|
There's already a PR for this issue awaiting review. #21775 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief Information
This pull request is in the type of:
What does this PR do?
Makes radar symbols animate out from the center together with the polyline/polygon on enter again, as they did in 4.x.
Fixed issues
Details
Before: What was the problem?
In the
addbranch ofRadarView, the symbols' start positions were read frompolyline.shape.pointsright aftergraphic.initProps(polyline, ...). With zrender 5,animateToalready writes the target points intopolyline.shape.points(in place) before the first frame. SoupdateSymbolsreceived the final points as both "old" and "new". The symbols were placed at their final positions andinitPropshad nothing to animate: no animator was created, and they appeared immediately while the lines grew from the center.After: How does it behave after the fixing?
The
addbranch passes freshgetInitialPoints(points)(the radar center) toupdateSymbols, so each symbol starts at the center and gets an enter animation to its final point, in sync with the lines. I used a separate array on purpose: zrender mutates the polyline's points array in place, so reusing that array would bring the bug back. Theupdatebranch is unchanged.Added
test/ut/spec/series/radar.test.ts:animationDuration, every symbol starts at the radar center and has an animator whose first keyframe is the center and last keyframe is its layout point (fails on master: the symbol is already at its finaly, with no animator)animation: false, symbols are placed at their final positions with no animatorsnpm test(27 suites / 196 tests), eslint on the changed file andtsc --noEmitpass locally.Document Info
Misc
Security Checking
ZRender Changes
Related test cases or examples to use the new APIs
N.A.
Merging options
Other information
AI disclosure: I used an AI coding assistant to help investigate and write this fix and its tests. I reviewed the change and ran the tests myself.