You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A figure can hold more than one heatmap-like trace (histogram2d, geo_histogram2d, corr_heatmap). Figure.to_spec() then requires them to share the same color_scale, color_range and color_norm (_validate_heatmap_styles in flexviz/figure.py), because the renderers treat the heatmap color control as figure-level.
That rule does not make the figure readable:
Each trace draws its own colorbar, at the same place. Reproduced on main (f0b8e7c) with two add_geo_histogram2d traces in one figure: two colorbars, with the tick labels on top of each other.
With color_range="auto", each trace has its own range, so two traces with the same style still get two different colorbars.
A heatmap is opaque, so the second trace hides the first wherever they overlap.
No test, example or doc uses two heatmaps in one figure, except the tests of the style check.
A heatmap together with other traces stays allowed, for example a line over a histogram2d, or a geo_line over a geo_histogram2d.
Update Architecture.md, which describes the style rule, and add a CHANGELOG entry. This is a breaking change, which the pre-1.0 policy permits.
Tests
Replace the style tests in tests/test_spec.py (TestFigureHeatmapValidation) with one test per heatmap type that checks that a second heatmap in one figure raises, and one test that a heatmap with a line still builds.
Activity
jvdd commentedon Sep 29, 2026
Fixed by #112.