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#
| property | explanation | type | default value |
|---|
| direction | the direction in which ranks are laid out | String | “t2b” |
| edgeSep | the separation between edges in the graph | Number | 50 |
| height | the height of the layout area | Number | 300 |
| left | the x offset of the layout area | Number | 0 |
refElements  | the reference elements used by this layout | Array | [] |
| spreadLinks | whether to spread links across the available width | Boolean | true |
| top | the y offset of the layout area | Number | 0 |
| type | the type of the layout | String | “directedgraph” |
| width | the width of the layout area | Number | 500 |
Methods#
| method | explanation | return type |
|---|
| clone() | returns a copy of this layout | DirectedGraphLayout |
Methods inherited from Layout#
| method | explanation | return type |
|---|
| addRefElement(re) | adds a reference element to this layout | void |
| clearRefElements() | removes all reference elements from this layout | void |