Skip to content

Instantly share code, notes, and snippets.

@poezn
Created February 13, 2013 07:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poezn/4942825 to your computer and use it in GitHub Desktop.
Save poezn/4942825 to your computer and use it in GitHub Desktop.
Tributary inlet
{"description":"Tributary inlet","endpoint":"","display":"canvas","public":true,"require":[{"name":"topojson","url":"d3js.org/topojson.v0.min.js"},{"name":"topojson","url":"d3js.org/topojson.v0.min.js"}],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"stops.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"routes.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01}
var projection = d3.geo.equirectangular()
.translate([0, 0])
.center([8.35,47.45])
.scale(144372)
var c = tb.ctx;
c.fillStyle = '#5C5C5C';
var path = d3.geo.path()
.projection(projection)
.context(c);
var topo_s = tb['stops'];
var topo_r = tb['routes'];
var stops = topojson.object(topo_s, topo_s.objects.stops);
var routes = topojson.object(topo_r, topo_r.objects.routes);
// background
path(stops);
c.fill();
path(routes);
c.stroke();
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
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