Repository navigation
refactor(figure): allow at most one heatmap trace per figure - #112
Merged
Merged
Conversation
This was referenced Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #101.
Stacked on #111 (both edit the heatmap section of
Architecture.mdand the heatmap tests intests/test_spec.py). Merge #111 first; this PR then targetsmain.Change
Figure.to_spec()raisesValueErrorwhen one figure holds more than one heatmap-like trace (histogram2d,geo_histogram2d,corr_heatmap).Dashboard.to_spec()callsFigure.to_spec()per figure, so it gets the check too._validate_heatmap_stylesand_effective_heatmap_style, which required several heatmaps in one figure to sharecolor_scale,color_rangeandcolor_norm. The value checks they repeated stay in the trace helpers (normalize_heatmap_color_scale,normalize_heatmap_color_range,normalize_heatmap_color_norm), which every heatmap constructor andfrom_trace_speccall.histogram2d, or ageo_lineover ageo_histogram2d.Architecture.mddescribes the new rule.Impact
_validate_bar_modeshas the same gap. The decoded-spec validation of Decoded specs skip trace validation: invalid display values give HTTP 500 at /view, and /share accepts them #99 is the place to close both.Tests
TestFigureHeatmapValidationis replaced byTestFigureHeatmapCount: a second heatmap raises (one case per heatmap type), a heatmap with a line or ageo_linebuilds, and theDashboardpath raises.pytest tests flexviz_polars/tests: 2396 passed, 2 skipped.pytest -m browser -k "heatmap or hist2d or geo or corr" tests: 33 passed, 1 skipped.