From this code at (https://bl.ocks.org/mbostock/4090848) I can access us.objects.states, .nation, or .counties but I just want to know if I can say: us.objects.states.geometries.id(Missouri FIPS code is 29)
I just want to get the state of Missouri or is there a way to narrow this down.
Or if you can give help or direction on how to manipulate this line:
.data(topojson.feature(us, us.objects.states).features)
I've read the API reference on the topojson.feature function but I am still confused on how to use it.
<svg width="960" height="600"></svg>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://d3js.org/topojson.v2.min.js"></script>
<script>
var svg = d3.select("svg");
var path = d3.geoPath();
d3.json("https://d3js.org/us-10m.v1.json", function(error, us) {
if (error) throw error;
svg.append("g")
.attr("class", "states")
.selectAll("path")
.data(topojson.feature(us, us.objects.states).features)
.enter().append("path")
.attr("d", path);
svg.append("path")
.attr("class", "state-borders")
.attr("d", path(topojson.mesh(us, us.objects.states, function(a, b) { return a !== b; })));
});
</script>