block by zeffii b602b35c682ec69b9025

stage fright 2

Full Screen

Built with blockbuilder.org

forked from zeffii‘s block: stage fright

index.html

<!DOCTYPE html>
<head>
  <meta charset="utf-8">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
  <script src="//coffeescript.org/extras/coffee-script.js"></script>
  <script type="text/coffeescript" src='frump.coffee'></script>
  <style>
    svg { height:300; width: 600}
  </style>
</head>

<body>
  <svg></svg>
</body>

frump.coffee

svg = d3.select("svg")

circle = svg.selectAll("circle")
    .data([32, 57, 93], (d) -> d )

circle.enter().append("circle")
    .attr("cy", 60)
    .attr("cx", (d, i) -> (i * 10 + 30) )
    .attr("r", (d) -> Math.sqrt(d) )

circle.exit().remove()