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 / distribution-and-quality

Distribution and quality

deck.gl is a public package family with one main package and focused packages for layers, data, map hosts, React, widgets, notebooks, and test support. Its release and quality flow protects the same user-facing contracts: applications can import the supported API, choose a suitable GPU path, render stable output, handle input, and keep working with supported hosts.

Distribution model

The monorepo publishes a small package family around the deck.gl runtime. The deck.gl package is the main entry point for applications. It brings together the core runtime, layer families, data features, map integrations, React support, and widgets. Engineers can also install focused packages when an application needs a smaller or more specific surface. The core rendering engine explains the runtime behind these packages, and the layer library explains the visual capabilities they expose.

The package family also serves distinct environments. Map adapters connect deck.gl to ArcGIS, Google Maps, Mapbox, and MapLibre. React and widget packages connect it to application and notebook UI systems. JSON and CARTO packages support data-driven use cases. The Jupyter package provides a notebook-facing browser bundle.

References: modules/…/package.json• L21-62 modules/…/package.json• L1-5 modules/…/package.json• L1-5 modules/…/package.json• L1-5 modules/…/package.json• L1-5 modules/…/package.json• L1-5 modules/…/package.json• L1-5

Public package boundaries

Each public package publishes compiled ESM and CommonJS entry points with TypeScript declarations where its API needs them. The published file set includes the package's distribution output and the source paths required by the release contract. Special package surfaces use focused entry points: @deck.gl/core/arrow exposes optional Apache Arrow support, @deck.gl/test-utils/vitest exposes Vitest helpers, and @deck.gl/…/stylesheet.css exposes widget styles. The main package re-exports those styles through deck.gl/stylesheet.css.

Peer dependencies keep host libraries and shared runtime versions aligned without forcing every integration into the base install. The main package marks ArcGIS, MapLibre, React, and React DOM as optional, while integration packages declare the deck.gl and host versions that they require. MapLibre supports major versions 4, 5, and 6 through its peer range.

References: modules/…/package.json• L23-45 modules/…/package.json• L23-57 modules/…/package.json• L23-46 modules/…/package.json• L21-43 modules/…/package.json• L64-82 modules/…/package.json• L24-51

Top-level API assembly

The top-level package gives module-based applications one convenient public surface. Its source API gathers the core runtime, layer families, MapLibre integration, React bindings, widgets, and their public types into one import path. Its dependencies gather the focused packages, and its bundle provides the same main API for script-based applications. Its stylesheet subpath copies the widget styles into the top-level distribution so applications do not need an internal build path.

The standalone top-level bundle keeps H3 support as an explicit external boundary. Applications that use that feature provide a compatible H3 library separately, while applications that do not use it avoid that base dependency.

References: modules/…/index.ts• L11-270 modules/…/package.json• L24-43 modules/…/package.json• L45-82 modules/…/bundle.ts• L5-30 test/…/imports.node.spec.ts• L76-95

Private experimental boundary

@deck.gl/proposals holds experimental layers and effects outside the supported public install. It remains private even though its build checks named ESM and CommonJS subpaths. Private builds and examples let engineers validate proposed APIs without making them part of the stable package contract.

References: modules/…/package.json• L1-5 modules/…/package.json• L12-73 package.json• L44-46

Build variants

Packages with GPU-dependent code publish a default distribution and a WebGL-only distribution. Both represent the same public API, but the WebGL-only path lets an application that does not need WebGPU avoid WebGPU-specific code. Packages without two GPU paths keep their normal module contract.

GPU output selection

Applications select the WebGL-only output with the visgl:webgl-only export condition. Imports without that condition use the default output. This is a deployment choice rather than a different application API. Peer ranges still matter because an import-compatible package can fail when paired with an unsupported core or GPU host version.

The condition is present on core and layer packages that support both GPU paths. It covers the core runtime, ordinary layers, aggregation layers, geospatial layers, and mesh layers.

References: modules/…/package.json• L27-45 modules/…/package.json• L26-35 modules/…/package.json• L27-36 modules/…/package.json• L27-36 modules/…/package.json• L27-36

Build sequencing

The root build creates the WebGL-only output first and moves it to its conditional package directory. It then creates the default output and builds the remaining workspace packages. A separate private path checks proposal exports and builds private examples. This order keeps conditional output, public packages, and experimental packages distinct at release time.

