g3-toolkit API Reference
    Preparing search index...

    Interface StructuralLayoutOptions

    interface StructuralLayoutOptions {
        crossingMinimization?: "LAYER_SWEEP" | "INTERACTIVE";
        direction?: "RIGHT" | "LEFT" | "DOWN" | "UP";
        edgeEdgeSpacing?: number;
        edgeNodeSpacing?: number;
        edgeRouting?: "ORTHOGONAL" | "POLYLINE" | "SPLINES";
        hPadding?: number;
        layering?: "network-simplex" | "coffman-graham" | "tight-tree";
        layeringBudgetMs?: number;
        layerSpacing?: number;
        layerWidth?: number;
        maxSweeps?: number;
        measure?: TextMeasure;
        nodePlacement?:
            | "BRANDES_KOEPF"
            | "NETWORK_SIMPLEX"
            | "LINEAR_SEGMENTS"
            | "SIMPLE";
        nodeSpacing?: number;
        orderingBudgetMs?: number;
        placement?: "brandes-koepf"
        | "median";
        routeEdges?: boolean;
        routingBudgetMs?: number;
        sketch?: Readonly<
            Record<
                string,
                { height?: number; width?: number; x: number; y: number },
            >,
        >;
        spacing?: number;
        vPadding?: number;
    }

    Hierarchy

    • G3tLayoutOptions
      • StructuralLayoutOptions
    Index

    Properties

    crossingMinimization?: "LAYER_SWEEP" | "INTERACTIVE"

    Crossing-minimization strategy. Default "LAYER_SWEEP". Superseded by INTERACTIVE for a run that carries a sketch.

    direction?: "RIGHT" | "LEFT" | "DOWN" | "UP"

    Direction of the top-level layered layout. Default "RIGHT".

    edgeEdgeSpacing?: number

    Preferred minimum gap between two parallel edge segments, mapped to ELK's edgeEdge and edgeEdgeBetweenLayers spacing. Raise it when edges that fan from one side to vertically-aligned targets bunch up or superimpose after their orthogonal bends. Default 24.

    edgeNodeSpacing?: number

    Preferred minimum gap between an edge segment and a node side (yFiles: minimum distance to node sides). Default 16. Keeps edges off the block borders for legibility.

    edgeRouting?: "ORTHOGONAL" | "POLYLINE" | "SPLINES"

    ELK edge routing style for the top-level graph. "ORTHOGONAL" (default) routes in horizontal/vertical segments; "POLYLINE" allows diagonals; "SPLINES" curves. ELK computes the actual routes regardless; whether the geometry carries them is controlled by routeEdges.

    hPadding?: number

    Horizontal padding inside rows and around headers (default 8).

    layering?: "network-simplex" | "coffman-graham" | "tight-tree"

    Layering strategy (LAY-002). Default "network-simplex".

    layeringBudgetMs?: number

    Network-simplex time budget in ms (anytime: ranks stay feasible between pivots, so expiry returns the best-so-far layering). Default 120.

    layerSpacing?: number

    Spacing between adjacent layers (the cross-flow gap that carries most inter-block edges). Default spacing + 20. Widen for denser edge sets.

    layerWidth?: number

    Layer width bound for coffman-graham (node count). Default 8.

    maxSweeps?: number

    Maximum barycenter+transpose sweep pairs. Default 8.

    measure?: TextMeasure

    Text measurement; defaults to the deterministic estimator.

    nodePlacement?:
        | "BRANDES_KOEPF"
        | "NETWORK_SIMPLEX"
        | "LINEAR_SEGMENTS"
        | "SIMPLE"

    ELK node-placement strategy. "BRANDES_KOEPF" (default) favors straight through-edges; "NETWORK_SIMPLEX" is more compact; "LINEAR_SEGMENTS"/"SIMPLE" are cheaper.

    nodeSpacing?: number

    Gap between nodes within a layer. Default 24.

    orderingBudgetMs?: number

    Crossing-minimization time budget in ms. Default 60.

    placement?: "brandes-koepf" | "median"

    Placement strategy (LAY-004). Default "brandes-koepf".

    routeEdges?: boolean

    Emit ELK's computed edge routes (node-avoiding polylines) into the geometry as edges. Default true. A renderer that follows them does not draw an edge behind a block. Set false to omit the routes and let the renderer fall back to endpoint-only routing (e.g. Cytoscape taxi).

    routingBudgetMs?: number

    Scene-routing escalation budget in ms (default 80): gap routes that intersect a box escalate to the grid router until the budget is spent; the simple route stands after (best-so-far).

    sketch?: Readonly<
        Record<
            string,
            { height?: number; width?: number; x: number; y: number },
        >,
    >

    Prior TOP-LEVEL positions: a layout sketch (G3L:LAY-017; the ruled 12.20 experiment graduated). When present and non-empty, the run switches ELK layered's cycle-breaking, layering, and crossing-minimization strategies to INTERACTIVE and seeds each hinted top-level node with its prior absolute top-left, so a local change (e.g. one compartment collapse) re-lays out WITHOUT materially moving untouched containers (accept criterion G3L:LAY-018: less than one grid unit). Ids without a hint lay out normally; hints for absent ids are ignored. Positions are hints, not pins: ELK still resolves overlaps and spacing.

    width/height are the node's PRIOR extents. When a hinted node shrinks along the flow axis (e.g. its compartment collapsed), the layout reserves the difference as a trailing margin so its layer keeps its prior extent and downstream layers do not slide toward it: the collapsed box shrinks IN PLACE and the freed space reads as whitespace (the ruled A2 tradeoff, accepted for sketch mode).

    spacing?: number

    Spacing between top-level elements (default 60).

    vPadding?: number

    Row height padding above/below measured text (default 5 each side).