Skip to content

fix(radar): animate symbols from the center on enter - #21792

Open
SahinurDEV wants to merge 1 commit into
apache:masterfrom
SahinurDEV:fix-radar-symbol-entry-animation
Open

SahinurDEV wants to merge 1 commit into
apache:masterfrom
SahinurDEV:fix-radar-symbol-entry-animation

Conversation

@SahinurDEV

Copy link
Copy Markdown

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

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 add branch of RadarView, the symbols' start positions were read from polyline.shape.points right after graphic.initProps(polyline, ...). With zrender 5, animateTo already writes the target points into polyline.shape.points (in place) before the first frame. So updateSymbols received the final points as both "old" and "new". The symbols were placed at their final positions and initProps had 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 add branch passes fresh getInitialPoints(points) (the radar center) to updateSymbols, 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. The update branch is unchanged.

Added test/ut/spec/series/radar.test.ts:

  • with a long 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 final y, with no animator)
  • with animation: false, symbols are placed at their final positions with no animators

npm test (27 suites / 196 tests), eslint on the changed file and tsc --noEmit pass locally.

Document Info

  • This PR doesn't relate to document changes

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

N.A.

Merging options

  • Please squash the commits into a single one when merging.

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.

@echarts-bot

echarts-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

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.

@martinburch

Copy link
Copy Markdown

There's already a PR for this issue awaiting review. #21775

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants