This is the code for Chapter 2, Figure 22 from D3.js in Action that nests data using d3.nest() and then represents the nested data as a bar chart by first computing the length of the nested data arrays and using that length to size the bars by.