From 4112f3713e24a64552a3ddd658b4ec30bd367c04 Mon Sep 17 00:00:00 2001 From: iain maitland Date: Wed, 7 Feb 2024 10:09:03 -0500 Subject: [PATCH] Update graph.js --- js/graph.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/graph.js b/js/graph.js index e7f27f9..c777656 100644 --- a/js/graph.js +++ b/js/graph.js @@ -95,6 +95,12 @@ const Graph = ForceGraph()(document.getElementById("graph")) //.d3Force('charge', null) .onEngineStop(() => { Graph.zoomToFit(200, 80); + // if mobile zoom to about... + + // Center/zoom on node + const rootNode = graph_data.nodes.find((node)=>{node.id === "about"}) + Graph.centerAt(rootNode.x, rootNode.y, 1000); + Graph.zoom(8, 2000); }) // Contain nodes to a box.