         me.mousedown_node = true
         me.scale = me.zoom.scale()
         me.translate = me.zoom.translate()
-        me.selectNode this
+        me.selectNode @
       .on "mouseup", () ->
         me.mousedown_node = false
         me.zoom.scale me.scale

      .nodes @node_data
      .start()

  restart : =>
    me = @
    @links = @links.data @link_data

      .on 'tick', @tick
      .start()

    #data for each element
    @node_data = []
    @link_data = []

    #D3 selector for each corresponding SVG element
    @nodes = @svg.selectAll ".node"
    @links = @svg.selectAll ".link"

    # add any provided nodes/edges on init
    if options
      if options.nodes
        for node in options.nodes
          @addNode node

      if options.edges
        for edge in options.edges
          @addEdge edge

    #enable deletion via delete/backspace key
    d3.select(window).on 'keydown', () ->
      if d3.event.keyCode in [46, 8]
        me.remove()

    @restart()
    @displayData()

  _constructor: GraphEdit

  #animation for force layout
  tick : =>
    @nodes.attr "cx", (d) -> d.x
    @nodes.attr "cy", (d) -> d.y
