Approche temporelle
Département
Commune
Ne sont représentées que les communes avec des données disponibles pour chacune des 7 années de référence
Département
tablodep = transpose(tabdep)
viewof dep = Inputs.select([null].concat(DEP), {label: "Sélectionnez le département :", value: "Paris (75)"})
newtab_dep = tablodep.filter(d => d.DEP === dep)
Inputs.table(newtab_dep, {
columns: [
"Indicateurs", "2015", "2016", "2017", "2018", "2019", "2020", "2021", "2022"
],
rows: 22
})
Commune
tablocom = transpose(tabcom)
viewof com = Inputs.select([null].concat(coms), {label: "Sélectionnez la commune :", value: "Palaiseau"})
newtab_com = tablocom.filter(d => d.COM === com)
Inputs.table(newtab_com, {
columns: [
"Indicateurs", "2016", "2017", "2018", "2019", "2020", "2021", "2022"
],
rows: 22
})
tablocomp = transpose(tabcom)
viewof ind = Inputs.select([null].concat(indics), {label: "Indicateur :", value: "Prix moyen par personne ($)"})
viewof com1 = Inputs.select([null].concat(coms), {label: "Sélectionnez la commune :",
value: "Pantin"})
viewof com2 = Inputs.select([null].concat(coms), {label: "Sélectionnez la commune :",
value: "Issy-les-Moulineaux"})
newtab_comp = tablocomp.filter(d => d.COM === com1 & d.Indicateurs === ind | d.COM === com2 & d.Indicateurs === ind)
Inputs.table(newtab_comp, {
columns: [
"COM", "2016", "2017", "2018", "2019", "2020", "2021", "2022"
],
rows: 22
})
t_tab = transpose(tab)
t_tab_idf = transpose(tab_idf)
newtab = t_tab.filter(d => d.COM === com1 & d.Indicateur === ind | d.COM === com2 & d.Indicateur === ind)
newtab_idf = t_tab_idf.filter(d => comp.includes(d.COM) & d.Indicateur === ind)
viewof comp = Inputs.checkbox(labels, {label: "comparaison", multiple: true})
Plot.plot({
y: {
grid: true,
label : ind
},
marks: [
Plot.line(newtab, {x: "Année", y: "tot", z: "COM", stroke: "COM"}),
Plot.line(newtab_idf, {x: "Année", y: "tot", z: "COM", stroke: "COM"}),
Plot.text(newtab_idf, Plot.selectLast({x: "Année", y: "tot", z: "COM", text: "COM"})),
Plot.text(newtab, Plot.selectLast({x: "Année", y: "tot", z: "COM", text: "COM"}))
]
})
t_tmp = transpose(tmp)
viewof ind_dep = Inputs.select([null].concat(indics), {value: "Prix moyen par personne ($)" ,label: "Indicateur :"})
viewof deps = Inputs.checkbox(DEP, {label: "Sélectionnez le(s) département(s)", multiple: true})
newtab_depp = t_tmp.filter(d => deps.includes(d.DEP) & d.Indicateur === ind_dep)
tmp2 = tablodep.filter(d => deps.includes(d.DEP) & d.Indicateurs === ind_dep)
Inputs.table(tmp2, {
columns: [
"DEP", "2016", "2017", "2018", "2019", "2020", "2021", "2022"
],
rows: 22
})
Plot.plot({
y: {
grid: true,
label : ind_dep
},
marks: [
Plot.line(newtab_depp, {x: "Année", y: "tot", z: "DEP", stroke: "DEP"}),
Plot.text(newtab_depp, Plot.selectLast({x: "Année", y: "tot", z: "DEP", text: "DEP"}))
]
})