[BUG]: `layout.uirevision` doesn't play well with map subplot auto-fit
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 18.3k
- Forks
- 2k
- Ø Merge
- 2 T. 12 Std.
- Gemergte PRs (30 T.)
- 28
Beschreibung
Description
When a map subplot uses fitbounds, layout.uirevision fails to preserve the user's subsequent pan/zoom across Plotly.react calls. The map snaps back to the auto-fit view even when the uirevision value is unchanged.
Screenshots/Video
https://github.com/user-attachments/assets/48f4da34-d74f-4958-a874-2bd9a3844181
Steps to reproduce
- Be on v4.0 (or the default branch after it gets released)
- Plot a
scattermapwithuirevisionset and no explicitcenter/zoom:Plotly.newPlot(gd, [{ type: 'scattermap', lon: [-75, -74, -73], lat: [40, 41, 42], mode: 'markers' }], { uirevision: 'v1', width: 400, height: 400 }); - Pan the map with the mouse
- Call
Plotly.reactwith the sameuirevision:Plotly.react(gd, gd.data, { uirevision: 'v1', width: 400, height: 400 }); - Note that the map snaps back to the auto-fit view instead of keeping the panned view
Notes
- Discovered while working on #7884. The auto-fit and zoom-button behaviors landed there; this uirevision integration was deferred as out-of-scope.
- This works correctly for cartesian axes (via
autorange) and for map subplots when the user has supplied an explicitcenter/zoomfrom the start. It only fails on the auto-fit path.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, den scattermap-Fall mit unverändertem layout.uirevision zu reproduzieren, und verfolge dann den Auto-Fit-Pfad des Karten-Subplots während Plotly.react. Vergleiche ihn mit dem bestehenden Verhalten für explizites center/zoom und dem Verhalten von autorange bei kartesischen Plots. Als erledigt gilt die Aufgabe, wenn das Panning oder Zoomen eines Benutzers über Plotly.react-Aufrufe hinweg erhalten bleibt, solange uirevision unverändert ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- data-visualization
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Aktiv
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 68/100