This is the code for Chapter 10, Figure 5 from D3.js in Action showing how a layout like d3.layout.grid() can be used to create different graphical elements, in this case SVG rect elements instead of SVG circles as in earlier examples.