Last active
October 20, 2018 07:18
-
-
Save thole/c624d5529ff89fee2c21 to your computer and use it in GitHub Desktop.
germany
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"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> | |
<script type="text/javascript" src="//d3js.org/d3.v3.min.js"></script> | |
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/topojson/1.6.20/topojson.min.js"></script> | |
</head> | |
<body> | |
<div id="reportBody"></div> | |
<script type="text/javascript"> | |
var geoDB = new Object(); | |
var width = 500, | |
height = 600; | |
var projection = d3.geo.albers() | |
.center([10, 51]) | |
.rotate([0, 0]) | |
.parallels([50, 60]) | |
.scale(3000) | |
.translate([width / 2, height / 2]); | |
var path = d3.geo.path() | |
.projection(projection); | |
var svg = d3.select("#reportBody").append("svg") | |
.attr("width", width) | |
.attr("height", height); | |
d3.json("deu.json", function(error, deu) { | |
svg.selectAll(".subunit") | |
.data(topojson.feature(deu, deu.objects.subunits).features) | |
.enter().append("path") | |
.attr("class", function(d) { return "subunit " + d.id; }) | |
.attr("d", path); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment