Skip to content

fix(label): finish the label fade-in before an instant update - #21810

Open
MindFreeze wants to merge 1 commit into
apache:masterfrom
MindFreeze:fix-label-fade-roam
Open

MindFreeze wants to merge 1 commit into
apache:masterfrom
MindFreeze:fix-label-fade-roam

Conversation

@MindFreeze

Copy link
Copy Markdown

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Finish a running label fade-in before an instant label update, so zooming during the fade no longer leaves labels half transparent.

Fixed issues

N.A.

Details

Before: What was the problem?

When labels are laid out for the first time with animation enabled, LabelManager fades them in from opacity 0. A zoom roam calls api.updateLabelLayout(), and roam payloads disable animation, so updateProps on the label takes the instant branch of animateOrSetProps. That branch calls el.stopAnimation(), which also stops the fade-in. The label keeps the opacity it had reached, and later layouts never touch its opacity again.

Graph with layout: 'none', zoomed 1 second into a 5 second fade-in. The labels stay at opacity 0.2:

before

After: How does it behave after the fixing?

Before an instant update, _animateLabels finishes the label's own enter animations with stopAnimation('enter', true). The label jumps to its final opacity. Animated updates are unchanged.

after

Document Info

One of the following should be checked.

  • 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

ZRender Changes

  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

test/label-animation.html, last case.

Others

Merging options

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

Other information

Found in the Home Assistant network graph, which carries this fix as a patch: home-assistant/frontend#55397.

Roam actions update the label layout without animation. The instant
branch of updateProps stops every animation of the label, so a fade-in
that was still running stayed at its current opacity for good.
@echarts-bot

echarts-bot Bot commented Oct 28, 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.

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.

1 participant