data = {
return d3.rollups(
final_resultats,
(d) => ({
voix: d3.sum(d, (c) => c.NbVoix),
candidats: d.length,
sieges: d3.filter(d, (c) => c.Elu == "OUI").length,
inscrits: d3.sum(
d.map(
(c) =>
final_inscrits.find(
(c2) => c2.CodCirc2 == c.CodCirc2 && c2.tour == c.tour
).Inscrits
)
)
}),
(d) => (d.CodNuaCand in groupes ? groupes[d.CodNuaCand] : "Autres")
);
}