This is the code for Chapter 3, Figure 17 from D3.js in Action demonstrating the colorbrewer.js color scales paired with d3.scale.quantize() for discrete categories of quantitative data.