Public
Edited
May 5, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
height = 800
Insert cell
width = 600
Insert cell
path_points = d3.geoPath().projection(projection)
Insert cell
path_basemap = d3.geoPath().projection(projection)
Insert cell
projection = d3.geoTransverseMercator().rotate([94,0]).fitExtent([[80, 80], [width, height]], census_features);
Insert cell
Insert cell
format = d3.format(".2s")
Insert cell
radius(5539.2)
Insert cell
d3.min([...data.values()])
Insert cell
d3.max([...data.values()])
Insert cell
//proportional symbols
radius = d3.scaleSqrt([0, d3.max([...data.values()])], [0, 25])
Insert cell
Insert cell
data.get("58621-AREA0000000001")
Insert cell
data = Object.assign(new Map(csv_data))
Insert cell
Insert cell
csv_data = d3.csvParse(await FileAttachment("swinefeedlot_over300lb_export.csv").text(),({item_id, animal_cou}) => [item_id, +animal_cou])
Insert cell
//import the point data (geojson)
points = FileAttachment("swinefeedlots_over300lb_export.json").json()
Insert cell
census_features = topojson.feature(basepolygons, basepolygons.objects.MinnesotaCensusCAFO_ExportFeature)
Insert cell
//import the polygon base map data
basepolygons = FileAttachment("MinnesotaCensusCAFO_ExportFeature.json").json()
Insert cell
simple = require("simple-statistics@7.0.7/dist/simple-statistics.min.js")
Insert cell
topojson = require("topojson-client@3")
Insert cell
d3 = require("d3@5")
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