I'm using one of Mike's TopoJSON files for the entire US
I need to be able to track which state is being rendered in the code below:
d3.json("us.json", function(error, us) {
g.selectAll("path")
.data(topojson.object(us, us.objects.states).geometries)
.enter().append("path")
.attr("d", path)
.attr("class", "feature")
.on("click", click);
g.append("path")
.datum(topojson.mesh(us, us.objects.states, function(a, b) { return a !== b; }))
.attr("class", "mesh")
.attr("d", path);
})
I need to apply different "fill" attribute per state.
I remember being able to do that with a GeoJSON file that I had also copied from one of Mike's examples.
Kind of a dumb question, but I'm wondering if go back to GeoJSON in case TopoJSON omits state/county name by convention?