[Feat] @deck.gl/react: should a <deckLayer> nested in a <deckView> render only in that view?
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Active
- Tech stack
- react, typescript
- Domain
- data-visualization, frontend
Research direction
This is a design discussion, not a scoped change: the issue explicitly says no change is planned and lists five open questions. Start by reading the @deck.gl/react renderer where the JSX tree is flattened into one layers list, plus the docs' layerFilter example, and compare with @deck.gl/react/legacy. Then read #9670 and the ViewLayout docs to see whether per-view layer lists could carry nested deckLayer elements; also inspect Deck._canvases and View.canvasId for how the generated filter composes with app filters. Done here means a decision on opt-in vs default, opt-out, nested-view ownership and filter precedence, not a patch.
Written by the indexing model from the issue text.
Description
Moved from visgl/deck.gl-community#1036, now that the renderer is @deck.gl/react in deck.gl. Tracking: #10161.
Target Use Case
Should this render points only in the main view?
<DeckGL>
<deckView view={new MapView({id: 'main'})}>
<deckLayer layer={new ScatterplotLayer({id: 'points'})} />
</deckView>
<deckView view={new MapView({id: 'minimap', x: '75%', width: '25%', height: '25%'})}>
<deckLayer layer={new PathLayer({id: 'routes'})} />
</deckView>
</DeckGL>
The tree suggests it does. Today it doesn't: the renderer flattens the tree into one layers list, and deck.gl draws every layer in every view unless the app passes a layerFilter. The @deck.gl/react docs say so and show a layerFilter example. @deck.gl/react/legacy reads JSX layers only from the direct children of DeckGL.
Proposal
Open for discussion; no change is planned yet.
- The original fiber renderer once generated a
layerFilterfrom the tree. In the community issue, brandonjpierce noted it was kludgey and couldn't opt a layer out of filtering. - #9670 proposes per-view layer lists,
new View({layers})or aLayerGroupthat views reference. If core supports either, a nested<deckLayer>could map onto it directly instead of the renderer building alayerFilter. ViewLayoutalready compiles a declarative view tree. JSX layout elements could follow it, and view-scoped layers could extend that pattern.- Multi-canvas (
Deck._canvases,View.canvasId) scopes layers to a canvas's views with a generatedlayerFilter. A tree-based rule has to compose with that and with the app's ownlayerFilter.
Open questions:
- Opt-in (a root prop) or the default? A default changes what existing trees render.
- How does a layer opt out, so it renders in every view?
- With nested views, does a layer belong to its nearest view only?
- With a
layerFilterprop, AND the two, or let the app's filter win? - Should this wait for the view and layout work in #9670?
- Dominant language
- TypeScript
- Stars
- 14.8k
- Forks
- 2.3k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 230
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from visgl/deck.gl
-
[Bug] Tile3DLayer selects no tiles until the camera moves when tileset.json loads right after a layer updatePossibly taken @lee3Q claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
[Bug] SplitterWidget calls onDragStart on drag end; Deck._getViews writes into the app's views arrayPossibly taken @04jennet-coder claimed this 20 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
[Bug] WMSLayer positions EPSG:4326 images as CARTESIANPossibly taken @athomct claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
[Bug] MapLibreOverlay under React StrictMode: 'WebGL context already attached to device' because the attach path omits _reuseDevicesPossibly taken @jsve claimed this 84 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
visgl/deck.gl#10681 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
Similar issues
-
accessibility area:ci ci-test level:low priority:high type:test
Difficulty 2/5 1-3 hours Newbie friendliness 71/100
skytuhua-org/Gen-V1#3132 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
drmrd/vernacular#1238 ·
Maintainers usually reply within 1 day
-
question
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
enhancement migration-prioritized
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Hudson-Pufferfish/local-party-console#136 ·
Maintainers usually reply within 1 day
-
priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day