 
       return ticks_in_range
 
-  HUNDRED_MILLIS = 100.0
+  ONE_MILLI = 1.0
   ONE_SECOND = 1000.0
   ONE_MINUTE = 60.0 * ONE_SECOND
   ONE_HOUR = 60 * ONE_MINUTE

      ideal_mantissa = ideal_interval / ideal_magnitude

      # An untested optimization.
#       index = _.sortedIndex(@allowed_mantissas, ideal_mantissa)
#       candidate_mantissas = @allowed_mantissas[index..index + 1]
      candidate_mantissas = @allowed_mantissas

      errors = candidate_mantissas.map((mantissa) ->
        Math.abs(desired_n_ticks -

    constructor: () ->
      super([
        # Sub-second.
        new AdaptiveScale([1, 2, 5], 10, 0, 500 * ONE_MILLI),

        # Seconds, minutes.
        new AdaptiveScale([1, 2, 5, 10, 15, 20, 30], 60,
                          ONE_SECOND, 30 * ONE_MINUTE),

        # Hours.
        new AdaptiveScale([1, 2, 4, 6, 8, 12], 24.0, ONE_HOUR, 12 * ONE_HOUR),

        # Days.
        new DaysScale(arange(1, 32)),
        new DaysScale(arange(1, 31, 3)),
        new DaysScale([1, 8, 15, 22]),
        new DaysScale([1, 15]),

        # Months.
        new MonthsScale(arange(0, 12)),
        new MonthsScale(arange(0, 12, 2)),
        new MonthsScale(arange(0, 12, 4)),
        new MonthsScale(arange(0, 12, 6)),

        # Catchall for large timescales.
        new AdaptiveScale([1, 2, 5], 10, ONE_YEAR, Infinity),
      ])

  class BasicTickFormatter
