Published unlisted
Edited
Sep 25, 2020
Insert cell
Insert cell
Insert cell
chart
Insert cell
import {chart}
with {rolled_nest_data as data}
from "@d3/zoomable-sunburst"
Insert cell
rolled_nest_data = ({name: "Portfolio", children: nest(grouped_data)})
Insert cell
function nest(rollup) {
return Array.from(rollup, ([key, value]) =>
value instanceof Map
? { name: key, children: nest(value) }
: { name: key, value: value.length }
);
}
Insert cell
d3.hierarchy(grouped_data).sum(d => d.value).sort((a, b) => b.value - a.value);
Insert cell
hierarchy = d3.hierarchy(grouped_data)
Insert cell
rollup = d3.rollup(sovereign_projects.slice(1), d => d.length, d => d["Status"], d => d["Country"], d => d["Sector"])
Insert cell
rolled_data = d3.rollup(sovereign_projects.slice(1), d => d["Status"], d => d["Country"], d => d["Sector"])
Insert cell
grouped_data = d3.group(sovereign_projects.slice(1), d => d["Status"], d => d["Country"], d => d["Sector"])
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