This is the code for Chapter 10, Figure 3 from D3.js in Action demonstrating the d3.layout.grid() layout created in this chapter as it adjusts in size with more data added.
Modified http://d3js.org/colorbrewer.v1.min.js to a secure url
https://d3js.org/colorbrewer.v1.min.js
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js