In response to a Stack Overflow question.
Last active
October 2, 2016 14:14
-
-
Save mbostock/5413933 to your computer and use it in GitHub Desktop.
Albers Siberia
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
license: gpl-3.0 |
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"> | |
<body> | |
<script src="//d3js.org/d3.v3.min.js"></script> | |
<script src="//d3js.org/topojson.v1.min.js"></script> | |
<script> | |
var width = 960, | |
height = 500; | |
var svg = d3.select("body").append("svg") | |
.attr("width", width) | |
.attr("height", height); | |
var projection = d3.geo.albers() | |
.rotate([-105, 0]) | |
.center([-10, 65]) | |
.parallels([52, 64]) | |
.scale(700) | |
.translate([width / 2, height / 2]) | |
.precision(.1); | |
var path = d3.geo.path() | |
.projection(projection); | |
d3.json("russia.json", function(error, russia) { | |
if (error) throw error; | |
svg.append("path") | |
.datum(topojson.feature(russia, russia.objects.russia)) | |
.attr("d", path); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment