SimpleProfitModel implements the ranking for edge and node labels.
Remarks
In this implementation node label positions have no ranking, the profit for all candidates is 1
.
The ranking of edge label positions depends on the locations described in the PreferredPlacementDescriptor associated with an edge.
Type Details
- yfiles module
- layout-core
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.layout.SimpleProfitModel
This model provides meaningful and different profit values only in conjunction with SliderEdgeLabelLayoutModel or DiscreteEdgeLabelLayoutModel. Otherwise, it yields equal profit values for all candidates of the same edge label.
Constructors
Creates a new instance of SimpleProfitModel.
Methods
Returns the profit for placing a label using the given LabelCandidate.
Remarks
Higher profit means better candidates. Hence, there is a higher probability that the candidate is chosen by a labeling algorithm.
Profits need to have a value between 0
and 1
.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- candidate - LabelCandidate
- the candidate
Returns
- ↪number
- the profit of the candidate