 class BaseTool extends Ubret.Events
-  constructor: (selector) ->
+  constructor: (@selector) ->
     super
     @opts = new Object
-    @opts.selector = d3.select selector
-    @opts.height = @opts.selector[0][0].clientHeight
-    @opts.width = @opts.selector[0][0].clientWidth
     @opts.selectedKeys = new Array
     @opts.selectedIds = new Array
 

    
  selectIds: (ids=[]) =>
    if _.isArray ids
      @opts.selectedIds = ids
    else
      @opts.selectedIds.push ids
    @trigger 'selection', ids

  childData: =>
    @opts.data

  settings: (settings) =>
    for setting, value of settings
      if typeof @[setting] is 'function'
        @[setting](value)
      else
        @opts[setting] = value
      @trigger 'update-setting', @opts[setting]
    @

  # Helpers
