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], nys_boundary);
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(nys_map.features)
.enter()
.append("path")
.attr('class','outlines')
.attr("d", path3)
.style("fill", "black")
.style("fill-opacity", "1")
.style('stroke-opacity','1')
.style("stroke-width", '0.5')
.style("stroke", "red")
var cir = svg.selectAll("circle")
.data(nyspots)
.enter()
.append("circle")
.attr('class','nyspots')
.attr("r", "3")
.attr("cx", function(d) {return projection([d.Long,d.Lat])[0]})
.attr("cy", function(d) {return projection([d.Long,d.Lat])[1]})
.style("fill", "cyan")
.style("fill-opacity", "1")
.style('stroke-opacity','1')
.style("stroke-width", '.5')
.style("stroke", "rgb(0,0,0)")
function fillColor(d,i){
var color = "rgb(200,0,200)"
if(d.Type=="food"){color = "rgb(255,0,0)"}
if(d.Type=="game"){color = "rgb(0,0,255)"}
return color
}
cir.enter().append("circle")
.data(scSteps)
.enter()
.append("circle")
.attr("r", "5")
.attr("cx", "150")
.attr("cy", function(d,i) {return 150+(i*20)})
.style("fill", "white")
.style("fill-opacity", "1")
.style('stroke-opacity','1')
.style("stroke-width", '2')
.style("stroke", "red")
.on("mouseover", animateMap)
.on("mouseout", stopAnimateMap)
function animateMap(event,d){
var tColor = "cyan"
if(d == "Raw Extraction"){tColor = "red"}
var circle = svg.selectAll(circle.nyspots).attr('r',8)
svg
.append("text")
.attr("x", "300")
.attr("y", "700")
.attr("class", "mouseText")
.style("font-family", "Helvetica")
.style("font-weight", "light")
.style("text-anchor", "start")
.style("font-size", "10px")
.style("fill", tColor)
.style("fill-opacity", "1")
.text(d)
}
function stopAnimateMap(event,d){
svg.selectAll("text.mouseText").remove()
}
var tx = svg.selectAll("text")
.data(scSteps)
.enter()
.append("text")
.attr("r", "3")
.attr("x", "160")
.attr("y", function(d,i) {return 155+(i*20)})
.style("font-family", "Helvetica")
.style("font-weight", "light")
.style("text-anchor", "start")
.style("font-size", "10px")
.style("fill", "black")
.style("fill-opacity", "0.5")
.style('stroke-opacity','1')
.style("stroke-width", '0.5')
.style("stroke", "rgb(0,0,0)")
.text(function(d) {return d})
return svg.node();
}