Interface CoordQuad<Ops>

a Coord that places nodes to minimize a quadratic function

This operators generally takes the longest of all built-in operators but produces a pleasing layout.

Create with coordQuad.

interface CoordQuad<Ops extends CoordQuadOps> {
    compress(val: number): CoordQuad<Ops>;
    compress(): number;
    linkCurve<NewLinkCurve extends LinkWeight<never, never>>(
        val: NewLinkCurve,
    ): CoordQuad<U<Ops, "linkCurve", NewLinkCurve>>;
    linkCurve(): Ops["linkCurve"];
    nodeCurve<NewNodeCurve extends NodeWeight<never, never>>(
        val: NewNodeCurve,
    ): CoordQuad<U<Ops, "nodeCurve", NewNodeCurve>>;
    nodeCurve(): Ops["nodeCurve"];
    vertStrong<NewVertStrong extends LinkWeight<never, never>>(
        val: NewVertStrong,
    ): CoordQuad<U<Ops, "vertStrong", NewVertStrong>>;
    vertStrong(): Ops["vertStrong"];
    vertWeak<NewVertWeak extends LinkWeight<never, never>>(
        val: NewVertWeak,
    ): CoordQuad<U<Ops, "vertWeak", NewVertWeak>>;
    vertWeak(): Ops["vertWeak"];
    <N extends unknown, L extends unknown>(
        layers: SugiNode<N, L>[][],
        sep: SugiSeparation<N, L>,
    ): number;
}

Type Parameters

Hierarchy (View Summary)

  • assign coordinates to a layered graph

    Type Parameters

    • N extends unknown
    • L extends unknown

    Parameters

    • layers: SugiNode<N, L>[][]

      a layered graph of sugiyama nodes

    • sep: SugiSeparation<N, L>

      how much horizontal separation should exist between nodes

    Returns number

    width - the total width of the layout

Methods

  • set the weight for how close nodes should be to zero.

    This ensures the optimization is sound, and is necessary if there are certain types of disconnected components or zero weights for different curvature constraints. If the graph is connected and the weights are positive this can be set to zero, otherwise it should be positive, but small.

    (default: 1e-6)

    Parameters

    • val: number

    Returns CoordQuad<Ops>

  • get the current compress weight.

    Returns number

  • set the node curve weight accessor

    The node curve weight penalizes curves through nodes. If a node only has one incoming and one outgoing edge, it will try to make them match in angle. Note that it does it for all possible "through edges" so multiple incoming and multiple outgoing will get counted several times. It's not clear why this would ever be desirable, but it's possible to specify.

    (default: 0)

    Type Parameters

    Parameters

    Returns CoordQuad<U<Ops, "nodeCurve", NewNodeCurve>>

  • get the current node curve accessor

    Returns Ops["nodeCurve"]