title: D3 quantize color scale not showing the right color distribution
body: <p>I'm trying to figure out how to get the right color palette given a dataset with the possibility of a wide range of values. (think github's contribution heat map) </p>
  
  <p>Note that the values are dynamic so I'm not sure I can use <code>d3.scale.threshold</code>. </p>
  
  <p>Quantize dataset:</p>
  
  <pre><code>var arr = [26,12,7,6,5,5,5,4,4,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0];
  </code></pre>
  
  <p>I'm using the following color scale, however, out of the 41 elements that should be colored, only the first four have a color, everything else is set as #eeeeee (grey).</p>
  
  <pre><code>    var color_scale = d3.scale.quantize()
          .domain([0, d3.max(arr)])
          .range(["#eeeeee","#edf8e9","#bae4b3","#74c476","#238b45"]);
  </code></pre>
  
  <p><strong>Quantize Output:</strong></p>
  
  <pre><code>color_scale(26): #238b45
  color_scale(12): #bae4b3
  color_scale(7) : #edf8e9
  color_scale(6) : #edf8e9
  color_scale(5) : #eeeeee
  color_scale(4) : #eeeeee
  color_scale(2) : #eeeeee
  color_scale(1) : #eeeeee
  color_scale(0) : #eeeeee
  </code></pre>
  
  <hr>
  
  <p>Update:</p>
  
  <p>It appears that using quantile, does not work as expected for the following set:</p>
  
  <p>Quantile dataset:</p>
  
  <pre><code>var arr = [26,12,7,6,5,5,5,4,4,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
  </code></pre>
  
  <p>Using the following color scale:</p>
  
  <pre><code>var color_scale = d3.scale.quantile()
      .domain(arr)
      .range(["#eeeeee","#edf8e9","#bae4b3","#74c476","#238b45"]);
  </code></pre>
  
  <p><strong>Quantile Output:</strong></p>
  
  <pre><code>color_scale(26): #238b45
  color_scale(12): #238b45
  color_scale(7) : #238b45
  color_scale(6) : #238b45
  color_scale(5) : #238b45
  color_scale(4) : #238b45
  color_scale(2) : #238b45
  color_scale(1) : #74c476
  color_scale(0) : #edf8e9
  </code></pre>
  
  <p>I expect all values > 0 have a color, all 0s be #eeeeee. </p>
  
  <p>Any ideas what am I doing wrong?</p>