Public
Edited
May 28, 2024
2 forks
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
myGraph = Plot.plot({
title: `Chronology of public art: ${categoryFilter}`,
height: chartHeight,
width: chartWidth,
marginBottom: 50,
marks: [
Plot.dot(chartData, Plot.dodgeY({
x: "date",
fill: "gender",
sort: "gender",
title: "title",
tip: true,
href: "url",
target: "_blank"
}))
],
color: {
type: "categorical",
domain: genderIdentities,
range:[burgundy, black, grey, yellow, blue, yellow],
legend: true
},
x: {
tickRotate: -45,
grid: true,
}
})
Insert cell
genderIdentities = _.uniq(data.map(d => d.gender))
Insert cell
chartData = {
var genderFilter = data.filter( d => genderSelection.includes(d.gender))
var timeFilter = genderFilter.filter(d => d.year > timeInterval[0] && d.year < timeInterval[1])

if (categoryFilter != null)
return timeFilter.filter(d => d.categories && d.categories.includes(categoryFilter))//then filter
else //if there is no categery filter
return timeFilter
}
Insert cell
timeInterval[1]
Insert cell
data
Insert cell
Object.keys(data[0])
Insert cell
categories = {
var categories = []
data.forEach(artwork => {
if (artwork.categories)
artwork.categories.map(c => categories.push(c))
})


return _.uniq(categories)
}
Insert cell
timeParser = d3.timeParse("%Y")
Insert cell
data.forEach(d => {
d.date = timeParser(d.year)
})
Insert cell
earliest = d3.min(data.map(d => d.year))
Insert cell
latest = d3.max(data.map(d => d.year))
Insert cell
import {data} from "@lenamk/pre-workshop-data-preparation"
Insert cell
import {interval} from "@mootari/range-slider@1781"
Insert cell
import {jaune as yellow} from "@artistes-femmes-mac/charte-de-couleurs"
Insert cell
import {noir as black} from "@artistes-femmes-mac/charte-de-couleurs"
Insert cell
import {bordeau as burgundy} from "@artistes-femmes-mac/charte-de-couleurs"
Insert cell
import {gris as grey} from "@artistes-femmes-mac/charte-de-couleurs"
Insert cell
import {turquoise as blue} from "@maison-mona/preparation-reconciliation"
Insert cell
data
X
Y
territory
Color
gender
Size
Facet X
Facet Y
Mark
bar
Type Chart, then Shift-Enter. Ctrl-space for more options.

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