Setting up the SVG

The next code block is pretty standard. Add the following code to the bottom of app.js:

d3.select('svg')
    .attr('width', WIDTH)
    .attr('height', HEIGHT);

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.