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 path4 = d3.geoPath().projection(projection);
var path5 = d3.geoPath().projection(projection);
var g = svg.append("g").attr("id", "paths");
g.selectAll("path1")
.data(bbox.features)
.enter()
.append("path")
.attr('class','outlines')
.attr("d", path1)
.style("stroke", "none")
.style('fill-opacity','.25')
.style("fill", "rgb(237, 125, 58)")
g.selectAll("path2")
.data(boundary.features)
.enter()
.append("path")
.attr('class','outlines')
.attr("d", path1) //The d attribute defines a path to be drawn, only applies to appended elements
.style("stroke", "none")
.style('fill-opacity','1')
.style("fill", "rgb(240,240,240)")
/////////// LINES = building outlines
g.selectAll("path3") //d3 geopath
.data(bldgs.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(255,255,255)")
.style("fill-opacity", ".25")
.style('stroke-opacity','1')
.style("stroke-width", '1')
.style("stroke", "rgb(255,255,255)")
/////////// LINES = street centerlines
g.selectAll("path4") //d3 geopath
.data(stLns.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','1')
.style("stroke-width", '1.25')
.style("stroke", "rgb(220,220,220)")
/////////// LINES = subway lines
g.selectAll("path5") //d3 geopath
.data(subLns.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','1')
.style("stroke-width", '2')
.style("stroke", "rgb(200,200,200)")
/*
var c = svg.selectAll("circle") //d3 geopath
.data(subSts.features)
.enter() //there are more data than elements, this selects them
.append("circle") //appends path to data
.attr("cx", function(d) {return path1.centroid(d)[0]})
.attr("cy", function(d) {return path1.centroid(d)[1]})
.attr('r',3)
.attr('fill','black')
.style('fill-opacity','1')
*/
var c = svg.selectAll("circle") //d3 geopath
/////////// DOTS = Chinese spots
c.enter().append("circle") //after the first use of a circle, use this method to add more
.data(chineseSpot)
.enter() //there are more data than elements, this selects them
.append("circle") //appends path to data
.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','rgb(237, 125, 58)')
.style('fill-opacity','.85')
.style('stroke','rgb(255,255,255)')
.style('stroke-width','2')
/////////// DOTS = ATM locations
c.enter().append("circle") //after the first use of a circle, use this method to add more
.data(atmLoc)
.enter() //there are more data than elements, this selects them
.append("circle") //appends path to data
.attr("cx", function(d) {return projection([d.long,d.lat])[0]})
.attr("cy", function(d) {return projection([d.long,d.lat])[1]})
.attr('r',4)
.attr('fill','rgb(31, 1, 185)')
.style('fill-opacity','.75')
.style('stroke','rgb(255,255,255)')
.style('stroke-width','1')
return svg.node();
}