Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
drawGraphAndAttachListeners() {
this.graph = new Workflow({
svgRoot: this.canvas.nativeElement as SVGSVGElement,
model: this.model as any,
plugins: [
new SVGArrangePlugin(),
new SVGPortDragPlugin(),
new SVGNodeMovePlugin(),
new SVGEdgeHoverPlugin(),
new SVGValidatePlugin(),
new SelectionPlugin(),
new ZoomPlugin(),
new DeletionPlugin(),
new UpdatePlugin()
],
editingEnabled: !this.readonly
});
try {
this.graph.fitToViewport();
} catch (ex) {
setTimeout(() => {
console.warn("Workflow should be able to fit in by now...");