Plot.plot({
width: 900,
height: 600,
projection: { type: "albers", domain: nycBoroughs },
color: {
legend: true,
label: "Tree Radius",
type: "log",
range: ["red", "green"],
interpolate: "hcl"
},
marks: [
Plot.geo(nycBoroughs, { stroke: "black", strokeOpacity: 0.3 }),
Plot.geo(nycShoreline, { stroke: "blue", strokeOpacity: 0.1 }),
Plot.dot(treeData, {
x: "longitude",
y: "latitude",
r: "tree_dbh",
fill: (d) => parseFloat(d.tree_dbh)
}),
Plot.dot(treeData, {
x: "longitude",
y: "latitude",
r: "tree_dbh",
fill: (d) => parseFloat(d.tree_dbh),
stroke: "black",
filter: (d) => d.tree_dbh > 35
}),
Plot.text(treeData, {
x: "longitude",
y: "latitude",
text: "spc_common",
filter: (d) => d.tree_dbh > 35,
fontSize: 14,
fontWeight: 600,
stroke: "white",
fill: "black",
textAnchor: "start",
dx: 15
})
]
})