Repository navigation
Docs: show feature info in a fixed box - #2359
Open
KhadeerBasha1232 wants to merge 1 commit into
Open
KhadeerBasha1232 wants to merge 1 commit into
KhadeerBasha1232 wants to merge 1 commit into
Conversation
Closes python-visualization#1545 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KhadeerBasha1232
temporarily deployed
to
pypi
November 19, 2026 07:36 — 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.
Docs: show feature info in a fixed box
Closes #1545
The problem
#1545 asks how to show the information of a hovered feature at a fixed spot
on the map, like the info box in Leaflet's
interactive choropleth tutorial.
GeoJsonTooltipalways follows the mouse, and the docs don't show another way.The change
A new page in the advanced guide, Show feature info in a fixed box
(
docs/advanced_guide/info_box.md). It builds the US unemployment map fromthe folium example data and shows how to:
InfoBoxMacroElementthat creates a Leaflet control at achosen
position, withfields/aliaseslikeGeoJsonTooltip;GeoJson(on_each_feature=...), passing the box toJsCodeas a parameter so
%(info)sbecomes its Javascript name.It only uses existing folium features, so there are no library changes. The
box fills in its text with
textContent, so property values are never parsedas HTML.
Depends on #2358
on_each_featurecrashes on the current main and in v1.0.0. #2358 fixesthat. Until it's merged this example renders without the states, the same
as the existing
on_each_featureuser guide page.How I checked it
I ran the page's code cells and opened the result in a browser, with #2358
applied:
"Hover over a state".
State: Texas/Unemployment (%): 6.4.