From cf5c76e7925b55c6ff42e67801b9bd1f9c98c693 Mon Sep 17 00:00:00 2001 From: Blackwhitebear8 Date: Sun, 6 Jul 2025 16:59:56 +0200 Subject: [PATCH] Update static/js/pages/visual-route.js --- static/js/pages/visual-route.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/static/js/pages/visual-route.js b/static/js/pages/visual-route.js index ff4c151..e36d386 100644 --- a/static/js/pages/visual-route.js +++ b/static/js/pages/visual-route.js @@ -63,13 +63,26 @@ document.addEventListener('DOMContentLoaded', function() { }); function drawGraph(data) { + const pathCount = data.path_count || 1; + const container = document.getElementById('bgprtv-mynetwork'); + + const baseHeight = 400; + const heightPerLane = 120; + + const lanes = Math.ceil((pathCount - 1) / 2); + + const newHeight = baseHeight + (lanes * heightPerLane); + + container.style.height = `${Math.max(400, newHeight)}px`; + allNodes = new vis.DataSet(data.nodes); allEdges = new vis.DataSet(data.edges); const options = { layout: { hierarchical: false }, edges: { - arrows: { to: { enabled: true, scaleFactor: 0.7 } } + arrows: { to: { enabled: true, scaleFactor: 0.7 } }, + smooth: { enabled: true, type: "cubicBezier", forceDirection: "horizontal", roundness: 0.85 } }, nodes: { shape: 'box',