Public
Edited
Dec 2, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
groups = new Map(
seats_election
.map((d) => ({
group_policy: d.group_policy,
color_group: d.color_group.concat("_").concat(d.group_policy)
}))
.map(JSON.stringify)
.filter((e, i, a) => i === a.indexOf(e))
.map(JSON.parse)
.map(Object.values)
)
Insert cell
seats_format
SELECT * FROM seats_format
WHERE election = ${election_select}
AND parliament = ${parliament}
AND seats_party >= 1
Insert cell
seats_election
SELECT group_policy, color_group FROM seats_election
GROUP BY 1, 2
Insert cell
seats_election
SELECT group_policy, group_long, seats_group_total, color_group, election FROM seats_election
GROUP BY 1, 2, 3, 4, 5
Insert cell
group_check = group_checkbox.length > 0
? group_checkbox.map((d) => d.split("_")[1])
: [""]
Insert cell
group_check
SELECT * FROM group_check
Insert cell
seats_db = DuckDBClient.of({ seats_election, group_checked })
Insert cell
seats_db
SELECT status,
"date",
"time",
"group",
election,
color_group,
group_long,
group_policy,
party,
country,
seats_party,
seats_group_total,
seats_group_country,
parties_group FROM seats_election
WHERE group_policy in (SELECT group_check FROM group_checked)
Insert cell
Insert cell
seats_selected_empty
SELECT group_policy, group_long, seats_group_total, color_group, election FROM seats_selected_empty
GROUP BY 1, 2, 3, 4, 5
Insert cell
Insert cell
stand = stand_eu.date != ""
? `Stand: ${new Date(stand_eu.date).getDate()}.${
new Date(stand_eu.date).getMonth() + 1
}.${new Date(stand_eu.date).getFullYear()} um ${stand_eu.time} Uhr`
: `${stand_eu.status} ${stand_eu.election}`

Insert cell
stand_eu = seats_selected.filter(
(d) => d.time == d3.max(seats_selected.map((d) => +d.time))
)[0]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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