Public
Edited
Apr 12, 2022
Fork of Pack Circles
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {powerplants_2019} from "@emfielduva/dvlib_sampledata"
Insert cell
Insert cell
allDataSorted = d3.sort(powerplants_2019, (a,b)=>d3.ascending(a[sortField],b[sortField]))
Insert cell
Insert cell
rollupData = d3.rollups(powerplants_2019, v => d3.sum(v, d => toNum(d["Plant annual net generation (MWh)"])), d => d["Plant primary fuel generation category"]).sort((a,b) => d3.descending(a[1],b[1]))
Insert cell
Insert cell
rollupDataByState = d3.rollups(powerplants_2019, v => d3.sum(v, d => toNum(d["Plant annual net generation (MWh)"])), d => d["Plant state abbreviation"], d => d["Plant primary fuel generation category"]);
Insert cell
Insert cell
dataLayout = layoutChildren("powerplants", dataAggregationSelected);
Insert cell
Insert cell
pcElem = d3.select(svgContainer).select("#layer1")
Insert cell
pc = dvPackCircles(pcElem,dataLayout,800,600,"Plant annual net generation (MWh)",options);
Insert cell
options = ({
transitionMS: 1000,
padding: 1,
classField: "Plant primary fuel generation category",
textLabelField: "Plant name"
})
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