Skip to main content

exportStyles

defines the styles that will be sent to the export service when exporting the diagram

exportStyles?: boolean | string[];
Default value: true

Example

const diagram = new dhx.Diagram("diagram_container", {     exportStyles:[        "https://mySite.com/exportStyle.css",        "https://mySite.com/secondExportStyle.css"    ]});

Related sample: Diagram. Export. Export styles

By default, all css styles included to the page are sent to the export service when exporting a DHTMLX Diagram. As a result, the size of the request increases that can cause the request to fail.

To avoid this problem, you can reduce the size of the exported data. For example, setting the exportStyles property to false will prevent all styles from being sent to the export service:

const diagram = new dhx.Diagram("diagram_container", {     exportStyles: false});

Or you can define a set of styles you want to be exported. For that, you need to set string values with the absolute paths to the desired styles to the exportStyles array:

const diagram = new dhx.Diagram("diagram_container", {     exportStyles:[        "https://mySite.com/exportStyle.css",        "https://mySite.com/secondExportStyle.css"    ]});

Note, that you must use only absolute paths not relative ones.

Change log:

added in v3.1

Related articles#

Exporting Diagram