Public
Edited
May 19
2 forks
Insert cell
Insert cell
Insert cell
population = FileAttachment("almost_done.json").json()
.then((data) =>
data
.slice(1)
.map(([p, state, county, category, personName, source]) => ({
state,
fips: `${state}${county}`,
population: +p,
category,
personName,
source
}))
)
Insert cell
centroid = {
const path = d3.geoPath();
return feature => path.centroid(feature);
}
Insert cell
us = FileAttachment("counties-albers-10m.json").json()
Insert cell
nation = topojson.feature(us, us.objects.nation)
Insert cell
statemap = new Map(topojson.feature(us, us.objects.states).features.map(d => [d.id, d]))
Insert cell
Insert cell
statemesh = topojson.mesh(us, us.objects.states, (a, b) => a !== b)
Insert cell
spike = (length, width = 7) => `M${-width / 2},0L0,${-length}L${width / 2},0`
Insert cell
povertyData = FileAttachment("cleaned_poverty_data.csv").csv({typed: true})
Insert cell
unemployment = FileAttachment("unemployment201907.csv").csv({typed: true})
Insert cell
namemap = new Map(us.objects.states.geometries.map(d => [d.properties.name, d.id]))
Insert cell
valuemap = new Map(unemployment.map(d => [d.name, d.rate]))
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