Public
Edited
Apr 6, 2023
Paused
6 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
all = {
const parse = d3.utcParse("%Y-%m-%d %H:%M:%S %Z");

do {
const text = await FileAttachment("brav-m.txt").text(); //
yield d3
.tsvParseRows(text)
// "fake UTC", branché sur l'heure de Paris
.map(([t, v]) => ({ date: parse(`${t} -0200`), signatures: +v }));
await Promises.delay(5 * 60 * 1000); // rechargeait toutes les 5 minutes quand la pétition était "live"
} while (false); // true pour une version live
}
Insert cell
// on regroupe par bins et on conserve le dernier de chaque, pour éviter d'avoir trop de points
counts = d3
.bin()
.value((d) => d.date)
.thresholds(30)(all)
.filter((d) => d.length)
.map((d) => d.pop())
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