The package metadata must stay aligned with this sequence. A published export is useful only when its emitted file exists in the package file set, and a private export must remain outside the public build.

References: package.json• L20-46 scripts/set-webgpu-build.mjs• L8-14 scripts/move-webgl-output.mjs• L8-41 scripts/build-modules.mjs• L5-25 scripts/verify-private-modules.mjs• L8-21 scripts/verify-proposed-layer-exports.mjs• L9-33 scripts/build-private-examples.mjs• L11-23

Validation system

The validation system uses several forms of evidence because no single test can prove that a visual library remains safe to use. Node checks cover browser-independent behavior. Browser checks cover real DOM, input, and GPU behavior. Render checks compare visible output. Import, integration, and compatibility checks protect the package boundaries that downstream applications use. The testing and validation page provides the detailed child view.

EvidenceMain questionNormal use
NodeDoes browser-independent behavior work?Fast local checks
Headless browserDoes the runtime work with a real DOM and GPU?Automated checks
BrowserCan an engineer inspect input and visual behavior?Local diagnosis
RenderDoes output match the approved visual result?Visual regression checks
Tape compatibilityDoes the legacy test utility path still work?Backward-compatibility smoke check

Layer test helpers also wait for asynchronous data and sublayer work. They report delayed failures after the layer finishes its update, so asynchronous behavior follows the same quality contract as synchronous state.

References: package.json• L29-36 test/…/lifecycle-test.spec.ts• L21-43 test/…/lifecycle-test.spec.ts• L67-108 test/…/vitest-browser-setup.ts• L5-33 test/…/vitest-node-setup.ts• L5-57

Rendering validation

Rendering validation treats a test case as a visual contract. The harness fixes the view and data, waits for a stable frame, captures the canvas, and compares it with an approved golden image. A failure can include the actual image and a pixel diff, which gives reviewers evidence of the visible change.

Shared cases run across map, globe, and orthographic views. The suite checks representative layer geometry, effects, masks, collision behavior, labels, icons, data filters, dashed paths, animation, and antialiasing. Cases run with WebGL and WebGPU when both support the feature. Backend-specific cases are skipped only for the backend that cannot support them, and selected edge checks also use numeric pixel coverage.

This diagram shows how a declared render case becomes visual evidence for one backend.

flowchart LR
  C[Test case] --> D[WebGL or WebGPU device]
  D --> R[Stable deck render]
  R --> S[Canvas screenshot]
  S --> P[Golden image or pixel metric]
  P --> O[Pass or failure artifacts]

References: test/…/render-test-suite.ts• L194-289 test/…/deck-test-utils.ts• L134-154 test/…/deck-test-utils.ts• L264-308 test/…/clip-extension.spec.ts• L89-186 test/…/data-filter-extension.spec.ts• L26-139 test/…/path-dash.spec.ts• L465-1096

Projection and data validation

Projection checks protect the meaning of coordinates as data moves through views, layers, picking, sizing, aggregation, and GPU backends. They cover map, globe, orthographic, and source-coordinate views. Focused checks also protect altitude, meter-sized features, bounds, view movement, and invalid or boundary positions.

Geospatial data checks extend the same contract to derived data and tile lifecycles. They verify that bins, contours, heatmaps, and visible tiles use the same view and coordinate meaning as ordinary layers. Tile checks also protect request priority, cache limits, cancellation, reloads, shared consumers, map-to-globe changes, and cleanup after a tile is no longer needed.

References: test/…/package.json• L1-17 test/…/custom-projection.spec.ts• L23-39 test/…/shared-mvt-layer.node.spec.ts• L32-57 test/…/shared-mvt-layer.render.spec.ts• L13-116 test/…/shared-tile-2d-layer.spec.ts• L291-387 test/…/tile-2d-master-parity.node.spec.ts• L22-77

Data and layer validation

Data and layer checks protect the meaning of application input as it becomes rendered content. They cover layer construction, property rules, updates, transitions, picking state, asynchronous data, model replacement, typed attributes, packed data, external buffers, and Apache Arrow columns.

