Defines the geometry of ILabel instances with respect to specific ILabelModelParameters.
Remarks
In addition to defining the geometry of a label with respect to a specific ILabelModelParameter, a label model is typically the factory of the label model parameters that are compatible with it, too.
Typically, the label model defines a, possibly infinite, compilation of valid geometries for labels, and a specific label model parameter specifies an exact geometry for a label.
By design, the same instance of a label model can be shared by multiple label model parameters. Similarly, the same instance of a label model parameter can be shared by multiple labels.
This interface supports the lookup method that can be used to query additional aspects of the implementation.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.graph.ILabelModel
See Also
Methods
Creates a default parameter that can be used for this model.
Returns
- ↪ILabelModelParameter
- a parameter for this model instance
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
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.
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
$class
property on JavaScript classes inheriting from yFiles classes is only valid once an instance of this subclass was created. Call fixType, first or instantiate the class at least once.