Skip to content

Instantly share code, notes, and snippets.

Forked from mbostock/.block
Last active January 24, 2017 21:27
  • Star 2 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
U.S. Counties TopoJSON Mesh
license: gpl-3.0
height: 600
border: no

A demo of TopoJSON on a U.S. counties shapefile from the U.S. census bureau.

<!DOCTYPE html>
<svg width="960" height="600"></svg>
<script src=""></script>
<script src=""></script>
var svg ="svg");
d3.json("", function(error, us) {
if (error) throw error;
var path = d3.geoPath(),
mesh = topojson.mesh(us),
transform = topojson.transform(us);
.attr("fill", "none")
.attr("stroke", "#000")
.attr("stroke-width", 0.25)
.attr("stroke-linejoin", "round")
.attr("d", path(mesh));
.attr("transform", function(d) { return "translate(" + transform(d[0]) + ")"; })
.attr("r", 1.25);
Copy link

aesnyder commented May 6, 2014

I noticed a ton of examples are no longer working, this one included. Any plans to fix?

Copy link

d3.json("/mbostock/raw/4090846/us.json", function(error, us)

what this line indicate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment