An EdgeLabelCandidate describes one valid placement for an edge label considering the label model.
Type Details
- yfiles module
- layout-core
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.layout.EdgeLabelCandidate
Constructors
EdgeLabelCandidate
(pos: YPoint, size: YDimension, param: Object, owner: IEdgeLabelLayout, internal?: boolean)Creates a new instance of EdgeLabelCandidate described by location, size, model parameter and internal flag.
Parameters
A map of options to pass to the method.
- pos - YPoint
- the location of the upper left corner of the candidate
- size - YDimension
- the size of the candidate
- param - Object
- the parameters of the label model associated with this candidate
- owner - IEdgeLabelLayout
- the label associated with the candidate
- internal - boolean
true
if the candidate is allowed to overlap with its owner,false
otherwise
EdgeLabelCandidate
(labelBox: YOrientedRectangle, param: Object, owner: IEdgeLabelLayout, internal?: boolean)Creates a new instance of EdgeLabelCandidate described by its box, model parameter and internal flag.
Parameters
A map of options to pass to the method.
- labelBox - YOrientedRectangle
- the box that specifies the candidate's size and position
- param - Object
- the parameters of the label model associated with this candidate
- owner - IEdgeLabelLayout
- the label associated with the candidate
- internal - boolean
true
if the candidate is allowed to overlap with its owner,false
otherwise
Properties
Gets the bounding box of this candidate.
Remarks
Implements
Gets the oriented box of this candidate.
Gets or sets the custom profit for this candidate.
Remarks
The profit describes the priority of this candidate with respect to other candidates. Labeling algorithms will use the profit to decide which candidate to choose.
The value is restricted to the interval [0,1]
, where 1
specifies the highest possible profit.
Default Value
0
.Throws
- Exception({ name: 'ArgumentError' })
- if the specified value lies outside of
[0,1]
Defined in
Gets or sets a penalty for a candidate position that overlaps the path of an edge.
Remarks
0
and 1
, where 0
means that an overlap is considered unimportant and 1
means that an overlap is considered severe.Default Value
1
.Throws
- Exception({ name: 'ArgumentError' })
- if the specified penalty is outside
[0,1]
Defined in
Gets the height of the candidate's bounding box.
Remarks
See Also
Defined in
Gets whether or not this candidate describes an internal label.
Gets the coordinates of the upper-left corner of the candidate's bounds.
Remarks
See Also
Defined in
Gets the model parameter that was used by the underlying model to generate this label candidate.
Defined in
Gets or sets a penalty for a candidate position that overlaps the box of a node.
Remarks
0
and 1
, where 0
means that an overlap is considered unimportant and 1
means that an overlap is considered severe.Default Value
1
.Throws
- Exception({ name: 'ArgumentError' })
- if the specified penalty is outside
[0,1]
Defined in
Gets the sum of node overlap penalty and edge overlap penalty.
See Also
Defined in
Gets the ILabelLayout for which this candidate was created.
Defined in
Gets whether or not this candidate's box had already been chosen by the labeling algorithm.
Remarks
See Also
Defined in
Gets the width and height of the candidate's bounds.
Remarks
See Also
Defined in
Gets the width of the candidate's bounds.
Remarks
See Also
Defined in
Gets the minimum x-coordinate of the candidate's bounds.
Remarks
See Also
Defined in
Gets the minimum y-coordinate of the candidate's bounds.
Remarks
See Also
Defined in
Methods
Replaces the model parameter and box of the owner with the model parameter and box of this candidate.
Remarks
See Also
Defined in
Returns a string representation of this LabelCandidate.
Remarks
Returns
- ↪string
- a representation of the candidate