Public
Edited
Dec 4, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
caDams
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof pickHazard = Inputs.checkbox(["Low", "Significant", "High"], {value:["Low", "Significant", "High"]})
Insert cell
Plot.plot({
marginTop: 50,
color: {
domain: ["Low", "Significant", "High"],
range: ["gray", "#ec5300", "#b62020"],
legend: true
},
x: { type: "log" },
y: { type: "log" },
marks: [
Plot.dot(
caDams.filter((d) =>
pickHazard.includes(d.HazardPotentialClassification)
),
{
x: "StorageAcreFeet",
y: "SurfaceAreaAcres",
r: "DrainageAreaSqMiles",
fill: "HazardPotentialClassification",
opacity: 0.6
}
),
Plot.tip(
caDams.filter((d) =>
pickHazard.includes(d.HazardPotentialClassification)
),
Plot.pointer({
x: "StorageAcreFeet",
y: "SurfaceAreaAcres",
title: (d) =>
`Name: ${d.DamName}\nPurpose: ${d.PrimaryPurpose}\nHazard: ${d.HazardPotentialClassification}`
})
)
]
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
dams = FileAttachment("californiaDams.csv").csv({typed: true})
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