[ Launch Inlet ]
Gist #4505683 An inlet to tributary
-
-
Save davo/4513347 to your computer and use it in GitHub Desktop.
An inlet to Tributary
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":"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},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.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} |
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 comunas = tributary.comunas; | |
var svg = d3.select("svg"); | |
var cw = 900; | |
var ch = 629; | |
var xy = d3.geo.mercator() | |
.scale(110968) | |
.translate([18163, -10586]) | |
//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