From the course: D3.js Essential Training for Data Scientists

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Advancing selections

Advancing selections - D3.js Tutorial

From the course: D3.js Essential Training for Data Scientists

Start my 1-month free trial

Advancing selections

- [Instructor] In the last section, we saw that a data point bound to a parent element could still be accessed by a child element. This is really important in D3, and in this section we're going to expand on it. You already know that D3 allows us to bind data with elements, and that this link stays in place unless you remove it or overwrite it. But what I haven't mentioned yet is that D3 automatically matches lower level data to lower level elements. In this section, I'm going to demonstrate this using code I have prepared earlier, and that's this select.js. You can follow along creating the same files if you like or you can put your pen and keyboard away because the purpose of this section is to get a concept across to you rather than to teach you a new tool. So in order for you to see the finished article, I need to just add some style decorations into the CSS. So I'm gonna say that my rectangle should lightblue, and I should have a nice border of cornflowerblue, and I've got some…

Contents