�deck.gl as a cross-language
visualization architecture
Public proposal
Last Updated April 15, 2020
Motivations
When we say that a code base is an implementation of “deck.gl”,�what exactly do we mean?�
Main Themes
Big picture: deck.gl as a cross-language architecture
deck.gl-native
dawn (native WebGPU)
@deck.gl/json
D3D12�Windows
OpenGL
Android
Rendered textures
pydeck (Python)
(Python classes generating deck json)
Interaction (events)
Swiftdeck�(Swift/Cocoa classes generating deck json)
deck.gl (the JS renderer)
WebGL
WebGPU
(TBA)
Renderers
@deck.gl/json (JSON)
Language Bindings
Javadeck (Android)�(Java classes generating deck json)
...
Protocol
C++ API
JS API
React API
Vulkan�Linux
Metal�iOS/OSX
deck.gl: Protocol and Transport
deck-browser-renderer (JS)
deck-native-renderer
deck-native-renderer (C++)
dawn (native WebGPU)
JSON “styles” initial
pydeck
(Python classes generating deck json)
WebGL
WebGPU
cppdeck�(C++ classes generating deck json)
Renderers
@deck.gl/json
Language Bindings
swiftdeck (iOS)�(Swift classes generating deck json)
...
Protocol & Transport
deck-node-renderer (JS)
“WebGL-node” *
JSON “styles” update
JSON “styles” (referencing data blob)
Init: Version, Metadata (prop types, ...)
Backchannel: logs and errors
Transport: data “blob” (JSON,CSV,binary...)_
Backchannel: interaction events
Back transport: rendered textures/buffers...
Back transport: large selections...
javadeck (Android)�(Java classes generating deck json)
Transports: One API Multiple Implementations
iOS
“Swift” <-> WebView Transport
iOS WebView
(transport via iOS WebView)
Android
Java <-> WebView Transport
Android WebView
(transport via Android WebView)
Python
Notebook <-> Browser Transport
pydeck JS
(transport via Jupyter Widget hooks)
Java Layer classes
Swift Layer classes
pydeck classes
(transport via Jupyter hooks)
Hosted JS app (deck.gl playground fork)
(transport via/ native Android / iOS WebView APIs, accessed via window object)
WebSocket
Socket <-> Browser Transport
Arbitrary language
(transport via WebSocket)
Hosted deck app
Android “Javadeck” demo
webView = findViewById(R.id.mainWebView);
deckGlView = DeckGlView.configure(webView);
imageView = findViewById(R.id.imageView);
// … configure connection to imageView ...
Deck visState = � Deck.builder()
.initialView(ViewState.builder()
.latitude(37.72)
.longitude(-122.45)
.build())
.layers(Arrays.asList(Layer.builder()
.type(Layers.GEO_JSON_LAYER)
.dataUrl(“https://…”)
.args(...)
.build())
.build();
deckGlView.update(visState);
Requirements for a transport layer / protocol
Data “Blob” Transport Messages
Relevant documents / RFCs
deck.gl native renderer
deck-native-renderer: Internal Structure
@deck.gl/json
deck-native-renderer
(C++? Rust? …)
\
C++/JS code sharing ideas...
Share GLSL code (transpile to MSL on iOS)?
Rewrite tesselation algorithms in C++ and use in JS via WASM?
@luma.gl replacement
Metal / OpenGL / Vulkan Backends (iOS + Android)
Rendered textures,
Interaction events?
...
@deck.gl/json: layer protocol parser (PORT)
@deck.gl/layers: port subset of layers
@deck.gl/core: port subset of core
From external apps
In various languages
dawn: Cross-platform native WebGPU
dawn is an open-source cross-platform implementation of WebGPU providing:
@luma.gl JS directions - WebGPU as “abstraction”?
Currently based on a WebGL class interface. Move to WebGPU-ish class interface?
Alternative: luma.gl abstraction layer completely hides WebGPU w/ custom classes.