Created
May 28, 2012 23:49
-
-
Save anonymous/2821705 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 startX = 50 | |
var startY = 200 | |
var curve = 150 | |
var amplitude = -151 | |
var targetX = 393 | |
var targetY = 0 | |
var svg = d3.select('svg') | |
var defs = svg.append('defs') | |
var font_size = 70 | |
var text_string = 'Coffee for free' | |
var font_face = 'Arial' | |
//______ To adjust change parameters above __________ | |
defs.append('path') | |
.attr('d','M '+startX+' '+startY+' q '+curve+' '+amplitude+' '+targetX+' '+targetY+'') | |
.attr('stroke','blue') | |
.attr('stroke-width',3) | |
.attr('fill','none') | |
.attr('id','bezierCurve') | |
var text = svg.append('text') | |
.attr('font-size',font_size) | |
.attr('font-family',font_face) | |
text.append('textPath') | |
.attr('xlink:href','#bezierCurve') | |
.text(text_string) | |
svg.append('use') | |
.attr('xlink:href','#bezierCurve') | |
.text(text_string) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment