C

CachingMasterProvider
abstract

An abstract base class that provides functionality for caching Master and StyleSheet instances.

Remarks

For each yFiles style instance, this master provider shall accept, one set of Master and StyleSheet instances is created and stored in a map. These instances will be returned for any future graph items with the same yFiles style instance.

Members

Show:

Constructors

Initializes a new instance of the CachingMasterProvider class.

The user should pass one or multiple style types that this master provider shall accept.

protected

Parameters

nodeStyleType?: ClassConstructor<INodeStyle>
edgeStyleType?: ClassConstructor<IEdgeStyle>
portStyleType?: ClassConstructor<IPortStyle>
labelStyleType?: ClassConstructor<ILabelStyle>

Initializes a new instance of the CachingMasterProvider class.

The user should pass one or multiple style types that this master provider shall accept.

protected

Parameters

nodeStyleType?: ClassConstructor<INodeStyle>
edgeStyleType?: ClassConstructor<IEdgeStyle>
portStyleType?: ClassConstructor<IPortStyle>
labelStyleType?: ClassConstructor<ILabelStyle>

Methods

This will be called once after the export is finished and shall clear any state created during the export, especially maps containing masters or style sheets for reuse.

Note that a master or style sheet is only valid for the same export run it was created.

This method shall create an object containing a master and style sheets that will be cached for later calls. You do not need to check if the item's style has the correct type.

This method shall create an object containing a master and style sheets that will be cached for later calls. You do not need to check if the item's style has the correct type.

This method shall create an object containing a master and style sheets that will be cached for later calls. You do not need to check if the item's style has the correct type.

This method shall create an object containing a master and style sheets that will be cached for later calls. You do not need to check if the item's style has the correct type.

Will be called once for each node in the graph and shall return a VSDX Master and VSDX StyleSheets or an empty Promise.

When this method returns a value the propagation will be stopped and the returned master and styles are used for the shape representing this node. Otherwise, this node will be propagated through other IMasterProviders in the chain after this one.

Parameters

node: INode

The node to create the master and styles for.

context: MasterProviderContext

Return Value

Promise<[ShapeStyleConfiguration, null]>
A promise with an object containing a master and style sheets to stop the propagation or an empty promise.