 
     @renderToolbar()
 
+    @zoom = d3.behavior.zoom().scaleExtent([.1,8]).on "zoom", @redraw
+
+    @resize true
+    $(window).resize () =>
+      @resize()
+
     # config
-    @width = @GRAPH.innerWidth()
-    @height = 500
     @colors = d3.scale.category10()
 
     # state vars

    @selected_edges = []
    @mousedown_node = false

    @zoom = d3.behavior.zoom().scaleExtent([.1,8]).on "zoom", @redraw

    # init visual
    @canvas = d3
      .select @GRAPH.get(0)
      .append "svg"
      .on "click", () ->
        if not ( d3.event.target.classList.contains("node") or \
                d3.event.target.classList.contains("link"))
          me.clearSelection()

    @svg = @canvas
      .attr "width", @width

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

    if not initial
      @restart()

  #animation for force layout
  tick : =>
