This video is available to students only

Creating our workspace

We create our wrapper and learn about d3 selection objects.

Creating our workspace#

Now we're set up and ready to start updating our webpage!

To add elements to our page, we'll need to specify an existing element that we want to append to.

Remember the #wrapper element already populated in index.html? One of d3's modules, d3-selection, has helper functions to select from and modify the DOM.

We can use , which accepts a CSS-selector-like string and returns the first matching DOM element (if any). If you're unfamiliar with CSS selector syntax, there are three main types of selectors:


This page is a preview of Fullstack D3 Masterclass

Please select a discussion on the left.