usmap = {
const svg = d3.create("svg")
.style("display", "block")
.attr("viewBox", [0, 0, width, height])
.attr("transform", "translate(0, 20) scale(1.15)");
svg.append("path")
.datum(topojson.feature(basepolygons, basepolygons.objects.states_simple))
.attr("fill", "#ccc")
.attr("d", path_basemap);
const defs = svg.append("defs");
defs.append("path")
.attr("id", "outline")
.attr("d", path(outline));
defs.append("clipPath")
.attr("id", "clip")
.append("use")
.attr("xlink:href", new URL("#outline", location));
const g = svg.append("g")
.attr("clip-path", `url(${new URL("#clip", location)})`);
g.append("use")
.attr("xlink:href", new URL("#outline", location))
.attr("fill", "white");
g.append("g")
.selectAll("path")
.data(basepolygons.objects.states_simple.geometries)
.join("path")
.attr("fill", d => color(yearData.get(d.properties.name)))
.append("title")
.text(d => `${d.properties.name}
${yearData.has(d.properties.name) ? yearData.get(d.properties.name) : "N/A"}`);
g.append("path")
.datum(topojson.mesh(basepolygons, basepolygons.objects.states_simple))
.attr("fill", "none")
.attr("stroke", "black")
.attr("stroke-linejoin", "round")
.attr("d", path_basemap);
return svg.node();
}