Public
Edited
Dec 6, 2019
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
deck = require('deck.gl@6.2.3/deckgl.min.js')
Insert cell
Insert cell
mapboxgl = require('mapbox-gl@~0.50.0/dist/mapbox-gl.js')
Insert cell
Insert cell
d3 = require("https://d3js.org/d3.v5.min.js")
Insert cell
Insert cell
ukRoadAccidents = d3.csv('https://raw.githubusercontent.com/uber-common/deck.gl-data/master/examples/3d-heatmap/heatmap-data.csv', row => ({lng: +row.lng, lat: +row.lat}))
Insert cell
Insert cell
Insert cell
Insert cell
deckgl = {
// This is an Observable hack: clear previously generated content
mapContainer.innerHTML = '';

return new deck.DeckGL({
// The HTML container to render into
container: mapContainer,

// Mapbox settings
// set `map: false` to turn off Mapbox base map
map: mapboxgl,
// This token is for demo-purpose only and rotated regularly. Get your token at https://www.mapbox.com
mapboxApiAccessToken: 'pk.eyJ1IjoidWJlcmRhdGEiLCJhIjoiY2pudzRtaWloMDAzcTN2bzN1aXdxZHB5bSJ9.2bkj3IiRC8wj3jLThvDGdA',
mapStyle: 'mapbox://styles/mapbox/dark-v9',

// Viewport settings
longitude: -122.4,
latitude: 38,
zoom: 8,
pitch: 30,
bearing: 0,
layers: [layer]
});
}
Insert cell
mapContainer = html `<div style="height:500px"></div>`
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more