[ Launch: Tributary inlet ] f46dc27d77c4c19bfc0c by poezn
-
-
Save poezn/f46dc27d77c4c19bfc0c to your computer and use it in GitHub Desktop.
Recharge projects
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":"Recharge projects","endpoint":"","display":"svg","public":true,"require":[{"name":"Topojson","url":"http://d3js.org/topojson.v1.min.js"}],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"data.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"styles.css":{"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,"ajax-caching":true,"thumbnail":"http://i.imgur.com/alFdCPr.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 topo = tb.data; | |
var path = d3.geo.path() | |
.projection(null); | |
var fundingSchemes = [ | |
"Prop 84", "Prop 1E", "Prop 50", "Prop 13" | |
]; | |
var gFs = g.selectAll("g.funding-scheme") | |
.data(fundingSchemes); | |
gFs.enter().append("g") | |
.attr({ | |
"class": "funding-scheme" | |
}); | |
var map = gFs.append("g").attr({ | |
"transform": function(d, i) { | |
return "translate(" + (i*250) + ", 0) scale(0.7)" | |
} | |
}); | |
map.append("path") | |
.datum(topojson.feature(topo, topo.objects.ca)) | |
.attr({ | |
"d": path, | |
"class": "outline" | |
}); | |
map.append("text") | |
.attr("transform", "translate(220, 30)") | |
.text(function(d, i) { return d; } ) | |
map.selectAll("path.basin") | |
.data(topojson.feature(topo, topo.objects.basins).features) | |
.enter().append("path") | |
.attr({ | |
"d": path, | |
"class": function(d, i) { | |
var prio = | |
d.properties.basin_pr19 == "High" ? "high" : | |
(d.properties.basin_pr19 == "Medium" ? "medium" : | |
(d.properties.basin_pr19 == "Low" ? "low" : "very_low" ) | |
) | |
return "basin " + prio | |
} | |
}); | |
map.selectAll("circle.recharge") | |
.data(function(d, i) { | |
return _.filter(topojson.feature(topo, topo.objects.recharge).features, function(f, i) { | |
return f.properties.funding_sc == d | |
}) | |
}) | |
.enter().append("circle") | |
.attr({ | |
"class": "recharge", | |
"cx": function(d, i) { return d.geometry.coordinates[0] }, | |
"cy": function(d, i) { return d.geometry.coordinates[1] }, | |
"r": 5 | |
}); | |
var cmi = tributary.getCodeEditor("inlet.js") | |
cmi.tabSize = 4; | |
var cms = tributary.getCodeEditor("styles.css") | |
cms.tabSize = 4; |
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
#display { | |
background-color: #FFF; | |
} | |
.outline { | |
fill: none; | |
stroke: #000; | |
} | |
.basin.high { | |
fill: #b7dea9; | |
} | |
.basin.medium { | |
fill: #ebe59d; | |
} | |
.basin.low, .basin.very_low { | |
fill: #d0c5b8; | |
} | |
.recharge { | |
fill: #a8002f; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment