chart = {
const width = 960,
height = 900;
const svg = d3.create("svg")
.attr("viewBox", [50, 50, width-100, height-100]);
var projection = d3
.geoMercator()
.fitSize([width - 50, height - 50], bbox);
var path1 = d3.geoPath().projection(projection);
var path2 = d3.geoPath().projection(projection);
var path3 = d3.geoPath().projection(projection);
var g = svg.append("g").attr("id", "paths");
g.selectAll("path3")
.data(bourough.features)
.enter()
.append("path")
.attr('class','outlines')
.attr("d", path3)
.style("fill", "rgb(240,240,240)")
.style("fill-opacity", ".5")
.style('stroke-opacity','.4')
.style("stroke-width", '.5')
.style("stroke", "rgb(0,0,0)")
g.selectAll("path3")
.data(park.features)
.enter()
.append("path")
.attr('class','outlines')
.attr("d", path3)
.style("fill", "green")
.style("fill-opacity", ".2")
.style('stroke-opacity','.4')
.style("stroke-width", '.5')
.style("stroke", "rgb(0,0,0)")
g.selectAll("path3")
.data(pond.features)
.enter()
.append("path")
.attr('class','outlines')
.attr("d", path3)
.style("fill", "blue")
.style("fill-opacity", ".2")
.style('stroke-opacity','.4')
.style("stroke-width", '.5')
.style("stroke", "rgb(0,0,0)")
var c = svg.selectAll("circle")
.data(spots)
.enter()
.append("circle")
.attr("cx", function(d) {return projection([d.long,d.lat])[0]})
.attr("cy", function(d) {return projection([d.long,d.lat])[1]})
.attr('r',3)
.attr('fill',artistColor)
.style('fill-opacity','1')
.on('mouseover', spotText)
.on('mouseout', removespotText)
if(curArtist!=undefined){
c.enter().append("circle")
.data(curArtist)
.enter()
.append("circle")
.attr("cx", function(d) {return projection([d.long,d.lat])[0]})
.attr("cy", function(d) {return projection([d.long,d.lat])[1]})
.attr('r',6)
.attr('fill',"cyan")
.style('fill-opacity','1')
.on('mouseover', spotText)
.on('mouseout', removespotText)
}
// var p = svg.selectAll('polyline')
// g.selectAll("path3") //d3 geopath
// .data(school) //get data to define path
// .enter() //there are more data than elements, this selects them
// .append('polyline') //appends path to data
// .attr('class','outlines')
// .attr('points', function(d) {return d})
// .style("fill", "deeppink")
// .style("fill-opacity", '1')
// .attr('stroke','snow')
// .attr("stroke-width", '2')
// .attr('stroke-opacity', '1')
function artistColor(){
var color = 'black'
//if statements that change the value of color depending on the artist
return color
}
function spotText(event,d){
d3.select(this).attr('fill','yellow')
svg.append('text')
.attr('class', 'spots')
.attr('x', '150')
.attr('y', '150')
.attr('font-family','Helvetica')
.attr('font-size', '1em')
.attr('text-anchor', 'start')
.attr('font-weight','bold')
.text(d.description)
svg.append('text')
.attr('class', 'spots')
.attr('x', '150')
.attr('y', '165')
.attr('font-family','Helvetica')
.attr('font-size', '.7em')
.attr('text-anchor', 'start')
.attr('font-weight','normal')
.text(d.who)
svg.append('line')
.attr('class','spotLine')
.attr('x1','150')
.attr('y1','150')
.attr('x2','350')
.attr('y2','150')
.style('stroke-width', '1')
.style('stroke', 'black')
/*
svg.append('image')
.attr('href',streetLines)
.attr('class','spots')
.attr('x', '0')
.attr('y','0')
.attr('width', 960)
.attr('height', 900)
*/
}
function removespotText(event,d){
d3.select(this).attr('fill','black')
d3.selectAll('text.spots').remove()
d3.selectAll('line.spotLine').remove()
}
return svg.node();
}