Created
August 13, 2012 09:01
-
-
Save sdqali/3338475 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
var foo = d3.geo.albers(); | |
d3.json("india.json", function(collection) { | |
d3.select("svg").selectAll("path") | |
.data(collection.features) | |
.enter().append("path") | |
.attr("d", d3.geo.path().projection(foo)); | |
}); |
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"> | |
<title>India map in d3.js</title> | |
<style> | |
path { | |
fill: #ccc; | |
stroke: #fff; | |
} | |
</style> | |
<svg width="960" height="500"></svg> | |
<script src="http://d3js.org/d3.v2.js?2.9.1"></script> | |
<script src="draw.js"> | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment