Skip to content

Instantly share code, notes, and snippets.

@enjalot
Created March 31, 2013 03:04
Show Gist options
  • Save enjalot/5279340 to your computer and use it in GitHub Desktop.
Save enjalot/5279340 to your computer and use it in GitHub Desktop.
#352 Orbital
{"description":"#352 Orbital","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"style.css":{"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/8BlgGMK.png"}
//http://geometrydaily.tumblr.com/post/38147826501/352-orbital-this-is-so-simple-just-a-bunch-of
//@tilman
var svg = d3.select("svg");
var n = 13;
var xoffset = 32;
var cx = tributary.sw/2;
var cy = tributary.sh/2;
var radius = 200;
var defs = svg.append("defs")
defs.append("clipPath")
.attr("id", "circleclip")
.append("circle")
.attr({
cx: cx,
cy: cy,
r: radius + 2
})
var circleg = svg.append("g")
.attr("clip-path", "url(#circleclip)")
circleg.selectAll("circle")
.data(d3.range(n))
.enter()
.append("circle")
.attr({
cx: function(d,i) { return cx + (i+1) * xoffset },
cy: cy,
r: radius
})
circle {
fill: none;
stroke: #170053;
stroke-width: 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment