documentationfor yFiles for HTML 3.0.0.4

PortStyleBase<TVisual extends Visual>

An abstract base class that makes it possible to easily implement a custom IPortStyle.

Inheritance Hierarchy
Implemented Interfaces

Remarks

Only createVisual and getBounds need to be implemented by subclasses, however to improve rendering performance it is highly recommended to implement at least updateVisual, too.

This implementation differs from the straightforward IPortStyle implementation in that there is no visible separation between the style and its IPortStyleRenderer. Instead the renderer used by the base class is fixed and delegates all calls back to the style instance.

Note that if your subclass has private fields (defined with JavaScript's # name syntax), the clone method needs to be overridden for the cloning to work properly.

Related Programming Samples

Custom Styles
Shows how to create custom styles for nodes, edges, labels, ports, and edge arrows.
01 Rendering the Port
Visualize a port as a basic circle shape

Type Parameters

TVisual: Visual
The optional type of the created and updated by the and methods. This type argument can be omitted, but specifying a more concrete type helps conveniently implementing with TypeScript.

Type Details

yFiles module
view

Constructors

Properties

Methods