[ Launch: #352 geometrydaily challenge ] 4998346 by enjalot
-
-
Save enjalot/4998346 to your computer and use it in GitHub Desktop.
#352 geometrydaily challenge
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":"#352 geometrydaily challenge","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":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/IHYdDAz.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
//http://geometrydaily.tumblr.com/post/38147826501/352-orbital-this-is-so-simple-just-a-bunch-of | |
var cx = tributary.sw/2; | |
var cy = tributary.sh/2; | |
var radius = 300; | |
var svg = d3.select("svg"); | |
var defs = svg.append("defs") | |
defs.append("clipPath") | |
.attr("id", "circleclip") | |
.append("circle") | |
.attr({ | |
cx: cx, | |
cy: cy, | |
r: radius+2, | |
}) | |
/* | |
//testing clip path with this | |
svg.append("rect") | |
.attr({ | |
x: cx - radius, | |
y: cy - radius, | |
width: radius*2, | |
height: radius*2, | |
"clip-path":"url(#circleclip)" | |
}) | |
*/ | |
var circles = svg.append("g") | |
.classed("circles", true) | |
.attr("clip-path","url(#circleclip)") | |
var array = d3.range(13); | |
circles.selectAll("circle.arc") | |
.data(array) | |
.enter() | |
.append("circle") | |
.classed("arc", true) | |
.attr({ | |
cx: function(d,i) { | |
return cx + (i+1) * 44 | |
}, | |
cy: function(d,i) { | |
return cy + i * 0; | |
}, | |
r: radius | |
}) | |
.style({ | |
fill: "none", | |
stroke: "#000000", | |
"stroke-width": 2, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment