     @zoom = d3.behavior.zoom().scaleExtent([.1,8]).on "zoom", @redraw
 
     # init visual
-    me = @
     @canvas = d3
       .select element
       .append "svg"

      @drawSelection()

  redraw : =>
  	if not @mousedown_node
		  @svg.attr "transform", "translate(" + d3.event.translate + ")" + "scale(" + d3.event.scale + ")"



# GRAPHEDIT PLUGIN DEFINITION
# ==========================

$.fn.graphEdit = ( option ) ->
	this.each ->
		$this = $(@)
		data = $this.data 'graphEdit'
		if !data then $this.data 'graphEdit', (data = new GraphEdit @, option)
		if typeof option is 'string' then data[option].call $this

$.fn.graphEdit.Constructor = GraphEdit


# GRAPHEDIT CLASS DEFINITION
# =========================
class GraphEdit
  constructor: ( element, options ) ->
    $el = $(element)

    me = @

    # config
    @width = 960
    @height = 500
    @colors = d3.scale.category10()
