SakshamSinghal20 opened a new pull request, #21502:
URL: https://github.com/apache/echarts/pull/21502
This pull request is in the type of:
bug fixing
new feature
others
What does this PR do?
Fixes heatmap axis type validation inconsistency between dev and prod
builds, enabling support for time and value axes.
Fixed issues
#21492 : Heatmap with time/value axes throws error in dev but works in prod
Details
Before: What was the problem?
Heatmaps using xAxis.type = "time" or "value" and yAxis.type = "value"
behaved differently across builds:
Dev build: Threw runtime error "Heatmap on cartesian must have two category
axes"
Prod build: Rendered successfully without errors
The root cause was validation code wrapped in __DEV__ blocks (lines 186-193
in HeatmapView.ts) that enforced category axes only in development builds. This
validation was stripped during production minification, creating inconsistent
behavior and making it unclear what axis types are officially supported.
After: How does it behave after the fixing?
Both dev and prod builds now consistently support heatmaps with any
combination of category, time, or value axes:
Removed the restrictive __DEV__ validation checks
Implemented dynamic cell size calculation:
Category axes with onBand: Use getBandWidth() (preserves original behavior)
Time/Value axes: Calculate cell dimensions as pixelSpan / dataSpan
Both X and Y axes are handled independently based on their type
The fix is fully backward compatible—existing heatmaps with category axes
continue to work exactly as before, while time and value axes are now
officially supported in both build types.
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
This PR depends on ZRender changes (ecomfe/zrender#xxx).
Related test cases or examples to use the new APIs
Test case added: test/heatmap-time-value-axes.html demonstrates heatmap with
time xAxis and value yAxis.
Merging options
Please squash the commits into a single one when merging.
Other information
N/A
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]