Skip to content

Instantly share code, notes, and snippets.

@sdqali
Created August 13, 2012 09:01
Show Gist options
  • Save sdqali/3338475 to your computer and use it in GitHub Desktop.
Save sdqali/3338475 to your computer and use it in GitHub Desktop.
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));
});
<!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>
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment