This class creates or parses a VsdxPackage, renders diagrams into it, and finally serializes the package.

Inheritance Hierarchy

Remarks

It provides a more powerful API than the VsdxExport class, and can parse (fromBlob) and modify existing VSDX files. It also allows to render (addGraph) multiple diagrams on a single page or on multiple different pages.

Members

No filters for this type

Properties

The VsdxPackage this class manages.

Methods

Renders the graph of the graphComponent on a page.

This method iterates the graph and creates appropriate shapes, masters and stylesheets for each item of the graph. The user can supply IMasterProviders and IShapeProcessingSteps through a VsdxExportConfiguration in order to customize the appearance of the graph items in the VSDX format.

Parameters

graphComponent: GraphComponent
config?: VsdxExportConfiguration

The export configuration. Default is VsdxExportConfiguration.createDefault().

page?: Page

An optional target page. If not provided, a new page will be added.

targetBounds?: Rect

Return Value

Promise<Page>
The page the diagram was written on. Either the page parameter or a new page if none was provided.

Renders the graph of the graphComponent on a page.

This method iterates the graph and creates appropriate shapes, masters and stylesheets for each item of the graph. The user can supply IMasterProviders and IShapeProcessingSteps through a VsdxExportConfiguration in order to customize the appearance of the graph items in the VSDX format.

Parameters

graphComponent: GraphComponent
config?: VsdxExportConfiguration
page?: Page
targetBounds?: Rect

Return Value

Promise<Page>
The page the diagram was written on. Either the page parameter or a new page if none was provided.

Writes the vsdxPackage to a VSDX file Blob.

Evaluates formulas if VsdxExportConfiguration.evaluateFormulas is set.

Parameters

Return Value

Static Methods

Creates a new VsdxIO instance. Sets reasonable defaults on the vsdxPackage such as creating a VsdxWindow and a default VsdxStyleSheet. The created VsdxPackage will initially have no pages.

Creates a new VsdxIO instance with an empty vsdxPackage.

Creates a new VsdxIO instance with a vsdxPackage that is parsed from the provided VSDX file. This allows for extending existing VSDX files.

static

Parameters

file: Blob

Return Value