Repository navigation
Add pane option to HeatMapWithTime - #2349
Open
KhadeerBasha1232 wants to merge 1 commit into
Open
KhadeerBasha1232 wants to merge 1 commit into
KhadeerBasha1232 wants to merge 1 commit into
Conversation
The heatmap library always appended its element to the overlay pane with no z-index, so any ImageOverlay (Leaflet gives it a z-index) covered the heatmap no matter the order the layers were added. HeatMapWithTime now takes a `pane` argument. Combined with a CustomPane that has a higher z_index, the heatmap can be drawn on top of image overlays. The default stays "overlayPane", so existing maps render as before. Closes python-visualization#1400 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KhadeerBasha1232
temporarily deployed
to
pypi
November 16, 2026 12:25 — with
GitHub Actions
Inactive
This branch was previously deployed
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.
Add
paneoption toHeatMapWithTimeCloses #1400
The problem
HeatMapWithTimeis drawn underneath anImageOverlay, even when the heatmap is added to the map after the image.The heatmap library (
pa7_leaflet_hm) always appends its<div>to Leaflet'soverlayPanewithz-index: auto. Leaflet gives everyImageOverlaya numericzIndex, so inside that pane the image always stacks above the heatmap. The CSS workaround from #1201 (.leaflet-heatmap-layer { z-index: 300 }) doesn't help here, because that class comes fromleaflet.heat, which the plainHeatMapplugin uses. The library behindHeatMapWithTimenever sets it.The fix
HeatMapWithTimenow takes apaneargument, like other Leaflet layers. To draw the heatmap on top, give it a custom pane with a higher z-index:"overlayPane", so existing maps render as before.PanedHeatmapOverlaysubclass moves the heatmap element into the chosen pane ononAddand removes it from there ononRemove. I didn't edit the bundledpa7_leaflet_hm.min.js, because folium loads that file from jsDelivr.Tests
ImageOverlayplusHeatMapWithTime:overlayPane, as before.LayerControl, stepping the time slider, zooming and panning all work with no console errors.CI note
The
pre-commit.cifailure isn't from this change. Black wants two blank lines between two tests intests/test_features.py, which also fails onmainsince #2307 and #2346 were merged. #2350 fixes it, and I'll rebase this PR once that's merged. All the test runs (Ubuntu, macOS, Windows × Python 3.11/3.14) pass.