       .append "g"
 
     # init nodes
-    @node_data = ({id:a, reflexive:false} for a in [1..10])
-    @link_data = [{"source":1, "target":3, "value":4}, {"source":1, "target":5, "value":4}]
+    @node_data = ({id:a, reflexive:false} for a in [1..4])
+    @link_data = [{"source":1, "target":3, "value":4}, {"source":1, "target":3, "value":4}]
+    @force = d3.layout.force()
+      #.nodes @node_data
+      #.links @link_data
+      .size [@width, @height]
+      .linkDistance 150
+      .charge -500
+      .on 'tick', @tick
+      .start()
 
-    #force layout
-    @force = d3.layout.force()
-        .nodes @node_data
-        .links @link_data
-        .size [@width, @height]
-        .linkDistance 150
-        .charge -500
-        .on 'tick', @tick
-        .start()
+    @nodes = @svg.selectAll ".node"
+    @links = @svg.selectAll ".link"
 
-    # add links
-    @links = @svg.selectAll ".link"
-        .data @link_data
-        .enter()
-        .append "line"
-        .attr "class", "link"
-        .style "stroke", "#000"
-        .style "stroke-width", () -> 1
-
-    # add nodes
-    @nodes = @svg
-        .selectAll ".node"
-        .data @node_data
-        .enter()
-        .append "circle"
-        .attr "class", "node"
-        .attr "r", 5
-        .style "fill", (d) -> me.colors(d.id)
-        .call me.force.drag
-
-        .on "mousedown", (d) ->
-          me.mousedown_node = true
-          me.scale = me.zoom.scale()
-          me.translate = me.zoom.translate()
-          me.select this
-        .on "mouseup", (d) ->
-          me.mousedown_node = false
-          me.zoom.scale me.scale
-          me.zoom.translate me.translate
+    #@setNodes(@node_data)
+    #@setLinks([{"source":1, "target":3, "value":4}, {"source":1, "target":3, "value":4}])
+    @restart()
 
 
 
-	_constructor: GraphEdit
+  _constructor: GraphEdit
 
-	method : =>
-		alert "I am a method"
+  method : =>
+    alert "I am a method"
+    0
 
   #animation
-	tick : =>
+  tick : =>
     @nodes.attr "cx", (d) -> d.x
     @nodes.attr "cy", (d) -> d.y
 

# GRAPHEDIT CLASS DEFINITION
# =========================
class GraphEdit
	constructor: ( element, options ) ->
    $el = $(element)
    
	# config
    @width = 960
    @height = 500
    @colors = d3.scale.category10()

# ===================================

$ ->
  $('body').on 'click.graphEdit.data-api', '[data-pluginNameAction^=Action]', ( e ) ->
    $(e.target).graphEdit()
