     @ctx.drawImage @paint, delta, 0
     super()
 
+  # Changes the number of buckets in response to an <code>option:buckets</code> event.
+  bucketsChanged: ->@redraw()
+
 # "Audio... Audio... Audio... Video Disco..." - Justice

    maxTotal = 0

    for layer in @data
      entry = layer.values[entryIndex]
      for bucket, count of entry.buckets
        bucketTotals[bucket] += count
      maxTotal += entry.max

    cubic: (value, max) -> Math.pow(value/max, 3)
    quartic: (value, max) -> Math.pow(value/max, 4)
    quintic: (value, max) -> Math.pow(value/max, 5)

  optionListeners =
    'option:buckets': 'bucketsChanged'
    'option:bucketRange': 'bucketRangeChanged'
    'option:opacity': 'opacityChanged'
    'option:bucketPadding': 'bucketPaddingChanged'
    'option:paintZeroValues': 'paintZeroValuesChanged'

  # Creates a new heatmap.
  # @param [Object] options Options for the heatmap.