Arrow checks protect the same behavior for chunked data, binary attributes, borrowed buffers, fallback accessors, picking indexes, and replacement updates. They also check the switch between Arrow-backed data and ordinary row data. Effects and extensions are checked as shared behavior, including composition, shader compilation, large numeric values, empty data, asynchronous data, and GPU validation errors.

References: test/…/layer.spec.ts• L101-188 test/…/layer-manager.spec.ts• L59-84 test/…/layer-columns.node.spec.ts• L35-127 test/…/scatterplot-arrow-columns.spec.ts• L30-197 test/…/scatterplot-arrow-lifecycle.node.spec.ts• L32-119 test/…/brushing-webgpu.spec.ts• L13-155 test/…/data-filter-webgpu.spec.ts• L91-237

Interaction validation

Interaction validation sends browser input to a rendered deck and checks the result that an application receives. Picking checks object identity and highlighting. Controller checks cover movement, rotation, keyboard, touch, trackpad, zoom anchors, bounds, and controller state changes.

Host integration checks extend this contract to map systems. Google Maps checks overlay lifecycles, shared contexts, context loss, fallback, drawing, picking, device pixels, and cleanup. MapLibre checks map and globe projections, overlay modes, label and icon visibility, and picking. These checks catch failures caused by event order, host callbacks, or shared context ownership that a static image cannot show.

References: test/…/google-maps-overlay.spec.ts• L19-47 test/…/google-maps-overlay.spec.ts• L224-384 test/…/globe-icons-text.spec.ts• L42-189 test/…/picking.spec.ts• L15-105 test/…/controllers.spec.ts• L127-171 vitest.config.ts• L212-316

Compatibility validation

Compatibility checks protect the ways users and downstream packages enter the system. Import checks load the top-level package and individual modules, reject empty exports, verify selected symbols, and confirm that the main package re-exports its public families. A Tape smoke test keeps the legacy @deck.gl/test-utils path usable.

The package boundary also rejects relative imports that cross from one published package into another package's source tree. Cross-package use must go through a public package entry point because source paths do not survive installation. Peer ranges and host integration checks then protect supported map and GPU combinations.

References: test/…/imports.node.spec.ts• L25-134 test/…/cross-package-imports.node.spec.ts• L20-78 test/…/tape-compat.tape.spec.js• L11-54 modules/…/package.json• L39-51 modules/…/package.json• L64-82 test/…/google-maps-overlay.spec.ts• L116-187

Regression evidence

Regression evidence is layered so a failure points to the contract that changed. Import failures suggest a public API problem. Unit failures suggest local behavior. Interaction failures suggest input or event behavior. Image or pixel-metric failures suggest a visible rendering change.

Golden image evidence

Golden images are approved visual results for representative layers, views, effects, transitions, and data. Platform or device-specific overrides can bound known raster differences, but every supported path still compares the main visual contract.

When a comparison fails, the harness can save the rendered image and a pixel diff beside the golden image. CI uploads these files as artifacts, so review can focus on the visible change rather than only a test name.

References: test/…/deck-test-utils.ts• L264-308 test/…/effects.spec.ts• L87-138 test/…/fill-pattern.spec.ts• L94-185 test/…/text-layer.spec.ts• L209-641 test/…/browser-commands.ts• L54-65 .github/…/test.yml• L43-56

Bundle size evidence

Bundle measurements protect the practical cost of the public API. Each measurement imports one feature from a built package entry point. Later measurements can exclude shared core code so the result shows the added cost of a layer or integration in an application that already uses deck.gl.

The measurements compare default output with WebGL-only output under the same bundler and compression settings. This keeps the signal useful when conditional exports or tree shaking change.

References: test/…/measuring-bundle-size.md• L3-73 docs/…/building-apps.md• L36-50

Quality gates

Pull request checks build packages before they run lint and the required test groups. The main automated path checks Node, headless browser, and WebGL render behavior with coverage. A separate path checks WebGPU behavior. Other jobs check that the website, Python bindings, and projection examples still build against the public packages. The root scripts also keep private proposal builds, private examples, and the legacy Tape path as explicit quality gates.

