Part of the process of learning to do cool things with D3 is looking at examples on bl.ocks.org. This is great, as you have a living, forkable code base that you can modify into something specific to your use case, but part of what makes learning D3 difficult is that quite often, these rely on layouts, which are effectively algorithms that restructure data in a certain way. These can seem really opaque if you don't know how they work.
D3 v4 alert! Everything in this and the next chapters has changed significantly with D3 v4. Now more than ever, make sure that you pay attention to which version of D3 an example uses when looking at them online.
Over the course of the next two chapters, we'll be diving into layouts and building a ludicrous number of quick charts. First, we start with hierarchical layouts, which assumes a data structure with parent...