D3 selectAll().enter()

I just watched this youtube vid https://www.youtube.com/watch?v=0CZ7-f9wXiM about d3 histograms. It is very well done and understandable.

The code executes as seen in the vid.

But At 4:29 min, we selectAll (.bars) line 31 then we use enter() and append (g) line 34 and (rect) line 36. We never used classed(.bars ) in the enter() section. How come the bars are still created and shown in the svg correctly ?

Here is a picture:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.