map = {
const projectionTranslator = d3
.geoAlbersUsa()
.translate([width / 2, height / 2])
.fitSize([width, height], pathsForMap);
const pathRenderer = d3.geoPath().projection(projectionTranslator);
const svg = d3
.select(DOM.element('svg'))
.attr('width', width)
.attr('height', height)
.attr('style', "font-family: 'Lato';")
const map = svg.append("g").attr("id", "map")
map.selectAll("path")
.data(pathsForMap.features)
.join('path')
.attr("d", d => pathRenderer(d))
.style('stroke', 'white')
.style('fill', 'darkblue')
const labels = svg.append("g").attr("id", "labels")
labels.selectAll("text")
.data(pathsForMap.features)
.join('text')
.attr('text-anchor', 'middle')
.attr('fill', 'white')
.text(d => stateLookup[d.properties.name])
.attr('x', d => pathRenderer.centroid(d)[0])
.attr('y', d => pathRenderer.centroid(d)[1])
return svg.node();
}