import { I as VisualGraph, f as Graph } from "../types-BAEQTwK_.mjs"; import { LayoutOptions } from "./index.mjs"; //#region src/layout/webcola.d.ts interface ColaLayoutOptions extends LayoutOptions { /** Target distance between linked nodes. Default: 80. */ linkDistance?: number; } /** * Constraint-based layout via WebCola (optional peer dependency). Runs the * solver to convergence synchronously (`keepRunning: false`) and returns a * positioned {@link VisualGraph}. * * - Overlap avoidance is always on: node rects (from `options.measure` → * node `width`/`height` → defaults) are kept disjoint. * - Deterministic: WebCola itself has no `Math.random` in its 2D solver * (its descent uses an internally seeded PRNG), so the seeded initial * scatter (`options.seed`) fully pins the result — same seed, same layout. * - `options.isFixed` pins positioned nodes at their current `x`/`y` (cola's * `fixed` flag). During overlap projection cola holds fixed nodes with a * large-but-finite weight, so pinning is within a small tolerance, not * exact. * - `options.direction ?? graph.direction` set → DAG-flow constraints via * cola's `flowLayout`: edges are separated along the axis ('down'/'up' → * `y`, 'left'/'right' → `x`) by at least `spacing.layer` (default 50). * Note: cola only separates source-before-target along the axis — 'up' and * 'left' flow the same way as 'down'/'right', not reversed. * - Hierarchy is ignored (flat layout); self-loops are skipped by the solver * but kept in the output graph. * * @example * ```ts * import { getColaLayout } from '@statelyai/graph/layout/webcola'; * * const laidOut = getColaLayout(graph, { seed: 42, direction: 'down' }); * ``` */ declare function getColaLayout(graph: Graph | VisualGraph, options?: ColaLayoutOptions): VisualGraph; //#endregion export { ColaLayoutOptions, getColaLayout };