C

SvgProcessingStep

A class responsible for processing a Shape representing a graph object rendered by styles that use svg elements.

Remarks

More precisely, this class calculates the geometry of the actual shape, along with the geometry of other potential elements included in the svg element.

This processing step has to be registered to the list of IShapeProcessingSteps of the VsdxExportConfiguration.

Members

Show:

Constructors

Initializes a new instance of the SvgProcessingStep class.

Properties

Methods

This will be called once after the export is finished and shall clear any state created during the export.

Creates the Visual for an IModelItem that will be converted to VSDX shapes.

Can be used to customize the visual created by an item's style for the export.

Since this method is asynchronous it can also be used to make sure a visual has been completely rendered before the SvgProcessingStep converts it to VSDX shapes. Note this when using a UI framework to render the contents of an item's visual: Some UI frameworks will update the visual's content only after the IVisualCreator.createVisual has returned. This is not noticeable when rendering the graph live in the browser, but retroactive modifications to a visual have no effect during the VSDX Export. This method can be overridden to make sure the UI framework has updated the visual's contents before it is converted to VSDX shapes.

The default implementation simply delegates to IVisualCreator.createVisual of the item's style.

protected

Parameters

item: IModelItem

A copy of the item to create the visual for.

renderContext: IRenderContext

The render context.

Return Value

Promise<[ Visual, null]> | Visual | null
A promise resolving to a Visual.

See node.

Parameters

shape: Shape

The shape representing the edge.

sourceConnection: Connection

The source connection representing the source port.

targetConnection: Connection

The target connection representing the target port.

edge: IEdge

The edge this shape represents.

context: ShapeProcessingContext

Return Value

Promise<void>
An empty promise.

See node.

Parameters

shape: Shape

The shape representing the label.

containerShape: Shape

The shape representing the label's owner. In case the owner is a node, this is the container shape of the node.

label: ILabel

The label this shape represents

context: ShapeProcessingContext

Return Value

Promise<void>
An empty promise.

Will be called once for each node in the graph.

This method may now set or modify any values of the shape.

Parameters

shape: Shape

The shape representing the visual appearance of the node.

containerShape: GroupShape

The shape containing all shapes belonging to this node, including shapes for labels, ports and the shape passed as first argument.

node: INode

The node this shape represents.

context: ShapeProcessingContext

Return Value

Promise<void>
An empty promise.

See node.

Parameters

shape: Shape

The shape representing the port.

ownerShape: GroupShape

The shape representing the port's owner. In case the owner is a node, this is the container shape of the node.

port: IPort

The port this shape represents.

context: ShapeProcessingContext

Return Value

Promise<void>
An empty promise.