[BUG]: `layout.uirevision` doesn't play well with map subplot auto-fit
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- JavaScript
- Estrellas
- 18.3k
- Forks
- 2k
- Merge medio
- 2 d 12 h
- PR fusionados (30 d)
- 28
Descripción
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.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Empieza reproduciendo el caso de scattermap con layout.uirevision sin cambios y, después, sigue la ruta de autoajuste del subplot de mapa durante Plotly.react. Compárala con el comportamiento existente de center/zoom explícitos y con el comportamiento de autorange cartesiano. Se considera terminado cuando el desplazamiento o zoom de un usuario se conserva entre llamadas a Plotly.react mientras uirevision no cambie.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript
- Área
- data-visualization
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 68/100