Skip to content

Instantly share code, notes, and snippets.

@roundrobin
Created July 29, 2012 10:14
Show Gist options
  • Save roundrobin/3197240 to your computer and use it in GitHub Desktop.
Save roundrobin/3197240 to your computer and use it in GitHub Desktop.
just another inlet to tributary
trib.x = 205
trib.y = 100
var freq = 0.32256
var scale = d3.scale.category20()
var text = g.append('text')
var string1 = 'tribuatry'
for (var i=1; i <= string1.length; i++) {
text.append('tspan')
.text(string1.charAt(i-1))
.attr('class','char letter'+i)
.attr('font-size',109*Math.sin(i*freq))
.attr('dominant-baseline','hanging')
.attr('fill',scale(i))
}
text.attr('transform','translate('+trib.x+','+trib.y+')')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment