ILabelLayoutFactory provides methods to create, add and remove node/edge labels for LayoutGraphs.
Remarks
It can be used, e.g., to temporarily add labels during layout calculation.
Note that original labels which are removed during a layout calculation have to be re-added when the layout calculation is done.
An instance of this factory can be obtained with method getLabelFactory. This method uses the createLabelFactory method to create the factory.
Note that each factory instance is bound to a specific graph instance, i.e., you can only create, add and remove labels for the graph which was given to method getLabelFactory.
Type Details
- yfiles module
- layout-core
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.layout.ILabelLayoutFactory
See Also
Properties
Gets the graph associated with this label factory instance.
Methods
Adds the given node label layout to the given node.
Remarks
Parameters
A map of options to pass to the method.
- node - YNode
- the node
- labelLayout - INodeLabelLayout
- the node label layout that should be added to the given node
Throws
- Exception({ name: 'ArgumentError' })
- if the given label layout has already been added to the graph
See Also
Adds the given IEdgeLabelLayout to the given edge.
Remarks
Parameters
A map of options to pass to the method.
- edge - Edge
- the edge
- labelLayout - IEdgeLabelLayout
- the edge label layout that should be added to the given edge
Throws
- Exception({ name: 'ArgumentError' })
- if the given label layout has already been added to the graph
See Also
Creates a new ILabelLayout for the given node.
Remarks
Parameters
A map of options to pass to the method.
- node - YNode
- the node
- orientedBox - YOrientedRectangle
- the box specifying the size and location of the label
Returns
- ↪INodeLabelLayout
- a new node label layout
See Also
createLabelLayout
(node: YNode, orientedBox: YOrientedRectangle, model: INodeLabelLayoutModel) : INodeLabelLayoutCreates a new ILabelLayout for the given node.
Parameters
A map of options to pass to the method.
- node - YNode
- the node
- orientedBox - YOrientedRectangle
- the box specifying the size and location of the label
- model - INodeLabelLayoutModel
- specifies the model of the created node label
Returns
- ↪INodeLabelLayout
- a new node label layout
See Also
Creates a new ILabelLayout for the given edge.
Remarks
Parameters
A map of options to pass to the method.
- edge - Edge
- the edge
- orientedBox - YOrientedRectangle
- the box specifying the size and location of the label
Returns
- ↪IEdgeLabelLayout
- a new edge label layout
See Also
createLabelLayout
(edge: Edge, orientedBox: YOrientedRectangle, model: IEdgeLabelLayoutModel, descriptor: PreferredPlacementDescriptor) : IEdgeLabelLayoutCreates a new ILabelLayout for the given edge.
Parameters
A map of options to pass to the method.
- edge - Edge
- the edge
- orientedBox - YOrientedRectangle
- the box specifying the size and location of the label
- model - IEdgeLabelLayoutModel
- specifies the model of the created edge label
- descriptor - PreferredPlacementDescriptor
- specifies the preferred placement descriptor of the created label. If this value is
null
, the default descriptor is used
Returns
- ↪IEdgeLabelLayout
- a new edge label layout
See Also
Removes the given node label layout from the given node.
Parameters
A map of options to pass to the method.
- node - YNode
- the node
- labelLayout - INodeLabelLayout
- the label layout that should be removed from the given node
See Also
Removes the given IEdgeLabelLayout from the given edge.
Parameters
A map of options to pass to the method.
- edge - Edge
- the edge
- labelLayout - IEdgeLabelLayout
- the label layout that should be removed from the given edge