Skip to content

Instantly share code, notes, and snippets.

@jonsadka jonsadka/.block
Last active Sep 18, 2016

What would you like to do?
Playing with d3.timer()
license: mit

Playing with d3.timer().

<!DOCTYPE html>
<meta charset="utf-8">
<script src=""></script>
var width = window.innerWidth || 960,
height = window.innerHeight || 500;
var svg ="body").append("svg")
.attr("width", width)
.attr("height", height);
d3.timer(function() {
for (var i = 0; i < 2; i++) {
.attr("cx", function(){
return Math.random()*width;
.attr("cy", function(){
return Math.random()*height;
.attr("r", 0)
.attr("r", 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.