Implementations can be used to find the best ILabelModelParameter to approximate a given layout for a given ILabelModel.
Remarks
Implementations of this class may be retrieved from ILabelModel implementations using their lookup method. Note that ILabelModel implementations are not required to return an instance if queried for this interface.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.graph.ILabelModelParameterFinder
See Also
Methods
findBestParameter
(label: ILabel, model: ILabelModel, layout: IOrientedRectangle) : ILabelModelParameterTries to find a parameter that best matches the given layout for the provided label instance.
Remarks
This method may not necessarily find a parameter that matches the provided layout exactly. Implementations may choose to simply return the model's default parameter but may never return
null
.Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- label - ILabel
- The label to find a parameter for.
- model - ILabelModel
- The model instance to use. This should be the instance this instance has been obtained from.
- layout - IOrientedRectangle
- The anticipated layout for the label.
Returns
- ↪ILabelModelParameter
- A non-
null
parameter that can be used for the label to approximate the provided layout.
Static Methods
create
(findBestParameter: function(ILabel, ILabelModel, IOrientedRectangle):ILabelModelParameter) : ILabelModelParameterFinderCreates an implementation of the interface ILabelModelParameterFinder by using the given function as implementation for its findBestParameter method.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- findBestParameter - function(ILabel, ILabelModel, IOrientedRectangle):ILabelModelParameter
- A function for ILabelModelParameterFinder's single abstract method findBestParameter.
Returns
- ↪ILabelModelParameterFinder
- An instance of the ILabelModelParameterFinder interface based on the given function.