Skip to content

Commit

Permalink
Update graph.js
Browse files Browse the repository at this point in the history
  • Loading branch information
imaitland authored Feb 7, 2024
1 parent 75d30fa commit 85c1e17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ const Graph = ForceGraph()(document.getElementById("graph"))
if (lastClickedNode) {
console.log('Last clicked node:', lastClickedNode.id);
Graph.centerAt(lastClickedNode.x, lastClickedNode.y, 1000);
Graph.zoom(8, 2000);
Graph.zoom(6, 2000);
} else {
console.log("using root node");
const rootNode = graph_data.nodes.find((node)=>{return node.id === "about"})
Graph.centerAt(rootNode.x, rootNode.y, 1000);
Graph.zoom(8, 2000);
Graph.zoom(5, 2000);
}
});

Expand Down

0 comments on commit 85c1e17

Please sign in to comment.