GraphLayoutLineWrapper can line-wrap or column-wrap a graph layout.
Remarks
This ILayoutStage supports both wrapping a layout at a given width (height) and wrapping a layout automatically at some width (height) such that the resulting overall aspect ratio is close to a desired target ratio.
The GraphLayoutLineWrapper can be used on an existing graph layout or on the result of the core layout algorithm.
Default Values of Properties
columnMode | false | The layout is wrapped horizontally, producing rows. |
coreLayout | null | |
edgeSpacing | 5 | |
fixedWidthLineBreaks | false | The target aspect ratio defines how the line width is chosen. |
mirror | true | Every other line is mirrored. |
spacing | 10 | |
targetRatio | 1 |
Type Details
- yfiles module
- layout-core
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.layout.GraphLayoutLineWrapper
See Also
Constructors
Creates a new GraphLayoutLineWrapper instance with default settings.
Parameters
A map of options to pass to the method.
- edgeSpacing - number
The space that should be kept between edges. This option sets the edgeSpacing property on the created object.
- columnMode - boolean
Whether this ILayoutStage wraps lines/rows or columns. This option sets the columnMode property on the created object.
- spacing - number
The space between adjacent lines of the wrapped graph layout. This option sets the spacing property on the created object.
- mirror - boolean
Whether or not every other line is mirrored. This option sets the mirror property on the created object.
- fixedWidthLineBreaks - boolean
Whether the algorithm should use the fixed width or target aspect ratio to determine line breaks. This option sets the fixedWidthLineBreaks property on the created object.
- targetRatio - number
The desired target aspect ratio for the layout. This option sets the targetRatio property on the created object.
- fixedWidth - number
The desired width of the lines. This option sets the fixedWidth property on the created object.
- coreLayout - ILayoutAlgorithm
The core layout algorithm that is wrapped by this stage. This option sets the coreLayout property on the created object.
Properties
Gets or sets whether this ILayoutStage wraps lines/rows or columns.
Remarks
If this mode is enabled, the layout is wrapped vertically and new columns are appended to the right of the first column. Otherwise, the layout is wrapped horizontally and new rows are appended below the first row.
Also, the fixedWidth property will be interpreted as a fixed height if this mode is enabled.
Default Value
false
.The layout is wrapped horizontally, producing rows.
See Also
Gets or sets the core layout algorithm that is wrapped by this stage.
Gets or sets the space that should be kept between edges.
Remarks
Default Value
5
.Throws
- Exception({ name: 'ArgumentError' })
- if the given spacing is a negative value
See Also
Sample Graphs
Gets or sets the desired width of the lines.
Remarks
The GraphLayoutLineWrapper breaks the lines at the specified width.
In column mode, the fixed width is interpreted as fixed height for a column.
Default Value
500
.See Also
Sample Graphs
true
.Gets or sets whether the algorithm should use the fixed width or target aspect ratio to determine line breaks.
Default Value
false
.The target aspect ratio defines how the line width is chosen.
See Also
Gets or sets whether or not every other line is mirrored.
Remarks
180
degrees. Then, the edges connecting both lines stay short. In case the remainder is not rotated, the edges are routed between the two lines to connect to the front of the non-mirrored line.Default Value
true
.Every other line is mirrored.
See Also
Sample Graphs
Gets or sets the space between adjacent lines of the wrapped graph layout.
Remarks
If the column mode is enabled, this spacing defines the distance between adjacent columns.
The spacing should be non-negative.
Default Value
10
.Throws
- Exception({ name: 'ArgumentError' })
- if the spacing is negative
See Also
Sample Graphs
Gets or sets the desired target aspect ratio for the layout.
Remarks
0
.Default Value
1
.Throws
- Exception({ name: 'ArgumentError' })
- if the target ratio is
0
or less
See Also
Sample Graphs
false
.Methods
Cuts the layout resulting from the core layout algorithm at a specified width/height and shifts the remaining graph into the next row/column until the layout has the desired width/height.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
See Also
Implements
Invokes the layout process of the core layout algorithm.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph