chart = {
const width = 960,
height = 900;
const svg = d3.create("svg")
.attr("viewBox", [-150, 80, width-100, height-100]);
var projection = d3
.geoMercator()
.fitSize([width - 50, height - 50], bbox2);
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(subLns.features)
.enter()
.append("path")
.attr('class','outlines')
.attr("d", path2)
.style("fill", "none")
.style('stroke-opacity','1')
.style("stroke-width", '.75')
.style("stroke", "rgb(247,147,30)")
g.selectAll("path3")
.data(parks.features)
.enter()
.append("path")
.attr('class','outlines')
.attr("d", path3)
.style("fill", "rgb(238,232,222)")
.style("fill-opacity", "1")
.style('stroke-opacity','.4')
.style("stroke-width", '.5')
.style("stroke", "rgb(0,0,0)")
g.selectAll("path4")
.data(boundary.features)
.enter()
.append("path")
.attr('class','outlines')
.attr("d", path4)
.style("fill", "rgb(46,49,146)")
.style("fill-opacity", ".1")
.style('stroke-opacity','.4')
.style("stroke-width", '.5')
.style("stroke", "rgb(0,0,0)")
g.selectAll("path4")
.data(footprints.features)
.enter()
.append("path")
.attr('class','outlines')
.attr("d", path4)
.style("fill", "rgb(46,49,146)")
.style("fill-opacity", ".2")
.style('stroke-opacity','.4')
.style("stroke-width", '.15')
.style("stroke", "rgb(0,0,0)")
var c = svg.selectAll("circle")
.data(subSts.features)
.enter()
.append("circle")
.attr("cx", function(d) {return path1.centroid(d)[0]})
.attr("cy", function(d) {return path1.centroid(d)[1]})
.attr('r',3.5)
.attr('fill','rgb(247,147,30)')
.style('fill-opacity','.8')
var p = svg.selectAll("polyline")
p.enter().append("polyline")
.data(philosopher)
.enter()
.append("polyline")
.attr("points", function(d) {return d})
.style("stroke","rgb(46,49,146)")
.style("stroke-width",".7px")
.style("fill","none")
p.enter().append("polyline")
.data(className)
.enter()
.append("polyline")
.attr("points", function(d) {return d})
.style("stroke","rgb(46,49,146)")
.style("stroke-width",".2px")
.style("fill","none")
p.enter().append("polyline")
.data(ccup)
.enter()
.append("polyline")
.attr("points", function(d) {return d})
.style("stroke","rgb(46,49,146)")
.style("stroke-width","2.5px")
.style("fill","none")
p.enter().append("polyline")
.data(ccup)
.enter()
.append("polyline")
.attr("points", function(d) {return d.Icon})
.style("stroke","black")
.style("stroke-width","20px")
.style("fill","black")
.attr("transform",function(d){return 'translate('+ projection([d.lat,d.long])[0]+" "+ projection([d.lat,d.long])[1] + ")"})
.on("mouseover",museumroutes)
.on("mouseover",removemuseumroutes)
function museumroutes(i,d){
console.log(d.name)
if(d.name=="The Skyscraper Museum'")
p.enter().append("polyline")
.data(route1)
.enter()
.append("polyline")
.attr("points", function(d) {return d.Icon})
.style("stroke","black")
.style("stroke-width","20px")
.style("fill","black")
}
function removemuseumroutes(){
svg.selectAll("polyline.route1").remove()
}
var t = svg.selectAll("text")
.data(subSts.features)
.enter()
.append("text")
.attr("x", function(d) {return path1.centroid(d)[0]})
.attr("y", function(d) {return path1.centroid(d)[1]-5})
.style('fill','rgb(0,32,255)')
.style("font-family","didot")
.style("font-weight","100")
.style("font-size","4.5px")
.style("text-anchor","end")
.text(function(d) {return d.properties.name})
c.enter().append("circle")
.data(museumData)
.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.5)
.attr('fill','rgb(96,96,96)')
.style('fill-opacity','1')
.on("mouseover",museumHover)
.on("mouseout",museumRemove)
function museumHover(i,d){
console.log(d.name)
svg.append("text")
.attr("class","dText")
.attr("x","20")
.attr("y","300")
.style("font-family","didot")
.style("font-weight","800")
.style("font-size","15px")
.style("text-anchor","start")
.text(d.name)
svg.append("text")
.attr("class","dText")
.attr("x","20")
.attr("y","310")
.style("font-family","didot")
.style("font-weight","200")
.style("font-size","7px")
.style("text-anchor","start")
.text(d.description)
var wrap = svg.selectAll("text.dText")
.each(function(d, i) { wrap_text(d3.select(this), 350) });
svg.append("line")
.attr("class","dLine")
.attr("x1","50")
.attr("y1","340")
.attr("x2",projection([d.long, d.lat])[0])
.attr("y2",projection([d.long, d.lat])[1])
.style("stroke","red")
.style("stroke-width",".5px")
.style("stroke-dasharray","4 1 2")
p.enter().append("polyline")
.data(droneMap)
.enter()
.append("polyline")
.attr("points", function(d) {return d})
.attr("class","dMap")
.style("stroke","rgb(0,32,255)")
.style("stroke-width",".5px")
.style("fill","none")
.style("stroke-dasharray","4 1 2")
p.enter().append("polyline")
.data(droneMapCircle)
.enter()
.append("polyline")
.attr("points", function(d) {return d})
.attr("class","dMapcircle")
.style("stroke","rgb(0,32,255)")
.style("stroke-width",".5px")
.style('fill-opacity','.15')
.style("stroke-dasharray","4 1 2")
.style("fill","rgb(247,147,30)")
p.enter().append("polyline")
.data(drone)
.enter()
.append("polyline")
.attr("points", function(d) {return d})
.attr("class","dronesh")
.style("stroke","rgb(0,32,255)")
.style("stroke-width",".3px")
.style("fill","none")
.style('fill-opacity','0')
p.enter().append("polyline")
.data(museumicon)
.enter()
.append("polyline")
.attr("class","MIcon")
.attr("points", function(d) {return d})
.style("stroke","black")
.style("stroke-width",".55px")
.style("fill","none")
}
function museumRemove(){
svg.selectAll("text.dText").remove()
svg.selectAll("line.dLine").remove()
svg.selectAll("polyline.dMap").remove()
svg.selectAll("polyline.dMapcircle").remove()
svg.selectAll("polyline.MIcon").remove()
svg.selectAll("polyline.dronesh").remove()
}
return svg.node();
}