Introducing a new way to review your PRs.

Read the announcement

visgl / deck.gl

WebGL2 powered visualization framework

View on GitHub

23 documents · Updated Nov 20, 2026

docs / arrow-layer-packages

Arrow layer packages

The Arrow layer packages are experimental deck.gl proposals that turn Apache Arrow and GeoArrow columns into GPU-backed visual layers. They aim to draw large column-based data with direct WebGPU models while keeping source-row picking, streamed loading, temporal views, and user view state correct. See the layer library, standard layer types, geospatial layer types, aggregation and mesh layers, and advanced GPU layer packages for related views.

Arrow-backed layer family

The Arrow-backed layer family maps column data to visual marks without first turning every row into a JavaScript object. It covers point, line, arc, column, polygon, text, path, and trip views. The same layer contract accepts Arrow tables, record batches, and GPU vectors prepared from Arrow data.

Column data path

The column data path carries Arrow or GeoArrow values into GPU layer models. It preserves the link between a drawn mark and its source row even when one logical input is split into physical chunks.

The main flow is:

flowchart LR
    A[Arrow or GeoArrow columns] --> B[Column adapter]
    B --> C[GPU vectors or prepared geometry]
    C --> D[Arrow-backed layer]
    D --> E[Rendered marks and source-row picking]

GPU-vector inputs can create direct WebGPU models. Prepared path and polygon data can also feed lower-level GPU layers without an Arrow dependency at draw time. Adapters reject column storage that does not match the format required by the layer.

References: modules/…/arrow-layers.spec.ts• L57-135 modules/…/arrow-layers.spec.ts• L281-350 modules/…/arrow-layers.spec.ts• L352-638 modules/…/arrow-layers.node.spec.ts• L21-64

Streamed data path

The streamed data path makes each ready record batch drawable before the source ends. New batches append to the view and report their loaded count, so a large source can become useful before full conversion completes.

Animation or style changes do not replace the active stream while a new source is being prepared. This keeps loaded batches, progress, and the current iterator stable until the replacement is ready. Pausing and resuming animation also preserves the stream and the elapsed trail time.

References: modules/…/arrow-layers.spec.ts• L640-729 modules/…/arrow-example-stream.node.spec.ts• L35-67 modules/…/arrow-example-stream.node.spec.ts• L70-104 modules/…/arrow-example-path-pause.node.spec.ts• L19-36 modules/…/arrow-example-text-pause.node.spec.ts• L31-97

Geometry and temporal data

GeoArrow geometry remains column data until the layer or its adapter prepares it for drawing. Polygon columns can become tessellated GPU geometry. Path and trip columns can carry timestamps that limit drawing to a moving time window.

Text columns also support dictionary-encoded labels. Streaming keeps each generated label aligned with its matching position across all record batches.

References: modules/…/arrow-layers.spec.ts• L189-267 modules/…/arrow-layers.spec.ts• L315-350 modules/…/arrow-example-text-stream.node.spec.ts• L11-22

Rendering state

Rendering state separates prepared data from live style and animation state. A style or time change can update an existing path model without rebuilding its geometry, and delayed batches use the newest settings when they arrive.

Preparation failures release GPU resources created for the failed update. Indirect trace and text draws wait for pipeline linking, so a draw does not run against an unfinished render pipeline.

References: modules/…/arrow-example-renderer.node.spec.ts• L19-55 modules/…/arrow-example-renderer.node.spec.ts• L58-138 modules/…/arrow-example-indirect-draw.node.spec.ts• L10-39

Graph visualizations

The graph proposal connects resident GPU graph data to deck.gl layers. It targets large relationship views in which node positions, graph measures, selection, and layout work stay on the GPU. The changed Arrow-layer tests do not alter this graph contract.

Graph analytics and layers

GPUGraphDeckEffect coordinates graph work for a deck.gl view. It exposes graph measures such as degree, PageRank, weak components, communities, and neighborhood distance to node styling and selection.

The graph display uses separate node and edge roles. Node layers draw resident vertices from GPU state. Edge layers draw visible edges from the original source partitions. Selection starts from a stable source vertex ID and drives a GPU neighborhood mask.

References: modules/…/gpu-graph-deck.node.spec.ts• L97-126 modules/…/gpu-graph-deck.spec.ts• L27-161 modules/…/gpu-graph-deck.spec.ts• L334-575

Graph scale and layout

The graph view separates the resident graph from the amount of layout work and edge detail shown at one time. It can keep the full graph in GPU data while using exact, spatial, or sampled layout work for different graph sizes.

Applications can provide sampling policy for sampled layout. The graph package keeps that policy outside the graph layers so the display remains separate from application-specific choices.

References: modules/…/gpu-graph-deck.node.spec.ts• L128-171 modules/…/gpu-graph-deck.spec.ts• L163-331

Graph interaction and replacement

Graph controls change population size, layout, color, node size, edge detail, search depth, and pause state. Replacing the resident graph keeps the selected modes, layer identities, source partitions, and picking behavior consistent with the new GPU data.

Diagnostics report only supported values. They describe resident counts, visible edge counts, CPU encoding, memory, and frame status without claiming GPU timing or layout convergence when the runtime cannot measure them.

References: modules/…/gpu-graph-deck.spec.ts• L334-820 modules/…/gpu-graph-deck.node.spec.ts• L185-243

Validation boundaries

