Skip to main content

ExportControls

Provides a set of buttons allowing your users to export a given canvas as SVG, PNG or JPG.

info

This component only works when your surface is using a ShapeLibrary to render elements, or if you are using a Diagram.

Usage​

import { FLOWCHART_SHAPES } from "@visuallyjs/browser-ui"
import { VisuallyJsModule } from "@visuallyjs/browser-ui-angular"

@Component({
template:`<div>
<vjs-surface [renderOptions]="renderOptions" [data]="data"/>
<vjs-export-controls />
</div>`
})
export class MyApp {
renderOptions = {
shapes:{
sets:[ FLOWCHART_SHAPES ]
}
}
data = { ... }
}

Definition​

Inputs​

NameTypeDescription
allowJpgExport?booleanDefaults to true - whether or not to show a JPG export button.
allowPngExport?booleanDefaults to true - whether or not to show a PNG export button.
allowSvgExport?booleanDefaults to true - whether or not to show an SVG export button.
imageOptions?ImageExportUIOptionsOptions for image exports.
label?stringWhat to show in the label, if visible. Defaults to "Export:".
margins?PointXYOptional margins to apply to both SVG and image exports. Will not override any margins specified in svgOptions or imageOptions.
showLabel?booleanWhether or not to show a label in front of the buttons. Defaults to true.
svgOptions?SvgExportUIOptionsOptions for SVG exports.