From 28e5dbbcf542011ab00989d82ff3ff9dcf3c5c0d Mon Sep 17 00:00:00 2001 From: Tim Lorsbach Date: Thu, 9 Jul 2026 20:30:27 +0200 Subject: [PATCH] Unconnected Nodes --- static/js/pw.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/static/js/pw.js b/static/js/pw.js index 2bfc2c79..b0610b87 100644 --- a/static/js/pw.js +++ b/static/js/pw.js @@ -67,6 +67,9 @@ function draw(pathway, elem) { const horizontalSpacing = 75; // horizontal space between nodes const depthMap = new Map(); + // Avoid leaving unconnected Nodes leaving the viewport + nodes.forEach(node => {if (node.depth < 0) node.depth = 0;}); + // Sort nodes by depth first to minimize crossings const sortedNodes = [...nodes].sort((a, b) => a.depth - b.depth);