The proposal tests validate the Arrow layer path in real deck.gl and WebGPU contexts. They check conversion, drawing, streamed progress, source-row provenance, pipeline readiness, resource ownership, camera state, and failure handling.

GPU layer boundaries

GPU-backed layers expose their active draw models to Deck and do not mirror Arrow columns through the normal attribute manager. Their default draw state keeps alpha blending enabled and depth writes disabled so transparent marks render as expected.

The adapters preserve specialized nested color vectors and scalar width vectors instead of forcing them through color-specific normalization. This keeps the input shape meaningful for both source data and GPU data.

References: modules/…/arrow-layers.node.spec.ts• L66-132 modules/…/arrow-layers.node.spec.ts• L134-173

Resource and ownership rules

Caller-owned GPU vectors remain usable after a layer is removed. A failed conversion releases resources created during that conversion. A live stream keeps its data until the layer no longer needs it.

Direct vector inputs also update the table view as a complete loaded source. This keeps progress and inspection state consistent when data is already available rather than arriving through a delayed stream.

When a source is replaced, finalized, or fails during preparation, its async iterator is closed. A rejected upload keeps the prior usable vectors in place rather than replacing them with partial state.

References: modules/…/arrow-layers.spec.ts• L640-729 modules/…/arrow-layers.spec.ts• L731-888 modules/…/arrow-layers.node.spec.ts• L21-43 modules/…/arrow-lifecycle.node.spec.ts• L43-75 modules/…/arrow-lifecycle.node.spec.ts• L78-109 modules/…/arrow-example-renderer.node.spec.ts• L58-78 modules/…/arrow-example-diagnostics.node.spec.ts• L55-77

User view state

Data, style, animation, and scroll updates do not reset the user camera. Paused text keeps its pan and zoom. Scrolling polygons keep the user offset while their scroll phase continues and then returns to its cycle.

References: modules/…/arrow-example-camera.node.spec.ts• L40-127

Failure and cleanup checks

Optional GPU readback failures settle without publishing false statistics and can be retried. Cleanup prevents a late readback from publishing after the effect is gone. Draw checks wait for pipeline readiness and skip hardware-only checks when a suitable WebGPU device is not available.

Arrow adapters reject incompatible column formats before they can be used for drawing. Cleanup also closes pending source iterators, and layer tests verify that a failed upload does not destroy the old vectors.

References: modules/…/arrow-example-diagnostics.node.spec.ts• L9-53 modules/…/arrow-layers.node.spec.ts• L21-64 modules/…/arrow-layers.spec.ts• L974-1093 modules/…/arrow-lifecycle.node.spec.ts• L43-109

Change checklist

When these files or sections are changed, remember to consider these:

  • Preserve source-row and batch-row picking when changing column adapters or chunk loading.
  • Keep the active iterator and loaded batches while a replacement stream is still being prepared.
  • Apply the latest style and time state to batches that finish after a live update.
  • Release only resources owned by a failed conversion. Keep caller-owned GPU vectors alive across layer removal.
  • Keep camera state separate from data, style, animation, and scroll updates.
  • Keep indirect draws behind pipeline readiness.
  • Keep diagnostics limited to measurements that the runtime supports.
  • Keep Arrow storage formats aligned with the GPU formats expected by each adapter.
  • Close source iterators on replacement, finalization, and preparation failure.

Important failure modes

TriggerConsequenceGuard
A replacement stream replaces the active stream before it is ready.Loaded data or progress is lost.Keep the current stream until the new source is complete.
A column adapter loses chunk provenance.Picking returns the wrong source row.Retain global, batch, and batch-local row identity.
A column uses storage that does not match its GPU format.Conversion or drawing fails with invalid input.Validate the Arrow vector format before upload.
A failed conversion keeps temporary GPU buffers.The failed update leaks device resources.Destroy all buffers created during failed preparation.
A rejected upload replaces the old vectors.A usable layer state is lost after a bad update.Keep the old vectors until the new upload succeeds.
A delayed batch uses old style or time settings.Later data renders differently from the active view.Resolve live settings when the batch is prepared.
A draw runs before its pipeline is linked.The indirect draw is skipped or fails.Wait for successful pipeline linking before issuing the draw.
A source iterator remains open after replacement or cleanup.Pending work and source resources remain active.Close the iterator on replacement, finalization, and preparation failure.
A readback settles after cleanup.Stale diagnostics appear or a destroyed resource is touched.Ignore late results and allow a later sample to retry.

Key files

FileWhy to read it
modules/…/arrow-layers.spec.tsDefines the main contract for Arrow and GPU-vector layers, streamed batches, temporal paths, picking, and ownership.
modules/…/arrow-layers.node.spec.tsShows input-format checks, active model exposure, draw defaults, and preservation of specialized GPU vectors.
modules/…/arrow-lifecycle.node.spec.tsShows rollback and iterator cleanup across source replacement, finalization, and preparation failure.
modules/…/arrow-example-renderer.node.spec.tsShows the separation between prepared path data and live style or time state.
modules/…/arrow-example-stream.node.spec.tsShows stream continuity while animation pauses and resumes.
modules/…/arrow-example-text-pause.node.spec.tsShows replacement-source behavior for streamed text settings.
modules/…/arrow-example-camera.node.spec.tsShows camera preservation across text and polygon updates.
modules/…/arrow-example-diagnostics.node.spec.tsShows readback cleanup and complete progress for direct vector input.
modules/…/arrow-example-indirect-draw.node.spec.tsShows the pipeline-readiness boundary for indirect trace and text drawing.