Public
Edited
Nov 13, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
us_power_plants=FileAttachment("us_power_plants.csv").csv()
Insert cell
Insert cell
Insert cell
caAccidents = FileAttachment("california_aircraft_accidents.csv").csv()
Insert cell
caCounties = FileAttachment("california-counties.geojson").json()
Insert cell
Plot.plot({
projection: "albers-usa",
marks: [
Plot.geo(states,{stroke: "#ccc" }),
Plot.dot(aggregatedData,
Plot.hexbin(
{ r:"count",fill: "count"},
{ x: "Longitude", y: "Latitude", tip:true}
))
],
height: 500,
width: 800,
color: {
legend: true,
label: "Number of Aircraft Accidents:",
scheme: "cool"
}
})
Insert cell
Plot.plot({
projection: "albers-usa",
marks: [
Plot.geo(states),
Plot.dot(aggregatedData, {
x: "Longitude",
y: "Latitude",
r:"numAccidents",
tip:true
})
],
height: 500,
width: 800,
margin: 50
})
Insert cell
aggregatedData = _.chain(accidents)
.groupBy((point) => `${point.Latitude},${point.Longitude}`)
.map((group) => ({
Latitude: group[0].Latitude,
Longitude: group[0].Longitude,
numAccidents: group.length,
City: group[0].City,
State: group[0].State,
}))
.value();
Insert cell
accidents = FileAttachment("Aircraft Crashes in the United States 2023@2.csv").csv()
Insert cell
accidents
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
import {us} from "@observablehq/us-geographic-data"
Insert cell
nation = topojson.feature(us, us.objects.nation)
Insert cell
counties = topojson.feature(us, us.objects.counties)
Insert cell
states = topojson.feature(us, us.objects.states)
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