plotly / plotly/plotly.js

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

Ouverte
#8,046 4 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

bug P2 size: 3
Langage dominant
JavaScript
Étoiles
18.3k
Forks
2k
Merge moyen
2 j 12 h
PR mergées (30 j)
28

Description

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.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par la configuration de scattergeo utilisant la projection natural earth, en particulier geo.center et geo.projection.rotation.lon, et reproduisez la route Vancouver–Séoul traversant l’antiméridien. Étudiez le comportement du centrage, du zoom, du rendu des frontières et des tableaux de coordonnées dans ce cas. C’est terminé lorsqu’une carte 2D natural earth peut se concentrer sur de telles routes sans clipping, décalages incorrects ni lignes traversant le globe entier.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript
Domaine
data-visualization
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
42/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.