 
     matrix = svgElement.getCTM().multiply(transformationMatrix)
     matrixString = "#{matrix.a} #{matrix.b} #{matrix.c} #{matrix.d} #{matrix.e} #{matrix.f}"
-    $svg.attr("transform", "matrix(#{matrixString})")
+    $el.attr("transform", "matrix(#{matrixString})")
     @oldZoomLevel = zoomLevel


  panZoom : (position, zoomLevel) ->

    svgElement = $svg[0]
    
    if position

      mouse =
        x: position[0] - $svg.offset().left
        y: position[1] - $svg.offset().top

    else

      mouse =
        x: $svg.width() / 2
        y: $svg.height() / 2

    scale = zoomLevel / @oldZoomLevel


    p.x = mouse.x
    p.y = mouse.y

    p.matrixTransform(svgElement.getCTM().inverse())

    transformationMatrix = svgElement.createSVGMatrix()
      .translate(p.x, p.y)
