Public
Edited
May 7
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().fitExtent([[0, 0], [width, height]], basefeatures)
Insert cell
format = d3.format(".3f");
Insert cell
radius(12122.3998)
Insert cell
d3.max([...data.values()])//maximum value inside data
Insert cell
radius(456)
Insert cell
radius = d3.scaleLinear([d3.min([...data.values()].filter(d => d > 0)) || 0, d3.max([...data.values()])], [2, 20]);
Insert cell
colors = [
[0,0],
["#A04000", "#DC7633"],
["#A93226", "#E6B0AA"],
["#6C3483","#AF7AC5"],
["#239B56","#82E0AA"]
]
Insert cell
data = new Map(csv_data.map(d => [
d[0], // FacilityName (first column in the array)
+d[selectedColumn] // Dynamically select the value column
]));
Insert cell
csv_data = d3.csvParse(await FileAttachment("LatLong@1.csv").text(),({
FacilityName, Cattle, Swine, Chicken, TotalAnimals
}) => [FacilityName, +Cattle, +Swine, +Chicken, +TotalAnimals]);
Insert cell
basefeatures=topojson.feature( basepolygons,basepolygons.objects.IowaCounties)
Insert cell
points = FileAttachment("AFOPointsGEO.json").json()//import the point data (geojson)d
Insert cell
basepolygons = FileAttachment("IowaCountiesSimp.json").json() //import the polygon base map data (topojson)
Insert cell
simple = require("simple-statistics@7.0.7/dist/simple-statistics.min.js") //computes statistics
Insert cell
topojson = require("topojson-client@3") //imports topojson library
Insert cell
d3 = require("d3@5") //imports d3 visualization library
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