Skip to content

fix(heatmap): prevent crash with missing coordinate system#21698

Merged
plainheart merged 1 commit into
apache:releasefrom
aloktomarr:fix/heatmap-missing-coordsys-19060
Jul 20, 2026
Merged

fix(heatmap): prevent crash with missing coordinate system#21698
plainheart merged 1 commit into
apache:releasefrom
aloktomarr:fix/heatmap-missing-coordsys-19060

Conversation

@aloktomarr

Copy link
Copy Markdown

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Prevents HeatmapView.render from throwing when a heatmap's coordinate system cannot be resolved.

Fixed issues

Details

Before: What was the problem?

HeatmapView.render read seriesModel.coordinateSystem.type without checking that the coordinate system existed. When a heatmap references a coordinate system whose component is missing (e.g. coordinateSystem: 'calendar' or 'bmap' not registered), coordinateSystem is undefined, so coordSys.type threw Cannot read properties of undefined (reading 'type'), aborting the entire render. incrementalRender already guarded this case with if (coordSys), but render did not.

After: How does it behave after the fixing?

render now returns early when the coordinate system is missing (same guard as incrementalRender), so the misconfiguration is skipped gracefully — ECharts still emits its usual "coordinate system cannot be found" warning — instead of throwing. Added a regression unit test (test/ut/spec/series/heatmap.test.ts).

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.

Merging options

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

@echarts-bot

echarts-bot Bot commented Jul 17, 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.

Comment thread src/chart/heatmap/HeatmapView.ts
@aloktomarr

Copy link
Copy Markdown
Author

Thanks for the review and the helpful context!!

Thanks for explaining the Vue case too, where the chart instance becomes reactive and [seriesModel.coordinateSystem] gets lost, and how shallowRef/markRaw help before 6.1.0 (and that #21293 fixes it from 6.1.0). That's a different cause from the case this PR handles, where a series uses a coordinate system that isn't registered or declared.

I've pushed a follow-up commit that adds a dev warning before skipping the render, instead of skipping silently:

[ECharts] Heatmap will not be rendered because its coordinate system is missing. Please make sure the coordinate system is declared and its component is imported.

It only logs once so it doesn't repeat on every render. Please let me know if you would like different wording.

Thanks again!!

@plainheart

Copy link
Copy Markdown
Member

@aloktomarr You were right to mention that ECharts already emits a warning when a coordinate system cannot be resolved. I had overlooked that and suggested an additional heatmap-specific warning unnecessarily. I’ve just pushed a follow-up commit to remove the redundant log. Sorry for the extra churn.

@plainheart plainheart changed the title fix(heatmap): skip render when the coordinate system is missing inste… fix(heatmap): prevent crash with missing coordinate system Jul 20, 2026
@plainheart
plainheart changed the base branch from master to release July 20, 2026 08:00
@aloktomarr

Copy link
Copy Markdown
Author

@plainheart No worries at all!! thanks for the quick follow-up and for cleaning it up!
Agreed: since ECharts already logs when the coordinate system can't be resolved, the extra heatmap warning isn't needed. The current version looks good to me. Thanks for the review!

@plainheart
plainheart changed the base branch from release to master July 20, 2026 08:12
@plainheart
plainheart changed the base branch from master to release July 20, 2026 08:15
@plainheart
plainheart force-pushed the fix/heatmap-missing-coordsys-19060 branch from 2cb161f to c6741a7 Compare July 20, 2026 08:18
@plainheart
plainheart merged commit bc21b40 into apache:release Jul 20, 2026
2 checks passed
@echarts-bot

echarts-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

Congratulations! Your PR has been merged. Thanks for your contribution! 👍

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.

[Bug] Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'type') at HeatmapView2.render (HeatmapView.js:137:18)

2 participants