[BUG]: `layout.uirevision` doesn't play well with map subplot auto-fit
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- JavaScript
- Estrelas
- 18.3k
- Forks
- 2k
- Merge médio
- 2d 12h
- PRs com merge (30d)
- 28
Descrição
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.
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece reproduzindo o caso de scattermap com layout.uirevision inalterado e, em seguida, rastreie o caminho de ajuste automático do subplot do mapa durante Plotly.react. Compare-o com o comportamento existente de center/zoom explícitos e com o comportamento de autorange cartesiano. Considera-se concluído quando o pan ou zoom de um usuário é preservado entre chamadas a Plotly.react quando uirevision não é alterado.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- javascript
- Domínio
- data-visualization
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Ativa
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 68/100