Skip to content

Instantly share code, notes, and snippets.

/_.md

Created January 10, 2013 20:51
Show Gist options
  • Select an option

  • Save anonymous/4505683 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/4505683 to your computer and use it in GitHub Desktop.
An inlet to Tributary

An inlet to tributary

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.
{"description":"An inlet to Tributary","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"comunas.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"tab":"edit","display_percent":0.7,"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,"hidepanel":false}
var comunas = tributary.comunas;
var svg = d3.select("svg");
var cw = 600;
var ch = 429;
var xy = d3.geo.mercator()
.scale(90724)
.translate([15235, -8655])
//then we need a path function
var geopath = d3.geo.path()
.projection(xy);
var chart = svg.append("g")
.attr("transform", "translate(" + [-81, 9] + ")");
chart.append("g")
.attr("id", "comunas");
var comunasGroup = chart.select("#comunas");
comunasGroup.selectAll("path")
.data(comunas.features)
.enter()
.append("path")
.attr("d", geopath)
.attr("id", function(d) {
return d.properties.name;
})
.style({
fill:"#F7924F",
stroke:"#FFFFFF",
"stroke-width": 0
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment