D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
nandakumar8
Full window
Github gist
D3 first examples
Built with
blockbuilder.org
<!DOCTYPE html> <head> <meta charset="utf-8"> <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script> <style> body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } svg { width:100%; height: 100% } </style> </head> <body> <script> // Feel free to change or delete any of the code you see! d3.select("body").append("div").attr("id","container") .append("svg") .attr("width" ,1000) .attr("height",5000) .style("background","white") .append("circle") .attr("cx",250) .attr("cy",250) .attr("r",100) .style("fill","grey"); d3.select("svg") .append("line") .attr("x1", 20) .attr("y1", 20) .attr("x2",400) .attr("y2",400) .style("stroke", "black") .style("stroke-width","2px"); d3.select("svg") .append("rect") .attr("width",250) .attr("height",250) .style("fill","red") .style("stroke","black"); d3.select("svg") .append("polygon") .attr("points","100,50, 200,150, 300,50") .style("fill","grey") .style("stroke","red"); d3.select("svg") .append("path") .attr("d","M 200,50 ,L 500,250,L 300,200 Z") .style("fill","blue") console.log("you are now rocking with d3", d3); </script> </body>
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js