layout the graph using the sugiyama layout
the graph to layout
dimension - the width and height of resulting layout
set the Coord operator
The final stage is coordinate assignment, which takes a layered graph with nodes in the correct order, and assigns them x coordinates.
There are four built-in coordinate assignment operators:
You can also supply any function that satisfies the Coord interface. See that documentation for more information about implementing your own coordinate assignment operator.
(default: coordSimplex)
const layout = sugiyama().coord(coordQuad());
get the current Coord.
set the Decross operator
The decross operator takes a layered graph with extra nodes for long paths, and reorders nodes along a layer to minimize the number of edge crossings (or other desired properties).
There are three built-in decrossing operators:
You can also supply any function that satisfies the Decross interface. See that documentation for more information about implementing your own decrossing operator.
(default: decrossTwoLayer)
const layout = sugiyama().decross(decrossOpt());
get the current Decross.
set the Layering operator
The layering operator takes the graph, and assigns each node layer that respects
There are three built-in layering operators:
You can also supply any function that satisfies the Layering interface. See that documentation for more information about implementing your own layering operator.
(default: layeringSimplex)
const layout = sugiyama().layering(layeringLongestPath());
get the current Layering.
sets the NodeSize
(default: [1, 1]
)
get the current node size
set the Tweaks to apply after layout
get the current Tweaks.
Generated using TypeDoc
the operator used to layout a Graph using the sugiyama layered method
The algorithm is roughly comprised of three steps:
The algorithm is based off ideas presented in K. Sugiyama et al. [1979], but described by S. Hong. The sugiyama layout can be configured with different algorithms for each stage of the layout. For each stage there should be adecuate choices for methods that balance speed and quality for your desired layout. In the absence of those, any function that meets the interface for that stage is valid.
Create with sugiyama.
Remarks
If one wants even more control over the algorithm, each step is broken down in the source code and can be achieved by calling an exported utility function. If one wants to call certain pieces incrementally, or adjust how things are called, it's recommended to look at the source and call each component function successively.