C

NodeLabelCandidates

Inheritance Hierarchy

Remarks

The created candidates are used by the GenericLabeling algorithm and specify valid candidate positions for the label placement.

Different candidates can be assigned a weight value when adding them, which is propagated to the created candidate's custom weight property and is used to prioritize the candidates.

See Also

Developer's Guide

Members

No filters for this type

Constructors

Creates a new, empty NodeLabelCandidates instance.

Methods

Adds a set of candidates that describe label placements at eight positions around a node and nine positions inside the node.
final

Parameters

labelPositions: DiscreteNodeLabelPositions
The label positions specify the valid positions for the candidates
distance?: number
The distance between the label candidate's bounds and the node. The distance must be a non-negative value. For positions in the node's interior, the distance specifies a padding from the node's boundary. The default is 40.0.
weight?: number
The weight for the candidates. The weight value can be used to specify priorities between different candidates. The default is 1.0.

Return Value

NodeLabelCandidates
The calling instance of NodeLabelCandidates
Adds a candidate that describes a label placement at a single fixed position.
The given bounds of the candidate are considered absolute, i.e., changing the position of the associated node does not change them.
final

Parameters

box: IOrientedRectangle
the bounds of the generated node label candidate
weight?: number
the weight for the created candidate. The weight value can be used to specify priorities between different candidates. The default is 1.0.

Return Value

NodeLabelCandidates
the calling instance of NodeLabelCandidates
Adds a set of candidates that describe label placements freely chosen from the area near the label's node.
final

Parameters

weight?: number
the weight for the candidates. The weight value can be used to specify priorities between different candidates. The default is 1.0.

Return Value

NodeLabelCandidates
the calling instance of NodeLabelCandidates
Returns all LabelCandidates that describe valid label positions.
The returned list is always created from scratch every time this method is called.

Parameters

label: LayoutNodeLabel
The label for which candidates should be generated

Return Value

IEnumerable<LabelCandidate>
The LabelCandidates that describe valid label positions