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 9cee5e6 commit 943a734
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const Graph = ForceGraph()(document.getElementById("graph"))
})
//.d3Force('charge', null)
.onEngineStop(() => {
Graph.zoomToFit(200, 80);
//Graph.zoomToFit(200, 80);
// if mobile zoom to about...

// Center/zoom on node
Expand All @@ -116,6 +116,7 @@ const Graph = ForceGraph()(document.getElementById("graph"))
Graph.centerAt(lastClickedNode.x, lastClickedNode.y, 1000);
Graph.zoom(8, 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);
Expand Down

0 comments on commit 943a734

Please sign in to comment.