The problem is extracting the x and y points from the links. One way to do this:
Link Generator:
self.diagonal = d3.svg.line().interpolate('step') .x(function (d) { return dx; }) .y(function (d) { return dy; });
And then use the generator as follows:
link.enter().append('svg:path', 'g') .duration(self.duration) .attr('d', function (d) { return self.diagonal([{ y: d.source.x, x: d.source.y }, { y: d.target.x, x: d.target.y }]); });
source share