vasturiano / 3d-force-graph

3D force-directed graph component using ThreeJS/WebGL
https://vasturiano.github.io/3d-force-graph/example/large-graph/
MIT License
4.72k stars 828 forks source link

ngraph physics parameter configuration #332

Closed Zolmeister closed 4 years ago

Zolmeister commented 4 years ago

ngraph seems to handle large graphs more efficiently than d3 (e.g.).

However dealing with large graphs requires tuning the physics parameters (e.g. to reduce drag).

I'd like to be able to configure the ngraph parameters. e.g.

forcegraph.ngraphPhysics({
  springLength: 30,
  springCoeff: 0.0008,
  gravity: -1.2,
  theta: 0.8,
  dragCoeff: 0.02,
  timeStep: 20
})
vasturiano commented 4 years ago

Thanks @Zolmeister, it's a good suggestion. I've added the option to the api, it follows the exact syntax you mentioned above.