-
-
Save Andrew-Reid/61f0b6f4d511ea7fc2a082a5279484d7 to your computer and use it in GitHub Desktop.
US Albers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<body> | |
<script src="https://d3js.org/d3.v3.min.js"></script> | |
<script> | |
var width = 960; | |
var height = 500; | |
var svg = d3.select("body").append("svg") | |
.attr("width",width) | |
.attr("height",height); | |
var projection = d3.geo.albersUsa().translate([width/2,height/2]); | |
var path = d3.geo.path().projection(projection); | |
d3.json("us.json",function(data) { | |
svg.append("path") | |
.datum(data) | |
.attr('d',path) | |
.attr('fill','steelblue') | |
.attr('stroke','black'); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment