Public
Edited
Sep 2, 2024
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
seats_table = md`
<table class="table_sn">
<tbody>
<tr >
<th style="text-align: left;padding-top: 16px;padding-bottom: 16px;"><b>Partei</b></th>
<th style="width: 20%; text-align: center;padding-top: 16px;padding-bottom: 16px;">Sitze</th>
</tr>
${seats_table_order.map(
(d) => htl.html`<tr>
<td style="text-align: left;"><span class="selected" style="color:${
d.color
};font-size: 14px; font-weight: 600;">${
d.party
}</span></span></td>
<td style="width: 20%; text-align: center;"><b>${
d.recent
}</b><br><span style="color: ${
d.change < 0
? "#e84f1c"
: d.change > 0
? "#6bb024"
: "#99AFC2"
}";>${
d.change == 0
? "±0"
: d.change > 0
? "+" + d.change
: d.change
}</span></td>

</tr>`
)}
</tbody>
</table>`
Insert cell
Insert cell
Insert cell
reihen = 4
Insert cell
inner = 56
Insert cell
Insert cell
radius = (width, document.body.clientWidth) / 100
Insert cell
Insert cell
party_check
SELECT * FROM party_check
Insert cell
Insert cell
seats_db = DuckDBClient.of({ seat_change, party_checked })
Insert cell
seats_db
SELECT party, recent, former, change FROM seat_change
WHERE party in (SELECT party_check FROM party_checked)
Insert cell
seat_change_data = read(
"https://docs.google.com/spreadsheets/d/1yZACpvw8QK4biAzfKRrwIOflakA4bw2Nzn7xDqDqdMM/edit?gid=1393437319#gid=1393437319",
"Sitze Thüringen"
)
Insert cell
Insert cell
Insert cell
seat_table = d3.sort(seat_change, (d) => d.recent).reverse()
Insert cell
seats_table_order = d3
.sort(
seat_table.filter((d) => !["fraktionslos", "Sonstige"].includes(d.party)),
(d) => d.seats
)
.concat(
seat_table.filter((d) => ["fraktionslos", "Sonstige"].includes(d.party))
)
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