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

enable zooming, panning and rotating separately for 3d graph #502

Open
toniuyt123 opened this issue Mar 14, 2024 · 3 comments
Open

enable zooming, panning and rotating separately for 3d graph #502

toniuyt123 opened this issue Mar 14, 2024 · 3 comments

Comments

@toniuyt123
Copy link

The 2d graph has the option to enable and disable zoom and pan separately but the 3d one does not. Could that also be added as a feature?

@vasturiano
Copy link
Owner

@toniuyt123 you can configure the trackball controls any way you wish, by accessing them via the .controls() method.

@rapo7
Copy link

rapo7 commented Aug 14, 2024

May I have an example please @vasturiano

@rapo7
Copy link

rapo7 commented Aug 14, 2024

Got the Example similar to CameraOrbit component that you have

const GraphnoZoom = () => {
      const fgRef = useRef();

      useEffect(() => {
        fgRef.current.controls().noZoom = true; // zoom is disabled here
      }, []);

      return <ForceGraph3D
        ref={fgRef}
        graphData={data}
        enableNodeDrag={false}
        enableNavigationControls={true} // this needs to be true
        showNavInfo={false}
      />;
    };

Thank you so much for the library

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