Public
Edited
Dec 5
4 forks
1 star
Insert cell
Insert cell
Insert cell
dotplot = Plot.dot(stats, {
x: "eam_soldenat_2015_2021",
y: "Part_moins25ans",
stroke: null,
fill: "darkgrey",
opacity: 0.6})
.plot()
Insert cell
Insert cell
bubbleplot = Plot.dot(stats, {
x: "eam_soldenat_2015_2021",
y: "Part_moins25ans",
stroke: "white",
fill: "darkgrey",
r:"Nb_moins25ans",
opacity: 0.6})
.plot()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot.rectY(stats, Plot.binX({y: "count"}, {x: "eam_population2015_2021", fill: "red"})).plot()
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
marginLeft: 70,
x: {
line: true,
},
y: {
line: true
},
marks: [
Plot.barY(
pops21,
{ y: "pop21" , x: "code", sort: {x: "y"}, fill: "orange" }
)
]
})
Insert cell
stats19 = d3.csv("https://raw.githubusercontent.com/ljegou/geotests/master/data_frdepts19.csv", d3.autoType);
Insert cell
Insert cell
Insert cell
Occitanie = (stats.filter((dept) => (dept.Code == 31) || (dept.Code == 9) || (dept.Code == 11) || (dept.Code == 12) || (dept.Code == 30) || (dept.Code == 46) || (dept.Code == 34) || (dept.Code == 65) || (dept.Code == 81) || (dept.Code == 82) || (dept.Code == 32) || (dept.Code == 48) || (dept.Code == 66)));
Insert cell
codes_depts = Object.values(Occitanie.map(d => d["Code"]))
Insert cell
populations2021 = Object.values(Occitanie.map(d => d["Population_municipale_2021"]))
Insert cell
pops21 = codes_depts.map((d, i) => ({"code":[d], "pop21": populations2021[i]}))
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