Published
Edited
Jun 14, 2021
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data = FileAttachment("ticks.json").json()
Insert cell
deck = require.alias({
h3: {},
s2Geometry: {}
})('deck.gl@8.4.1/dist.min.js')
Insert cell
mapboxgl = require('mapbox-gl@^1.5.1/dist/mapbox-gl.js')
Insert cell
token = {
// Don't use this token. It will be rotated frequently. Get your own at https://mapbox.com
return 'pk.eyJ1Ijoiam9obmhhbGRlbWFuIiwiYSI6ImNrMjIxNnBrdTAxN3Mzb3BmbWFzbnV6OGoifQ.HrfAiASrw9EQetZn13xAPg';
}
Insert cell
getDeckGLMap = (layers, pitch) => {
if (pitch === undefined) {
pitch = 0;
}

let container = html`<div style="height:700px"></div>`;

let deckgl = new deck.DeckGL({
container,
map: mapboxgl,
mapboxAccessToken: '',
mapboxApiAccessToken: token,
mapStyle: 'mapbox://styles/mapbox/dark-v10',
layers: layers,
initialViewState: {
longitude: -88.5,
latitude: 45,
zoom: 3.3,
pitch: pitch
},
controller: true
});

return container;
}
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