Public
Edited
Sep 17, 2024
Importers
4 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Tree(groupSelected, { height: 600 })
Insert cell
Sunburst(groupSelected, {
height: 600,
width,
value: (d) => d?.size || d[year],
group: (d) => (groupBy.length ? d[groupBy[0]] : null),
label: (d, n) => [...groupBy.map((a) => d[a]), n.value / 10 ** 6].join("\n")
})
Insert cell
import { Tree } from "@d3/radial-tree"
Insert cell
import { Icicle } from "@d3/icicle"
Insert cell
groupSelected = d3.group(
selected.map((d) => Object.assign(d, { name: d[groupBy[0]] })),
// (v) =>
// [Object.fromEntries(years.map((y) => [y, d3.sum(v.map((d) => d[y]))]))]
// ,
...groupBy.map((a) => (d) => d[a])
)
Insert cell
years = outlays.columns.filter((c) => Number.isInteger(+c))
Insert cell
otherAttribs = outlays.columns.filter((c) => !Number.isInteger(+c))
Insert cell
import {multiAutoSelect} from "@john-guerra/multi-auto-select"

Insert cell
import { navio } from "@john-guerra/navio"
Insert cell
import {Treemap} from "@d3/treemap"
Insert cell
import {Sunburst} from "@d3/sunburst-component"
Insert cell
outlays = FileAttachment("BUDGET-2025-DB-2.csv").csv({ typed: true })
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more