plotly / plotly/plotly.js

[BUG]: `layout.uirevision` doesn't play well with map subplot auto-fit

Aperta
#7,907 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug good for agent P2 plotly-internal size: 3
Lingua principale
JavaScript
Stelle
18.3k
Fork
2k
Merge medio
2g 12h
PR unite (30g)
28

Descrizione

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 scattermap with uirevision set and no explicit center/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.react with the same uirevision:
    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 explicit center/zoom from the start. It only fails on the auto-fit path.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo il caso scattermap con layout.uirevision invariato, quindi segui il percorso di adattamento automatico del subplot della mappa durante Plotly.react. Confrontalo con il comportamento esistente di center/zoom espliciti e con il comportamento di autorange cartesiano. Il lavoro è completato quando il pan o lo zoom dell'utente viene preservato tra le chiamate a Plotly.react quando uirevision è invariato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
data-visualization
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
68/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.