Code Monkey home page Code Monkey logo

Comments (9)

vasturiano avatar vasturiano commented on May 18, 2024 1

@shikharka from v1.22.0 you can now specify a custom distance using cameraPosition. F.e:

myGraph.cameraPosition({ z: 1000 });

from 3d-force-graph.

vasturiano avatar vasturiano commented on May 18, 2024 1

@shaliniBITC you can access the various config of TrackballControls via the .controls() method.
So, for min/max distance:

myGraph.controls().maxDistance = 2000;

from 3d-force-graph.

vasturiano avatar vasturiano commented on May 18, 2024

@shikharka the initial zoom level is calculated based on the number of nodes in the system, in a cubic relationship.
For reference, this is where that logic is applied:
https://github.com/vasturiano/3d-force-graph/blob/master/src/3d-force-graph.js#L132

There is no way currently to specify zoom max/min boundaries programmatically from outside the component.

from 3d-force-graph.

shikharka avatar shikharka commented on May 18, 2024

It will be a good to have feature
I found 'e.camera.position.z=150*Math.cbrt(e.forceGraph.graphData().nodes.length) ' in the js. If 150 can be passed through a variable having default value 150 and will overridden by a value passed by ForceGraph3D function, it might work

from 3d-force-graph.

shikharka avatar shikharka commented on May 18, 2024

Thanks! will check

from 3d-force-graph.

Doni44 avatar Doni44 commented on May 18, 2024

Hello, and is ther any wat to tell the graph not to move? I mean, the first time it'is like the 3D grapgh flies away from my div...

from 3d-force-graph.

vasturiano avatar vasturiano commented on May 18, 2024

@Doni44 answered in #72.

from 3d-force-graph.

rdecapomaranca avatar rdecapomaranca commented on May 18, 2024

By exposing tbControls like you exposed camera and scene I was able to set the min and max zoom and also disable rotation which I needed to display a 2D graph. Could you maybe expose this, so that my code doesn't differ from the one on repository.

Thank you,
Nika

from 3d-force-graph.

shaliniBITC avatar shaliniBITC commented on May 18, 2024

By exposing tbControls like you exposed camera and scene I was able to set the min and max zoom and also disable rotation which I needed to display a 2D graph. Could you maybe expose this, so that my code doesn't differ from the one on repository.

Thank you,
Nika

Hi, can you please explain how you set min and max zoom.

from 3d-force-graph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.