5. Data-Joins: Enter

Data-joins are the bread and butter of D3. If you take one thing away from this book, make it an understanding of how data-joins work and how to use them. Remember that D3 has no basic function for producing charts. Instead, it has data-joins. This chapter covers how to use data-joins to add elements to a webpage and then manipulate them with data.

What Are Data-Joins?

As the name suggests, data-joins involve joining data with something. That something is an element or a number of elements on a web page—<rect>’s, <circles>’s, <div>’s...all the usual suspects. More specifically, that something is a D3 selection of those elements.

Before we get into all of that, let’s take a few steps back. Forget about D3 for a second. Now, ...

Get Visual Storytelling with D3: An Introduction to Data Visualization in JavaScript™ now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.