Skip to content

Instantly share code, notes, and snippets.

@mbostock
Forked from mbostock/.block
Last active January 24, 2017 21:45
Show Gist options
  • Save mbostock/4134057 to your computer and use it in GitHub Desktop.
Save mbostock/4134057 to your computer and use it in GitHub Desktop.
U.S. Land TopoJSON
license: gpl-3.0
height: 600
border: no
<!DOCTYPE html>
<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("path")
.attr("d", path(topojson.feature(us, us.objects.nation)));
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment