D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
jonsadka
Full window
Github gist
Playing with d3.timer()
Playing with d3.timer().
<!DOCTYPE html> <meta charset="utf-8"> <body> <script src="https://d3js.org/d3.v3.min.js"></script> <script> var width = window.innerWidth || 960, height = window.innerHeight || 500; var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height); d3.timer(function() { for (var i = 0; i < 2; i++) { svg.append("circle") .attr("cx", function(){ return Math.random()*width; }) .attr("cy", function(){ return Math.random()*height; }) .attr("r", 0) .transition() .attr("r", 3); } }); </script>
https://d3js.org/d3.v3.min.js