Skip to content

Instantly share code, notes, and snippets.

@roundrobin
Created September 17, 2013 21:51
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 roundrobin/6601168 to your computer and use it in GitHub Desktop.
Save roundrobin/6601168 to your computer and use it in GitHub Desktop.
pattern
{"description":"pattern","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}},"tab":"edit","display_percent":0.5781249999999999,"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,"hidepanel":false,"fullscreen":false,"thumbnail":"http://i.imgur.com/BDoRGWY.png","ajax-caching":true}
var svg = d3.select("svg")
.append("g")
.attr("transform", "translate(200,200)")
var n = 7;
j=1;
var r = 107 + (j * 20);
for(var i = 0; i < n; i++){
var cx = r * Math.cos(2 * Math.PI * i / n);
var cy = r * Math.sin(2 * Math.PI * i / n);
svg.append("circle")
.attr({
r: 10,
cx: cx,
cy: cy,
fill: "#16AA63"
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment