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 / application-integrations

Application integrations

deck.gl is a rendering system that adds interactive GPU layers to web applications and Python-driven views. It adapts to the host: React manages composition, map renderers provide geographic context, standalone JavaScript owns the page, and Python sends a visualization description to a browser view.

Integration choices

Choose an integration from the role that the host application must play:

Host environmentIntegration roleMain result
React applicationReact rendering surfaceDeck layers, views, and widgets take part in the React render flow. See React integration.
Map rendererMap overlay or shared rendererDeck layers follow a map camera and can render above or inside a compatible map renderer. See map renderer integrations.
Standalone web page or widgetDirect JavaScript rendererA page can create a deck instance without React or a map library. See standalone usage.
Notebook or browser widgetNotebook display surfaceA Jupyter front end renders a deck configuration and can exchange selected data and interaction events. See widgets and Jupyter.
Python applicationConfiguration and HTML bridgePython builds a deck.gl-compatible description and displays it in an HTML page or notebook frame. See Python bindings.

These choices can combine. For example, a React application can place a map component below deck.gl, while a Python application can choose a map provider for the generated browser view.

React applications

React rendering surface

The DeckGL component is the React entry point for deck.gl. The package also exposes factories for layer, view, widget, and effect components, so deck.gl content can follow the host application's component model. It presents the deck canvas, view content, and optional widgets as one React surface while the deck engine manages layer updates, picking, view state, and drawing. React children can describe layers, views, and widgets in JSX, so the host keeps one composition model for its own UI and deck.gl content.

References: modules/…/index.ts• L5-6 modules/…/index.ts• L6-21 modules/…/deckgl.ts• L31-52 modules/…/deckgl.ts• L94-131 modules/…/deckgl.ts• L153-157 modules/…/deckgl.ts• L268-325 modules/…/package.json• L39-43 modules/…/index.ts• L132-136

React map composition

A React application can use a map component as geographic context and place deck.gl layers in the same view. The map and deck.gl must share view state so that a pan or zoom keeps the two render surfaces aligned. React wrappers for Mapbox, MapLibre, and Google Maps provide common host components; deck.gl map adapters are useful when the map renderer must own the overlay lifecycle.

The main React concern is update timing. High-rate interaction callbacks can cause React state updates, so the application should keep those updates small. Server rendering does not draw WebGL content, so applications that render on the server must load the deck view on the client.

References: docs/…/using-with-react.md• L45-54 docs/…/using-with-react.md• L97-112 modules/…/deckgl.ts• L162-175 modules/…/deckgl.ts• L281-325

Map renderer integrations

Map overlay modes

Map integrations connect deck.gl to a host map's camera, size, input events, and render cycle. They support two broad modes:

  • Overlaid: deck.gl draws on its own canvas above the map. This keeps the two render systems separate and is the general choice for a 2D base map.
  • Interleaved: deck.gl draws in the map renderer's WebGL2 context and takes part in the map's layer order. This lets map labels or 3D map features appear in front of or behind deck layers.

Interleaving gives tighter visual integration but depends on APIs and WebGL2 support from the map renderer. Overlay mode has fewer shared-context limits, but the adapter must still keep the deck view aligned with the map view.

The repository provides dedicated adapters for Mapbox GL JS, MapLibre GL JS, Google Maps, and the ArcGIS API for JavaScript. The main package surface re-exports the MapLibre overlay for applications that use the shared deck.gl entry point. Google Maps selects a vector-map path or a raster overlay path from the map's rendering type. ArcGIS supplies deck content as a custom scene renderer. Other map libraries can use the core Deck class as a separate overlay when they can provide a suitable container and synchronized view state.

References: docs/…/using-with-map.md• L5-23 modules/…/index.ts• L124-129 modules/…/package.json• L44-50 modules/…/package.json• L39-48 modules/…/package.json• L44-52 modules/…/google-maps-overlay.ts• L140-153 modules/…/package.json• L42-50 modules/…/deck-renderer.ts• L98-123 modules/…/deck-renderer.ts• L165-223

Map lifecycle

The map remains the owner of geographic navigation. An adapter reads the map camera and size during map updates, forwards map input to deck.gl for picking and interaction, and removes its listeners and rendering resources when the map removes the overlay. Mapbox, MapLibre, and vector Google Maps can also provide a shared render context and repaint cycle, so deck.gl follows the host renderer instead of creating a second render surface. Raster Google Maps uses a positioned overlay, while ArcGIS supplies a scene render cycle and WebGL context for its deck content.

Interleaved Mapbox rendering uses one shared deck surface per map context. The map owns shared canvas sizing and device-pixel state while deck.gl follows view state and requests map repaints. Mapbox and MapLibre adapters carry map projection, world repetition, padding, and terrain camera state into deck.gl. MapLibre also tracks style readiness and projection changes so interleaved layer groups stay in the map's layer stack. Google Maps supplies either overlay camera data or a shared vector-map context. Its adapter also rebuilds the host connection when Google changes between vector and raster rendering. ArcGIS supplies SceneView camera state and composites deck output into its scene. Interleaved MapLibre rendering needs WebGL2, one interleaved overlay per map, and a supported MapLibre GL JS release. The MapLibre package supports 4.5.1 and the 5.x and 6.x lines.

References: modules/…/mapbox-overlay.ts• L98-164 modules/…/mapbox-overlay.ts• L175-213 modules/…/mapbox-overlay.ts• L254-303 modules/…/overlay.ts• L47-76 modules/…/overlay.ts• L97-134 modules/…/overlay.ts• L220-299 modules/…/overlay.ts• L324-420 modules/…/deck-utils.ts• L35-57 modules/…/deck-utils.ts• L76-112 modules/…/deck-utils.ts• L114-187 modules/…/deck-utils.ts• L226-323 modules/…/compatibility.ts• L7-38 modules/…/compatibility.ts• L41-75 modules/…/package.json• L39-51 modules/…/deck-utils.ts• L24-81 modules/…/deck-utils.ts• L187-230 modules/…/google-maps-overlay.ts• L72-97 modules/…/google-maps-overlay.ts• L162-187 modules/…/google-maps-overlay.ts• L191-234 modules/…/google-maps-overlay.ts• L236-279 modules/…/google-maps-overlay.ts• L301-343 modules/…/utils.ts• L25-92 modules/…/utils.ts• L111-125 modules/…/utils.ts• L308-349 modules/…/commons.ts• L24-49 modules/…/commons.ts• L126-151 modules/…/deck-renderer.ts• L120-163 modules/…/deck-renderer.ts• L168-241 modules/…/deck-renderer.ts• L251-266 modules/…/package.json• L42-50 modules/…/package.json• L47-50 modules/…/package.json• L44-52

Standalone JavaScript applications

Core rendering surface

The core Deck class is the framework-neutral entry point. It accepts deck.gl layers and view settings and renders them into a canvas, so a JavaScript application can use deck.gl without React, Mapbox GL JS, or MapLibre GL JS. The application supplies the page lifecycle around the deck instance, including its container size and event model. The main deck.gl package re-exports Deck with the core views, controllers, and layer types for this framework-neutral use.

References: docs/…/using-standalone.md• L1-12 docs/…/using-standalone.md• L24-48 modules/…/index.ts• L11-70

Browser scripting surface

The standalone bundle provides a browser-friendly scripting interface for small pages, prototypes, and notebook-like web tools. It exposes deck.gl classes through a global object so a page can add layers with a script tag instead of setting up a module build. An optional Mapbox or MapLibre library can supply the base map through the extended deck surface.

References: docs/…/using-standalone.md• L89-136 docs/…/using-standalone.md• L138-196 test/…/index.js• L1-80

Widgets

Deck controls

Widgets are optional UI controls that operate on deck views. They provide common map and visualization actions such as zoom, reset view, compass, fullscreen, selection, loading state, screenshots, and themes. Applications can use the widget package directly in a standalone or map-hosted deck, or render supported widgets as DeckGL children in React. The main deck.gl package re-exports the public widget set alongside its core and React entry points.

