Skip to content

Instantly share code, notes, and snippets.

@boydgreenfield
Created November 18, 2012 01:44
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 boydgreenfield/4102694 to your computer and use it in GitHub Desktop.
Save boydgreenfield/4102694 to your computer and use it in GitHub Desktop.
Another Inlet
{"description":"Another Inlet","endpoint":"","display":"svg","public":true,"require":[],"tab":"edit","display_percent":0.7,"play":true,"loop":true,"restart":true,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"editor_editor":{"coffee":false,"vim":false,"emacs":false,"width":600,"height":300,"hide":false}}
var data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
var circlesize = 6;
var circlecontrol = 9;
var circlefill = "#14297C";
var circleopacity = 1.0;
var circlestroke = "#FFFFFF";
var circlestrokewidth = 1.0;
var circley = 10;
var circlex = 10;
var yoffset = 250;
var xoffset = 250;
var svg = d3.select("svg");
var circle = svg.selectAll("dots")
.data(data)
.enter()
.append("svg:circle")
.attr("cx", function(d, i) {
return Math.cos(i/12 * 2 * Math.PI)*circlesize*circlecontrol + xoffset;
})
.attr("cy", function(d, i) {
return Math.sin(i/12 * 2 * Math.PI)*circlesize*circlecontrol + yoffset;
})
.attr("r", circlesize)
.style("fill", circlefill)
.style("opacity", function(d, i) {
return (i/12 * 0.7 + 0.3);
})
.style("stroke", circlestroke)
.style("stroke-width", circlestrokewidth);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment