Skip to content

Instantly share code, notes, and snippets.

@roundrobin
Created June 24, 2012 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roundrobin/2985548 to your computer and use it in GitHub Desktop.
Save roundrobin/2985548 to your computer and use it in GitHub Desktop.
just another inlet to tributary
trib.x = 100
trib.y = 100
var scale = d3.scale.category10()
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',99*Math.sin(i*0.26))
.attr('dy',21*Math.sin(i*1.352))
.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