import { I as VisualGraph, f as Graph } from "../types-BAEQTwK_.mjs"; import { LayoutFrame, LayoutOptions } from "./index.mjs"; //#region src/layout/d3-force.d.ts interface ForceLayoutOptions extends LayoutOptions { /** Target distance between linked nodes. Default: 80. */ linkDistance?: number; /** Many-body charge strength (negative repels). Default: -300. */ chargeStrength?: number; /** Number of simulation ticks. Default: 300 (d3's natural cooling span). */ iterations?: number; } /** * Iterative force-directed layout via d3-force (optional peer dependency). * Each `next()` advances one simulation tick and yields a {@link LayoutFrame} * (top-left node positions by id + remaining `alpha`); the caller owns pacing * (e.g. one tick per animation frame via {@link applyLayoutFrame}) and * cancellation (stop iterating). The generator's return value is the settled * {@link VisualGraph}. * * - Deterministic: `options.seed` drives d3's `randomSource`; the same seed * always produces the same layout. * - `options.isFixed` pins nodes at their current position (d3 `fx`/`fy`). * - Hierarchy is ignored (force layouts are flat); per-edge `mode` is * irrelevant (forces are symmetric). * * @example * ```ts * import { genForceLayout } from '@statelyai/graph/layout/d3-force'; * import { applyLayoutFrame } from '@statelyai/graph/layout'; * * for (const frame of genForceLayout(graph, { seed: 42 })) { * applyLayoutFrame(graph, frame); * render(graph); * } * ``` */ declare function genForceLayout(graph: Graph | VisualGraph, options?: ForceLayoutOptions): Generator; /** * Run {@link genForceLayout} to completion and return the settled * {@link VisualGraph}. Convenience for non-animated use. * * @example * ```ts * import { getForceLayout } from '@statelyai/graph/layout/d3-force'; * * const laidOut = getForceLayout(graph, { seed: 42 }); * ``` */ declare function getForceLayout(graph: Graph | VisualGraph, options?: ForceLayoutOptions): VisualGraph; //#endregion export { ForceLayoutOptions, genForceLayout, getForceLayout };