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;

Properties

propertyexplanationtypedefault value
directionthe direction in which ranks are laid outString“t2b”
edgeSepthe separation between edges in the graphNumber50
heightthe height of the layout areaNumber300
leftthe x offset of the layout areaNumber0
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”
widththe width of the layout areaNumber500

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