Public
Edited
Jun 9, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
sansDate = oeuvres.filter(d => d.produced_at == null)
Insert cell
Insert cell
oeuvresPre2000 = oeuvres.filter(d => d.produced_at < "2000").filter(d => d.genreSimplifie == "masculin" || d.genreSimplifie == "féminin")
Insert cell
Insert cell
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
## Dates
Insert cell
annees = {
var resultat = []
oeuvres.map(d => {
resultat.push(d.produced_at)
})
return _.uniqBy(resultat.sort())
}
Insert cell
Plot.plot({
height: 500,
width: 1200,
x:{
domain: annees,
tickRotate: -60,
},
y:{
grid: true,
},
marks: [
Plot.dot(indexOfYears, {x: "name", y: "ratioFem", tip: true}),
Plot.lineY(indexOfYears, {x: "name", y: "ratioFem", stroke:"lightgrey"})]
})
Insert cell
indexOfYears = {
var resultat = []

annees.forEach(o =>{
var current = oeuvres.filter(d => d.produced_at == o)
var parFemmes = oeuvres.filter(d => d.genreSimplifie =="féminin" && d.produced_at == o)
var parNonBinaire = oeuvres.filter(d => d.genreSimplifie =="non binaire" && d.produced_at == o)
var parHommes = oeuvres.filter(d => d.genreSimplifie =="masculin" && d.produced_at == o)
var parMixte = oeuvres.filter(d => d.genreSimplifie =="mixte" && d.produced_at == o)
//le reste sont inconnus, collectifs ou mixtes
resultat.push({
name: o,
count: current.length,
countFemmes: parFemmes.length,
countNonBinaires: parNonBinaire.length,
countHommes: parHommes.length,
countMixtes: parMixte.length,
ratioFem: parFemmes.length*100/current.length,
list: current
})
})

return resultat.filter(d => d.name != null).sort((a, b) => {
return a.name - b.name;
}).reverse()
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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