A label model that can be used to describe any position and orientation of a label.
Remarks
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.graph.FreeLabelModel
See Also
Methods
Creates a new label model parameter that places the label at the given absolute position using the provided angle.
Parameters
A map of options to pass to the method.
- anchorLocation - Point
- The location for the parameter.
- angle - number
- The angle of rotation. The default is 0.
Returns
- ↪ILabelModelParameter
- A new parameter that is associated with this instance.
Creates a new label at the given dynamic location using the provided angle.
Parameters
A map of options to pass to the method.
- location - IPoint
- The location to place the parameter at. That instance is stored by reference.
- angle - number
- The angle of rotation. The default is 0.
Returns
- ↪ILabelModelParameter
- A new parameter that is associated with this instance.
Creates a default parameter that can be used for this model.
Creates a new label model parameter that dynamically reads the label layout from the provided instance.
Parameters
A map of options to pass to the method.
- layout - IOrientedRectangle
- The oriented rectangle to dynamically retrieve the values from.
Returns
- ↪ILabelModelParameter
- A new parameter that is associated with this instance.
findBestParameter
(label: ILabel, model: ILabelModel, layout: IOrientedRectangle) : ILabelModelParameterTries to find a parameter that best matches the given layout for the provided label instance.
Remarks
null
.Parameters
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.
Implements
Provides a lookup context for the given combination of label and parameter.
Parameters
A map of options to pass to the method.
- label - ILabel
- The label to use in the context.
- layoutParameter - ILabelModelParameter
- The parameter to use for the label in the context.
Returns
- ↪ILookup
- An implementation of the ILookup interface that can be used to query additional aspects of the label/parameter combination.
See Also
Implements
Calculates the geometry of the given label using the given model parameter.
Parameters
A map of options to pass to the method.
- label - ILabel
- The label to calculate the geometry for.
- layoutParameter - ILabelModelParameter
- A parameter that is compatible with this model. Typically, this is a parameter that has been created by this model, and its property model returns this instance.
Returns
- ↪IOrientedRectangle
- An IOrientedRectangle that describes the geometry of the label. This is typically designed as a flyweight, therefore clients should not cache the instance but store the values if they need a snapshot for later use.
Implements
Returns an instance that implements the given type or null
.
Remarks
null
implementations for the types, nor does it have to return the same instance any time. Also it depends on the type and context whether the instance returned stays up to date or needs to be reobtained for subsequent use.Type Parameters
- T: any
Parameters
A map of options to pass to the method.
- type - Class<T>
- The type for which an instance shall be returned.
Returns
- ↪T
- an instance that is assignable to type or
null
See Also
Implements
Constants
A shared public instance that can be used to obtain parameters.