The experimental _ColorScaleWidget adds a legend for resolved layer color scales. It can show categorical entries, value ranges, or a sampled continuous ramp, and it can be limited to one view.

References: modules/…/index.ts• L5-40 modules/…/index.ts• L63-64 modules/…/index.ts• L92 modules/…/color-scale-widget.tsx• L16-28 modules/…/color-scale-widget.tsx• L165-293 modules/…/color-scale-widget.tsx• L295-431 modules/…/package.json• L39-43 modules/…/package.json• L48-55 modules/…/index.ts• L138-169 docs/…/using-with-react.md• L52-94

Widget presentation

Widgets separate interaction logic from presentation. The widget package supplies a common visual theme and a public stylesheet entry, while each widget defines its control action and placement. A host application can therefore add focused controls without rebuilding the deck canvas or taking ownership of the map camera.

References: modules/…/index.ts• L42-64 modules/…/zoom-widget.tsx• L85-103 modules/…/package.json• L27-46

Notebooks and Python environments

Jupyter display surface

The Jupyter integration packages a browser front end as a Jupyter widget and JupyterLab extension. The browser renders the same deck.gl layer model and map adapters used by web applications. The front end includes the core layer families, widgets, Google Maps, Mapbox, and MapLibre integrations so a notebook can use those host choices within the widget boundary.

The widget model supports updates from Python to the displayed view and interaction messages from the browser back to Python. It also defines a path for large data buffers when JSON is not an efficient choice. The separate widgets and Jupyter page covers this notebook contract in more detail.

References: modules/…/package.json• L21-33 modules/…/package.json• L35-67 modules/…/index.js• L7-21 modules/…/index.js• L31-60 modules/…/plugin.js• L14-29 bindings/…/widget.py• L24-67

Python visualization description

pydeck is a Python binding that turns Python objects into a deck.gl-compatible JSON description. A Python Deck groups layers, views, map choices, view state, effects, and optional widgets. It can select Carto, Mapbox, Google Maps, or MapLibre as a map provider, and MapLibre can use globe projection. The browser then renders that description with deck.gl.

Python can also load custom JavaScript libraries. A library may be a classic script or an ES module, but it must use the deck.gl packages already loaded by the browser front end. Experimental npm loading uses an ES module CDN and shares pydeck's deck.gl, luma.gl, loaders.gl, and math.gl packages with that front end. Community packages without a version use the deck.gl major and minor version loaded by pydeck. Re-registering a library name replaces its prior entry, which supports repeated notebook-cell execution.

The Python boundary keeps data preparation and visualization choice in Python while the browser owns rendering. The A5 example shows this pattern: Python reads remote data, creates an A5Layer, sets the view and map style, then writes an interactive HTML result. Custom library loading extends the same boundary without moving GPU rendering into Python.

References: bindings/…/deck.py• L30-52 bindings/…/deck.py• L115-160 bindings/…/json_tools.py• L54-99 bindings/…/settings.py• L9-31 bindings/…/settings.py• L66-77 bindings/…/settings.py• L87-147 bindings/…/custom_layers.rst• L4-15 bindings/…/custom_layers.rst• L30-45 bindings/…/custom_layers.rst• L59-101 bindings/…/a5_layer.py• L13-41 bindings/…/CHANGELOG.rst• L9-30 bindings/…/test_settings.py• L40-157

HTML and notebook output

The Python binding can render a self-contained HTML result or display that result in a notebook frame. The output loads the deck.gl Jupyter bundle from a CDN by default, with development and offline choices for other environments. The pydeck package also installs a Jupyter extension entry and matching notebook configuration so the front end can load through the expected require target.

Compact JSON keeps the embedded result smaller. Engineers must distinguish this HTML or iframe path from the richer widget message contract described by the JavaScript and Python widget classes. In the current checked code, Deck.update() reports that the live Jupyter update path is not supported in pydeck v0.9.

