Skip to content

Instantly share code, notes, and snippets.

Last active November 7, 2017 07:17
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Gray Earth
license: gpl-3.0
<!DOCTYPE html>
<meta charset="utf-8">
#land {
fill: none;
stroke: #000;
stroke-linejoin: round;
<script src="//"></script>
<script src="//"></script>
var width = 960,
height = 600;
var projection = d3.geo.azimuthalEqualArea()
.translate([33.5, 262.5])
.rotate([100, -45])
.center([-17.6076, -4.7913]) // rotated [-122.4183, 37.7750]
var path = d3.geo.path()
var svg ="body").append("svg")
.attr("width", width)
.attr("height", height);
d3.json("/mbostock/raw/4090846/us.json", function(error, us) {
if (error) throw error;
var defs = svg.append("defs");
.attr("id", "land")
.attr("d", path);
.attr("id", "clip")
.attr("xlink:href", "#land");
.attr("clip-path", "url(#clip)")
.attr("xlink:href", "shaded-relief.png")
.attr("width", width)
.attr("height", height);
.attr("xlink:href", "#land");
});"height", height + "px");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment