Skip to content

Instantly share code, notes, and snippets.

Forked from jasondavies/
Last active February 9, 2016 01:35
  • Star 0 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?
Rotating Orthographic
license: gpl-3.0
<!DOCTYPE html>
<meta charset="utf-8">
circle {
fill: none;
stroke: #000;
stroke-width: 2px;
<script src="//"></script>
<script src="//"></script>
var width = 960,
height = 500,
radius = 240;
var origin = [-71, 42],
velocity = [.012, -.002],
t0 =;
var projection = d3.geo.orthographic()
var path = d3.geo.path()
var svg ="body").append("svg")
.attr("width", width)
.attr("height", height);
.attr("cx", width / 2)
.attr("cy", height / 2)
.attr("r", radius);
d3.json("/mbostock/raw/4090846/world-110m.json", function(error, world) {
if (error) throw error;
var feature = svg.append("path")
.attr("d", path);
d3.timer(function() {
var t = - t0;
projection.rotate([origin[0] + velocity[0] * t, origin[1] + velocity[1] * t]);
feature.attr("d", path);
Copy link

hello! where can i get the data:world-110m.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment