Published
Edited
Oct 4, 2022
1 fork
18 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
states = topojson
.feature(us, us.objects.states)
.features.map((feature) => {
const properties = feature.properties;
const bounds = d3.geoPath().bounds(feature);

return {
fips: feature.id,
name: properties.name
.replace("Commonwealth of the ", "") // shorten Northern Mariana Islands
.replace("United States ", ""), // shorten Virgin Islands
bounds
};
})
.sort((a, b) => d3.ascending(a.name, b.name))
Insert cell
us = d3.json(geography_url)
Insert cell
geography_url = "https://unpkg.com/us-atlas@3.0.0/states-10m.json"
Insert cell
topojson = require('topojson-client@3')
Insert cell
html`<style>.bounds-table tbody tr:hover { background-color: #efefef; }<style>`
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