visgl / visgl/deck.gl

[Bug] PathLayer segment colors misaligned when `wrapLongitude: true`

Open
#9,782 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
14.6k
Forks
2.3k
Avg merge
2d 9h
Merged PRs (30d)
42

Description

Description

When enabling wrapLongitude on PathLayer the coloring of segments shift.
Even in paths not crossing the anti-meridian.

With wrapping enabled the lines cross the anti-meridian correctly. However, I color the path segments based on attributes from data aligned with the positions I provide through getPath.
After applying wrapLongitude these attributes do not align with the path at all, leading to the path coloring not matching the originating data at all, even on paths that never cross the anti-meridian.

Seems to get worse the longer the path is.

Image of path with scatter plot with wrapLongitude: false

Image

Image of path with scatter plot with wrapLongitude: true

Image

Here ^ you can clearly see that a segment in between two red points is colored blue.

Flavors
  • Script tag
  • React
  • Python/Jupyter notebook
  • MapboxOverlay
  • GoogleMapsOverlay
  • CARTO
  • ArcGIS
Expected Behavior

Same coloring of the segments independent of if wrapLongitude is enabled or not.

Steps to Reproduce

Minimal reproduction CodePen: https://codepen.io/KaHole/pen/ZYQEGrK
Flip const WRAP_LONGITUDE_ENABLED = true; to see the difference

Environment
  • Framework version: 9.1.14
  • Browser: Edge 140.0.3485.66 (Official build) (64-bit)
  • OS: Fedora 42
Logs

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodePen reproduction and toggle WRAP_LONGITUDE_ENABLED to compare PathLayer segment colors with and without wrapping. Trace how wrapLongitude transforms paths and how segment color attributes are associated with them. Done means segment colors remain aligned with the originating data in both modes, including paths that do not cross the anti-meridian.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.