Created
September 21, 2011 20:31
-
-
Save AWinterman/1233208 to your computer and use it in GitHub Desktop.
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> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
<title>North Pole</title> | |
<script type="text/javascript" src="https://github.com/mbostock/d3/raw/v2.2.0/d3.js"></script> | |
<script type="text/javascript" src="https://github.com/mbostock/d3/raw/v2.2.0/d3.geo.js"></script> | |
<style type="text/css"> | |
svg { | |
width: 960px; | |
height: 500px; | |
} | |
#states path { | |
fill: #ccc; | |
stroke: #fff; | |
stroke-width: 0.5px; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="chart"></div> | |
<script type="text/javascript"> | |
//the projection | |
var xy1 = d3.geo.azimuthal().origin([0,90]); | |
var svg = d3.select("body").append("svg:svg"); | |
svg.append("svg:g").attr("id", "states"); | |
d3.json("world-countries.json", function(collection) { | |
svg.select("#states") | |
.selectAll("path") | |
.data(collection.features) | |
.enter().append("svg:path") | |
.attr("d", d3.geo.path().projection(xy1)); | |
}); | |
</script> | |
<hr> | |
</body> </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment