visgl / visgl/deck.gl

[Bug] ScatterplotLayer hover/click not working properly when circles overlap

Open
#7,541 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

https://user-images.githubusercontent.com/20474783/209679807-02fa8bc2-4311-478e-b762-9cb3505c3926.mp4

I'm using ScatterplotLayer and the circles that are drawn first (bottom ones) are hovered instead of the ones at the top when there's an overlap.
Same with onClick.

Although it works fine when the map is pitched and billboard is set to true.
Also works when interleaved:false

const overlay = useControl<IControl>(() => {
    return new MapboxOverlay({
      layers: [
         new ScatterplotLayer({
              data: [...],
              visible: true,
              pickable: true,
              stroked: true,
              autoHighlight: true,
              billboard: true,
              highlightColor: [...],
              radiusUnits: "meters",
              getRadius: 70,
              getLineColor: ...,
              getLineWidth: ...,
              beforeId: "country-label-lg"
         })
     ],
      interleaved: true,
    }) as IControl;
});

Is this a known issue or am I doing something wrong here ?

Flavors
  • React
  • Python/Jupyter notebook
  • MapboxLayer
  • GoogleMapsOverlay
  • CartoLayer
  • DeckLayer/DeckRenderer for ArcGIS
Expected Behavior
  • Circles that are on top should be picked (hovered/clicked)
Steps to Reproduce

/

Environment
  • Framework version: 8.8.20
  • Browser: Chromium 108.0.5359.125; Safari 16.1
  • OS: macOS Ventura 13.0.1

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 by reproducing the overlap case with ScatterplotLayer through MapboxOverlay using interleaved: true, then compare picking behavior with interleaved: false and with billboard enabled. Trace the ScatterplotLayer hover and onClick picking path; done means the top circle is consistently picked for both interactions in the affected configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization, frontend
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.