Skip to content

Instantly share code, notes, and snippets.

@EHDEV
Created February 23, 2015 19:50
Show Gist options
  • Save EHDEV/404241b88369abf4839e to your computer and use it in GitHub Desktop.
Save EHDEV/404241b88369abf4839e to your computer and use it in GitHub Desktop.
.build
node_modules
package.json
makefile
.build
node_modules
package.json
<!DOCTYPE html>
<meta charset="utf-8">
<style>
path {
fill: none;
stroke: #000;
stroke-linejoin: round;
stroke-linecap: round;
}
</style>
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script>
var width = 960,
height = 600;
var path = d3.geo.path()
.projection(null);
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
d3.json("build/counties.json", function(error, us) {
if (error) return console.error(error);
svg.append("path")
.datum(topojson.mesh(us))
.attr("d", path);
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment