Public
Edited
May 15, 2024
Insert cell
# Pistes cyclables en France - 3
Insert cell
pistes_cyclables_departement@1.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
data=
{
const text = await FileAttachment("pistes_cyclables_departement@1.csv").text();
const parseDate = d3.utcParse("%Y-%m");
return d3.csvParse(text, ({date, Pistes_cyclables, Departement, proportion_pistes_et_voies_vertes, pistes_et_voies_vertes}) => ({
date: parseDate(date),
pistes: +Pistes_cyclables,
proportion_pistes_et_voies_vertes : +proportion_pistes_et_voies_vertes,
pistes_et_voies_vertes: +pistes_et_voies_vertes,
departement:Departement
}));
}
Insert cell
Insert cell
data2dep = data.filter(d=> ["Paris", "Gironde", "Loire-Atlantique", "Var", "Gar"].includes(d.departement))
Insert cell
data
Insert cell
viewof select_departement_val = Inputs.radio(["En valeur absolue", "En comparaison avec les voies routières"], {label: "Longueur des pistes cyclables", value: "En valeur absolue"})
Insert cell
Insert cell
Plot.plot((() => {
let d1 = 'A';
let this_data = data.filter(d=>d.departement == 'Paris')
console.log(this_data)
return {
grid:false,
marks: [
Plot.ruleY([0]),
Plot.lineY(this_data, {x: "date", y: "pistes_et_voies_vertes"})
]
}
})())
Insert cell
Insert cell
bands = 1
Insert cell
step = d3.max(data2dep, (d) => d.pistes) / bands
Insert cell
filtered_data = data.filter(d=> ["Paris", "Gironde", "Gard", "Var"].includes(d.departement))
Insert cell
data
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