Public
Edited
Jul 18, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
html`${elues.map(item)}`
Insert cell
item = (e) => {
const plot = () =>
Plot.plot({
axis: null,
width: 12,
height: 12,
color: {
domain: Object.keys(couleurs_mdpt),
range: Object.values(couleurs_mdpt)
},
style: "display: inline-block;",
marks: [
Plot.dotX([e.CodNuaCand], { fill: (d) => groupes[d] || "Autres" })
]
});

return md`${[
plot(),
" ",
e.NomPsn.toUpperCase(),
" ",
e.PrenomPsn,
" ",
e.CodCirc2
? `[${e.CodCirc2}](https://elections.gouv.lol/legislatives/circonscription#${e.CodCirc2})`
: ""
]}`;
}
Insert cell
t1_resultats = fetch_results(2024, 1)
Insert cell
t2_resultats = fetch_results(2024, 2)
Insert cell
elues = d3.sort(
d3.merge([t1_resultats, t2_resultats]).filter((d) => d.Elu == "OUI"),
(d) => d.NomPsn.replaceAll(" ", "")
)
Insert cell
import { fetch_results, couleurs_mdpt, groupes } from "@taniki/lg2024-common"
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