Public
Edited
May 8, 2022
5 forks
1 star
Insert cell
Insert cell
Insert cell
Insert cell
import {powerplants_2019} from "@emfielduva/dvlib_sampledata"
Insert cell
slice = d3.shuffle(powerplants_2019).slice(0,5000) // sampling records for speed for demonstration.
Insert cell
clElem = d3.select(svgContainer).select("#layer1")
Insert cell
Insert cell
fociFuels = ({
"OIL":{x: 200, y: 200},"GAS":{x: 400, y: 200},"HYDRO":{x: 600, y: 200},"COAL":{x: 800, y: 200},
"NUCLEAR":{x: 200, y: 400},"WIND":{x: 400, y: 400},"SOLAR":{x: 600, y: 400},"BIOMASS":{x: 800, y: 400},
"GEOTHERMAL":{x: 200, y: 600},"OFSL":{x: 400, y: 600},"OTHF":{x: 600, y: 600},"":{x: 800, y: 600}
})
Insert cell
Insert cell
options = ({
"startFoci": fociFuels,
"fociField": "Plant primary fuel generation category",
"classField": "Plant primary fuel generation category", // to set their class/color
"dotScaleFactor": 0.005,
"strength": -1,
"alphaTarget": 0.09
})
Insert cell
Insert cell
Insert cell
clusters = dvCluster(clElem,slice,800,800,"Plant annual net generation (MWh)",options)
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