O'Reilly logo

Visual Storytelling with D3: An Introduction to Data Visualization in JavaScript™ by Ritchie S. King

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required