Published
Edited
Dec 7, 2021
Fork of TEST2
Importers
Insert cell
Insert cell
mapContainer = html `<div style="height:${width*0.9}px">
<div class="data-panel">
<i>total:?</i>
</div>
<div id="tooltip"></div>
</div>`
Insert cell
mapContainer1 = html `<div style="height:${width*1.3}px">
<div class="data-panel">
<i>total:?</i>
</div>
<div id="tooltip"></div>
</div>`
Insert cell
width = 500
Insert cell
heatmap = {
var width = 500;
var height = 500;
var svg = d3.select("body")
.append("svg")
.attr("width", width)
.attr("height", height);

const hexagonLayer = new deck.HexagonLayer({
id: 'heatmap',
colorRange,
data,
elevationRange: [0, 1],
elevationScale: 20,
extruded: true,
getPosition: d => [d.lng, d.lat],
opacity: 0.3,
radius: 200,
coverage: 0.97,
lightSettings,
pickable: true,
autoHighlight: true,
});

// svg.append('hexagonLayer')
deckgl.setProps({layers: [hexagonLayer]});
return svg.node();
}
Insert cell
Insert cell
deckgl = {
return new deck.DeckGL({
container: mapContainer,
map: mapboxgl,
mapboxAccessToken: 'pk.eyJ1IjoiZGF0YXBpeHkiLCJhIjoiY2tnM3ZhZWJjMDE1ajJxbGY1eTNlemduciJ9.YZ9CJEza0hvAQmTRBhubmQ',
mapStyle: 'https://api.maptiler.com/maps/toner/style.json?key=bMizIsuAeRiZikCLHO9q',
//mapStyle: 'https://api.maptiler.com/maps/streets/style.json?key=16w5shr5tFdXZDtfZGGN',
latitude: 40.0067,
longitude: -83.0305,
zoom: 12,
minZoom: 8,
maxZoom: 15,
pitch: 30
});
}
Insert cell
heatmap
Insert cell
Insert cell
colorRange1 = {
return [
[1, 152, 189],
[73, 227, 206],
[216, 254, 181],
[254, 237, 177],
[254, 173, 84],
[209, 55, 78]
];
}
Insert cell
colorRange = {
return [
// [255, 247, 236],
// [253, 220, 176],
// [253, 179, 125],
// [241, 108, 74],
// [201, 31, 20],
// [128, 0, 0]
[49, 54, 149],
[117, 171, 208],
[220, 241, 236],
[254, 209, 131],
[244, 121, 73],
[165, 0, 38]
];
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more