     @edges.push(e)
     e
 
+  addEventListener: (eventName, handler) =>
+    throw Error "Unexpected event type #{eventName}" unless @handlers[eventName]?
+    @handlers[eventName].push(handler)
+
   fetchNode: (id)->
     @nodes.find (node)->
       node.id == id


    @nodes = []
    @edges = []

    @options = params.options || {
      nodes: {
        fill: 'white',
        stroke: 'black',
        strokeWidth: 1.5,
        fillOpacity: 1,
        draggable: true
      },
      edges: {
        stroke: 'black',
        strokeWidth: 1
      }
    }

  addNode: (node)->
    n = new SvgNodes.Node(

      cy: @y
    this._moveEdges()
    this._moveLabel()

  highlight: =>
    @highlighted = true
    @svg.transform(Snap.matrix().scale(1.1, 1.1, @x, @y))
    @label.attr(fontWeight: 'bold')

  dim: =>
    @highlighted = false
    @svg.transform(Snap.matrix())
    @label.attr(fontWeight: 'normal')

  _moveEdges: =>
    @map.edges.forEach (e)=>
