diff options
author | Thomas F. K. Jorna <[email protected]> | 2021-07-29 17:40:32 +0200 |
---|---|---|
committer | Thomas F. K. Jorna <[email protected]> | 2021-07-29 17:40:32 +0200 |
commit | 0f4c025869cc5eaae38c270e8cd8b37457513eff (patch) | |
tree | 77f70e3ec748864dd31860a18d90ea302a437de8 /pages/index.tsx | |
parent | 5c4ff3d788b9f039aabcb7d7ad43d6ca478ff7e0 (diff) |
zooommm
Diffstat (limited to 'pages/index.tsx')
-rw-r--r-- | pages/index.tsx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pages/index.tsx b/pages/index.tsx index d1c9cf2..2b1ba62 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -132,7 +132,6 @@ export function GraphPage() { const graphRef = useRef<any>(null) useEffect(() => { - const fg = graphRef.current const socket = new ReconnectingWebSocket('ws://localhost:35903') socket.addEventListener('open', (event) => { console.log('Connection with Emacs established') @@ -157,6 +156,7 @@ export function GraphPage() { ...links.flatMap((link) => [link.source, link.target]), ].map((nodeId) => [nodeId, {}]), ) + const fg = graphRef.current fg.zoomToFit(2000, 200, (node: OrgRoamNode) => nodes[node.id!]) } case 'toggle': { |