Created
August 6, 2012 08:10
-
-
Save roundrobin/3272220 to your computer and use it in GitHub Desktop.
just another 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
var txt; | |
var r; | |
tributary.init = function(g) { | |
var scale = d3.scale.linear().domain([0, -113]).range([0.18581, 20]); | |
var data = d3.range(359).map(function(i) { return 1.248 * scale(i/(71) ) / 1; }); | |
var svg = g | |
.data([data]) | |
.append("g") | |
.attr("transform", "translate(" + 500 + "," + 274 + ")"); | |
r= svg.append("path") | |
.attr("class", "area") | |
.attr("d", d3.svg.area.radial() | |
.innerRadius(function(d,i) { return i/2; }) | |
.outerRadius(function(d,i) { return 176; }) | |
.angle(function(d, i) { return i/(14);//(4.71515) * Math.cos(i); | |
})); | |
}; | |
tributary.run = function(g,t) { | |
r | |
.attr("d", d3.svg.area.radial() | |
.innerRadius(function(d,i) { return i/2.08; }) | |
.outerRadius(function(d,i) { return i+t%30.92; }) | |
.angle(function(d, i) { return i+t%(-31.5);//(4.71515) * Math.cos(i); | |
})); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment