         fill: 'white',
         stroke: 'black',
         strokeWidth: 1.5,
-        fillOpacity: 1
+        fillOpacity: 1,
+        draggable: true
       },
       edges: {
         stroke: 'black',

    @svg = @map.svg.circle(@x, @y, @r)
    @label = new SvgNodes.Label(@map, @x + @r, @y + @r, @text)
    @svg.attr(@map.options.nodes)
    this.onClick ->
      alert "Fancy click"

  attr: (hash)->
    @svg.attr(hash)

      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: ->
  onClick: (fn, bubbling = true)=>
    @_clickHandlers.push(fn)
    self = this
    @svg.click (e)->
      fn() for fn in self._clickHandlers
      e.stopPropagation() unless bubbling

  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)->
