Created
March 23, 2015 08:33
-
-
Save trengrj/94f9bbf8c52dbec7872f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var w = 500, | |
var h = 300, | |
var svg = d3.select("svg") | |
.attr("width", w) | |
.attr("height", h) | |
.style("background-color", "#fefefe") | |
.style("display", "block"); | |
var circle = svg.selectAll("circle") | |
.data([19,30,18,20,22,29]); | |
circle.enter() | |
.append("circle") | |
.style("fill", "#cc2266"); | |
function move() { | |
circle.transition() | |
.duration(1780) | |
.attr("cx", function(d) { return Math.random() * (w - 100) + 50; }) | |
.attr("cy", function(d) { return Math.random() * (h - 100) + 50; }) | |
.attr("r", function(d) { return d + Math.random() * 30; }); | |
} | |
window.setInterval(move, 1800); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment