Base class for node styles that use a SVG snippet as template for the visualization of INodes.
Type Details
- yfiles module
- styles-template
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.styles.TemplateNodeStyleBase
See Also
Constructors
Constructs a new instance.
Parameters
A map of options to pass to the method.
- renderer - TemplateNodeStyleRenderer
- The renderer to use with this instance. If no renderer is provided a default instance is used.
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
null
for this property. The default value is EMPTY_CONTEXT_LOOKUPGets or sets the insets the INodeInsetsProvider implementation for INode should yield for this instance.
Remarks
5
for all insets.See Also
Gets or sets the minimum size an INodeSizeConstraintProvider implementation for INode should yield.
Gets or sets the normalized outline of a node that will be displayed using the created visual.
Remarks
This shape will be used to satisfy requests to isInBox, isHit, as well as for IShapeGeometry methods (which affect edge cropping at the node outline).
This property may be left at or set to null
to indicate default (rectangular) behavior.
The default value is null
.
Gets the renderer implementation that can be queried for implementations that provide details about the visual appearance and visual behavior for a given node and this style instance.
Remarks
const creator = style.renderer.getVisualCreator(node, style)
const visual = creator.createVisual(context)
See Also
Implements
Gets or sets the tag that is associated with this style instance.
Remarks
See Also
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 TemplateNodeStyleRenderer to create the visual that will be used for the display of the node.
Parameters
A map of options to pass to the method.
- context - IRenderContext
- The context for which the visual should be created.
- node - INode
- The node that will be rendered.
Returns
- ↪SvgVisual
- The readily styled visual.
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.