Published
Edited
Mar 1, 2022
8 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
hbpRed = d3.rgb(235, 31, 53)
Insert cell
hbpGreen = d3.rgb(15, 126, 72)
Insert cell
style = html`<style>
.hbp {
color: ${hbpGreen};
font-weight: bold;
}
</style>`
Insert cell
states = ({
type: "GeometryCollection",
geometries: us.objects.states.geometries.filter(
d => d.id !== "02" && d.id !== "15"
)
})
Insert cell
projection([33, -84])
Insert cell
projection = d3
.geoAlbers()
.scale(1280)
.translate([480, 300])
Insert cell
height = width / 1.618
Insert cell
hbpLocations = hbpLocationsRaw.map(d => ({
...d,
label: html`<span>${d.label}`.textContent
}))
Insert cell
hbpLocationsRaw = FileAttachment("hbp_locations@8.csv").csv()
Insert cell
us = d3.json("https://cdn.jsdelivr.net/npm/us-atlas@1/us/10m.json")
Insert cell
isMobile = require('ismobilejs')
Insert cell
topojson = require("topojson-client@3")
Insert cell
d3 = require('d3')
Insert cell
Insert cell
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