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

    @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)->
    @_clickHandlers = []
    @_dragHandlers =  []
    @svg = @map.svg.circle(@x, @y, @r)
    @label = new SvgNodes.Label(@map, @x + @r, @y + @r, @text)
    @svg.attr(@map.options.nodes)
    this.setDraggable(@map) if @map.options.nodes.draggable

  setDraggable: (map, draggable = true) =>
    return unless draggable
    node = this
    this.svg.drag (dx, dy, x, y, e)=>
      x = x - map.bbox.x
      y = y - map.bbox.y
      this.move(x,y)

  move: (x, y)=>
    @x = x


    @nodes = []
    @edges = []
    @selection = []

    @handlers =
      "selection:change": []
      "selection:empty": []
      "click:map": []
      "click:node": []
      "drag:map:start": []
      "drag:map:move": []
      "drag:map:end": []
      "drag:node:start": []
      "drag:node:move": []
      "drag:node:end": []
      "zoom": []

    @options = params.options ||
      nodes:
        fill: 'white',
        stroke: 'black',
        strokeWidth: 1.5,
        fillOpacity: 1,
        draggable: true
      edges:
        stroke: 'black',
        strokeWidth: 1
    @interactive = true
    @transformations =
      zoom: 1
      x:    0
      y:    0
      dx:   0
      dy:   0

    this._setDefaultHandlers()
    this.enableInteractivity()

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