Function sugiyama

  • construct a new Sugiyama with the default settings

    The sugiyama layout takes a three step layering approach. First it calls Sugiyama#layering to assign a layer to each node. Then it calls Sugiyama#decross to arrange nodes in each layer to minimize edge crossings. Finally it calls Sugiyama#coord to assign actual coordinates given the ordering.

    Finally, you can also tweak the standard settings of Sugiyama#nodeSize, Sugiyama#gap, and Sugiyama#tweaks. Note that Rank can be set in some Layering operators.

    Sugiyama example

    Parameters

    • Rest ...args: never[]

    Returns DefaultSugiyama

    Example

    To use the default layout:

    const grf: Graph = ...
    const layout = sugiyama();
    layout(dag);
    for (const node of dag.nodes()) {
    console.log(node.x, node.y);
    }

    Example

    To use optimal decrossing, which will only work for small graphs:

    const grf: Graph = ...
    const layout = sugiyama().decross(decrossOpt());
    layout(dag);
    for (const node of dag.nodes()) {
    console.log(node.x, node.y);
    }

Generated using TypeDoc