Skip to content

Instantly share code, notes, and snippets.

Created August 10, 2019 23:20
What would you like to do?
Simplified Globe
license: mit
<!DOCTYPE html>
<meta charset="utf-8">
<script src=""></script>
<script src="//"></script>
<script src="//"></script>
<svg width="960" height="500"></svg>
const path ='svg').append('path');
const projection = d3.geoOrthographic();
const geoPath = d3.geoPath().projection(projection);
d3.json('world-110m.json', (error, world) => {
const presimplified = topojson.presimplify(world);
const simpleWorld = topojson.simplify(presimplified, 11);
const land = topojson.feature(simpleWorld,;
d3.timer(t => {
projection.rotate([t * 0.05, Math.sin(t * 0.0005) * 45]);
path.attr('d', geoPath(land));
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment