Published
Edited
Jul 12, 2022
32 stars
Insert cell
Insert cell
Insert cell
Insert cell
ca=FileAttachment("NY@4.csv").csv({typed: true})
Insert cell
Insert cell
counties = {
const names = []
const lats = d3.rollup(ca, d => d3.sum(d, d => d.y * d.pop) / d3.sum(d, d => d.pop), d => d.COUNTYFP)
for (let fip of fips) {
const code = +fip.fips.slice(2, 5)
const {name} = fip
names.push({
name,
code,
COUNTYFP: code,
y: lats.get(code)
})
}
// return lats
return names
}
Insert cell
Insert cell
d3 = require("d3-fetch", "d3-array")
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