chart = {
const width = 1300,
height = 900
;
const svg = d3.create("svg")
.attr("viewBox", [400, 250, width-500, height-400])
;
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");
svg.append('image')
.attr('href',view)
.attr('class','spotImage')
.attr('x', '340')
.attr('y','75')
.attr('width', 905)
.attr('height', 845)
var c = svg.selectAll("circle")
.data(cities1.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)
.style('fill','red')
.style('fill-opacity','1')
.on('mouseover',fireText)
.on('mouseout',removefireText)
function fireText(event,d){
console.log(d)
svg
.append("text")
.attr('x','400')
.attr('y','375')
.attr('class','mypoints_position')
.style('font-family','helvetica')
.style('font-size','20px')
.style('font-weight','light')
.text(d.properties.description)
var wrap = svg.selectAll("text.mypoints_position")
.each(function(d, i) { wrap_text(d3.select(this), 100) });
svg
.append("line")
.attr('x1','400')
.attr('y1','370')
.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.mypoints_position').remove()
d3.selectAll('line.fireLine').remove()
}
c.enter().append("circle")
.data(cities1)
.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',100)
.style('stroke','red')
.style('stroke-width','1')
.style('fill','cyan')
.style('fill-opacity','1')
svg
.append("text")
.attr('x','400')
.attr('y','275')
.style('font-family','garamond')
.style('font-size','18px')
.style('font-weight','bold')
.text('Coastal Louisiana Oyster Reef Map')
svg
.append("line")
.attr('x1','300')
.attr('y1','277')
.attr('x2','675')
.attr('y2','277')
.style("stroke-width", '1')
.style("stroke", "rgb(0,0,0)")
return svg.node();
}