FreeNodeLabelLayoutModel allows placing node labels at any desired position.
Remarks
Type Details
- yfiles module
- layout-core
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.layout.FreeNodeLabelLayoutModel
See Also
Constructors
Returns a new instance of FreeNodeLabelLayoutModel.
Properties
Gets a model parameter that encodes the default position of INodeLabelLayoutModel.
Remarks
The node label's upper-left corner is placed 20
pixels to the left and 20
pixels above the node.
This parameter can be passed to getLabelPlacement to retrieve the corresponding label box.
Implements
Methods
Creates a model parameter that represents the given node label position within this model.
Remarks
The created model parameter represents the current location of the given label.
This parameter can be passed to getLabelPlacement to retrieve the current label box.
Parameters
A map of options to pass to the method.
- labelBounds - YOrientedRectangle
- the bounds of the label the parameter represents
- nodeLayout - INodeLayout
- the layout of the node to which the label belongs
Returns
- ↪Object
- the model parameter
Throws
- Exception({ name: 'ArgumentError' })
- if one or more of the given bounds' values are invalid, i.e.,
NaN
See Also
Implements
Returns the NodeLabelCandidate that describes the current label position.
Parameters
A map of options to pass to the method.
- labelLayout - INodeLabelLayout
- the label for which candidates should be generated
- nodeLayout - INodeLayout
- the layout of the node to which the label belongs
Returns
- ↪YList
- a list of NodeLabelCandidate instances
Implements
getLabelPlacement
(labelSize: YDimension, nodeLayout: INodeLayout, param: Object) : YOrientedRectangleReturns the bounds 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
- nodeLayout - INodeLayout
- the layout of the node to which the label belongs
- param - Object
- the model parameter that describes the abstract position of the label within this model
Returns
- ↪YOrientedRectangle
- the oriented box of the label