import { GraphConfig } from '@cosmos.gl/graph'; export interface SimulationConfig { /** * Decay coefficient. Use bigger values if you want the simulation to "cool down" slower. * Default value: `5000` */ simulationDecay?: GraphConfig['simulationDecay']; /** * Gravity force coefficient. * Default value: `0.25` */ simulationGravity?: GraphConfig['simulationGravity']; /** * Centering to center mass force coefficient. * Default value: `0` */ simulationCenter?: GraphConfig['simulationCenter']; /** * Repulsion force coefficient. * Default value: `1.0` */ simulationRepulsion?: GraphConfig['simulationRepulsion']; /** * Decreases / increases the detalization of the Many-Body force calculations. * Default value: `1.15` */ simulationRepulsionTheta?: GraphConfig['simulationRepulsionTheta']; /** * Link spring force coefficient. * Default value: `1` */ simulationLinkSpring?: GraphConfig['simulationLinkSpring']; /** * Minimum link distance. * Default value: `10` */ simulationLinkDistance?: GraphConfig['simulationLinkDistance']; /** * Range of random link distance values. * Default value: `[1, 1.2]` */ simulationLinkDistRandomVariationRange?: GraphConfig['simulationLinkDistRandomVariationRange']; /** * Repulsion coefficient from mouse position. * The repulsion force is activated by pressing the right mouse button. * Default value: `2` */ simulationRepulsionFromMouse?: GraphConfig['simulationRepulsionFromMouse']; /** * Friction coefficient. * Default value: `0.85` */ simulationFriction?: GraphConfig['simulationFriction']; /** * Coefficient of simulation impulse from 0 to 1. If `undefined`, the graph will not apply a new impulse to the renders during adding or removing data items, but instead will use the current simulation impulse value from the graph. Has no impact if `enableSimulation` is `false`. * Default value: `undefined`. */ simulationImpulse?: number; } export interface SimulationEventConfig { /** Callback function that will be called when the simulation starts. */ onSimulationStart?: GraphConfig['onSimulationStart']; /** Callback function that will be called when the simulation stops. */ onSimulationEnd?: GraphConfig['onSimulationEnd']; /** Callback function that will be called when the simulation is paused. */ onSimulationPause?: GraphConfig['onSimulationPause']; /** Callback function that will be called when the simulation is unpaused. */ onSimulationUnpause?: GraphConfig['onSimulationUnpause']; /** Callback function that will be called on every tick of the simulation. */ onSimulationTick?: GraphConfig['onSimulationTick']; /** @deprecated Use `onSimulationUnpause` instead */ onSimulationRestart?: GraphConfig['onSimulationUnpause']; }