zoomToFit on new graphData, not on Node repositioning (or other user interactions) #531
Unanswered
fordmaxson
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://github.com/vasturiano/react-force-graph/blob/master/example/fit-to-canvas/index.html
show the use of
return <ForceGraph2D
ref={fgRef}
graphData={data}
cooldownTicks={100}
onEngineStop={() => fgRef.current.zoomToFit(400)}
/>;
for zoomToFit. While that works perfectly when new graphData is provide to render a new graph, when the user drags a node to a new location, that also cause the entire graph to zoom back out. Is there a way to control zoomToFit for initial data load versus other graph manipulation? Thanks.
Beta Was this translation helpful? Give feedback.
All reactions