Skip to content

Instantly share code, notes, and snippets.

@TheSisb
Created September 16, 2013 16:40
Show Gist options
  • Save TheSisb/6583145 to your computer and use it in GitHub Desktop.
Save TheSisb/6583145 to your computer and use it in GitHub Desktop.
Test world
{"description":"Test world","endpoint":"","display":"svg","public":true,"require":[{"name":"jquery","url":"//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"},{"name":"d3","url":"http://d3js.org/d3.v3.min.js"},{"name":"topojson","url":"http://d3js.org/topojson.v0.min.js"}],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"world.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/M9PFm5m.png"}
var width = 1280,
height = 1024;
var projection = d3.geo.mercator()
.center([10, 73])
.scale(250)
.rotate([0,0]);
var svg = d3.select("svg")
.attr("viewBox", "-500 0 " + width + " " + height )
.attr("preserveAspectRatio", "xMinYMin");
var path = d3.geo.path()
.projection(projection);
var g = svg.append("g")
.attr("width", width)
.attr("height", height);
// load and display the World
var topology = tributary.world;
g.selectAll("path")
.data(topojson.object(topology, topology.objects.countries)
.geometries)
.enter()
.append("path")
.attr("d", path)
Display the source blob
Display the rendered blob
Raw
Loading
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