From 2c6c7f1995932035755a3052644e1ecd58cd6ca3 Mon Sep 17 00:00:00 2001 From: David Kaltschmidt Date: Thu, 10 Sep 2015 15:17:46 +0200 Subject: [PATCH] Set beginning and end points to node coordinates This is to ignore node bounding box which sometimes leads to disconnected edges. --- client/app/scripts/charts/nodes-layout.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/app/scripts/charts/nodes-layout.js b/client/app/scripts/charts/nodes-layout.js index 456b87dbf..5a6011789 100644 --- a/client/app/scripts/charts/nodes-layout.js +++ b/client/app/scripts/charts/nodes-layout.js @@ -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