Skip to content

Instantly share code, notes, and snippets.

@dcposch
Created November 11, 2012 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcposch/4056536 to your computer and use it in GitHub Desktop.
Save dcposch/4056536 to your computer and use it in GitHub Desktop.
D3GL Hello Earth

Three views, side by side. Drag to rotate, mouse wheel to zoom.

Built with d3gl

<!DOCTYPE html>
<html>
<head>
<title>D3GL Hello Earth</title>
<link rel="stylesheet" href="http://dcpos.ch/d3gl/css/demo.css" />
</head>
<body>
<script type="text/javascript" src="http://dcpos.ch/d3gl/js/d3gl.min.js"></script>
<script type="text/javascript">
$(function(){
// get some data
var textures = [
"http://dcpos.ch/d3gl/img/earth-tex.png", // day
"http://dcpos.ch/d3gl/img/earth-night-tex.jpg", // night
"http://dcpos.ch/d3gl/img/earth-bump.jpg" // altitude
];
// create a d3gl chart...
var globe = d3.gl.globe()
.width(320).height(320)
.texture(function(d){return d;});
// use it to paint three views, side by side
d3.select("body").selectAll("span")
.data(textures).enter().append("span")
.call(globe);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment