Published
Edited
Jun 8, 2021
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
union = moyennes.filter(c => candidatsSelected.includes(c.candidat))
Insert cell
challengers = moyennes.slice(0,2)
Insert cell
moyennes = [...d3.rollup(data, v => ({
echantillons: v.length,
moyenne: d3.mean(v.map(c=>c.intentions)),
inf:d3.mean(v.map(c=>c.erreur_inf)),
sup:d3.mean(v.map(c=>c.erreur_sup))
}),
c => c.candidat)
]
.map(x => ({candidat: x[0], ...x[1]}))
//.filter(c => candidatsSelected.includes(c.candidat))
.sort((a,b)=> b.moyenne - a.moyenne)
Insert cell
data = {
return sondages.slice(0, sondagesNb)
.map(s => s.tours[0].hypotheses.map(h => h.candidats.map(c =>({sondage: s.id, hypothese: h.hypothese, ...c}))))
.flat(10)
}
Insert cell
import { sondages } from '@taniki/presidentielles2022-intentions'
Insert cell
import { candidats, sondages as sondages_ } from '@taniki/presidentielles2022-sondages-suivi'
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