Represents a label for a node within a LayoutGraph data structure.
Remarks
A LayoutNodeLabel encapsulates a possibly rotated rectangular area represented by an IOrientedRectangle. This rectangle defines the boundaries for the label's content, such as text or images.
This class cannot be instantiated
Default Values of Properties
Type Details
- yFiles module
- algorithms
See Also
Properties
Gets or sets a value indicating whether the position of a node label is relative to its owner or absolute.
Remarks
This property should only be modified temporarily in custom labeling implementations. Built-in layout algorithms assume that absolutePlacement is set to false
.
The positioning of the node label determines its behavior in relation to the movement of its owner. If absolutePlacement is false
, the label will maintain its position relative to its owner when the owner is moved. Otherwise, the label remains at its position, unaffected by its owner's movement.
Default Value
absolutePlacement.is false
by default, indicating that node labels are placed relative to their owner.
Gets or sets a snapshot of the bounds of the node label.
Remarks
The bounds are represented as an oriented rectangle, detailing the absolute position of the label in the drawing space.
The layout property returns a snapshot of the label's current bounds. Changes applied to that snapshot do not affect the label itself.
Gets the owner of this node label.
Property Value
null
if not assigned.Gets or sets the tag object associated with this item instance.
Remarks
See Also
Implements
Methods
Returns the data stored for the node label in the IMapper<K,V> registered with the LayoutGraph of the owner under the given look-up key.
Type Parameters
- TData
- The type of the data to retrieve.
Parameters
A map of options to pass to the method.
- dataKey - NodeLabelDataKey<TData>
This node label must currently be in a LayoutGraph, otherwise, this method will throw an exception. Directly use getItemData if it is required to access that of node labels that are temporarily removed from the graph.
The look-up key that is used to query the map from the graph, containing the data for the node label.
Returns
- ↪TData?
- The data item associated with this node label in the IMapper<K,V> if found, otherwise the default value of
TData
.