Published
Edited
Feb 23, 2022
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
names = new Map(
Array.from(
employmentData,
({ state, county_id, alt_code, county_name, full_name, ff_employment }) => [
+alt_code,
full_name
]
)
)
Insert cell
ff_employment = new Map(
Array.from(
employmentData,
({ state, county_id, alt_code, county_name, full_name, ff_employment }) => [
+alt_code,
[+ff_employment]
]
)
)
Insert cell
employmentData = FileAttachment("ff_employment_by_county.csv").csv()
Insert cell
Insert cell
path = d3.geoPath() // function to draw the shapes
Insert cell
counties = topojson.feature(topology, topology.objects.counties).features // county details
Insert cell
states = topojson.mesh(topology, topology.objects.states, (a, b) => a !== b) // state details
Insert cell
topology = (
await d3.json(
"https://gist.githubusercontent.com/mbostock/df1b792d76fcb748056ff94b912e4bb8/raw/b1da4894cfb1e56a24129c27b39aa957d7f0c165/topology.json"
)
).topology // Thanks, Mike!
Insert cell
topojson = require("topojson-client@3")
Insert cell
d3 = require("d3@5") // Thanks, Mike!
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