D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
aaizemberg
Full window
Github gist
4 círculos (lie factor = 1)
<!DOCTYPE html> <html> <head> <script src="https://d3js.org/d3.v3.min.js"></script> <meta charset="utf-8"> <title>4 circulos</title> </head> <body> <script> var h = 200, w = 500; var data = [10,25,50,100]; var svg = d3.select("body") .append("svg") .attr("width",w) .attr("height",h); var area = d3.scale.sqrt().domain([0, 100]).range([0, 50]); var px = d3.scale.linear().domain([0, data.length-1]).range([w/(data.length+1), w - (w/(data.length+1)) ]); svg.selectAll("circle").data(data).enter() .append("circle") .attr("cx", function(d,i) {return px(i);} ) .attr("cy", h / 2) // .attr("r", function(d) {return 6*Math.sqrt(d);}); .attr("r", area ); </script> </body> </html>
Modified
http://d3js.org/d3.v3.min.js
to a secure url
https://d3js.org/d3.v3.min.js