Joins, Drill 1

Write the function createCircles to complete the following snippet and insert three circles into the svg element #svg, each bound to one of the elements in data, in order:

<body>
  <svg id="svg">
  </svg>
  <script>
    data = [{ v1: 10, v2: 20 }, { v1: 30, v2: 20 }, { v1: 40, v2: 30 }];
    selection = d3.select("#svg");
    createCircles(selection, data); // write this function
  </script>
</body>

Try it

Editor
SVG Output
Messages

  
DOM