D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
leorawe
Full window
Github gist
Learning Circles
Built with
blockbuilder.org
<!DOCTYPE html> <head> <meta charset="utf-8"> <script src="https://d3js.org/d3.v4.min.js"></script> <style> body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } .container { width: 800px; margin: 0 auto; border: 1px solid #666666; padding: 50px 0; } .mine { width: 500px; height: 400px; background-color: #eee; margin: 0 auto; display: block; } </style> </head> <body> <div class="container"> <svg class="mine"></svg> </div> <script> // Feel free to change or delete any of the code you see in this editor! var svg = d3.select("svg"); //var w = svg.width; svg.append("text") .attr("y", 100) .attr("x", 50) .attr("font-size", 24) .attr("font-family", "Georgia") .style("opacity", 0) .text("Some text"); svg.append("circle") .attr("r", 50) .attr("cx", 250) .attr("cy", 200) .attr("fill", "#507799"); d3.selectAll("text").transition().delay(3000).style("opacity",1); d3.selectAll("circle").transition().duration(2000).attr("cy",300); d3.selectAll("circle").transition().duration(1000).attr("cy",100); </script> </body>
https://d3js.org/d3.v4.min.js