A class responsible for creating VSDX masters and stylesheets for all graph items that are visualized by styles that use svg elements for rendering.
Remarks
The provider has to be registered to the list of master providers of the VsdxExportConfiguration.
The master created for this style will be cached and returned for all nodes that are rendered with the same yFiles style instance.
Note that, since most of the common yFiles styles are rendered through svg elements, it is recommended to register this provider at the end of the list of IMasterProviders so that it handles only styles for which no predestined processing step exists. For example, nodes with ShapeNodeStyle could also be processed by SvgProvider, but it is in general recommended to use the corresponding ShapeNodeProvider.
Members
Constructors
Initializes a new instance of the SvgProvider class.
Initializes a new instance of the SvgProvider class.
Methods
Note that a master or style sheet is only valid for the same export run it was created.
Defined in
CachingMasterProvider.clearcreateForEdge
(edge: IEdge, context: MasterProviderContext): Promise<ShapeStyleConfiguration>protectedThis 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.
createForEdge
(edge: IEdge, context: MasterProviderContext): Promise<ShapeStyleConfiguration>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.
Parameters
- edge: IEdge
The edge.
- context: MasterProviderContext
The context.
Return Value
Overrides
CachingMasterProvider.createForEdgecreateForLabel
(label: ILabel, context: MasterProviderContext): Promise<ShapeStyleConfiguration>protectedThis 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.
createForLabel
(label: ILabel, context: MasterProviderContext): Promise<ShapeStyleConfiguration>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.
Parameters
- label: ILabel
The label.
- context: MasterProviderContext
The context.
Return Value
Overrides
CachingMasterProvider.createForLabelcreateForNode
(node: INode, context: MasterProviderContext): Promise<ShapeStyleConfiguration>protectedThis 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.
createForNode
(node: INode, context: MasterProviderContext): Promise<ShapeStyleConfiguration>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.
Parameters
- node: INode
The node.
- context: MasterProviderContext
The context.
Return Value
Overrides
CachingMasterProvider.createForNodecreateForPort
(port: IPort, context: MasterProviderContext): Promise<ShapeStyleConfiguration>protectedThis 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.
createForPort
(port: IPort, context: MasterProviderContext): Promise<ShapeStyleConfiguration>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.
Parameters
- port: IPort
The port.
- context: MasterProviderContext
The context.
Return Value
Overrides
CachingMasterProvider.createForPortSee node.
See node.
See node.
See node.
Parameters
- label: ILabel
- context: MasterProviderContext
Return Value
Defined in
CachingMasterProvider.labelWill be called once for each node in the graph and shall return a VSDX Master and VSDX
StyleSheets or an empty Promise.
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.
Defined in
CachingMasterProvider.nodeSee node.
See node.