Skip to content

Conversation

@Srajan-Sanjay-Saxena
Copy link
Contributor

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Fixes canvas laggy rendering for geo maps with many labels by optimizing ZRender refresh cycles to prevent unnecessary re-renders.

Fixed issues

Details

Before: What was the problem?

Geo maps with many data points and labels caused performance issues due to excessive refresh cycles in ZRender:

  • Multiple refresh() calls restarted animation loop unnecessarily (8 animation starts for 5 refresh calls)
  • Fixed 10-frame sleep threshold wasn't optimal for complex scenes
  • Redundant hover refresh requests wasted resources
  • Demo showing issue: https://www.makeapie.cn/echarts_content/xVNl_-jjok.html

After: How does it behave after the fixing?

Performance optimizations in ZRender prevent unnecessary re-renders:

  • ✅ Duplicate refresh prevention: 8 → 1 animation starts
  • ✅ Adaptive sleep threshold: Complex scenes sleep sooner (3-5 frames vs 10)
  • ✅ Hover refresh optimization: Prevents redundant flag setting
  • ✅ Automated test verification: test/test-optimizations.html

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

Security Checking

  • This PR uses security-sensitive Web APIs.

ZRender Changes

Related test cases or examples to use the new APIs

  • test/test-optimizations.html - Automated verification of all performance optimizations
  • Tests duplicate refresh prevention (8 → 1 animation starts)
  • Tests adaptive sleep threshold functionality
  • Tests hover refresh optimization
  • Provides automated verification of zrender performance improvements

Merging options

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

Other information

Performance improvements verified with automated tests showing significant reduction in unnecessary animation restarts and better resource management for complex visualizations.

- Tests duplicate refresh prevention (8 → 1 animation starts)
- Tests adaptive sleep threshold functionality
- Tests hover refresh optimization
- Provides automated verification of zrender performance improvements
@echarts-bot
Copy link

echarts-bot bot commented Nov 3, 2025

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.

This PR depends on ZRender changes. Please update the ZRender dependency to the latest nightly version including this change, which takes place everyday at 8:00 UTC (16:00 Beijing Time).
You can use npm i zrender@npm:zrender-nightly@dev to update package.json.
If you have any question about this, please leave a comment and we will give you extra help on this.

@Srajan-Sanjay-Saxena
Copy link
Contributor Author

i have upgraded the package of zrender to nightly in commit 5af7efd

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