Published
Edited
Apr 22, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
height = 610
Insert cell
width = 975
Insert cell
path_points = d3.geoPath().projection(projection)
Insert cell
path_basemap = d3.geoPath().projection(projection)
Insert cell
projection = d3.geoAlbers()
Insert cell
format = d3.format(".2s")
Insert cell
radius = d3.scaleThreshold()
.domain(naturalbreaks)
.range(["7", "13", "18", "28"])
Insert cell
sizeArrayForLegend = Array.from(radiusArray, d=>Math.PI*Math.pow(d, 2))
Insert cell
radiusArray = [3, 9, 23, 40]
Insert cell
circleLabels = Array.from(naturalbreaks, d=> format(Math.pow(d, 2)))
Insert cell
colors = d3.scaleThreshold()
.domain(naturalbreaks)
.range(PuBu)
Insert cell
naturalbreakssquared = Array.from(naturalbreaks, d=> format(Math.pow(d, 2)))
Insert cell
PuBu = ["#f1eef6", "#bdc9e1", "#74a9cf", "#0570b0"]
Insert cell
naturalbreaks = simple.ckmeans(attribute, 4).map(v => v.pop())
Insert cell
d3.max(attribute)
Insert cell
attribute = Array.from(points.features, d=>Math.sqrt(d.properties[attributeName]))
Insert cell
idName = "STATE_NAME"
Insert cell
attributeName = "BLACK"
Insert cell
//import the point data (geojson)
points = FileAttachment("state48.points.geojson").json()
Insert cell
//import the polygon base map data
basepolygons = FileAttachment("UnitedStates.json").json()
Insert cell
Insert cell
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