From 7a9b3585e11593d7b7710a97148bb62e9e5dce1b Mon Sep 17 00:00:00 2001 From: Utsob Roy Date: Tue, 21 Mar 2023 15:11:59 +0600 Subject: [PATCH] global graph fix --- src/site/_includes/components/graphScript.njk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/site/_includes/components/graphScript.njk b/src/site/_includes/components/graphScript.njk index 29718e3..e97f805 100644 --- a/src/site/_includes/components/graphScript.njk +++ b/src/site/_includes/components/graphScript.njk @@ -166,9 +166,10 @@ window.fullGraph = null; function renderFullGraph() { if (!window.fullGraph) { + const hiddens = Object.values(window.graphData.nodes).filter((n) => n.hide).map((n) => n.id); const graphData = { - links: JSON.parse(JSON.stringify(window.graphData.links)), - nodes: [...Object.values(window.graphData.nodes)] + links: JSON.parse(JSON.stringify(window.graphData.links)).filter((l) => hiddens.indexOf(l.source) == -1 && hiddens.indexOf(l.target) == -1), + nodes: [...Object.values(window.graphData.nodes).filter((n) => !n.hide)] } let g = document.createElement('div');