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.
Creates a new, empty EdgeLabelCandidates instance.
Methods
addDiscreteCandidates
(angle?: numberdistance?: numberpositionRelativeToEdge?: booleanautoRotation?: booleanweight?: number): EdgeLabelCandidatesAdds a set of candidates that allow placement of rotated edge labels at predefined positions along the edge.
addDiscreteCandidates
(angle?: number
distance?: number
positionRelativeToEdge?: boolean
autoRotation?: boolean
weight?: number
): EdgeLabelCandidatesAdds 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 is0.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
trueif the label positions should be interpreted relative to the edge,falseif they should be interpreted in a geometric sense. The default isfalse.- autoRotation?: boolean
trueif the label candidates should automatically be rotated relative to the corresponding edge segments,falseotherwise. The default istrue.- 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.
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.
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
addSliderCandidates
(angle?: numberdistance?: numberdistanceRelativeToEdge?: booleanautoRotation?: booleanweight?: number): EdgeLabelCandidatesAdds 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.
addSliderCandidates
(angle?: number
distance?: number
distanceRelativeToEdge?: boolean
autoRotation?: boolean
weight?: number
): EdgeLabelCandidatesAdds 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 is0.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 is5.0. - distanceRelativeToEdge?: boolean
trueif the sign of thedistanceshould be interpreted relative to the edge's path,falseotherwise. The default istrue.- autoRotation?: boolean
trueif the label candidates should automatically be rotated relative to the corresponding edge segments,falseotherwise. The default istrue.- 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.
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