async function plotParks(visual) {
visual.selectAll('.parks')
.data(parkData, d=>d.park)
.join('image')
.attr('r', 2)
.attr('class', 'parks')
.style('fill', 'gray')
.attr('width', 18)
.attr('height', 18)
.attr('xlink:href', await FileAttachment('unselectedtree.png').url())
.attr('x',
d => {
var projectedX = projectX(d.longitude);
return projectedX;
})
.attr('y',
d => {
var projectedY = projectY(d.latitude);
return projectedY;
})
.on('mouseover', async function (event, d) {
var projectedLocation = [projectX(d.longitude), projectY(d.latitude)];
d3.select(this).attr('xlink:href', await FileAttachment('selectedtree.png').url())
visual.append('text')
.attr('class', 'parkLabel')
.attr('x', projectedLocation[0] - 10)
.attr('y', projectedLocation[1] - 10)
.text(d.park)
})
.on('mouseout', async function(event, d) {
visual.selectAll('.parkLabel').remove()
d3.select(this).attr('xlink:href', await FileAttachment('unselectedtree.png').url())
})
}