Skip to content

Instantly share code, notes, and snippets.

@enjalot
Created February 20, 2013 19:17
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 enjalot/4998346 to your computer and use it in GitHub Desktop.
Save enjalot/4998346 to your computer and use it in GitHub Desktop.
#352 geometrydaily challenge
{"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"}
//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