Created
September 1, 2024 22:37
-
-
Save colinfwren/c174d13f0651b0861a97639737e47c1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { useRef } = React | |
const Graph = () => { | |
const fgRef = useRef(); | |
return <ForceGraph2D | |
ref={fgRef} | |
graphData={data} | |
nodeCanvasObject={nodeCanvasObject} | |
nodePointerAreaPaint={nodePointerAreaPaint} | |
cooldownTicks={100} | |
onEngineStop={() => fgRef.current.zoomToFit(400)} | |
/> | |
} | |
ReactDOM.render( | |
<Graph />, | |
document.getElementById('graph') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment