Base class for label styles that use a SVG snippet as template for the visualization of ILabels.
Type Details
- yfiles module
- styles-template
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.styles.TemplateLabelStyleBase
See Also
Constructors
Constructs a new instance using the provided renderer
.
Properties
Gets or sets an implementation of IContextLookup that can be used to satisfy queries that are made to the implementation which is returned by calls to getContext that are made on the style renderer that is associated with this style instance.
Remarks
Gets or sets the normalized outline of a label that will be displayed using the created visual.
Gets or sets the preferred size of the labels that use this style.
Gets the renderer implementation that can be queried for implementations that provide details about the visual appearance and visual behavior for a given label and this style instance.
Remarks
const creator = style.renderer.getVisualCreator(label, style)
const visual = creator.createVisual(context)
Implements
Gets or sets the tag that is associated with this style instance.
Remarks
Methods
Performs a shallow clone of this instance, except for the value of styleTag which is cloned, too, if it can be cloned.
Factory method that is called by the TemplateLabelStyleRenderer to create the visual that will be used for the display of the label.
Parameters
A map of options to pass to the method.
- context - IRenderContext
- The context for which the visual should be created.
- label - ILabel
- The label that will be rendered.
Returns
- ↪SvgVisual
- The readily styled visual.
Determines the preferred size of the label if this style was applied.
Parameters
A map of options to pass to the method.
- context - IRenderContext
- The context for which the size should be calculated.
- label - ILabel
- The label to determine the preferred size of.
Returns
- ↪Size
- The preferred size.
Raises the PropertyChanged event.
Parameters
A map of options to pass to the method.
- evt - PropertyChangedEventArgs
- The PropertyChangedEventArgs instance containing the event data.
Events
Occurs when a property value changes.
Overrides
Event Registration
addPropertyChangedListener(function(this, PropertyChangedEventArgs):void)
Event Deregistration
removePropertyChangedListener(function(this, PropertyChangedEventArgs):void)
Signature Details
function(sender: any, args: PropertyChangedEventArgs)
Parameters
- sender - any
- The object which dispatched the event.
- args - PropertyChangedEventArgs
- The arguments which define the change.
Static Methods
Loads all template script elements that have not been parsed, yet, and creates the respective template cache objects.