   createD3Elements: ->
     @tree = d3.layout.tree().size([@width, @height-20])
                             .nodeSize([100, 70])
+    @diagonal = d3.svg.diagonal().projection((d) =>
+      [ d.x, @height - d.y ]
+    )
 
   setZoom: ->
     @zoom = d3.behavior.zoom().scaleExtent([0.0001,3])

              .append("svg")
              .attr("width", @width)
              .attr("height", @height)
              .attr('viewBox',"0 0 #{@width} #{@height}")
              .attr('preserveAspectRatio', 'xMidYMid')
              .style("overflow", "scroll")
              .append('g')
              .attr("class","drawarea")
              .attr('transform', 'translate(0,10)')
    d3.select('svg').call @zoom



  width: null
  height: null
  zoom: null
  diagonal: null

  constructor: (@selector) ->
    @$node = $(@selector)
