Add circles to the SVG

Add the following to the bottom of app.js:

var nodes = d3.select("#nodes")
    .selectAll("circle")
    .data(nodesData)
    .enter()
    .append("circle");

This will create a circle for each element in our nodesData array. Our Developer  tools should look as follows:

Get D3.js Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.