I have a D3 map of the US. I want to be able to change the color of the border for a given state. However, it appears that when I do the topojson.mesh it creates on path for all the state borders. What can I do to create a different path for each state?
d3.json("../json/us_states_topo.json", function(error, us) {
var features = svg.append("g");
features
.attr("class", "state")
.selectAll("path")
.data(topojson.feature(us, us.objects.layer1).features)
.enter().append("path")
.attr("d", path)
.attr("id", function(d) {
return d.properties.STATE;
})
features.append("path")
.attr("class",function(d) { return "state-boundaries";})
.datum(topojson.mesh(us, us.objects.layer1, function(a, b) { return a !== b }))
.attr("d", path)