Interface Zherebko<Ops>

a simple topological layout operator.

This layout algorithm constructs a topological representation of the graph meant for visualization. The algorithm is based off a PR by D. Zherebko. The nodes are topologically ordered, and edges are then positioned into "lanes" to the left and right of the nodes.

Create with zherebko.

interface Zherebko<Ops extends ZherebkoOps = ZherebkoOps> {
    gap(val: readonly [number, number]): Zherebko<Ops>;
    gap(): readonly [number, number];
    nodeSize<NewNodeSize extends NodeSize>(
        val: NewNodeSize,
    ): Zherebko<U<Ops, "nodeSize", NewNodeSize>>;
    nodeSize(): Ops["nodeSize"];
    rank<NewRank extends Rank<never, never>>(
        val: NewRank,
    ): Zherebko<U<Ops, "rank", NewRank>>;
    rank(): Ops["rank"];
    tweaks<const NewTweaks extends readonly Tweak<never, never>[]>(
        val: NewTweaks,
    ): Zherebko<U<Ops, "tweaks", NewTweaks>>;
    tweaks(): Ops["tweaks"];
    (graph: Ops extends ZherebkoOps<N, L> ? Graph<N, L> : never): LayoutResult;
}

Type Parameters

Methods

  • set the gap size between nodes

    (default: [1, 1])

    Parameters

    • val: readonly [number, number]

    Returns Zherebko<Ops>

  • get the current gap size

    Returns readonly [number, number]