The local commands mirror these gates at different costs:

  • yarn test-fast runs lint and Node checks.
  • yarn test-headless runs browser tests without a visible browser.
  • yarn test-render runs visual regression checks.
  • yarn test-webgpu runs headless and render checks with WebGPU selected.
  • yarn test-browser runs the headed browser project for diagnosis.
  • yarn test-tape-compat checks the legacy test utility path.
  • yarn test-ci combines lint, Node, headless, and WebGL render checks with coverage.
  • yarn build-private validates the private proposals build and export boundary.
  • yarn test-private runs Node and headless checks with private modules enabled.
  • yarn build-private-examples type-checks and builds private proposal examples.

Coverage shows which module paths execute. It supports the quality signal, but browser, image, import, integration, and compatibility checks protect contracts that line coverage cannot show.

References: package.json• L20-46 vitest.config.ts• L109-115 .github/…/test.yml• L32-63 .github/…/test.yml• L87-107 .github/…/test.yml• L130-185

Change checklist

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

  • Keep the default and visgl:webgl-only outputs aligned when GPU support changes.
  • Keep every public export and CSS subpath aligned with its emitted file and package files list.
  • Update the top-level package when a public package or widget stylesheet changes. Keep optional integrations out of the required base install.
  • Keep proposal packages private. Check their ESM and CommonJS exports and private examples when experimental APIs change.
  • Review peer ranges when a package changes its supported core, GPU, map host, React, or Arrow versions.
  • Recheck import, cross-package boundary, Tape, and host integration checks when package exports or adapter contracts change.
  • Review golden images and platform overrides when a rendering change is intentional. Run shared validation with WebGL and WebGPU.
  • Recheck async layer and tile cleanup when data loading, cache limits, shared consumers, or deferred updates change.
  • Recheck bundle-size measurements when core dependencies, conditional exports, or tree-shaking boundaries change.

Important failure modes

TriggerConsequenceGuard
A package export or re-export is missingAn installed application cannot import a symbol that works from sourcePublic import and re-export checks
A private proposal enters the public buildExperimental API becomes an unsupported install-time contractPrivate build and proposal export checks
A WebGPU path leaks into a WebGL-only buildA WebGL application fails at load or carries avoidable codeConditional outputs and render checks
A peer range does not match the host integrationAn application resolves an unsupported map or GPU dependency setPackage peer metadata and integration checks
A published subpath points to a missing fileCSS or a special API works in source but fails after installPackage file lists and import checks
A tile finishes after its consumer detachesA released view receives stale data or callbacksAsync tile lifecycle checks
An Arrow conversion fails or is supersededA layer loses valid buffers or draws with stale dataColumn replacement and lifecycle checks
An overlay uses stale camera or context stateThe first draw is wrong or later host-map changes are lostMap host lifecycle checks
A render compares an incomplete frameThe test approves the wrong image or times outLoad and update completion checks
A visible output changes without an approved imageA visual regression reaches review without clear evidenceGolden image comparison and diff artifacts

Key files

FileWhy to read it
package.jsonWorkspace build, test, coverage, private-build, and publishing commands
modules/…/package.jsonTop-level package assembly, CSS entry point, and optional host boundaries
modules/…/index.tsTop-level public API and type assembly
modules/…/package.jsonCore exports, optional Arrow entry point, and WebGL-only surface
modules/…/package.jsonCore layer exports and shared peer contract
modules/…/package.jsonGeospatial package format and GPU variants
modules/…/package.jsonMapLibre package contract and supported host versions
modules/…/package.jsonPublic test utility entry points, including Vitest helpers
modules/…/package.jsonPrivate experimental package boundary
modules/…/package.jsonNotebook-oriented browser distribution contract
modules/…/package.jsonWidget API and stylesheet subpath
scripts/build-modules.mjsWorkspace build order and private-package exclusion
scripts/move-webgl-output.mjsSeparation of WebGL-only output from the default output
vitest.config.tsTest projects, browser modes, device selection, and coverage scope
test/…/render-test-suite.tsWebGL and WebGPU render lifecycles
test/…/deck-test-utils.tsRender completion, screenshots, golden comparison, and failure artifacts
test/…/google-maps-overlay.spec.tsHost context, drawing, picking, and cleanup contracts
test/…/globe-icons-text.spec.tsMapLibre globe, labels, icons, and picking behavior
test/…/shared-tile-2d-layer.spec.tsShared tile loading, cache, view, reload, and cleanup behavior
test/…/scatterplot-arrow-columns.spec.tsArrow data, GPU buffers, picking, and backend parity