       @listenTo(@model, 'data_update', @plot_view.request_render)
 
   render: () ->
+    @map_data() ##unclear why calling this in init returns NaNs
 
-    @set_data(@mget('source'))
-
-    if @mget('render_mode') == 'css'
+    if @mget('render_mode') == 'canvas'
+      @_canvas_text()
+    else
       @_css_text()
-    else
-      @_canvas_text()
 
   _canvas_text: () ->
     ctx = @plot_view.canvas_view.ctx
-
-    x_offset = @mget('x_offset')
-    y_offset = @mget('y_offset')
-
-    [@sx, @sy] = @map_to_screen(_.map(@x, (x) -> x + x_offset),
-                                _.map(@y, (y) -> y + y_offset))
-
     for i in [0...@x.length]
       ctx.save()
       ctx.translate(@sx[i], @sy[i])

class LabelView extends Renderer.View
  initialize: (options) ->
    super(options)
    @$el.appendTo(@plot_view.$el.find('div.bk-canvas-overlays'))
    @$el.addClass('label')
    @$el.hide()

  bind_bokeh_events: () ->
    if @mget('render_mode') == 'css'

      ctx.restore()

  _css_text: () ->
    for i in [0...@text.length]
      if @label_div[i] == null
        @label_div[i] = $("<div>")
          .html(@text[i])
          .addClass('label')
          .css({
            'position': 'absolute'
            'top': "#{@sy[i] + @mget('y_offset')}px"
            'left': "#{@sx[i] + @mget('x_offset')}px"
            # 'background-color': 'rgba(255, 255, 255, 0)'
            'font-size': '9pt'
            'font-family': 'sans-serif'
            })

        overlays = @plot_view.$el.find('div.bk-canvas-events')
        @label_div[i].appendTo(overlays)

      else
        @label_div[i]
          .html(@text[i])
          .css({
            'position': 'absolute'
            'top': "#{@sy[i] + @mget('y_offset')}px"
            'left': "#{@sx[i] + @mget('x_offset')}px"
            # 'background-color': 'rgba(255, 255, 255, 0)'
            'font-size': '9pt'
            'font-family': 'sans-serif'
            })

class Label extends Annotation.Model
  default_view: LabelView

  type: 'LabelAnnotation'

  coords: [ ['x', 'y'] ]
  mixins: ['text']

  props: ->
    return _.extend {}, super(), {
      x_units:      [ p.SpatialUnits, 'data'            ]
      y_units:      [ p.SpatialUnits, 'data'            ]
      text:         [ p.StringSpec,   { field :"text" } ]
      angle:        [ p.AngleSpec,    0                 ]
