Public
Edited
Feb 3, 2023
Insert cell
Insert cell
chart = Pack(rollup, {
value: ([, value]) => value,
label: ([key]) => key?.split(/\s+/g).join("\n"),
title: ([key], n) => `${n.depth
? `${n.ancestors().reverse().slice(1).map(({data: [key]}) => key).join("\n")}\n`
: ""}${n.value.toLocaleString("en")}`,
width: 2000,
height: 2000,
})
Insert cell
rollup = d3.rollup(
h1bs,
D => d3.sum(D, d => d["Initial Approvals"] + d["Initial Denials"] + d["Continuing Approvals"] + d["Continuing Denials"]),
d => d.State,
d => d.City,
d => d.Employer,
)
Insert cell
h1bs = FileAttachment("h1b_datahubexport-2019.csv").csv({typed: true})
Insert cell
Insert cell
import {Pack} from "@d3/pack"
Insert cell
import {howto} from "@d3/example-components"
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