Skip to content

Instantly share code, notes, and snippets.

@petabyte
Created June 11, 2013 08:20
Show Gist options
  • Save petabyte/5755248 to your computer and use it in GitHub Desktop.
Save petabyte/5755248 to your computer and use it in GitHub Desktop.
Circles
{"description":"Circles","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"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}
var svg = d3.select("svg");
var xc = function xCoord() {
return Math.random() * 206;
};
svg.append("circle")
.style("fill", "steelblue")
.attr("cy", 41)
.attr("cx", xc)
.attr("r", 30);
svg.append("circle")
.style("fill", "steelblue")
.attr("cy", 125)
.attr("cx", xc)
.attr("r", 30);
svg.append("circle")
.style("fill", "steelblue")
.attr("cy", 91)
.attr("cx", xc)
.attr("r", 30);
var circle = svg.selectAll("circle")
.data([32, 57, 112, 293]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment