chart = {
const width = 960,
height = 900;
const svg = d3.create("svg")
.attr("viewBox", [50, 50, width-50, height-50]);
var projection = d3
.geoMercator()
.fitSize([width - 50, height - 50], boundingBox);
var path1 = d3.geoPath().projection(projection);
var path2 = d3.geoPath().projection(projection);
var path3 = d3.geoPath().projection(projection);
var path4 = d3.geoPath().projection(projection);
var g = svg.append("g").attr("id", "paths");
g.selectAll("path2")
.data(parisCountiesLayer.features)
.enter()
.append("path")
.attr('class','outlines')
.attr("d", path2)
.style("fill", "rgb(128,128,128)")
.style("fill-opacity", ".05")
.style('stroke-opacity','.25')
.style("stroke-width", '.5')
.style("stroke", "rgb(128,128,128)")
g.selectAll("path3")
.data(parisGreenSpacesLayer.features)
.enter()
.append("path")
.attr('class','outlines')
.attr("d", path3) //The d attribute defines a path to be drawn, only applies to appended elements
.style("fill", "rgb(153,184,147)")
.style("fill-opacity", ".5")
.style('stroke-opacity','1')
.style("stroke-width", '.4')
.style("stroke", "rgb(153,184,147)")
g.selectAll("path4") //d3 geopath
.data(parisBikePathLayer.features) //get data to define path
.enter() //there are more data than elements, this selects them
.append("path") //appends path to data
.attr('class','outlines')
.attr("d", path3) //The d attribute defines a path to be drawn, only applies to appended elements
.style("fill", "none")
.style("fill-opacity", ".5")
.style('stroke-opacity','1')
.style("stroke-width", '.5')
.style("stroke", "rgb(0,0,100)")
g.selectAll("path5") //d3 geopath
.data(parisRiversLayer.features) //get data to define path
.enter() //there are more data than elements, this selects them
.append("path") //appends path to data
.attr('class','outlines')
.attr("d", path3) //The d attribute defines a path to be drawn, only applies to appended elements
.style("fill", "rgb(149,200,216)")
.style("fill-opacity", "1")
.style('stroke-opacity','1')
.style("stroke-width", '1')
.style("stroke", "rgb(149,200,216)")
g.selectAll("path6") //d3 geopath
.data(parisBuiltAreasLayer.features) //get data to define path
.enter() //there are more data than elements, this selects them
.append("path") //appends path to data
.attr('class','outlines')
.attr("d", path3) //The d attribute defines a path to be drawn, only applies to appended elements
.style("fill", "rgb(128,128,128)")
.style("fill-opacity", ".1")
.style('stroke-opacity','1')
.style("stroke-width", '.25')
.style("stroke", "rgb(128,128,128)")
var c = svg.selectAll("circle") //d3 geopath
.data(Dream_Vacation)
.enter() //there are more data than elements, this selects them
.append("circle") //appends path to data
.attr('class','Vacationpts')
.attr("cx", function(d) {return projection([d.Long,d.Lat])[0]})
.attr("cy", function(d) {return projection([d.Long,d.Lat])[1]})
.attr('r',5)
.style('fill','black')
.style('fill-opacity','1')
.on('mouseover',Vacationinfo)//listens for a mousover, and calls function
.on('mouseout',Vacationinfoout)
svg
.append('line')
//.attr('class','steakLine')
.attr('x1','125')
.attr('y1','725')
.attr('x2','400')
.attr('y2','725')
.style('stroke','black')
.style('stroke-width','1')
.style('stroke-dasharray', '4,4,8,8')
function Vacationinfo(event,d){
d3.select(this).style('fill','red')
svg
.append('text')
.attr('class','VacationText')
.attr('x','150')
.attr('y','700')
.style("font-family", "Helvetica")
.style('font-size','.75em')
.style('fill','rgb(0,200,0)')
.style('text-anchor','start')
.text(d.Name)
svg
.append('text')
.attr('class','VacationText')
.attr('x','150')
.attr('y','700')
.style("font-family", "Helvetica")
.style('font-size','.75em')
.style('fill','rgb(0,200,0)')
.style('text-anchor','start')
.text(d. Rating)
svg
.append('text')
.attr('class','VacationText')
.attr('x','150')
.attr('y','700')
.style("font-family", "Helvetica")
.style('font-size','.75em')
.style('fill','rgb(0,200,0)')
.style('text-anchor','start')
.text(d.Description)
svg
.append('line')
.attr('class','VacationLine')
.attr('x1','125')
.attr('y1','725')
.attr('x2','400')
.attr('y2','725')
.style('stroke','black')
.style('stroke-width','1')
}
function Vacationinfoout(event,d){
d3.selectAll('circle.Vacationpts').style('fill','black')
d3.selectAll('text.VacationText').remove()
d3.selectAll('line.VacationLine').remove()
}
return svg.node();
}