Created
August 5, 2012 23:58
-
-
Save roundrobin/3268177 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
function randomXToY(minVal,maxVal,floatVal) | |
{ | |
var randVal = minVal+(Math.random()*(maxVal-minVal)); | |
return typeof floatVal=='undefined'?Math.round(randVal):randVal.toFixed(floatVal); | |
} | |
var text = {"message":"Hello","amplitude":1.216,"segments":10.91,"change1":0,"functionName":"Sinus", "change2" : 16.3,"a":1,"b":1,"c":0}; | |
var boolFlag = false; | |
var r = 576 / 2, | |
data = d3.range(430).map(function(i) { | |
var axis = 4; | |
var segments = Math.floor(361 / axis); | |
var part = Math.floor(i/segments); | |
var value = text.amplitude + Math.sin(i / text.segments * Math.PI) / text.change2; | |
var scale = d3.scale.linear().domain([0, -96]).range([0.79, 20]); | |
var check = Math.sin(i / -10); | |
var val = scale(value); | |
return val; | |
}); | |
var svg = g | |
.data([data]) | |
.append("g") | |
.attr("transform", "translate(" + r + "," + r + ")"); | |
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; })); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment