pivotick - v2.0.1
    Preparing search index...

    Interface Simulation

    interface Simulation {
        applyPhysicsPreset(name: PhysicsPresetName): void;
        changeLayout(
            type: LayoutType,
            simulationOptions?: DeepPartial<SimulationOptions.SimulationOptions>,
        ): Promise<void>;
        destroy(): void;
        disable(): void;
        disableAutoPhysics(): void;
        enable(): void;
        enableAutoPhysics(): void;
        enableAutoTreeSpacing(): void;
        getForceSimulation(): SimulationForces;
        getLayoutType(): LayoutType;
        getPhysicsKnobs(): PhysicsKnobs;
        getSimulation(): Simulation<Node, undefined>;
        getTreeRoot(): TreeRoot;
        getTreeSpacing(): TreeSpacing;
        isAutoPhysicsEnabled(): boolean;
        isAutoTreeSpacingEnabled(): boolean;
        isDragging(): boolean;
        isEnabled(): boolean;
        isFitViewOnExpandCollapse(): boolean;
        isFreezeNodesOnDrag(): boolean;
        isGridSnappingEnabled(): boolean;
        pause(): void;
        refreshForcesAndReheat(alpha?: number): void;
        reheat(alpha?: number): void;
        restart(): void;
        setCentering(knob: number): void;
        setCollisionRadius(knob: number): void;
        setFriction(knob: number): void;
        setLinkDistance(knob: number): void;
        setRepulsion(knob: number): void;
        setSettleTime(knob: number): void;
        setTreeRoot(
            root: { rootId: string } | { algorithm: TreeLayoutAlgorithm },
        ): void;
        setTreeSpacing(spacing: Partial<TreeSpacing>): void;
        snapToGrid(value: number): number;
        start(recomputeLayout?: boolean): Promise<void>;
        stop(): void;
        toggleFitViewOnExpandCollapse(): void;
        toggleFreezeNodesOnDrag(): void;
        toggleGridSnapping(): void;
        update(): void;
        waitForSimulationStop(): Promise<void>;
    }
    Index

    Methods

    • Apply a named preset (PHYSICS_PRESETS): sets every knob and reheats once, at CLICK_REHEAT_ALPHA rather than the slider default — a preset describes a whole layout, and reaching it from a settled graph takes a fresh layout's worth of travel.

      Parameters

      Returns void

    • Stop the engine and release the container observer.

      Returns void

    • Turn Auto off, leaving the knobs wherever they currently sit.

      Returns void

    • Turn Auto on and tune immediately. force because this is the Auto button: an answer inside the deadband would otherwise make the click do nothing visible.

      Returns void

    • Hand the tree spacing back to the tuner, which re-derives both multipliers from the node sizes and tree shape and keeps doing so as the graph changes. The counterpart of setTreeSpacing. No-op under the force layout, where Auto is enableAutoPhysics.

      Returns void

    • Where the active tree hangs from. Under the force layout there is no tree, so this reports the finder a tree would start with and no pin.

      Returns TreeRoot

    • Is the Auto preset currently driving the knobs?

      Returns boolean

    • Is the tree spacing tuning itself? false under the force layout.

      Returns boolean

    • Re-read the node-dependent force accessors and reheat. d3-force caches per-node radius/strength when a force is initialised, not per tick, so a radius mutated mid-run has no effect until the nodes are re-set. For a custom node that measures itself after the opening layout has 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

    • Pull toward the canvas centre. Knob 0–100 → d3GravityStrengthConnected, with d3GravityStrength (isolated nodes) following as a fixed multiple. Separate components only repel each other, so this is the only thing keeping them in frame.

      Parameters

      • knob: number

      Returns void

    • Node spacing. Knob 4–60 → d3CollideRadiusMultiplier (scales each node's collision radius).

      Parameters

      • knob: number

      Returns void

    • Motion damping. Knob 0–100 → d3VelocityDecay (÷100). Applied live each tick — no reheat.

      Parameters

      • knob: number

      Returns void

    • Preferred edge length. Knob 40–600 (px) → d3LinkDistance.

      Parameters

      • knob: number

      Returns void

    • Push-apart strength. Knob 0–100 → d3ManyBodyStrength.

      Parameters

      • knob: number

      Returns void

    • How long the layout is given to settle, in seconds. Knob 0.5–8 → d3AlphaDecay and cooldownTime together: alpha decay sets how fast the sim cools, cooldown is the wall-clock wall that stops it. Moving either alone does nothing — raise the cooldown and the sim is already cold; slow the decay and the wall truncates it.

      Parameters

      • knob: number

      Returns void

    • Re-hang the tree from another root: { rootId } pins it to that node, { algorithm } drops the pin and lets the finder choose. No-op under the force layout, which has no hierarchy to root.

      A pinned root is walked ignoring edge direction, so any node — a leaf included — gives a whole tree rather than a stump beside the old one. See TreeLayout.setRoot.

      Parameters

      Returns void

    • Re-lay-out the tree at new spacing multipliers (TREE_SPACING_RANGE). No-op under the force layout, where spacing is the physics knobs' job.

      A redraw and a reheat: the pinned axis moves immediately, so the change shows even with physics paused, while the free axis still settles into its new sibling slots.

      Parameters

      Returns void

    • Snap a graph-space coordinate to the grid when grid-snapping is enabled (a no-op otherwise). Public so non-simulation draggables (e.g. notes) can snap on the same grid as nodes.

      Parameters

      • value: number

      Returns number

    • 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>