Skip to content

fix(heatmap): skip render when the coordinate system is missing inste…#21698

Open
aloktomarr wants to merge 1 commit into
apache:masterfrom
aloktomarr:fix/heatmap-missing-coordsys-19060
Open

fix(heatmap): skip render when the coordinate system is missing inste…#21698
aloktomarr wants to merge 1 commit into
apache:masterfrom
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 on lines +124 to +130
// The coordinate system may be unresolved, e.g. a heatmap that
// references a `calendar`/`geo`/`bmap` coordinate system whose component
// is missing. Skip rendering instead of throwing on `coordSys.type`
// (`incrementalRender` already guards this the same way). See #19060.
if (!coordSys) {
return;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the contribution! For #19060, it generally happens in a Vue setup because the ECharts instance can be proxied and seriesModel.coordinateSystem can be lost unexpectedly. See also #17723 (comment). For users on ECharts versions before 6.1.0, the recommended workaround is still to avoid making the ECharts instance reactive (for example, with shallowRef or markRaw); in ECharts 6.1.0 and later, this is no longer necessary. (PR #21293)

In the scenario covered by your regression test, where a series references an unregistered or undeclared coordinate system, I think your fix makes sense. It would be even better to emit a development warning/log before returning, rather than silently skipping the render.

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