Public
Edited
Feb 23, 2023
140 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import { tweet } from "@mbostock/tweet"
Insert cell
import { toc } from "@nebrius/indented-toc"
Insert cell
import {Tree as RadialTree} from "@d3/radial-tree"
Insert cell
import {Tree} from "@d3/tree"
Insert cell
radialDendrogram = RadialTree(hierarchicalData, {
label: d => d.name,
width: 640,
height: 640
})
Insert cell
clusterDendrogram = Tree(hierarchicalData, {
label: d => d.name,
width: 640
})
Insert cell
import { chart as collapsibleTree } with {
hierarchicalData as data
} from "@d3/collapsible-tree"
Insert cell
import {
viewof t as sunburstToIcicleSlider,
chart as sunburstToIcicle
} from "@kerryrodden/unrolling-a-sunburst"
Insert cell
import {
viewof t as lineChartSlider,
chart as lineChart
} from "@kerryrodden/unrolling-a-line-chart"
Insert cell
import {
viewof t as barChartSlider,
chart as radialBarChart
} from "@kerryrodden/unrolling-a-radial-bar-chart"
Insert cell
hierarchicalData = {
const maxDepth = 3;
const numChildren = 5;
function buildTree(node, depth) {
if (depth <= maxDepth) {
node.children = Array(numChildren).fill(null)
.map(() => ({ name: String(depth) }));
node.children.forEach(child => buildTree(child, depth + 1));
} else {
node.value = 1;
}
return node;
}
return buildTree({ name: "root" }, 1);
}
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