An implementation of ILabelModel that can be used to create custom label models out of existing ILabelModelParameter instances.
Remarks
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.graph.GenericLabelModel
Constructors
GenericLabelModel
(defaultLayoutParameter: ILabelModelParameter, descriptor?: ILabelCandidateDescriptor)Create a new generic label model using the provided parameter as the default parameter.
Remarks
Parameters
A map of options to pass to the method.
- defaultLayoutParameter - ILabelModelParameter
- The parameter to use as the default.
- descriptor - ILabelCandidateDescriptor
- The descriptor to associate with the parameter.
Throws
- Exception({ name: 'ArgumentError' })
defaultParameter
is null.
See Also
Methods
addParameter
(layoutParameter: ILabelModelParameter, descriptor?: ILabelCandidateDescriptor) : ILabelModelParameterAdds another parameter to this models collection of parameters.
Remarks
Parameters
A map of options to pass to the method.
- layoutParameter - ILabelModelParameter
- The parameter to add to this instance.
- descriptor - ILabelCandidateDescriptor
- The descriptor to associate with the parameter.
Returns
- ↪ILabelModelParameter
- A new parameter that wraps the provided parameter and uses this instance as its model.
Creates a default parameter that can be used for this model.
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
Yields the ILabelCandidateDescriptor that has been associated with the instance during addParameter.
Parameters
A map of options to pass to the method.
- label - ILabel
- The label instance to use.
- layoutParameter - ILabelModelParameter
- The parameter to get the descriptor for.
Returns
- ↪ILabelCandidateDescriptor
- The descriptor instance that had been added to this instance during addParameter.
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 enumerator over a set of possible ILabelModelParameter instances that can be used for the given label and model.
Parameters
A map of options to pass to the method.
- label - ILabel
- The label instance to use.
- model - ILabelModel
- The model to provide parameters for.
Returns
- ↪IEnumerable<ILabelModelParameter>
- A possibly empty enumerator over a set of label model parameters.
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