From 24d7bdce5bf6cddfe5fdb906980743e836f3f24a Mon Sep 17 00:00:00 2001 From: Utsob Roy Date: Wed, 1 Feb 2023 15:05:39 +0600 Subject: [PATCH] local graph zoom fix --- src/site/_includes/components/graphScript.njk | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/site/_includes/components/graphScript.njk b/src/site/_includes/components/graphScript.njk index 166b34b..ed0610d 100644 --- a/src/site/_includes/components/graphScript.njk +++ b/src/site/_includes/components/graphScript.njk @@ -93,9 +93,11 @@ .onNodeClick(node => { window.location = node.url; }); - setTimeout(() => { - Graph.zoomToFit(5, 75); - }, delay); + if (delay != null) { + setTimeout(() => { + Graph.zoomToFit(5, 75); + }, delay); + } return Graph; } @@ -117,7 +119,7 @@ Graph._destructor(); Graph = null; } - renderGraph(filterToDepth(JSON.parse(JSON.stringify(window.graphData))), "link-graph", 330, 330, 1); + renderGraph(filterToDepth(JSON.parse(JSON.stringify(window.graphData))), "link-graph", 330, 330, null); }) window.fullGraph = null;