Fix duplicate HTML when map.save() is called repeatedly#2239
Open
vraj2131 wants to merge 1 commit into
Open
Conversation
14e8de6 to
9707f4a
Compare
Repeated save() calls appended duplicate JavaScript because SetIcon and ElementAddToElement created new render children with unique IDs on each pass. Use stable script names so repeated renders replace instead of append. Do not clear figure.html in render(); geopandas adds legend HTML directly there. Fixes python-visualization#2237
9707f4a to
2b7290a
Compare
|
neuroslope |
Collaborator
|
Seems like a sensible change. I do not understand everything yet. Why is the |
banderlog
reviewed
Jun 13, 2026
banderlog
reviewed
Jun 13, 2026
banderlog
reviewed
Jun 13, 2026
|
Adding But I have no idea why UPD: all other changes, except those two above mentioned functions are irrelevant |
banderlog
reviewed
Jun 13, 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.
Summary
SetIconandElementAddToElementso repeatedsave()calls replace JavaScript instead of appending duplicatesfigure.htmlduringrender()so geopandas legend HTML added directly to the figure is preservedsave()calls produce identical HTMLFixes #2237
Test plan
pytest tests/test_map.py::test_repeated_save_produces_identical_htmlpytest geopandas/tests/test_explore.pylegend tests (categorical legend, colorbar, mapclassify)pytest tests --ignore=tests/seleniumpre-commit runon changed files