Public
Edited
May 8
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()
// Set up the projection centered on Iowa
.center([0, 42.0]) // latitude center
.rotate([93.5, 0]) // longitude center (Iowa is ~93.5°W)
.parallels([29.5, 45.5]) // standard parallels for conic projections
.scale(8000) // zoom level; adjust depending on canvas size
.translate([width / 2, height / 2]) // center it in your SVG
Insert cell
format = d3.format(".2s")
Insert cell
//proportional symbols
//radius = d3.scaleSqrt([0, d3.max(attribute)], [0, 30])
Insert cell
radius = d3.scaleThreshold()
.domain(attribute)
.range(radiusArray)
Insert cell
sizeArrayForLegend = Array.from(radiusArray, d=>Math.PI*Math.pow(d, 2))
Insert cell
radiusArray = [3, 6, 12, 20]
Insert cell
circleLabels = Array.from(cluster, d=> format(Math.pow(d, 2)))
Insert cell
quantiles = d3.scaleQuantile()
.domain(attribute)
.range(pinks)
Insert cell
pinks = ["#feebe2", "#fbb4b9", "#f768a1", "#ae017e"]
Insert cell
cluster = 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
attributeName = "T_Respiratory_Disease_Death_Data___Resp_Crude"
Insert cell
idName = "FIPS"
Insert cell
//import the point data (geojson)
points = FileAttachment("CAFOResp.geojson").json()
Insert cell
//import the polygon base map data
basepolygons = FileAttachment("iowa_counties_topo.json").json()
Insert cell
Insert cell
Insert cell
Insert cell
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