       des
     )
     @edges.push(e)
+    e
 
   fetchNode: (id)->
     @nodes.find (node)->
       node.id == id
 
+  clear: =>
+    @nodes.splice(0,@nodes.length)
+    @edges.splice(0,@edges.length)
+    @svg.clear()
+
 class SvgNodes.Responsible
   constructor: ->
-    @svg.click ->
-      for fn in @_clickHandlers
-        fn()
-    @svg.drag ->
-      for fn in @_dragHandlers
-        fn()
+  onClick: (fn, bubbling = true)=>
+    @_clickHandlers.push(fn)
+    self = this
+    @svg.click (e)->
+      fn() for fn in self._clickHandlers
+      e.stopPropagation() unless bubbling
 
-  onClick: (fn)->
-    @_clickHandlers.push(fn)
-
-  onDrag:  (fn)->
+  onDrag:  (fn, bubbling = true)=>
     @_dragHandlers.push(fn)
+    self = this
+    @svg.drag (e)->
+      fn() for fn in self._dragHandlers
+      e.stopPropagation() unless bubbling
 
 class SvgNodes.Node extends SvgNodes.Responsible
   constructor: (@map, @id, @x, @y, @r, @text, @style)->

        fill: 'white',
        stroke: 'black',
        strokeWidth: 1.5,
        fillOpacity: 1
      },
      edges: {
        stroke: 'black',

    @w = params.w
    @h = params.h
    @svg = Snap(parent) || Snap(@w, @h)
    @bbox = {
      x: @svg.node.getBoundingClientRect().x
      y: @svg.node.getBoundingClientRect().y
    }


    @nodes = []
    @edges = []