References: bindings/…/deck.py• L195-227 bindings/…/deck.py• L229-283 bindings/…/json_tools.py• L97-105 bindings/…/html.py• L33-63 bindings/…/pydeck.json• L1-5 bindings/…/test_nbextension_path.py• L8-36 bindings/…/Makefile• L17-36 bindings/…/CHANGELOG.rst• L29-30

Data and interaction bridge

The notebook bridge has two directions. Python sends the visualization description and optional data buffers to the browser. The browser sends events such as hover, click, drag, resize, and view-state changes back through the widget message channel. Large tabular data can use a binary transfer path instead of placing every value in JSON, while smaller views can use normal serialization.

References: bindings/…/widget.py• L61-122 bindings/…/layer.py• L121-169 bindings/pydeck/examples/03 - Event handlers and data selection in pydeck.ipynb#L83-L146 bindings/pydeck/examples/05 - Interacting with other Jupyter widgets.ipynb#L61-L110 bindings/…/jupyter.rst• L11-25

Change checklist

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

  • Changes to the React render contract must stay aligned with JSX handling for layers, views, and widgets and with the client-only guidance for server-rendered applications.
  • Changes to a map adapter must preserve camera, resize, input, style, and resource cleanup in both overlaid and interleaved modes.
  • Changes to interleaved rendering must be checked against the host map's WebGL2 and shared-context limits. Overlay behavior must remain usable when interleaving is not available.
  • Changes to MapLibre compatibility must preserve supported projection handling, camera elevation updates, render-parameter checks, and the one-interleaved-overlay-per-map rule.
  • Changes to Google Maps or ArcGIS adapters must preserve the host-specific render mode, camera mapping, shared context, resize, and resource-release contract.
  • Changes to widgets must consider the widget exports, shared theme and CSS surface, and the React child path when the control is intended for both host styles.
  • Changes to color-scale legend discovery or display must preserve the resolved-scale contract, view filtering, and the empty-legend behavior when no visible layer supplies a scale.
  • Changes to the main package exports must keep the core, React, MapLibre, widget, and public type surfaces aligned with the integration choices described above.
  • Changes to Python output must preserve the JSON naming boundary, compact HTML output, provider and projection choices, and both HTML/iframe output and the Jupyter widget message path.
  • Changes to custom Python libraries must preserve the libraryName and resourceUri contract, the classic-script and ES-module distinction, shared package names, import-map loading order, and deck.gl version alignment for community packages.
  • Changes to the notebook front end, Python widget, or pydeck.json must keep the module name, version contract, require target, installed static bundle, and notebook configuration aligned.
  • Changes to binary data transfer must preserve the Python data shape expected by the transfer path and the browser-side layer accessor mapping.

Important failure modes

TriggerConsequenceGuard
A server-rendered React process imports or mounts the WebGL view as page contentRendering fails during server execution or produces no useful visualizationLoad the deck view on the client when the framework cannot handle its browser dependencies.
An interleaved map uses a WebGL1 contextDeck layers cannot share the map renderer's contextUse overlaid mode or a map configuration that provides WebGL2.
A MapLibre interleaved overlay is added without WebGL2 or supported render parametersThe overlay cannot attach to the shared map render cycleUse MapLibre GL JS 4.5.1 or later with WebGL2, or use overlaid mode.
More than one MapLibre interleaved overlay is added to one mapThe second overlay is rejectedKeep one interleaved deck overlay on each MapLibre map.
A MapLibre map uses a projection other than Mercator or globeCamera setup fails because deck.gl cannot map the projectionUse a supported projection or use a separate overlay with a compatible view.
A map adapter does not receive map resize, render, or style changesThe deck canvas can have the wrong size, camera, or layer orderKeep the adapter lifecycle attached to the map lifecycle.
A map integration uses incompatible deck, luma, or host-map versionsThe adapter can fail to load or cannot safely share the host rendering contextKeep peer version ranges aligned, including the supported MapLibre major versions.
Google Maps changes between vector and raster rendering while an overlay is activeThe old overlay or shared context can remain attached to the wrong host modeLet the overlay listen for rendering-type changes and recreate the host connection.
A custom pydeck library bundles another copy of deck.glLayer type checks can fail and the custom layer can be droppedMark deck.gl and luma.gl as externals and use the copies supplied by pydeck.
An ES module library is loaded after another module or without a module-capable responseThe custom library cannot resolve or execute in the browserLoad it through pydeck's module path with the required import-map order and server headers.
A community npm library targets another deck.gl minor versionThe custom library can load with incompatible shared packagesUse the matching pydeck deck.gl minor version or review the warning before loading it.
The notebook configuration enables a require target that does not match the installed static bundleJupyter cannot load the pydeck front endKeep pydeck.json, the require path, and the installed JavaScript file in sync.
A notebook cannot reach the default CDN and no offline bundle is selectedThe HTML frame has no deck.gl front end to render the JSONUse the offline bundle or provide a reachable hosted bundle.
Deck.update() is used with current pydeck v0.9 codeThe call raises NotImplementedError instead of changing an existing viewUse the HTML display path or confirm that live widget updates are available in the target pydeck version.
Binary transfer is requested for unsupported dataThe data cannot be prepared for the binary pathUse normal JSON data or convert the data to the supported tabular form.

