Public
Edited
Sep 20, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
percent_sum = d3.sum(wahlen_bb.map((d) => d.percent))
Insert cell
wahlen_adjust = wahlen_bb.map((d) => ({
...d,
percent_adjust: (d.percent / percent_sum) * 100,
party: d.party
}))
Insert cell
Insert cell
wahlen_adjust
SELECT date, institut, land, party, percent_adjust as percent,
sum(percent_adjust) OVER (ORDER BY percent_adjust desc) as cumsum
FROM wahlen_adjust
Insert cell
Insert cell
Insert cell
Insert cell
color_default = new Map(
small_parties
.filter((d) => (d.party != "Linke") & (d.party != "FDP"))
.map((d) => ({
party: d.party,
color: d.party
.concat("_")
.concat(
Array.from(hochburgen.keys()).includes(d.party)
? hochburgen.get(d.party)
: "#99AFC2"
)
}))
.map(Object.values)
)
Insert cell
Insert cell
Insert cell
ns = Inputs.text().classList[0]
Insert cell
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