Set beginning and end points to node coordinates

This is to ignore node bounding box which sometimes leads to
disconnected edges.
This commit is contained in:
David Kaltschmidt
2015-09-10 15:17:46 +02:00
parent 5f2e632319
commit 2c6c7f1995

View File

@@ -93,6 +93,9 @@ const doLayout = function(nodes, edges, width, height, scale, margins, topologyI
point.y += offsetY;
});
edge.points = graphEdge.points;
// set beginning and end points to node coordinates to ignore node bounding box
edge.points[0] = {x: edge.source.x, y: edge.source.y};
edge.points[edge.points.length - 1] = {x: edge.target.x, y: edge.target.y};
});
// return object with the width and height of layout