     @w = params.w
     @h = params.h
     @svg = Snap(parent) || Snap(@w, @h)
+    @bbox = {
+      x: @svg.node.getBoundingClientRect().x
+      y: @svg.node.getBoundingClientRect().y
+    }
+
 
     @nodes = []
     @edges = []

      node.label
    )
    @nodes.push(n)

  addEdge: (edge)->
    src = this.fetchNode(edge.from)

    @svg = @map.svg.circle(@x, @y, @r)
    @label = new SvgNodes.Label(@map, @x + @r, @y + @r, @text)
    @svg.attr(@map.options.nodes)
    this.setDraggable(@map) if @map.options.nodes.draggable

  setDraggable: (map, draggable = true) =>
    return unless draggable
    node = this
    this.svg.drag (dx, dy, x, y, e)=>
      x = x - map.bbox.x
      y = y - map.bbox.y
      this.move(x,y)

  move: (x, y)=>
    @x = x
    @y = y
    this.attr
      cx: @x
      cy: @y
    this._moveEdges()
    this._moveLabel()

  _moveEdges: =>
    @map.edges.forEach (e)=>
      if e.src.id == @id
        e.svg.attr
          x1: @x
          y1: @y
      if e.dest.id == @id
        e.svg.attr
          x2: @x
          y2: @y
  _moveLabel: =>
    @label.svg.attr
      x: @x + @r
      y: @y + @r

  attr: (hash)->
    @svg.attr(hash)
