Public
Edited
Oct 13, 2023
Insert cell
Insert cell
Insert cell
data={
const data=[]
Object.keys(json).map(d=>{
if (json[d]['colophon']!== undefined){
var arr = json[d]['colophon']['persons']['real']
Object.keys(arr).map(i=>{
const obj = {}
var number = d.match(/\d/g).join("")
obj.person = i
obj.issue = number
data.push(obj)
})
}
})
return data
}
Insert cell
Plot.plot({
grid:true,
title: "Printers over time in Leigh Hunt's The Indicator (per issue)",
marginLeft:110,
marginBottom: 60,
width: 1180,
color:{legend:true},
x:{label: 'Issues'},
y:{label: 'Printers'},
marks: [
Plot.cell(data, {
x: d=>d.issue,
y: d=>d.person,
fill: d=>d.person,
tip: true
})
]
})
Insert cell
require('d3-array')
Insert cell
require('d3-collection')
Insert cell
require('d3')
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