Base class for port styles that use a SVG snippet as template for the visualization of IPorts.
Type Details
- yfiles module
- styles-template
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.styles.TemplatePortStyleBase
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
null
for this property. The default value is EMPTY_CONTEXT_LOOKUPGets or sets a path that specifies the normalized outline of a port that will be displayed using the created visual.
Gets or sets an offset for the port visualization.
Remarks
This offset will be used to satisfy requests to isInBox, isInPath, getBounds, and isHit. This can be used to have a port visualization that is not centered on the port's location, e.g. to get a port visualization that extends outside of the node, while the port lies on the node outline.
The default value is (0,0).
Gets the renderer implementation that can be queried for implementations that provide details about the visual appearance and visual behavior for a given port and this style instance.
Remarks
const creator = style.renderer.getVisualCreator(port, 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 TemplatePortStyleRenderer to create the visual that will be used for the display of the port.
Parameters
A map of options to pass to the method.
- context - IRenderContext
- The context for which the visual should be created.
- port - IPort
- The port 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.