Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to zoom in and out properly when entering and exiting full screen mode? #535

Open
wadeewang opened this issue Sep 11, 2024 · 2 comments

Comments

@wadeewang
Copy link

wadeewang commented Sep 11, 2024

Why can't zoomTofit api be used in react-force-grapg-2d?

@vasturiano
Copy link
Owner

@vasturiano thanks for reaching out.

zoomToFit is a component method for react-force-graph-2d. In fact, you can see it working in this example:
https://github.com/vasturiano/react-force-graph/blob/master/example/fit-to-canvas/index.html

If you're having some trouble getting it to work, please provide a simple example on https://codesandbox.io/.

@hyeonbeomsong
Copy link

@W-HanYu For zoomToFit() methods, <ForceGraphref={graphRef}/>

This will occur when a graph instance, graphRef.current, exists.
In the case of react, it seems that it will be available after useEffect or onEngineStop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants