Published
Edited
Sep 27, 2019
1 fork
Importers
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
mapAsGeoObject = {

let geo = {}
geo.type = "Feature"
geo.geometry = {}
geo.geometry.type = "Polygon"
geo.geometry.coordinates =
[
[
projection.invert([0,0]),
projection.invert([0, height]),
projection.invert([width,height]),
projection.invert([width,0])
].reverse() // winding order
]
return geo
}
Insert cell
earthRadius = 6371
Insert cell
area = d3.geoArea(mapAsGeoObject) * Math.pow(earthRadius,2)
Insert cell
pixelsArea = width * height
Insert cell
pixelsPerSqKM = pixelsArea / area
Insert cell
thresholds = densityContours.map(z => z.value)
Insert cell
perKM = thresholds.map(z => z * pixelsPerSqKM)
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
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