Created
August 4, 2012 22:06
-
-
Save roundrobin/3260300 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; | |
function randomXToY(minVal,maxVal,floatVal) | |
{ | |
var randVal = minVal+(Math.random()*(maxVal-minVal)); | |
return typeof floatVal=='undefined'?Math.round(randVal):randVal.toFixed(floatVal); | |
} | |
tributary.init = function(g) { | |
var text = {"message":"Hello","amplitude":1.216,"segments":26.03,"change1":0,"functionName":"Sinus", "change2" : 16.3,"a":1,"b":1,"c":0}; | |
var boolFlag = false; | |
var circleBoundaries = d3.scale.linear().domain([0, 10]).range([0.79, 20]); | |
var r = 576 / 2, | |
data = d3.range(430).map(function(i) { | |
var returnedValue = Math.sin(i / -37) * -123; | |
var val = circleBoundaries(returnedValue); | |
return val; | |
}); | |
var svg = g | |
.data([data]) | |
.append("g") | |
.attr("transform", "translate(" + r + "," + r + ")"); | |
var path = svg.append("path") | |
.attr("class", "area") | |
.attr("d", d3.svg.area.radial() | |
.innerRadius(94.6) | |
.outerRadius(function(d) { return r * d; }) | |
.angle(function(d, i) { return i / 180 * Math.PI; })); | |
g.pathy = path | |
}; | |
tributary.run = function(g,t) { | |
var index = Math.floor(t)*10; | |
if(index % 100 == 0){ | |
console.log('sdfsdf',index,g.pathy); | |
.attr("class", "area") | |
.attr("d", d3.svg.area.radial() | |
.innerRadius(30.6) | |
.outerRadius(function(d) { return r * d; }) | |
.angle(function(d, i) { return i / 180 * Math.PI; })); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment