This interface defines the properties of the model associated with an IEdgeLabelLayout.
Remarks
An IEdgeLabelLayoutModel provides a set of possible candidates for the placement of an edge label. It also defines a parameter that describes the current location of the label.
It is important that all state information is encapsulated in the model parameter. IEdgeLabelLayoutModel instances may be shared between multiple edge labels but produce different parameters for labels with different locations.
Type Details
- yfiles module
- layout-core
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.layout.IEdgeLabelLayoutModel
See Also
Properties
Gets a model parameter that encodes the default position of this model's allowed edge label positions.
Remarks
Methods
createModelParameter
(labelBounds: YOrientedRectangle, edgeLayout: IEdgeLayout, sourceLayout: INodeLayout, targetLayout: INodeLayout) : ObjectCreates a model parameter that represents the given edge label position within this model.
Remarks
The created model parameter is the closest parameter representation of the given label location that can be achieved within this model.
This parameter can be passed to getLabelPlacement to retrieve the current label box.
A model parameter can be an arbitrary Object. However it must contain all information to allow restoring of the encoded location with this IEdgeLabelLayoutModel.
Parameters
A map of options to pass to the method.
- labelBounds - YOrientedRectangle
- the oriented box of the label, encoding the label location for which the parameter should be created
- edgeLayout - IEdgeLayout
- the layout of the edge to which the label belongs
- sourceLayout - INodeLayout
- the layout of the source node of the label-owning edge
- targetLayout - INodeLayout
- the layout of the target node of the label-owning edge
Returns
- ↪Object
- the model parameter representing the given label location
See Also
getLabelCandidates
(labelLayout: IEdgeLabelLayout, edgeLayout: IEdgeLayout, sourceLayout: INodeLayout, targetLayout: INodeLayout) : YListReturns all EdgeLabelCandidates that describe valid label positions within this model.
Remarks
Parameters
A map of options to pass to the method.
- labelLayout - IEdgeLabelLayout
- the label for which candidates should be generated
- edgeLayout - IEdgeLayout
- the layout of the edge to which the label belongs
- sourceLayout - INodeLayout
- the layout of the source node of the label-owning edge
- targetLayout - INodeLayout
- the layout of the target node of the label-owning edge
Returns
- ↪YList
- a list of EdgeLabelCandidate instances
getLabelPlacement
(labelSize: YDimension, edgeLayout: IEdgeLayout, sourceLayout: INodeLayout, targetLayout: INodeLayout, parameter: Object) : YOrientedRectangleReturns the oriented box of the label for the position encoded by the given model parameter.
Parameters
A map of options to pass to the method.
- labelSize - YDimension
- the width and height of the label
- edgeLayout - IEdgeLayout
- the layout of the edge to which the label belongs
- sourceLayout - INodeLayout
- the layout of the source node of the label-owning edge
- targetLayout - INodeLayout
- the layout of the target node of the label-owning edge
- parameter - Object
- the model parameter that describes the abstract position of the label within this model
Returns
- ↪YOrientedRectangle
- the oriented bounds of the label