Repository navigation
fix(adapters): draw a geo_histogram2d overlay target and fade its background - #103
Merged
Merged
Conversation
jvdd
force-pushed
the
fix/geo-overlay-heatmap-extent
branch
from
September 27, 2026 15:56
289b462 to
a5cb5ea
Compare
This was referenced Sep 27, 2026
Merged
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.
Fixes #97.
A
geo_histogram2dthat another figure filters in overlay mode did not draw correctly. This PR fixes the two bugs behind that.The crash
heatmapZFiniteExtentreadzas rows of cells. A choropleth has a flatz, so the inner loop threw(row || []) is not iterable:syncHeatmapOverlayColorScaleand stopped the render. The map kept only its background layer.heatmapHasRenderableCells, after the render, infvFinalizeHeatmapOverlayColorbars. The colorbar stayed on the background layer.heatmapZFiniteExtentnow takes the trace and reads the flatzof a choropleth as one row. It branches on the trace type, as the log norm does, instead of guessing from the data shape.The background was never faded
Once the crash was fixed, a second bug showed: the background layer of the map was drawn at full strength, so the cells outside the selection looked like filtered data. Plotly's
choroplethmaphas no trace-levelopacity(checked in the Plotly.js 3.0.0 schema), soOVERLAY_BG_OPACITYhad no effect on it. Maplibre painted the layer atfill-opacity: 1.The new
applyChoroplethLayerOpacityputs the layer opacity on the marker opacity of each cell. With a log norm, it multiplies with the per-cell values that hide the cells at or below 0.Before this change, the overlay design for heatmap-like targets was reviewed with a demo on real data. The decision was to keep it as it is for now, and to consider dropping overlay for these targets later: #104.
A review of this PR found a problem that is older than this PR: after a zoom with an active selection, the background of a
filtered_onlytrace keeps its pre-zoom grid, and a box selection on such a zoomed map gets a wrong box. It is recorded in #104 and not fixed here.Tests
test_overlay_map_fades_background_under_filtered_layer, with three cases: a linear norm, a log norm, and a log norm on a signedhistfunc="sum".main, with the crash fix alone, and when the fade overwrites the per-cell log opacities with one value.make test: 2390 passed, 2 skipped.make test-browser: 316 passed, 12 skipped.ruffis clean.fill-opacity: 0.16 for the background layer and 1 for the filtered layer with a linear norm.