     @set_mapper()
     safebind(this, @model, 'change:data_range', @set_mapper)
     safebind(this, @mget_ref('data_range'), 'change', @request_render)
+
   set_mapper : () ->
     @mapper = new Bokeh.LinearMapper({},
       data_range : @mget_ref('data_range')

      @plot_view.viewstate.get('height'))
    while current_tick <= last_tick
      x_ticks.push(current_tick)
      text_width = can_ctx.measureText(current_tick.toString()).width
      x = @plot_view.viewstate.xpos(@mapper.map_screen(current_tick))
      txtpos = ( x - (text_width/2))
      if txtpos > last_tick_end
        can_ctx.fillText(
          current_tick.toString(), txtpos, 20)
        last_tick_end = (txtpos + text_width) + 10
      @plot_view.ctx.beginPath()
      @plot_view.ctx.moveTo(x, 0)

    @render_end()


class D3LinearDateAxisView extends D3LinearAxisView
  tick_label : (tick) ->
    start = @mget_ref('data_range').get('start')
    end = @mget_ref('data_range').get('end')
    one_day = 3600 * 24 *1000
    tick = new Date(tick)
    if (Math.abs(end - start))  > (one_day * 2)
      return tick.toLocaleDateString()
    else
      return tick.toLocaleTimeString()

class LineRendererView extends XYRendererView
  render : ->
