Specifies custom layout data for the GivenCoordinatesStage.
Examples
The following example shows how to create a new instance of GivenCoordinatesStageData and use it with a GivenCoordinatesStage:
In many cases the complete initialization of GivenCoordinatesStageData can also be done in a single object initializer:
Type Details
- yfiles module
- view-layout-bridge
- yfiles-umd modules
- view-layout-bridge
- Legacy UMD name
- yfiles.layout.GivenCoordinatesStageData
Constructors
Creates a new instance of GivenCoordinatesStageData which helps configuring GivenCoordinatesStage.
Parameters
A map of options to pass to the method.
- nodeLocations - ItemMapping<INode,IPoint>
The mapping from nodes to their initial location. This option sets the nodeLocations property on the created object.
- nodeSizes - ItemMapping<INode,ISize>
The mapping from nodes to their sizes. This option sets the nodeSizes property on the created object.
- edgePaths - ItemMapping<IEdge,IEnumerable<IPoint>>
A mapping from edges to their initial edge paths. This option sets the edgePaths property on the created object.
Properties
Gets or sets a mapping from edges to their initial edge paths.
Remarks
Before calling the core layout algorithm, the GivenCoordinatesStage sets the path of each edge to the mapped point path. The path must contain the source port location, followed by the bends (if any), followed by the target port location.
If an empty path is specified, the current path will be reset (all bends are cleared, the current source/target port locations are kept). The path of edges that have no associated path are not changed by the stage.
Examples
The easiest option is to reset all paths, by setting a constant empty path:
Handling only certain edges differently can be done easily by using the mapper property:
In cases where the path for each edge can be determined by looking at the edge itself it's often easier to just set a delegate instead of preparing a mapper:
See Also
Gets or sets the mapping from nodes to their initial location.
Remarks
Examples
The easiest option is to place all nodes on the same location, by setting a constant location:
Handling only certain nodes differently can be done easily by using the mapper property:
In cases where the location for each node can be determined by looking at the node itself it's often easier to just set a delegate instead of preparing a mapper:
See Also
Gets or sets the mapping from nodes to their sizes.
Remarks
Examples
The easiest option is to resize all nodes to the same dimension, by setting a constant size:
Handling only certain nodes differently can be done easily by using the mapper property:
In cases where the dimension for each node can be determined by looking at the node itself it's often easier to just set a delegate instead of preparing a mapper:
See Also
Methods
Combines this instance with the given layout data.
Remarks
Parameters
A map of options to pass to the method.
- data - LayoutData
- The LayoutData to combine this instance with.
Returns
- ↪LayoutData
- The combined layout data.