Built with blockbuilder.org
xxxxxxxxxx
<meta charset='utf-8'>
<title>US Counties</title>
<svg width="960" height="600" fill="none" stroke="#000" stroke-linejoin="round" stroke-linecap="round"></svg>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://unpkg.com/topojson-client@3"></script>
<script>
var svg = d3.select("svg");
var path = d3.geoPath();
d3.json("https://unpkg.com/us-atlas@1/us/10m.json", function(error, us) {
if (error) throw error;
var counties = topojson.feature(us, us.objects.counties).features;
// Examine one of the county features in the developer console.
// The "id" attribute is a 5-digit GEOID (state + county).
// See: https://www.census.gov/geo/reference/geoidentifiers.html
console.log(counties[0]);
svg.selectAll('path.county')
.data( counties )
.enter().append("path")
.attr("d", path)
.attr("stroke", "#aaa")
.attr("stroke-width", 0.5);
svg.append("path")
.attr("stroke-width", 0.5)
.attr("d", path(topojson.mesh(us, us.objects.states, function(a, b) { return a !== b; })));
svg.append("path")
.attr("d", path(topojson.feature(us, us.objects.nation)));
});
</script>
https://d3js.org/d3.v4.min.js
https://unpkg.com/topojson-client@3