Created
December 2, 2015 06:44
-
-
Save arisatha/e9b36fa342f7261c490e 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> | |
<title>D3 tutorial</title> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script src="http://d3js.org/topojson.v1.min.js"></script> | |
<style type="text/css"> | |
</style> | |
</head> | |
<body> | |
<script> | |
var canvas = d3.select("body").append("svg") | |
.attr("width", 1000) | |
.attr("height", 1000); | |
d3.json("output.geojson", function (data) { | |
var group = canvas.selectAll("g") | |
.data(data.features) | |
.enter() | |
.append("g"); | |
//var projection = d3.geo.mercator() | |
//.scale(100); | |
var projection = d3.geo.conicConformal() | |
.center([4.37, 50.84]) | |
.scale(220000) | |
.translate([500, 500]); | |
var path = d3.geo.path().projection(projection); | |
var areas = group.append("path") | |
.attr("d", path) | |
.attr("class", "area") | |
.attr("fill", "steelblue"); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment