 
     (scale(i) for i in [1..numColors])
 
-
-  # colors = ["#08519c","#3182bd","#6baed6","#bdd7e7",
-  #           "#bae4b3","#74c476","#31a354","#006d2c"]
-  # colors = 
-  #   colorsBetween("#e0f3f8","#313695", 6).reverse()  # negative
-  #   .concat(colorsBetween("#e5f5e0","#00441b", 6))   # positive
+  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 = []

  numBands = 4
  valueExtent = null
  timeExtent = null

  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)]

              return bands[i - 1]

          return bands[0]


    else


      parent.select("div.legend").selectAll("g.item").select("text")
        .text((d, i) ->
          domain = yscale.domain()

          v = if showNegativeLegend
            if i < m
              - (max / m) * (m - i)
            else if i == m
              0
            else
              (max / m) * (i - m)
          else
            if i > 0
              (max / m) * (i)
            else
              0

          valueFormat v
        )





    parent.selectAll("div.horizon").each (data) ->
