Plot.plot({
projection: { type: "mercator", domain: caCounties },
width: 1000,
height: 1000,
color: {
type: "categorical",
domain: ["Low", "Significant", "High"],
range: ["hsl(141deg,29%,90%)",
"hsl(45deg,49%,66%)",
"hsl(3deg,59%,40%)"],
legend: true
},
symbol: { domain: primaryPurposes, legend: true },
r: {
domain: d3.extent(caDams.map((d) => d.StorageAcreFeet)),
range: [3, 15]
},
marks: [
Plot.geo(caCounties, { stroke: "grey", strokeWidth: 0.9 }),
Plot.geo(caHydro, { stroke: "blue", strokeWidth: showRivers ? 0.3 : 0 }),
Plot.dot(
caDams.filter(
(d) =>
mapHazzardClass.includes(d.HazardPotentialClassification) &&
selectedPurposes.includes(d.PrimaryPurpose) &&
d.YearCompleted <= pickYear &&
d.StorageAcreFeet >= minStorage
),
{
x: "Longitude",
type: "log",
y: "Latitude",
tip: true,
fill: "HazardPotentialClassification",
symbol: "PrimaryPurpose",
opacity: 0.5,
r: "StorageAcreFeet",
channels: { Dam_Name: "DamName", Year_Completed: "YearCompleted" }
}
)
]
})