[ Launch: Test world ] 6583145 by TheSisb
-
-
Save TheSisb/6583145 to your computer and use it in GitHub Desktop.
Test world
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"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"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment