[ Launch: sin waves ] 5447280 by roundrobin
See Previous Inlet [ Gist ]
-
-
Save roundrobin/5447280 to your computer and use it in GitHub Desktop.
sin waves
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
{"editor_editor":{"coffee":false,"vim":false,"emacs":false,"width":600,"height":300,"hide":false},"description":"sin waves","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"inlet.svg":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/UO9qAUz.png"} |
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 data = [ | |
1,2,4,5,1,2,4,5, 1,2,4,5 | |
]; | |
var svg = d3.select('svg'); | |
var type = 'grand-challenges'; | |
var x = 73; | |
var y = 0; | |
var radius = 208; | |
var gcGroup = svg.selectAll('.'+type) | |
.data(data) | |
.enter(); | |
var amplitdute = 2.91821986863514; | |
var stauching = 1; | |
var direction = -1; | |
var distance = 44; | |
var gc = gcGroup.append('g') | |
.attr({ | |
transform: function(d, i){ | |
var i = i - (data.length-1)/2; | |
var x = Math.pow(amplitdute*(i),2)+(i*stauching)+127; | |
var y = 397+(distance * i); | |
return 'translate('+(x)+','+(y)+')'; | |
}, | |
'class': type | |
}); | |
gc.append("rect") | |
.attr({ | |
width: 46, | |
height: 15, | |
rx: 0, | |
ry: 0 | |
}); | |
gc.append('text') | |
.text("Lorem Ipsum") | |
.attr({ | |
fill: "#000000", | |
x : 80, | |
y: 12, | |
"font-size": 10, | |
"font-family": "Arial", | |
"text-anchor": "middle" | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment