This is in answer to this google groups question. The aim was to create a colour scale that wasn't biased by underlying distribution of the data. To achieve this an ordinal scale was used in conjunction with a custom colour interpolation.
Modified http://d3js.org/d3.v3.min.js to a secure url
https://d3js.org/d3.v3.min.js