map = {
const width = 960;
const height = 600;
const projection = d3.geoAlbersUsa()
.translate([width/2, height/2])
.scale(SCALE_FACTOR);
const path = d3.geoPath();
const formatNumber = d3.format(",.0f");
const svg = d3.select(DOM.svg(width, height))
.style("width", "100%")
.style("height", "auto");
svg.append("path")
.datum(topojson.feature(us, us.objects.nation))
.attr("fill", "#ddd")
.attr("d", path);
svg.append("path")
.datum(topojson.mesh(us, us.objects.states, (a, b) => a !== b))
.attr("fill", "none")
.attr("stroke", "white")
.attr("stroke-linejoin", "round")
.attr("d", path);
svg.append("g")
.attr("fill", "brown")
.attr("fill-opacity", 0.5)
.attr("stroke", "#fff")
.attr("stroke-width", 0.5)
.selectAll("circle")
.data(americanLaunches)
.enter().append("circle")
.attr('cx', d => projection(d.coords)[0])
.attr('cy', d => projection(d.coords)[1])
.attr("r", "3")
.append("title")
.text(d => `${d.name} | ${d.location.name})`)
return svg.node();
}