From f66f0c3f5c643249300ed50e02962200542bc80f Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Tue, 16 Jul 2019 04:45:12 +0000 Subject: [PATCH] Fix graph node label exclusion zone. --- LayoutNode.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/LayoutNode.js b/LayoutNode.js index a125d3c..ed15a40 100644 --- a/LayoutNode.js +++ b/LayoutNode.js @@ -44,8 +44,9 @@ class LayoutNode { // If so, preserve one space above the group let labeled = new Set(Array.from(this.groups).filter(g => !!g.label)); if (asymDifference(labeled, node.groups).size) { - this.addAffinity(node, (d, v) => - (v[0] == 0 && v[1] > 0 && v[1] < 2) ? -INF : 0); + this.addAffinity(node, + (d, v) => + (v[0] >= -1 && v[0] <= 1 && v[1] < 0 && v[1] >= -2) ? -INF : 0); } // Try to stack nodes with the same label