 
         # Transition links to their new position.
         link.transition()
-            .duration(duration)
-            .attr("d", diagonal)
+            .duration(NODE_TRANSITION_DURATION)
+            .attr("d", @diagonal)
 
         # Transition exiting nodes to the parent's new position.
         link.exit().transition()
-            .duration(duration)
-            .attr("d", (d)->
+            .duration(NODE_TRANSITION_DURATION)
+            .attr("d", (d)=>
               o = {
                 x: source.x,
                 y: source.y
               }
-              diagonal({
+              @diagonal({
                 source: o,
                 target: o
               })

        # Enter any new links at the parent's previous position.
        link.enter().insert("path", "g")
            .attr("class", "link")
            .attr("d", (d)->
              o = {
                x: source.x0,
                y: source.y0
              }
              diagonal({
                source: o,
                target: o
              })


        # Transition nodes to their new position.
        nodeUpdate = node.transition()
            .duration(NODE_TRANSITION_DURATION)
            .attr("transform", (d)->
                "translate(" + d.y + "," + d.x + ")"
            )
