C

EdgeLabelCandidates

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 EdgeLabelCandidates instance.

Methods

Adds a set of candidates that allow placement of rotated edge labels at predefined positions along the edge.
final

Parameters

labelPositions: DiscreteEdgeLabelPositions
The label positions specify the valid positions for the candidates. The positions are interpreted either relative to the edge or in a geometric sense, depending on the value specified for positionRelativeToEdge.
angle?: number
The angle (measured in radians) of the label candidates. The angle is applied in a clockwise direction and is interpreted either relative to the label's owner edge or to the horizontal axis, depending on the value specified for autoRotation. The default is 0.0.
distance?: number
The distance between the label candidate's bounds and the edge's path. The distance must be a non-negative value. The default is 2.0.
positionRelativeToEdge?: boolean
true if the label positions should be interpreted relative to the edge, false if they should be interpreted in a geometric sense. The default is false.
autoRotation?: boolean
true if the label candidates should automatically be rotated relative to the corresponding edge segments, false otherwise. The default is true.
weight?: number
The weight for the created candidates. The weight value can be used to specify priorities between different candidates. The default is 1.0.

Return Value

EdgeLabelCandidates
The calling instance of EdgeLabelCandidates
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 route of the associated edge does not change them.
final

Parameters

box: IOrientedRectangle
the bounds of the generated edge 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

EdgeLabelCandidates
the calling instance of EdgeLabelCandidates
Adds a set of candidates that describe label placements freely chosen from the area near the label's edge.
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

EdgeLabelCandidates
the calling instance of EdgeLabelCandidates
Adds a set of candidates that allow placement of edge labels at continuous rotated positions along both sides of an edge or directly on the edge path.
final

Parameters

mode: EdgeLabelSliderMode
the slider mode that determines whether the label slides on the edge, along both sides of the edge or along one side of the edge
angle?: number
the angle (measured in radians) of the label candidates. The angle is applied in clockwise direction and is interpreted either relative to the label's owner edge or to the horizontal axis, depending on the value specified for autoRotation. The default is 0.0.
distance?: number
the distance between the label candidate's box and the edge's path. The interpretation of the distance's sign depends on distanceRelativeToEdge. The default is 5.0.
distanceRelativeToEdge?: boolean
true if the sign of the distance should be interpreted relative to the edge's path, false otherwise. The default is true.
autoRotation?: boolean
true if the label candidates should automatically be rotated relative to the corresponding edge segments, false otherwise. The default is true.
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

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

Parameters

label: LayoutEdgeLabel
the label for which candidates should be generated

Return Value

IEnumerable<LabelCandidate>
a list of the LabelCandidates that describe valid label positions