LabelLayoutData encapsulates layout information for a label.
Remarks
The information is used by clients to inform label-aware layout algorithms about labeling constraints like label size and preferred placement.
Label-aware algorithms like HierarchicLayout return the calculated label positions by assigning the corresponding box to the provided LabelLayoutData instances.
DataProviders are used for associating an array of LabelLayoutData instances with either the nodes or the edges of a LayoutGraph. The DataProviders must be registered with the input graph using one of the keys defined in LabelLayoutKeys.
Default Values of Properties
preferredPlacementDescriptor | PreferredPlacementDescriptor
| A descriptor that allows all placements |
Type Details
- yfiles module
- layout-core
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.layout.LabelLayoutData
Constructors
Creates a new instance of LabelLayoutData for a label with the given width and height.
Parameters
A map of options to pass to the method.
- width - number
- the width of the label
- height - number
- the height of the label
Creates a new instance of LabelLayoutData for a label with the given oriented box and preferred placement descriptor.
Parameters
A map of options to pass to the method.
- bounds - YOrientedRectangle
- the box of the label
- preferredPlacement - PreferredPlacementDescriptor
- a preferred placement descriptor
See Also
Properties
Gets or sets the oriented box of the label.
Gets the height of the label's bounding box.
See Also
Gets or sets the preferred placement of this label.
Gets the width of the label's bounding box.
See Also
Gets the x-coordinate of the upper-left corner of the label's bounding box.
See Also
Gets the y-coordinate of the upper-left corner of the label's bounding box.
See Also
Methods
Specifies the coordinates of the upper-left corner of the bounding box of the label.
Parameters
A map of options to pass to the method.
- x - number
- the new x-coordinate of the upper-left corner
- y - number
- the new y-coordinate of the upper-left corner
See Also
Specifies the width and height of the oriented box of this label.
Parameters
A map of options to pass to the method.
- width - number
- the width of the oriented box
- height - number
- the height of the oriented box
See Also
Returns a string representation of LabelLayoutData.
Remarks
Returns
- ↪string
- the string representation of LabelLayoutData