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.
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js
https://d3js.org/colorbrewer.v1.min.js