[ Launch: the dog next door won't be quiet ] 6694952 by enjalot
[ Launch: the dog next door won't be quiet ] 6694098 by georules
[ Launch: the dog next door won't be quiet ] 6688084 by karlin
[ Launch: zzz 2 ] 6145095 by gelicia
[ Launch: zzz ] 5521819 by zeffii
[ Launch: zzz ] 5521497 by gelicia
-
-
Save enjalot/6694952 to your computer and use it in GitHub Desktop.
the dog next door won't be quiet
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
{"description":"the dog next door won't be quiet","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":true,"loop":true,"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/MwnCKoL.gif","controls":{"size":"220","width":"90","num_points":"16.4","gapMin":"0.01","gapMax":"0.36"}} |
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 svg = d3.select('svg'); | |
tributary.loop_type="pingpong" | |
var startPoint = {x: tributary.sw/2, y: tributary.sh/2}; | |
var size = tributary.control({name: "size", min: 100, max: 500}); | |
var width = tributary.control({name: "width", min: -300, max: 300 }); | |
var gapMin = tributary.control({name: "gapMin", min: 0.0, max: 0.2 }); | |
var gapMax = tributary.control({name: "gapMax", min: 0.2, max: 1 }); | |
var gap = tributary.anim(gapMin,gapMax); | |
var two_pi = 2 * Math.PI; | |
var num_points = Math.floor(tributary.control({name:"num_points", min: 2, max: 20})); | |
var jump = two_pi / num_points; | |
var star = [] | |
var even, amp, ijump; | |
var prevJump = 0 | |
for (var i = 1; i <= num_points; i+=1){ | |
ijump = jump * i; | |
var arc = d3.svg.arc().innerRadius(size-width). | |
outerRadius(size).startAngle(prevJump + (gap/2)) | |
.endAngle(ijump - (gap/2)); | |
prevJump = ijump; | |
svg.append("svg:path") | |
.attr({ | |
d : arc, | |
fill: 'green', | |
transform: "translate(" + startPoint.x + "," + startPoint.y + ")" | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment