d3-dag
    Preparing search index...

    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.

      Self loops aren't part of the layering. Each leaves below its node's center, runs up beside it, and comes back in above. Loops on one node alternate right and left, nested one inside the next, with room left for them on the sides they're on.

      Sugiyama example

      Parameters

      • ...args: never[]

      Returns DefaultSugiyama

      To use the default layout:

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

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

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