Public
Edited
Dec 1, 2022
Insert cell
Insert cell
Plot.plot({
insetRight: 10,
height: 400,
width,
marks: [
Plot.dot(
data,
Plot.dodgeY({
x: "year",
r: "count",
// title: (d) => `${d.NAME}\n${(d.rMVOP / 1e3).toFixed(1)}B`,
fill: "leaning"
})
)
]
})
Insert cell
data = _.flatten(
d3
.groups(
_data,
(d) => d.leaning,
(d) => d.year
)
.map(([leaning, arr]) =>
arr.map(([year, arr]) => ({ leaning, year, count: arr.length }))
)
)
Insert cell
_data = surveyMultiple([14, 15, 16, 17, 18, 19, 20, 21, 22, 23])
Insert cell
import { surveyMultiple } from "1b294fcddb0025d2";
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