chart = {
const width = 2600,
height = 1600;
const svg = d3.create("svg")
.attr("viewBox", [100, 415, width-1400, height-645]);
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 path4 = d3.geoPath().projection(projection);
var g = svg.append("g").attr("id", "paths");
g.selectAll("path3")
.data(wards.features)
.enter()
.append("path")
.attr('class','outlines')
.attr("d", path3)
.style("fill", "rgb(240,240,240)")
.style("fill-opacity", ".5")
.style('stroke-opacity','0')
.style("stroke-width", '.5')
.style("stroke", "rgb(0,0,0)")
var p = svg.selectAll("polyline")
.data(test1)
.enter()
.append("polyline")
.attr("points", function(d) {return d})
.attr('fill','white')
.style('fill-opacity','.5')
.style("stroke-width", '.15')
.style("stroke", "none")
var p = svg.selectAll("polyline") //d3 geopath
.data(route1)
.enter() //there are more data than elements, this selects them
.append("polyline") //appends path to data
.attr("points", function(d) {return d})
.attr('fill','white')
.style('fill-opacity','0')
.style("stroke-width", '.25')
.style("stroke", "black")
.style('stroke-dasharray', '1')
g.selectAll("path2") //d3 geopath
.data(streets1.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", path2) //The d attribute defines a path to be drawn, only applies to appended elements
.style("fill", "none")
.style('stroke-opacity','.15')
.style("stroke-width", '.25')
.style("stroke", "red")
g.selectAll("path2") //d3 geopath
.data(rivers.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", path2) //The d attribute defines a path to be drawn, only applies to appended elements
.style("fill", "none")
.style('stroke-opacity','.15')
.style("stroke-width", '5')
.style("stroke", "blue")
g.selectAll("path2") //d3 geopath
.data(buildings3.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", path2) //The d attribute defines a path to be drawn, only applies to appended elements
.style("fill", "none")
.style('stroke-opacity','.25')
.style("stroke-width", '.5')
.style("stroke", "gray")
var c = svg.selectAll("circle")
.data(spotsfr.features)
.enter()
.append("circle")
.attr("cx", function(d) {return path1.centroid(d)[0]})
.attr("cy", function(d) {return path1.centroid(d)[1]})
.attr('r',5)
.style('fill','cyan')
.style('fill-opacity','1')
.on('mouseover',fireText)
.on('mouseout',removefireText)
function fireText(event,d){
console.log(d)
svg
.append("text")
.attr('x','225')
.attr('y','750')
.attr('class','spotsfr_position')
.style('font-family','helvetica')
.style('font-size','20px')
.style('font-weight','light')
.text(d.properties.description)
var wrap = svg.selectAll("text.spotsfr_position")
.each(function(d, i) { wrap_text(d3.select(this), 100) });
svg
.append("line")
.attr('x1','350')
.attr('y1','790')
.attr('x2', path1.centroid(d)[0])
.attr('y2', path1.centroid(d)[1])
.attr('class','fireLine')
.style("stroke-width", '3')
.style("stroke", "rgb(0,0,0)")
.style('stroke-dasharray', '6 4')
}
function removefireText(){
d3.selectAll('text.spotsfr_position').remove()
d3.selectAll('line.fireLine').remove()
}
svg
.append("text")
.attr('x','220')
.attr('y','660')
.style('font-family','helvetica')
.style('font-size','50px')
.style('font-weight','bold')
.text('New Orleans')
svg
.append("text")
.attr('x','220')
.attr('y','720')
.style('font-family','helvetica')
.style('font-size','20px')
.style('font-weight','bold')
.text('Building Description:')
svg
.append("line")
.attr('x1','220')
.attr('y1','680')
.attr('x2','620')
.attr('y2','680')
.style("stroke-width", '10')
.style("stroke", "rgb(0,0,0)")
return svg.node();
}