D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
aaizemberg
Full window
Github gist
Dibujando 30.000 círculos con <canvas>
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>30.000 cĂrculos</title> </head> <body> <canvas id="myCanvas" width="960" height="500" style="border:1px solid #000;"></canvas> <script> function rc() { return (Math.random() * 256); } var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); for (i = 0; i < 30000; i++) { ctx.beginPath(); ctx.arc(c.width * Math.random(), c.height * Math.random(), 10 * Math.random(), 0, 2 * Math.PI); ctx.fillStyle = 'rgba('+rc()+', '+rc()+', '+rc()+', 0.5)'; ctx.fill(); } </script> </body> </html>