Key files

FileWhy to read it
modules/…/index.tsShows the unified public entry surface for core rendering, MapLibre, React, widgets, and related types.
modules/…/index.tsShows the public React package entry point.
modules/…/index.tsShows the React component and wrapper factory surface.
modules/…/deckgl.tsShows the React boundary between component rendering and the deck engine.
docs/…/using-with-react.mdExplains React composition, base-map use, performance, and server-rendered applications.
modules/…/mapbox-overlay.tsShows the map control contract and the difference between overlaid and interleaved rendering.
modules/…/deck-utils.tsShows shared map camera, projection, terrain, repaint, and render state.
modules/…/overlay.tsShows the parallel MapLibre integration and its map lifecycle.
modules/…/deck-utils.tsShows MapLibre's shared render state, camera sync, elevation tracking, and layer drawing.
modules/…/compatibility.tsShows the MapLibre projection, camera elevation, and render-parameter compatibility boundary.
modules/…/package.jsonShows the supported MapLibre host range and peer version boundary.
modules/…/google-maps-overlay.tsShows how Google Maps selects vector and raster rendering hooks and responds to host mode changes.
modules/…/utils.tsShows how Google Maps camera data, map events, and deck lifecycle are connected.
modules/…/deck-renderer.tsShows how the ArcGIS SceneView supplies camera state and a shared render pass for deck content.
modules/…/commons.tsShows the ArcGIS render resource and composition boundary.
docs/…/using-with-map.mdGives the broad comparison of supported map renderer modes.
docs/…/using-standalone.mdDescribes framework-neutral and browser-script entry points.
modules/…/index.tsDefines the public widget, theme, and color-scale legend surface.
modules/…/color-scale-widget.tsxShows the optional legend for layer color scales.
modules/…/package.jsonShows the public widget stylesheet entry and host package boundary.
modules/…/index.jsDefines the browser side of the notebook integration.
modules/…/package.jsonShows the notebook front end's deck.gl, map, widget, and Jupyter dependencies.
bindings/…/deck.pyDefines the Python visualization boundary and output choices.
bindings/…/json_tools.pyDefines the Python-to-deck JSON naming and payload boundary.
bindings/…/html.pyShows how Python creates HTML and notebook output.
bindings/…/settings.pyDefines custom JavaScript and npm library loading for pydeck.
bindings/pydeck/docs/custom_layers.rstExplains the supported custom library forms and the shared browser package boundary.
bindings/…/widget.pyDefines Python-side widget state and event callbacks.
bindings/…/pydeck.jsonDefines the notebook extension configuration.
bindings/…/test_nbextension_path.pyChecks that the notebook require target matches the installed front end.
bindings/…/test_settings.pySummarizes the custom-library, npm, version, and shared-package contract.
bindings/…/a5_layer.pyShows the main Python flow from remote data and a layer to an HTML view.
bindings/pydeck/docs/CHANGELOG.rstRecords current pydeck integration capabilities such as widgets, MapLibre globe views, extensions, and custom npm libraries.