states = {
const path = d3.geoPath(projection);
const scale = width / 960;
const svg = d3.create("svg")
.attr("viewBox", "0 0 960 600")
.style("width", "100%")
.style("height", "auto");
svg.append("g")
.selectAll("path")
.data(topojson.feature(us, us.objects.states).features)
.join("path")
.classed('interior', true)
.attr("fill", "darkgray")
.attr("d", path)
.on('mouseover', function(d) {
d3.select(this).style("fill", "red");
let state = d.properties.STATE;
mutable z = [state, json[state]];
})
.on('mouseout', function() { d3.select(this).style("fill", null) })
svg.append("path")
.datum(topojson.mesh(us, us.objects.states, (a, b) => a !== b))
.classed('mesh', true)
.attr("fill", "none")
.attr("stroke", "white")
.attr("stroke-linejoin", "round")
.attr("d", path);
svg.append("path")
.datum(topojson.mesh(us, us.objects.nation))
.classed('nation', true)
.attr("fill", "none")
.attr("stroke", "black")
.attr("stroke-linejoin", "round")
.attr("d", path);
return svg.node();
}