   numBands = 4
   valueExtent = null
   timeExtent = null
+
+  # colors = ["#08519c","#3182bd","#6baed6","#bdd7e7",
+  #           "#bae4b3","#74c476","#31a354","#006d2c"]
 
   negativeColorRange = [d3.hcl(-139.23, 6.94, 94.62), d3.hcl(-60.84, 60.56, 10)]
   positiveColorRange = [d3.hcl(137.27, 12.24, 85.88), d3.hcl(147.32, 35.76, 10)]

    maxOrdMagn = Math.ceil(log10(max))
    m = numBands

    useLog10Bands = (useLog10BandSplitting  and  maxOrdMagn >= m)

    if useLog10Bands  

      # TODO: find min nonzero abs value in the data and uniformly 
      # split the interval between the min and max orders of magnitude 
      # (not always by 10, but possibly by 100 or 1000)

      # TODO: deal with situations when there is no large difference
      # between orders of magnitudes 
      # (maybe automatically switch to the linear scale?)

      #minOrdMagn = Math.ceil(log10(min))
      pow10 = (n) -> v = 1; v *= 10 for i in [1..n]; return v
      bands = (for i in [1..m]
        magn = maxOrdMagn + (i - m)
        start = (if i is 1 then 0 else pow10(magn - 1))


    (scale(i) for i in [1..numColors])

  pow10 = (n) ->
    v = 1
    if n > 0
      v *= 10 for i in [1..n]; return v
    else
      v /= 10 for i in [1..-n]; return v



  colors = []
