DeckGL is a React component that takes deck.gl layer instances and
viewport parameters, and renders those layers as a transparent overlay.
import DeckGL, {ScatterplotLayer} from 'deck.gl';
const App = (viewport, data) => (
<DeckGL
{...viewport}
layers={[new ScatterplotLayer({data})]} />
);Canvas ID to allow style customization in CSS.
viewport (Viewport, optional)
This property should contain a Viewport instance which represents your
"camera" (essentially view and projection matrices, together with viewport
width and height). By changing the viewport you change the view of your
layers, e.g. as a result of mouse events or through programmatic animations.
If viewport is not supplied, deck.gl will look for web mercator projection
parameters (latitude, longitude, zoom, bearing and pitch) and create a
WebMercatorViewport (which is a subclass of Viewport).
Width of the canvas.
Height of the canvas.
Current latitude - used to define a mercator projection if viewport is not supplied.
Current longitude - used to define a mercator projection if viewport is not supplied.
Current zoom - used to define a mercator projection if viewport is not supplied.
Current bearing - used to define a mercator projection if viewport is not supplied.
Current pitch - used to define a mercator projection if viewport is not supplied.
The array of deck.gl layers to be rendered. This array is expected to be an array of newly allocated instances of your deck.gl layers, created with updated properties derived from the current application state.
Css styles for the deckgl-canvas.
Extra pixels around the pointer to include while picking.
This is helpful when rendered objects are difficult to target, for example
irregularly shaped icons, small moving circles or interaction by touch.
Default 0.
Will use device ratio by default.
gl context, will be autocreated if not supplied.
Flag to enable debug mode.
Note: debug mode is somewhat slower as it will use synchronous operations to keep track of GPU state.
Callback, called once the WebGL context has been initiated
Callback arguments:
gl- the WebGL context.
Callback - called when the object under the pointer changes.
Callback Arguments:
info- theinfoobject for the topmost picked layer at the coordinatepickedInfos- an array of info objects for all pickable layers that are affected.event- the original MouseEvent object
Callback - called when clicking on the layer.
Callback Arguments:
info- theinfoobject for the topmost picked layer at the coordinatepickedInfos- an array of info objects for all pickable layers that are affected.event- the original MouseEvent object