Interface LayeringLongestPath<Ops>

a Layering that minimizes the height of the final layout.

This often results in very wide and unpleasing graphs, but is very fast. The layout can go top-down or bottom-up, either assigning all roots to layer 0 or all leaves to the last layer.

Create with layeringLongestPath.

interface LayeringLongestPath<
    Ops extends LayeringLongestPathOps = LayeringLongestPathOps,
> {
    rank<NewRank extends Rank<never, never>>(
        newRank: NewRank,
    ): LayeringLongestPath<U<Ops, "rank", NewRank>>;
    rank(): Ops["rank"];
    topDown(val: boolean): LayeringLongestPath<Ops>;
    topDown(): boolean;
    <N extends unknown, L extends unknown>(
        graph: Graph<N, L>,
        sep: Separation<N, L>,
    ): number;
}

Type Parameters

Hierarchy (View Summary)

  • layer a graph

    After calling this, every node should have a y coordinate that satisfies sep.

    Type Parameters

    • N extends unknown
    • L extends unknown

    Parameters

    • graph: Graph<N, L>

      the graph to layer

    • sep: Separation<N, L>

      the minimum separation between nodes

    Returns number

    height - the height after layering

Methods

Methods