     @selected_edges = []
     @mousedown_node = false
 
-    @zoom = d3.behavior.zoom().scaleExtent([.1,8]).on "zoom", @redraw
+    #data for each element
+    @node_data = []
+    @link_data = []
+
+    # 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.removeSelection()
+
+    @restart()
+    @displayData()
+
+  _constructor: GraphEdit
+
+  resize : (initial) =>
+    @GRAPH.html ""
+    console.log "resize canvas"
+    console.log @GRAPH.innerWidth()
+    @width = @GRAPH.innerWidth()
+    @height = 500
 
     # init visual
     @canvas = d3
       .select @GRAPH.get(0)
       .append "svg"
-      .on "click", () ->
+      .on "click", () =>
         if not ( d3.event.target.classList.contains("node") or \
                 d3.event.target.classList.contains("link"))
-          me.clearSelection()
+          @clearSelection()
 
     @svg = @canvas
       .attr "width", @width

  # renders and changes to data
  restart : =>
    me = @
    @links = @links.data @link_data

    # update existing links

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

    if not initial
      @restart()

  #animation for force layout
  tick : =>
