Public
Edited
Jan 30, 2022
Fork of NLRB cases
Insert cell
Plot.plot({
y: {
grid: true,
domain: [0, 50]
},
facet: {
data: data_bls,
x: "seriesID",
columns: true
},
fx: { paddingInner: 0.2 },
fy: { paddingInner: 0.2 },

marks: [
Plot.text(
data_bls,
Plot.selectFirst({
x: 2000,
y: 50,
dy: -8,
text: (d) =>
d.sector === "Mining, quarrying, and oil and gas extraction"
? "Mining, quarrying, and oil and gas"
: d.sector,
textAnchor: "start",
fontWeight: "bold"
})
),
Plot.line(data_bls, { y: "value", x: "year" })
]
})
Insert cell
Insert cell
Insert cell
blsAPI = "df48dbacee684021bca5cb7f518ef2f9"
Insert cell
Insert cell
bls = new BLS("df48dbacee684021bca5cb7f518ef2f9")
Insert cell
Insert cell
zip = (rows) => rows[0].map((_, c) => rows.map((row) => row[c]))
Insert cell
data_bls = bls.fetchSeries(sectors, 2000, 2021)
Insert cell
see https://observablehq.com/@fil/faceted-bar-chart-experimental for more formatting ideas
Insert cell
import { Plot } from "@fil/facet-wrap-332"
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