Public
Edited
Jul 29, 2022
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data = minerLocationsReport.minerLocations
.filter(({ miner }) => minerPowerDailyAverageReport.miners[miner])
.map(({ miner, long, lat, numLocations }) => {
const power = minerPowerDailyAverageReport.miners[miner].qualityAdjPower
return {
latitude: Number(lat),
longitude: Number(long),
qualityAdjPower: power / numLocations
}
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
initialViewState = ({
latitude: 30,
longitude: 10,
zoom: 1.2,
bearing: 0,
pitch: 0,
minZoom: 1,
maxZoom: 20
})
Insert cell
deckgl = {
return new deck.DeckGL({
container,
map: mapboxgl,
mapboxAccessToken: '',
// 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',
initialViewState,
controller: true,
layers: [ hexagonLayer ]
});
}
Insert cell
hexagonLayer = new deck.HexagonLayer({
id: 'miners',
extruded: true,
data: data,
radius: 80000,
getPosition: d => [d.longitude, d.latitude],
getElevationWeight: d => d.qualityAdjPower,
elevationAggregation: 'SUM',
elevationScale: 2000,
opacity: 0.6,
colorRange: [
[0, 170, 0, 255],
[0, 190, 0, 255],
[0, 255, 0, 255]
],
onClick: info => {
console.log('Click', info)
}
})
Insert cell
Insert cell
Insert cell
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