Skip to content

Instantly share code, notes, and snippets.

Forked from mbostock/.block
Last active June 1, 2016 16:07
What would you like to do?
license: gpl-3.0

These state boundaries are extracted from a single TopoJSON file. States are stroked in thin black, and the country in thick black.

<!DOCTYPE html>
<meta charset="utf-8">
path {
fill: none;
stroke: #000;
stroke-width: .5px;
.land-boundary {
stroke-width: 1px;
.county-boundary {
stroke: #aaa;
<script src="//"></script>
<script src="//"></script>
var width = 960,
height = 500;
var path = d3.geo.path();
var svg ="body").append("svg")
.attr("width", width)
.attr("height", height);
d3.json("/mbostock/raw/4090846/us.json", function(error, topology) {
if (error) throw error;
.attr("d", path)
.attr("class", "land-boundary");
.datum(topojson.mesh(topology, topology.objects.states, function(a, b) { return a !== b; }))
.attr("d", path)
.attr("class", "state-boundary");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment