Public
Edited
Jan 14
Insert cell
Insert cell
chrono = {
const champs = new Set();

var result = [];

data.forEach((d) => {
const dateEtType = d["Date_et_typologie_de_la_protection"].split(";");

const nom = d.Titre_editorial_de_la_notice;

dateEtType.forEach((e) => {
const date = new Date(e.substring(0, e.indexOf(":")));
const qualif = e.substring(e.indexOf(":") + 1).trim();
champs.add(qualif);
if (qualif.indexOf("class") > -1) {
result.push({ date, nom, type: "classé" });
}

if (qualif.indexOf("inscrit") > -1) {
result.push({ date, nom, type: "inscrit" });
}
});
});

result = result.sort((a, b) => a.date - b.date);

return { result, champs };
}
Insert cell
depuis_2000.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
data = FileAttachment("depuis_2000.csv").csv()
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