   initialize : (options) ->
     if not _.has(options, 'id')
       this.id = _.uniqueId('BokehView')
-  tag_id : (tag) ->
-    tag + "-" + this.id
-  tag_el : (tag) ->
-    @$el.find("#" + this.tag_id(tag))
-  tag_d3 : (tag) ->
-    val = d3.select(this.el).select("#" + this.tag_id(tag))
+  tag_id : (tag, id) ->
+    if not id
+      id = this.id
+    tag + "-" + id
+  tag_el : (tag, id) ->
+    @$el.find("#" + this.tag_id(tag, id))
+  tag_d3 : (tag, id) ->
+    val = d3.select(this.el).select("#" + this.tag_id(tag, id))
     if val[0][0] == null
       return null
     else

    if  node == null
      node = d3.select(@el).append('svg')
        .attr('id', @tag_id('mainsvg'))
    node.attr('width', @mget('width')).attr("height", @mget('height'))

  render_mainbox : ->
    node = @tag_d3('mainbox')
    if node == null
      node = @tag_d3('mainsvg').append('rect').attr('id', @tag_id('mainbox'))
    node.attr('fill', @model.get('background-color'))
  		.attr('stroke', @model.get('foreground-color'))
      .attr('width', @mget('width')).attr("height", @mget('height'))

  render : ->
    @render_mainsvg();
    @render_mainbox();
    for own key, view of @renderers
      view.render()
    if not @model.get_ref('parent')

  map_screen : (data) ->
    return @scale(data)

class Renderer extends BokehView
  initialize : (options) ->
    this.plot_id = options['plot_id']
    super(options)

class ScatterRendererView extends Renderer
  render : ->
    plotcontent = @tag_d3('plotcontent', this.plot_id)
    plotcontent.append('g')
      .attr('id', @tag_id('g'))
      .selectAll(@model.get('mark'))
      .data(@model.get_ref('data_source').get('data'))
