pivotick - v1.2.0
    Preparing search index...

    Interface Simulation

    interface Simulation {
        changeLayout(
            type: LayoutType,
            simulationOptions?: DeepPartial<SimulationOptions.SimulationOptions>,
        ): Promise<void>;
        disable(): void;
        enable(): void;
        getForceSimulation(): SimulationForces;
        getSimulation(): Simulation<Node, undefined>;
        isDragging(): boolean;
        isEnabled(): boolean;
        isFreezeNodesOnDrag(): boolean;
        pause(): void;
        refreshForcesAndReheat(alpha?: number): void;
        reheat(alpha?: number): void;
        restart(): void;
        start(recomputeLayout?: boolean): Promise<void>;
        stop(): void;
        toggleFreezeNodesOnDrag(): void;
        toggleGridSnapping(): void;
        update(): void;
        waitForSimulationStop(): Promise<void>;
    }
    Index

    Methods

    • Re-read the node-dependent force accessors and reheat.

      d3-force caches per-node radius/strength when a force is initialised (i.e. when nodes are set), not on every tick — so mutating a node's radius after the sim is running has no effect until the forces are re-initialised. Re-setting the nodes does that; the reheat then lets collision/charge re-lay-out with the new sizes. Used when a custom node measures its size after the initial layout has already cooled. No-op when disabled.

      Parameters

      • alpha: number = 0.5

      Returns void

    • Restart the simulation with a bit of heat

      Parameters

      • alpha: number = 0.7

      Returns void

    • Restart the simulation with rendering on each animation frame.

      Returns void

    • Start the simulation with rendering on each animation frame.

      Parameters

      • recomputeLayout: boolean = true

      Returns Promise<void>

    • Manually stop the simulation and cancel animation frame.

      Returns void

    • Returns a promise that resolves when the simulation stops naturally. Useful for performing actions (like fitAndCenter) after stabilization.

      Returns Promise<void>