Plot.plot({
width: 900,
height: 600,
projection: { type: "albers", domain: nycBoroughs },
color: {
legend: true,
range: ["blue","orange"],
interpolate: "hcl"
},
marks: [
Plot.geo(nycBoroughs, { stroke: "black", strokeOpacity: 0.3 }),
Plot.geo(nycShoreline, { stroke: "blue", strokeOpacity: 0.1 }),
Plot.dot(selectedData.includes("1995") ? treeData1995 : [] , {
x: "longitude",
y: "latitude",
r: "diameter",
fill: "diameter"
}),
Plot.dot(selectedData.includes("2005") ? treeData2005 : [], {
x: "longitude",
y: "latitude",
r: "tree_dbh",
fill: (d) => parseFloat(d.tree_dbh)
}),
Plot.dot(selectedData.includes("2015") ? treeData2015 : [], {
x: "longitude",
y: "latitude",
r: "tree_dbh",
fill: "spc_common"
})
]
})