A label model for node labels that lie inside the node's layout bounds and have been stretched to fit the node's size.
Remarks
This label model supports seven positions inside the layout's bounds.
The label's preferredSize is ignored. Instead, the label is stretched to fit the node's width and/or height.
For the vertical positions CENTER_VERTICAL, LEFT, and RIGHT the label is rotated by 90 degrees.
Type Details
- yFiles module
- view
Sample Graphs
Constructors
Properties
Methods
Creates the parameter for the given position.
Parameters
A map of options to pass to the method.
- position - StretchNodeLabelModelPosition
- The position.
Returns
- ↪StretchNodeLabelModelParameter
- The parameter for the given position.
Provides a lookup context for the given label.
Calculates the geometry of the given label using the given model parameter.
Parameters
A map of options to pass to the method.
- label - ILabel
- The label to calculate the geometry for.
- layoutParameter - ILabelModelParameter
- A parameter that is compatible with this model. Typically, this is a parameter that has been created by this model, and its property model returns this instance.
Returns
- ↪IOrientedRectangle
- An IOrientedRectangle that describes the geometry of the label. This is typically designed as a flyweight, therefore clients should not cache the instance but store the values if they need a snapshot for later use.
Implements
Returns the minimum size this model would require for the node owner of the label if the given label was used with the provided parameter.
Parameters
A map of options to pass to the method.
- label - ILabel
- The label to use.
- layoutParameter - ILabelModelParameter
- The parameter to use.
Returns
- ↪Size
- The minimum size requirements for this label.
Returns the padding this model would require for the node owner of the label if the given label were used with the provided parameter.
Parameters
A map of options to pass to the method.
- label - ILabel
- The label to use.
- layoutParameter - ILabelModelParameter
- The parameter to use.
Returns
- ↪Insets
- The padding rectangle.
Constants
A predefined parameter that places the label on the bottom side of the node interior, stretching over the node's width.
Remarks
Sample Graphs
A predefined parameter that places the label inside the node, filling the node's layout.
Remarks
Sample Graphs
A predefined parameter that places the label at the vertical center with the preferred height of the label and the width of the node.
Remarks
Sample Graphs
A predefined parameter that places the label at the horizontal center with the preferred width of the label and the height of the node.
Remarks
Sample Graphs
A predefined parameter that places the label on the left side of the node interior, stretching over the node's height.
Remarks
The label is rotated 90 degrees counterclockwise.
This parameter's model is immutable. Trying to change its padding property will raise an InvalidOperationError.
Sample Graphs
A predefined parameter that places the label on the right side of the node interior, stretching over the node's height.
Remarks
The label is rotated 90 degrees clockwise.
This parameter's model is immutable. Trying to change its padding property will raise an InvalidOperationError.
Sample Graphs
A predefined parameter that places the label on the top side of the node interior, stretching over the node's width.