Public
Edited
May 8
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
height = 525
Insert cell
width = 850
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("1")
Insert cell
//proportional symbols
//radius = d3.scaleSqrt([0, d3.max(attribute)], [0, 30])
Insert cell
radius = d3.scaleThreshold()
.domain(naturalbreaks)
.range(radiusArray)
Insert cell
sizeArrayForLegend = Array.from(radiusArray, d=>Math.PI*Math.pow(d, 2))
Insert cell
radiusArray = [8, 10, 14, 19, 26, 30]
Insert cell
circleLabels = Array.from(naturalbreaks.slice(1), d => format(Math.pow(d, 2)))
Insert cell
colors = d3.scaleThreshold()
.domain(naturalbreaks)
.range(Greens)
Insert cell
Greens = ['#edf8fb','#ccece6','#99d8c9','#66c2a4','#2ca25f','#006d2c']
Insert cell
naturalbreaks = simple.ckmeans(attribute, 6).map(v => v.pop())
Insert cell
d3.max(attribute)
Insert cell
attribute = Array.from(points.features, d=>Math.sqrt(d.properties[Percent_Fire_Deparments_RespondingtoWildfires]))
Insert cell
filteredPoints = {
return {
...points,
features: points.features.filter(d => d.properties.states_sim !== "District of Columbia")
};
}
Insert cell
csv_data = d3.csvParse(await FileAttachment("StateF2Pexport-1@1.csv").text(),({Firedepart, Firedepa_2}) => [Firedepart, Firedepa_2])
Insert cell
Percent_Fire_Deparments_RespondingtoWildfires = "Firedepa_2"
Insert cell
idName = "Firedepart"
Insert cell
//import the point data (geojson)
points = FileAttachment("StateF2Pexport.json").json()
Insert cell
//import the polygon base map data
basepolygons = FileAttachment("states_simple.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