Public
Edited
May 13, 2024
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
debutTravail = age - experience
Insert cell
fruitsPreferees = ["banane", 3, {nom:"pamplemousse", categorie: "agrume"}]
Insert cell
fruitsPreferees.sort()
Insert cell
fruitsPreferees[2].nom
Insert cell
cars
Insert cell
cars[48].year
Insert cell
cadillac = cars.filter(d => d.name.includes("Cadillac"))
Insert cell
resultatAnnees = {
var annees = []
cars.forEach(d => annees.push(d.year))

return annees.sort()
}
Insert cell
anneesUniques = {
var annees = new Set()
cars.forEach(d => annees.add(d.year))

return Array.from(annees).sort()
}
Insert cell
oeuvresTriees = oeuvres.sort((a, b) => {
return a.produced_at - b.produced_at;
}).filter(d => d.produced_at != null && d.produced_at != "0000").map(d => d.produced_at)
Insert cell
Insert cell
categories = new Set (oeuvres.map(d => d.firstCat))
Insert cell
oeuvres
Insert cell
categoriesObjet = {
var resultat = []

//pour chaque oeuvre d'art dans oeuvres
oeuvres.forEach(oeuvre => {

//si l'œuvre a des valeurs dans categories
if (oeuvre.categories != null){
//aller dans categories en français
oeuvre.categories.fr.forEach(cat => {
//pour chaque categorie, ajouter la categérie au résultat
resultat.push(cat)
})
}
})
return resultat
}
Insert cell
import {data as oeuvres} from "@maison-mona/artworks-api"
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