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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more