DirectedGraphLayout

extends Layout

The DirectedGraphLayout class represents a layout that positions objects using a directed graph algorithm. The direction property controls the rank direction of the graph. To create a DirectedGraphLayout object and apply it to a collection, use the layout function:

let gl = msc.layout("directedgraph", {direction: "l2r"});
collection.layout = gl;

This layout is implemented using the dagre library.

Properties

propertyexplanationtypedefault value
directionthe direction in which ranks are laid outString“t2b”
edgeSepthe separation between edges in the graphNumber50
leftthe x offset of the layout areaNumber0
nodeSepthe separation between nodes in the graphNumber100
rankSepNumber of pixels between each rank in the layoutNumber50
refElements the reference elements used by this layoutArray[]
spreadLinkswhether to spread links across the available widthBooleantrue
topthe y offset of the layout areaNumber0
typethe type of the layoutString“directedgraph”

Methods

methodexplanationreturn type
clone()returns a copy of this layoutDirectedGraphLayout

Methods inherited from Layout

methodexplanationreturn type
addRefElement(re)adds a reference element to this layoutvoid
clearRefElements()removes all reference elements from this layoutvoid