map = {
const svg = d3.create("svg")
.attr("width", width)
.attr("height", 600)
.style("text-anchor", "middle")
.style('font-family', 'sans-serif')
.style("font-size", "12px")
const paths = svg.selectAll("path")
.data(topojson.feature(shapefile, shapefile.objects.states).features)
.join("path")
.attr("d", path)
.attr("fill", d => {
return color(most_recent_obj.get(d.properties.name))
})
const labels = svg.selectAll("text")
.data(topojson.feature(shapefile, shapefile.objects.states).features)
.join("text")
.text(d => most_recent_obj.get(d.properties.name).toFixed(1))
.attr("y", d => path.centroid(d)[1])
.attr("x", d => path.centroid(d)[0])
const title = svg.append("text")
.attr('x', width/2)
.attr("y", 20)
.text("Presidential Forecast")
.style("font-size", "20px")
svg.append("g")
.attr("transform", `translate(${width - 300}, 5)`)
.append(() => color_legend)
return svg.node()
}