Public
Edited
Dec 5
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
marginRight: 80,
x: { label: "Rank" },
fy: { label: "Charity" },
marks: [
Plot.rectY(
dataTidy.filter((d) =>
[charityA, charityB, charityC].includes(d["charity"])
),
Plot.binX({ y: "count" }, { x: "rank", fy: "charity", interval: 1 })
),
Plot.ruleY([0])
]
})
Insert cell
Insert cell
Donation Election Votes- Public - Final data.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
dataTidy = aq
.from(data)
.fold(aq.not("vote_id"), { as: ["charity", "rank"] })
.objects()
Insert cell
charities = ["", ...Object.keys(data[0]).slice(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