plotly / plotly/plotly.js

[Feature Request / Bug]: Limitations in scattergeo and natural earth projection when handling antimeridian crossing and programmatic centering

Aperta
#8,046 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

Description
When working with long-haul transpacific flight tracks that cross the 180° meridian (antimeridian) on a 2D map view (natural earth projection), scattergeo exhibits severe limitations regarding automatic centering, zooming, and boundary rendering.

Specifically, attempting to programmatically center the map on routes crossing the dateline results in projection clipping or shifts the view incorrectly (e.g., to the Atlantic/African perspective). While injecting null values into coordinate arrays successfully prevents straight lines from stretching awkwardly across the entire globe, it breaks standard spherical centroid and midpoint calculations. Furthermore, because bounded 2D projections like natural earth lack infinite horizontal wrapping, smooth centering across the antimeridian is virtually unsupported.

Steps to reproduce
Set up a scattergeo plot using the natural earth projection (geo.projection.type: 'natural earth').

Plot a flight path with coordinates crossing the 180° meridian (e.g., from Vancouver [-123.18, 49.19] across the Pacific to Seoul [126.44, 37.46]).

Attempt to programmatically update geo.center or geo.projection.rotation.lon to focus/zoom into the midpoint of the route.

Note the issue: The flat 2D projection either clips/shifts the viewport entirely away from the Pacific or forces lines to span across the map, as there is no native antimeridian-aware centering support for bounded 2D geo projections.

Notes
This issue impacts custom flight dash applications using scattergeo where users want to select specific routes to zoom into. Having native support for antimeridian-aware bounding/centering or seamless horizontal wrapping in flat 2D projections would eliminate the need for complex workaround scripts.

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 con la configurazione scattergeo usando la proiezione natural earth, in particolare geo.center e geo.projection.rotation.lon, e riproduci la rotta Vancouver–Seoul che attraversa l’antimeridiano. Analizza come si comportano il centraggio, lo zoom, il rendering dei confini e gli array di coordinate in questo caso. Il lavoro è completo quando una mappa 2D natural earth può concentrarsi su rotte di questo tipo senza clipping, spostamenti errati o linee che attraversano l’intero globo.

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

Valutazione

Stack tecnologico
javascript
Ambito
data-visualization
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.