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}`
})
)
]
})