The layout uses a physics simulator driven by three forces: Spring force (Hooke's law), Repulsion (Coulomb's law), and Drag. You can customize the simulation behavior via a settings object passed to createLayout.
Available settings:
timeStep: Simulation time step.dimensions: Number of dimensions.gravity: Gravity strength.theta: Barnes-Hut parameter.springLength: Target distance for connected nodes.springCoefficient: Strength of the spring force.dragCoefficient: Strength of the drag force.
var physicsSettings = {
timeStep: 0.5,
dimensions: 2,
gravity: -12,
theta: 0.8,
springLength: 10,
springCoefficient: 0.8,
dragCoefficient: 0.9,
};
var layout = require('ngraph.forcelayout')(graph, physicsSettings);
// Access the read-only simulator instance
var simulator = layout.simulator;