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.67k stars 825 forks source link

Default Settings for "charge" force not clear in documentation please help!! #660

Open gottliebtj opened 8 months ago

gottliebtj commented 8 months ago

The code below works as expected unless i change back to the Cloud Nebula layout the change force is still influced from the last change. i cant seem to find what the exact force is out of the box with the generic 3d force graph. please let me know thanks! Great npm package btw 👍

var simulation = graph.forceEngine("d3");
    if(graphLayout == "Cloud Nebula"){
      simulation.d3Force("collision", () => d3.forceCollide().radius(300));

    }else{
      simulation.d3Force("collision", () => d3.forceCollide().radius(300));
      simulation.d3Force("charge", d3.forceManyBody().strength(-30));
    }

also setting it to null just removes the existing force. Im looking for the exact one that is under the hood.