       .style("fill-opacity", 1)
     
     # Transition exiting nodes to the parent's new position.
-    nodeExit = node.exit().transition().duration(duration).attr("transform", (d) ->
-      "translate(" + source.y + "," + source.x + ")"
-    ).remove()
+    nodeExit = node.exit()
+      .transition()
+      .duration(duration)
+      .attr("transform", (d) ->
+        "translate(" + source.rightPoint() + "," + source.x + ")"
+      )
+      .remove()
+
     nodeExit.select("circle").attr "r", 1e-6
     nodeExit.select("text").style "fill-opacity", 1e-6
     

    link.exit().transition().duration(duration).attr("d", (d) ->
      o =
        x: source.x
        y: source.y
  
      diagonal
        source: o

      .attr("d", (d) ->
        o =
          x: source.x0
          y: source.rightPoint()

        diagonal
          source: o
