[Feat] @deck.gl/react: should a <deckLayer> nested in a <deckView> render only in that view?

Aperta
#11,289 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
20/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
react, typescript

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

feature

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 layerFilter from 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 a LayerGroup that views reference. If core supports either, a nested <deckLayer> could map onto it directly instead of the renderer building a layerFilter.
  • ViewLayout already 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 generated layerFilter. A tree-based rule has to compose with that and with the app's own layerFilter.

Open questions:

  1. Opt-in (a root prop) or the default? A default changes what existing trees render.
  2. How does a layer opt out, so it renders in every view?
  3. With nested views, does a layer belong to its nearest view only?
  4. With a layerFilter prop, AND the two, or let the app's filter win?
  5. Should this wait for the view and layout work in #9670?
Lingua principale
TypeScript
Stelle
14.8k
Fork
2.3k
Merge medio
1g 9h
PR unite (30g)
230

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di visgl/deck.gl

Tutte le issue di visgl/deck.gl

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.