Published
Edited
Apr 8, 2021
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
points = prepare(
data.map(v => Item(v.id, ...project(v), 1, v)),
items => d3.sum(items, i => i.n ?? 1) / divider
)
Insert cell
Insert cell
flat = prepare(
data.map(v => Item(v.id, ...project(v), 1, v)),
() => 1
)
Insert cell
Insert cell
data = (await (await fetch(
"https://media.githubusercontent.com/media/Caster/growing-glyphs/master/input/csv/risse.tsv"
)).text())
.split("\n")
.slice(1)
.map(l => {
const [id, title, year, lat, lng] = l.split(/\t+/);
return { id, title, year, lat: parseFloat(lat), lng: parseFloat(lng) };
})
.filter(p => !(isNaN(p.lat) || isNaN(p.lng)))

// d3
// .tsv(
// "https://media.githubusercontent.com/media/Caster/growing-glyphs/master/input/csv/risse.tsv",
// p => ({
// ...p,
// id: p['item_id'],
// lat: parseFloat(p.latitude),
// lng: parseFloat(p.longitude)
// })
// )
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