Skip to content

Instantly share code, notes, and snippets.

@georules
Created September 10, 2013 01:17
Show Gist options
  • Save georules/6503801 to your computer and use it in GitHub Desktop.
Save georules/6503801 to your computer and use it in GitHub Desktop.
World map
{"description":"World map","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"test.json":{"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}},"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/mT1MHAO.png"}
var width = 600;
var height= 400;
g.append("rect")
.attr({
width: width,
height: height,
fill: "green",
"opacity" : 0.1
});
var feature = g.append("g")
.attr("class","world-map")
.attr('height',height)
.attr('width', width);
var projection = d3.geo.mercator()
.scale((width + 1) / 1.0496)
.translate([width / 0.32, height / 0.24])
.precision(.9);
var path = d3.geo.path()
.projection(projection);
collection = tributary.test;
feature.selectAll(".path")
.data(collection.features)
.enter()
.append("path")
.attr("fill",'#AA2A2A')
.attr("d", path);
feature = g.select(".world-map").attr("transform","scale(0.15)");
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