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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more