visgl / visgl/deck.gl

[Bug] Picking for custom layers should be optional and shouldn't log warnings

Open
#9,283 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

If you create a custom layer (inheriting from Layer) but do not include the 'picking' module you get a warning: "hook.js:608 luma.gl: Module picking not found". This is caused by picking logic in the base Layer class, specifically the call in _postUpdate function to: setShaderModuleProps({picking}).

Ideally no warning should be raised for custom layers that don't require interactivity/picking. One workaround is to override the setShaderModuleProps function in your custom layer to intercept/swallow this call, however, it seems like there should be a way to disable picking altogether that would avoid all of picking related logic/methods/etc.. Perhaps moving the picking logic to a higher-level PickableLayer class instead of including it in the base Layer class might be another way to approach this?

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

Ideally no warnings would be logged when creating a custom layer that doesn't require picking. Superfluous warnings make it easy for other important warnings to be overlooked.

Steps to Reproduce

Create a custom layer, but do not include the picking module.

Environment
  • Framework version: 9.0.36
  • Browser: any
  • OS: any
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 in the base Layer class at _postUpdate and inspect the setShaderModuleProps({picking}) call and related picking logic. Reproduce a custom layer without the picking module, then trace how the warning is emitted and determine a focused way to disable or avoid picking for that layer. Done means such layers produce no picking-module warning while pickable layers retain their behavior.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.