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 fc55e6d commit 6ab7371
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ const Graph = ForceGraph()(document.getElementById("graph"))
d.source.tag;
})
.onNodeClick((node) => {
// Center/zoom on node
Graph.centerAt(node.x, node.y, 1000);
Graph.zoom(8, 2000);
if (node.id == "day") {
document.getElementsByClassName("logo")[0].style.color = "black";

Expand Down Expand Up @@ -99,7 +102,6 @@ const Graph = ForceGraph()(document.getElementById("graph"))

// Center/zoom on node
const rootNode = graph_data.nodes.find((node)=>{return node.id === "about"})
console.log("R", rootNode);
Graph.centerAt(rootNode.x, rootNode.y, 1000);
Graph.zoom(8, 2000);
})
Expand Down

0 comments on commit 6ab7371

Please sign in to comment.