diff --git a/package.json b/package.json index 4fbf17e..c79d5c4 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@angular/platform-browser-dynamic": "^16.2.6", "@angular/router": "^16.2.6", "@joint/plus": "file:joint-plus.tgz", + "libavoid-js": "^0.4.0", "rxjs": "^7.8.1", "tslib": "^2.6.2", "zone.js": "~0.13.0" diff --git a/src/app/app.component.ts b/src/app/app.component.ts index e13564c..eceeb59 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,5 +1,10 @@ import { AfterViewInit, OnInit, Component, ElementRef, ViewChild } from '@angular/core'; -import { dia, ui, shapes } from '@joint/plus'; +import { linkTools, elementTools, dia, shapes, highlighters } from '@joint/plus'; +import { Link, Message, FlowchartStart, FlowchartEnd } from '../shared/shapes'; +import ResizeTool from '../shared/resize-tool'; +import { AvoidRouter } from '../shared/avoid-router'; + +declare const window: any; @Component({ selector: 'app-root', @@ -11,47 +16,4346 @@ export class AppComponent implements OnInit, AfterViewInit { private graph: dia.Graph; private paper: dia.Paper; - private scroller: ui.PaperScroller; - public ngOnInit(): void { - const graph = this.graph = new dia.Graph({}, { cellNamespace: shapes }); + public async ngOnInit(): Promise { + const cellNamespace = { + ...shapes, + app: { + Link, + Message, + FlowchartStart, + FlowchartEnd + } + }; - const paper = this.paper = new dia.Paper({ - model: graph, - background: { - color: '#F8F9FA', + // Prepare the diagram. + const graph = window.graph = this.graph = new dia.Graph({}, { cellNamespace }); + const paper = window.paper = this.paper = new dia.Paper({ + model: graph, + cellViewNamespace: cellNamespace, + width: 1000, + height: 600, + gridSize: 10, + interactive: { linkMove: false }, + linkPinning: false, + async: true, + frozen: true, + background: { color: '#F3F7F6' }, + snapLinks: { radius: 100 }, + overflow: true, + defaultConnector: { + name: 'straight', + args: { + cornerType: 'cubic', + cornerRadius: 4, + }, + }, + highlighting: { + default: { + name: 'mask', + options: { + padding: 2, + attrs: { + stroke: '#EA3C24', + strokeWidth: 2, + }, + }, }, - frozen: true, - async: true, - sorting: dia.Paper.sorting.APPROX, - cellViewNamespace: shapes + }, + defaultLink: () => new Link(), + validateConnection: ( + sourceView, + sourceMagnet, + targetView, + targetMagnet, + end + ) => { + const source = sourceView.model as dia.Element; + const target = targetView.model as dia.Element; + if (source.isLink() || target.isLink()) return false; + if (targetMagnet === sourceMagnet) return false; + if (end === 'target' ? targetMagnet : sourceMagnet) { + return true; + } + if (source === target) return false; + return end === 'target' ? !target.hasPorts() : !source.hasPorts(); + }, + validateMagnet: (cellView, magnet) => { + // Do not create links from passive ports: + if (magnet.getAttribute('magnet') === 'passive') return false; + // Do not create links from ports which already have a connected links: + const portId = ((magnet.parentElement as HTMLElement).getAttribute('port') as string); + //const port = (cellView as dia.ElementView).findPortNode(portId); + const portConnectedLinks = graph.getConnectedLinks(cellView.model).filter((link) => { + if (link.source()?.port === portId) return true; + return false; + }); + if (portConnectedLinks.length === 0) return true; + return false; + }, }); - const scroller = this.scroller = new ui.PaperScroller({ - paper, - autoResizePaper: true, - cursor: 'grab' - }); + // Add tools to the elements. + graph.getElements().forEach((el) => addElementTools(el, paper)); + graph.on('add', (cell) => { + if (cell.isLink()) return; + addElementTools(cell, paper); + }); - scroller.render(); + function addElementTools(el: dia.Element, paper: dia.Paper) { + const tools = [ + new ResizeTool({ + selector: 'body', + }), + new elementTools.Remove({ + useModelGeometry: true, + x: -10, + y: -10, + }), + ]; + if (!el.hasPorts()) { + tools.push( + new elementTools.Connect({ + useModelGeometry: true, + x: 'calc(w + 10)', + y: 'calc(h - 20)', + }) + ); + } - const rect = new shapes.standard.Rectangle({ - position: { x: 100, y: 100 }, - size: { width: 100, height: 50 }, - attrs: { - label: { - text: 'Hello World' - } - } + el.findView(paper).addTools(new dia.ToolsView({ tools })); + } + + // Add tools to the links. + paper.on('link:mouseenter', (linkView) => { + linkView.addTools( + new dia.ToolsView({ + tools: [ + new linkTools.Remove(), + new linkTools.TargetArrowhead(), + ], + }) + ); + }); + + paper.on('link:mouseleave', (linkView) => { + linkView.removeTools(); + }); + + paper.on('blank:pointerdblclick', (evt, x, y) => { + const node = new Message({ + position: { x: x - 50, y: y - 50 }, + size: { width: 100, height: 100 }, + }); + graph.addCell(node); + }); + + // Add a class to the links when they are being interacted with. + // See `styles.css` for the styles. + paper.on('link:pointerdown', (linkView) => { + highlighters.addClass.add(linkView, 'line', 'active-link', { + className: 'active-link' }); + }); - this.graph.addCell(rect); + paper.on('link:pointerup', (linkView) => { + highlighters.addClass.remove(linkView); + }); } public ngAfterViewInit(): void { - const { scroller, paper, canvas } = this; - canvas.nativeElement.appendChild(this.scroller.el); - scroller.center(); + const { canvas, graph, paper } = this; + + // Prepare the Avoid Router. + const router = new AvoidRouter(graph, { + shapeBufferDistance: 20, + idealNudgingDistance: 10, + portOverflow: 10, + }); + router.addGraphListeners(); + + // Import elements. + router.disableListeners(); + graph.fromJSON({ + "cells": [ + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "S100", + "magnet": "portBody", + "port": "POut100" + }, + "target": { + "id": "T0", + "magnet": "portBody", + "port": "PIn100" + }, + "id": "L100", + "z": 1, + "attrs": {} + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn100" + }, + { + "group": "out", + "id": "POut101" + } + ] + }, + "position": { + "x": 500, + "y": 0 + }, + "id": "T0", + "z": 2, + "attrs": { + "label": { + "text": "Init" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn101" + }, + { + "group": "out", + "id": "POut106" + } + ] + }, + "position": { + "x": 500, + "y": 250 + }, + "id": "T139", + "z": 3, + "attrs": { + "label": { + "text": "Ven" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn106" + }, + { + "group": "out", + "id": "POut102" + } + ] + }, + "position": { + "x": 500, + "y": 500 + }, + "id": "T112", + "z": 4, + "attrs": { + "label": { + "text": "Schr" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 448, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn102" + }, + { + "group": "out", + "id": "POut103" + }, + { + "group": "out", + "id": "POut104" + }, + { + "group": "out", + "id": "POut173" + } + ] + }, + "position": { + "x": 500, + "y": 750 + }, + "id": "T113", + "z": 5, + "attrs": { + "label": { + "text": "Ver" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn103" + }, + { + "group": "out", + "id": "POut105" + } + ] + }, + "position": { + "x": 106, + "y": 1000 + }, + "id": "T134", + "z": 6, + "attrs": { + "label": { + "text": "Box" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn105" + }, + { + "group": "out", + "id": "POut107" + } + ] + }, + "position": { + "x": 303, + "y": 1250 + }, + "id": "T141", + "z": 7, + "attrs": { + "label": { + "text": "Vert" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn107" + }, + { + "group": "out", + "id": "POut108" + } + ] + }, + "position": { + "x": 303, + "y": 1500 + }, + "id": "T142", + "z": 8, + "attrs": { + "label": { + "text": "Dok" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn108" + }, + { + "group": "out", + "id": "POut137" + } + ] + }, + "position": { + "x": 303, + "y": 1750 + }, + "id": "T383", + "z": 9, + "attrs": { + "label": { + "text": "Ke" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn137" + }, + { + "group": "out", + "id": "POut134" + } + ] + }, + "position": { + "x": 303, + "y": 2000 + }, + "id": "T370", + "z": 10, + "attrs": { + "label": { + "text": "Info" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn134" + }, + { + "group": "out", + "id": "POut135" + } + ] + }, + "position": { + "x": 303, + "y": 2250 + }, + "id": "T371", + "z": 11, + "attrs": { + "label": { + "text": "Ep" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn104" + }, + { + "group": "out", + "id": "POut136" + } + ] + }, + "position": { + "x": 600, + "y": 1000 + }, + "id": "T373", + "z": 12, + "attrs": { + "label": { + "text": "Scu" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn109" + }, + { + "group": "in", + "id": "PIn136" + }, + { + "group": "out", + "id": "POut111" + } + ] + }, + "position": { + "x": 797, + "y": 1250 + }, + "id": "T157", + "z": 13, + "attrs": { + "label": { + "text": "VerTest" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn111" + }, + { + "group": "out", + "id": "POut112" + } + ] + }, + "position": { + "x": 797, + "y": 1500 + }, + "id": "T158", + "z": 14, + "attrs": { + "label": { + "text": "V" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn112" + }, + { + "group": "out", + "id": "POut113" + } + ] + }, + "position": { + "x": 797, + "y": 1750 + }, + "id": "T191", + "z": 15, + "attrs": { + "label": { + "text": "Sc" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn113" + }, + { + "group": "out", + "id": "POut142" + }, + { + "group": "out", + "id": "POut143" + } + ] + }, + "position": { + "x": 797, + "y": 2000 + }, + "id": "T402", + "z": 16, + "attrs": { + "label": { + "text": "Re" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn142" + }, + { + "group": "out", + "id": "POut153" + }, + { + "group": "out", + "id": "POut154" + } + ] + }, + "position": { + "x": 797, + "y": 2250 + }, + "id": "T427", + "z": 17, + "attrs": { + "label": { + "text": "Ber" + } + } + }, + { + "type": "app.FlowchartStart", + "size": { + "width": 48, + "height": 48 + }, + "ports": { + "items": [ + { + "group": "out", + "id": "POut100" + } + ] + }, + "position": { + "x": 500, + "y": -160 + }, + "id": "S100", + "z": 18, + "attrs": { + "label": { + "text": "Start" + }, + "data": { + + }, + "additional_info": { + "text": "" + }, + "workflowDetails": { + "workflowName": "Stest", + "workflowVersion": "4.39", + "author": "" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn153" + }, + { + "group": "out", + "id": "POut155" + }, + { + "group": "out", + "id": "POut156" + } + ] + }, + "position": { + "x": 797, + "y": 2500 + }, + "id": "T440", + "z": 18, + "attrs": { + "label": { + "text": "Ve" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn155" + }, + { + "group": "out", + "id": "POut149" + }, + { + "group": "out", + "id": "POut150" + } + ] + }, + "position": { + "x": 303, + "y": 2750 + }, + "id": "T422", + "z": 19, + "attrs": { + "label": { + "text": "GV" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn150" + }, + { + "group": "out", + "id": "POut144" + }, + { + "group": "out", + "id": "POut145" + } + ] + }, + "position": { + "x": 600, + "y": 3000 + }, + "id": "T404", + "z": 20, + "attrs": { + "label": { + "text": "Ren" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn144" + }, + { + "group": "out", + "id": "POut157" + } + ] + }, + "position": { + "x": 600, + "y": 3250 + }, + "id": "T442", + "z": 21, + "attrs": { + "label": { + "text": "GV" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn156" + }, + { + "group": "out", + "id": "POut147" + }, + { + "group": "out", + "id": "POut148" + } + ] + }, + "position": { + "x": 797, + "y": 2750 + }, + "id": "T421", + "z": 22, + "attrs": { + "label": { + "text": "G 3b" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn148" + }, + { + "group": "out", + "id": "POut151" + }, + { + "group": "out", + "id": "POut152" + } + ] + }, + "position": { + "x": 1094, + "y": 3000 + }, + "id": "T425", + "z": 23, + "attrs": { + "label": { + "text": "R" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn151" + }, + { + "group": "out", + "id": "POut158" + } + ] + }, + "position": { + "x": 1094, + "y": 3250 + }, + "id": "T444", + "z": 24, + "attrs": { + "label": { + "text": "GV" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn143" + }, + { + "group": "in", + "id": "PIn145" + }, + { + "group": "in", + "id": "PIn147" + }, + { + "group": "in", + "id": "PIn149" + }, + { + "group": "in", + "id": "PIn152" + }, + { + "group": "in", + "id": "PIn154" + }, + { + "group": "in", + "id": "PIn157" + }, + { + "group": "in", + "id": "PIn158" + }, + { + "group": "out", + "id": "POut114" + }, + { + "group": "out", + "id": "POut115" + } + ] + }, + "position": { + "x": 106, + "y": 3000 + }, + "id": "T192", + "z": 25, + "attrs": { + "label": { + "text": "Za" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn114" + }, + { + "group": "out", + "id": "POut116" + } + ] + }, + "position": { + "x": 106, + "y": 3250 + }, + "id": "T194", + "z": 26, + "attrs": { + "label": { + "text": "Kontr" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn116" + }, + { + "group": "out", + "id": "POut146" + } + ] + }, + "position": { + "x": 500, + "y": 3500 + }, + "id": "T411", + "z": 27, + "attrs": { + "label": { + "text": "Buc" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 448, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn115" + }, + { + "group": "in", + "id": "PIn146" + }, + { + "group": "out", + "id": "POut117" + }, + { + "group": "out", + "id": "POut118" + }, + { + "group": "out", + "id": "POut119" + } + ] + }, + "position": { + "x": 500, + "y": 3750 + }, + "id": "T325", + "z": 28, + "attrs": { + "label": { + "text": "Ahl" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn117" + }, + { + "group": "out", + "id": "POut120" + } + ] + }, + "position": { + "x": 303, + "y": 4000 + }, + "id": "T330", + "z": 29, + "attrs": { + "label": { + "text": "Scha" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn119" + }, + { + "group": "out", + "id": "POut121" + } + ] + }, + "position": { + "x": 797, + "y": 4000 + }, + "id": "T333", + "z": 30, + "attrs": { + "label": { + "text": "Um" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn118" + }, + { + "group": "in", + "id": "PIn120" + }, + { + "group": "in", + "id": "PIn121" + }, + { + "group": "out", + "id": "POut160" + }, + { + "group": "out", + "id": "POut161" + } + ] + }, + "position": { + "x": 500, + "y": 4250 + }, + "id": "T446", + "z": 31, + "attrs": { + "label": { + "text": "ER" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn160" + }, + { + "group": "out", + "id": "POut162" + }, + { + "group": "out", + "id": "POut163" + } + ] + }, + "position": { + "x": 500, + "y": 4500 + }, + "id": "T448", + "z": 32, + "attrs": { + "label": { + "text": "E" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn162" + }, + { + "group": "out", + "id": "POut164" + } + ] + }, + "position": { + "x": 500, + "y": 4750 + }, + "id": "T450", + "z": 33, + "attrs": { + "label": { + "text": "ES" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn164" + }, + { + "group": "out", + "id": "POut165" + } + ] + }, + "position": { + "x": 500, + "y": 5000 + }, + "id": "T451", + "z": 34, + "attrs": { + "label": { + "text": "Dru" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn161" + }, + { + "group": "in", + "id": "PIn163" + }, + { + "group": "in", + "id": "PIn165" + }, + { + "group": "in", + "id": "PIn169" + }, + { + "group": "out", + "id": "POut167" + }, + { + "group": "out", + "id": "POut168" + } + ] + }, + "position": { + "x": 500, + "y": 5250 + }, + "id": "T461", + "z": 35, + "attrs": { + "label": { + "text": "Che" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn167" + }, + { + "group": "out", + "id": "POut169" + } + ] + }, + "position": { + "x": 303, + "y": 5500 + }, + "id": "T462", + "z": 36, + "attrs": { + "label": { + "text": "Me" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn168" + }, + { + "group": "out", + "id": "POut170" + }, + { + "group": "out", + "id": "POut171" + } + ] + }, + "position": { + "x": 797, + "y": 5500 + }, + "id": "T463", + "z": 37, + "attrs": { + "label": { + "text": "Mit" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn171" + }, + { + "group": "out", + "id": "POut172" + } + ] + }, + "position": { + "x": 797, + "y": 5750 + }, + "id": "T466", + "z": 38, + "attrs": { + "label": { + "text": "Pl" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn170" + }, + { + "group": "in", + "id": "PIn172" + }, + { + "group": "out", + "id": "POut138" + }, + { + "group": "out", + "id": "POut139" + } + ] + }, + "position": { + "x": 303, + "y": 5750 + }, + "id": "T396", + "z": 39, + "attrs": { + "label": { + "text": "Aut" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn138" + }, + { + "group": "out", + "id": "POut140" + } + ] + }, + "position": { + "x": 303, + "y": 6000 + }, + "id": "T398", + "z": 40, + "attrs": { + "label": { + "text": "A" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn139" + }, + { + "group": "out", + "id": "POut141" + } + ] + }, + "position": { + "x": 797, + "y": 6000 + }, + "id": "T401", + "z": 41, + "attrs": { + "label": { + "text": "Ma" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn140" + }, + { + "group": "in", + "id": "PIn141" + }, + { + "group": "out", + "id": "POut109" + }, + { + "group": "out", + "id": "POut110" + } + ] + }, + "position": { + "x": 500, + "y": 6250 + }, + "id": "T156", + "z": 42, + "attrs": { + "label": { + "text": "No" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 760, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn110" + }, + { + "group": "out", + "id": "POut124" + }, + { + "group": "out", + "id": "POut125" + }, + { + "group": "out", + "id": "POut126" + }, + { + "group": "out", + "id": "POut127" + }, + { + "group": "out", + "id": "POut128" + }, + { + "group": "out", + "id": "POut129" + } + ] + }, + "position": { + "x": 500, + "y": 6500 + }, + "id": "T357", + "z": 43, + "attrs": { + "label": { + "text": "G" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn124" + }, + { + "group": "out", + "id": "POut130" + } + ] + }, + "position": { + "x": -485, + "y": 6750 + }, + "id": "T359", + "z": 44, + "attrs": { + "label": { + "text": "Da" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn125" + }, + { + "group": "out", + "id": "POut131" + } + ] + }, + "position": { + "x": 9, + "y": 6750 + }, + "id": "T361", + "z": 45, + "attrs": { + "label": { + "text": "Da" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn126" + }, + { + "group": "out", + "id": "POut132" + } + ] + }, + "position": { + "x": 503, + "y": 6750 + }, + "id": "T363", + "z": 46, + "attrs": { + "label": { + "text": "Da" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn127" + }, + { + "group": "out", + "id": "POut133" + } + ] + }, + "position": { + "x": 997, + "y": 6750 + }, + "id": "T369", + "z": 47, + "attrs": { + "label": { + "text": "D" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn128" + }, + { + "group": "out", + "id": "POut159" + } + ] + }, + "position": { + "x": 1491, + "y": 6750 + }, + "id": "T445", + "z": 48, + "attrs": { + "label": { + "text": "Ser" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn129" + }, + { + "group": "out", + "id": "POut166" + } + ] + }, + "position": { + "x": 1985, + "y": 6750 + }, + "id": "T454", + "z": 49, + "attrs": { + "label": { + "text": "P" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn130" + }, + { + "group": "in", + "id": "PIn131" + }, + { + "group": "in", + "id": "PIn132" + }, + { + "group": "in", + "id": "PIn133" + }, + { + "group": "in", + "id": "PIn159" + }, + { + "group": "in", + "id": "PIn166" + }, + { + "group": "out", + "id": "POut122" + } + ] + }, + "position": { + "x": 500, + "y": 7000 + }, + "id": "T346", + "z": 50, + "attrs": { + "label": { + "text": "In" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn122" + }, + { + "group": "out", + "id": "POut123" + } + ] + }, + "position": { + "x": 500, + "y": 7250 + }, + "id": "T347", + "z": 51, + "attrs": { + "label": { + "text": "Ep" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn173" + } + ] + }, + "position": { + "x": 1094, + "y": 1000 + }, + "id": "T1", + "z": 52, + "attrs": { + "label": { + "text": "Test1" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn123" + } + ] + }, + "position": { + "x": 500, + "y": 7500 + }, + "id": "T467", + "z": 53, + "attrs": { + "label": { + "text": "end" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn135" + } + ] + }, + "position": { + "x": 303, + "y": 2500 + }, + "id": "E10", + "z": 54, + "attrs": { + "label": { + "text": "Ende" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T0", + "magnet": "portBody", + "port": "POut101" + }, + "target": { + "id": "T139", + "magnet": "portBody", + "port": "PIn101" + }, + "id": "1", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T112", + "magnet": "portBody", + "port": "POut102" + }, + "target": { + "id": "T113", + "magnet": "portBody", + "port": "PIn102" + }, + "id": "2", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "u " + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T113", + "magnet": "portBody", + "port": "POut103" + }, + "target": { + "id": "T134", + "magnet": "portBody", + "port": "PIn103" + }, + "id": "3", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "pp " + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T113", + "magnet": "portBody", + "port": "POut104" + }, + "target": { + "id": "T373", + "magnet": "portBody", + "port": "PIn104" + }, + "id": "4", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T134", + "magnet": "portBody", + "port": "POut105" + }, + "target": { + "id": "T141", + "magnet": "portBody", + "port": "PIn105" + }, + "id": "5", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T139", + "magnet": "portBody", + "port": "POut106" + }, + "target": { + "id": "T112", + "magnet": "portBody", + "port": "PIn106" + }, + "id": "6", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T141", + "magnet": "portBody", + "port": "POut107" + }, + "target": { + "id": "T142", + "magnet": "portBody", + "port": "PIn107" + }, + "id": "7", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T142", + "magnet": "portBody", + "port": "POut108" + }, + "target": { + "id": "T383", + "magnet": "portBody", + "port": "PIn108" + }, + "id": "8", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "tt" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T156", + "magnet": "portBody", + "port": "POut109" + }, + "target": { + "id": "T157", + "magnet": "portBody", + "port": "PIn109" + }, + "id": "9", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "yt" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T156", + "magnet": "portBody", + "port": "POut110" + }, + "target": { + "id": "T357", + "magnet": "portBody", + "port": "PIn110" + }, + "id": "10", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T157", + "magnet": "portBody", + "port": "POut111" + }, + "target": { + "id": "T158", + "magnet": "portBody", + "port": "PIn111" + }, + "id": "11", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T158", + "magnet": "portBody", + "port": "POut112" + }, + "target": { + "id": "T191", + "magnet": "portBody", + "port": "PIn112" + }, + "id": "12", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T191", + "magnet": "portBody", + "port": "POut113" + }, + "target": { + "id": "T402", + "magnet": "portBody", + "port": "PIn113" + }, + "id": "13", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "rrq" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T192", + "magnet": "portBody", + "port": "POut114" + }, + "target": { + "id": "T194", + "magnet": "portBody", + "port": "PIn114" + }, + "id": "14", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "re" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T192", + "magnet": "portBody", + "port": "POut115" + }, + "target": { + "id": "T325", + "magnet": "portBody", + "port": "PIn115" + }, + "id": "15", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T194", + "magnet": "portBody", + "port": "POut116" + }, + "target": { + "id": "T411", + "magnet": "portBody", + "port": "PIn116" + }, + "id": "16", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "as" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T325", + "magnet": "portBody", + "port": "POut117" + }, + "target": { + "id": "T330", + "magnet": "portBody", + "port": "PIn117" + }, + "id": "17", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "dw" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "cd" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T325", + "magnet": "portBody", + "port": "POut118" + }, + "target": { + "id": "T446", + "magnet": "portBody", + "port": "PIn118" + }, + "id": "18", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "ww" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T325", + "magnet": "portBody", + "port": "POut119" + }, + "target": { + "id": "T333", + "magnet": "portBody", + "port": "PIn119" + }, + "id": "19", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T330", + "magnet": "portBody", + "port": "POut120" + }, + "target": { + "id": "T446", + "magnet": "portBody", + "port": "PIn120" + }, + "id": "20", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T333", + "magnet": "portBody", + "port": "POut121" + }, + "target": { + "id": "T446", + "magnet": "portBody", + "port": "PIn121" + }, + "id": "21", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T346", + "magnet": "portBody", + "port": "POut122" + }, + "target": { + "id": "T347", + "magnet": "portBody", + "port": "PIn122" + }, + "id": "22", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T347", + "magnet": "portBody", + "port": "POut123" + }, + "target": { + "id": "T467", + "magnet": "portBody", + "port": "PIn123" + }, + "id": "23", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "qa" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T357", + "magnet": "portBody", + "port": "POut124" + }, + "target": { + "id": "T359", + "magnet": "portBody", + "port": "PIn124" + }, + "id": "24", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "qsd" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "qasd" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T357", + "magnet": "portBody", + "port": "POut125" + }, + "target": { + "id": "T361", + "magnet": "portBody", + "port": "PIn125" + }, + "id": "25", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "xc" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "bh" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T357", + "magnet": "portBody", + "port": "POut126" + }, + "target": { + "id": "T363", + "magnet": "portBody", + "port": "PIn126" + }, + "id": "26", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "vf" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "qas" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T357", + "magnet": "portBody", + "port": "POut127" + }, + "target": { + "id": "T369", + "magnet": "portBody", + "port": "PIn127" + }, + "id": "27", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "xc" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "qsd" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T357", + "magnet": "portBody", + "port": "POut128" + }, + "target": { + "id": "T445", + "magnet": "portBody", + "port": "PIn128" + }, + "id": "28", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "cf" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T357", + "magnet": "portBody", + "port": "POut129" + }, + "target": { + "id": "T454", + "magnet": "portBody", + "port": "PIn129" + }, + "id": "29", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T359", + "magnet": "portBody", + "port": "POut130" + }, + "target": { + "id": "T346", + "magnet": "portBody", + "port": "PIn130" + }, + "id": "30", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T361", + "magnet": "portBody", + "port": "POut131" + }, + "target": { + "id": "T346", + "magnet": "portBody", + "port": "PIn131" + }, + "id": "31", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T363", + "magnet": "portBody", + "port": "POut132" + }, + "target": { + "id": "T346", + "magnet": "portBody", + "port": "PIn132" + }, + "id": "32", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T369", + "magnet": "portBody", + "port": "POut133" + }, + "target": { + "id": "T346", + "magnet": "portBody", + "port": "PIn133" + }, + "id": "33", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T370", + "magnet": "portBody", + "port": "POut134" + }, + "target": { + "id": "T371", + "magnet": "portBody", + "port": "PIn134" + }, + "id": "34", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T371", + "magnet": "portBody", + "port": "POut135" + }, + "target": { + "id": "E10", + "magnet": "portBody", + "port": "PIn135" + }, + "id": "35", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T373", + "magnet": "portBody", + "port": "POut136" + }, + "target": { + "id": "T157", + "magnet": "portBody", + "port": "PIn136" + }, + "id": "36", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T383", + "magnet": "portBody", + "port": "POut137" + }, + "target": { + "id": "T370", + "magnet": "portBody", + "port": "PIn137" + }, + "id": "37", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "qxd" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T396", + "magnet": "portBody", + "port": "POut138" + }, + "target": { + "id": "T398", + "magnet": "portBody", + "port": "PIn138" + }, + "id": "38", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "cgw" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T396", + "magnet": "portBody", + "port": "POut139" + }, + "target": { + "id": "T401", + "magnet": "portBody", + "port": "PIn139" + }, + "id": "39", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T398", + "magnet": "portBody", + "port": "POut140" + }, + "target": { + "id": "T156", + "magnet": "portBody", + "port": "PIn140" + }, + "id": "40", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T401", + "magnet": "portBody", + "port": "POut141" + }, + "target": { + "id": "T156", + "magnet": "portBody", + "port": "PIn141" + }, + "id": "41", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "qxd" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T402", + "magnet": "portBody", + "port": "POut142" + }, + "target": { + "id": "T427", + "magnet": "portBody", + "port": "PIn142" + }, + "id": "42", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "nj" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T402", + "magnet": "portBody", + "port": "POut143" + }, + "target": { + "id": "T192", + "magnet": "portBody", + "port": "PIn143" + }, + "id": "43", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "xde" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T404", + "magnet": "portBody", + "port": "POut144" + }, + "target": { + "id": "T442", + "magnet": "portBody", + "port": "PIn144" + }, + "id": "44", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "as" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T404", + "magnet": "portBody", + "port": "POut145" + }, + "target": { + "id": "T192", + "magnet": "portBody", + "port": "PIn145" + }, + "id": "45", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T411", + "magnet": "portBody", + "port": "POut146" + }, + "target": { + "id": "T325", + "magnet": "portBody", + "port": "PIn146" + }, + "id": "46", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "bq" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T421", + "magnet": "portBody", + "port": "POut147" + }, + "target": { + "id": "T192", + "magnet": "portBody", + "port": "PIn147" + }, + "id": "47", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "zq" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T421", + "magnet": "portBody", + "port": "POut148" + }, + "target": { + "id": "T425", + "magnet": "portBody", + "port": "PIn148" + }, + "id": "48", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "zq" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T422", + "magnet": "portBody", + "port": "POut149" + }, + "target": { + "id": "T192", + "magnet": "portBody", + "port": "PIn149" + }, + "id": "49", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "zqw" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T422", + "magnet": "portBody", + "port": "POut150" + }, + "target": { + "id": "T404", + "magnet": "portBody", + "port": "PIn150" + }, + "id": "50", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "zq" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T425", + "magnet": "portBody", + "port": "POut151" + }, + "target": { + "id": "T444", + "magnet": "portBody", + "port": "PIn151" + }, + "id": "51", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "vre" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T425", + "magnet": "portBody", + "port": "POut152" + }, + "target": { + "id": "T192", + "magnet": "portBody", + "port": "PIn152" + }, + "id": "52", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "9" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T427", + "magnet": "portBody", + "port": "POut153" + }, + "target": { + "id": "T440", + "magnet": "portBody", + "port": "PIn153" + }, + "id": "53", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "xq" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T427", + "magnet": "portBody", + "port": "POut154" + }, + "target": { + "id": "T192", + "magnet": "portBody", + "port": "PIn154" + }, + "id": "54", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "zx" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T440", + "magnet": "portBody", + "port": "POut155" + }, + "target": { + "id": "T422", + "magnet": "portBody", + "port": "PIn155" + }, + "id": "55", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "xcf" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T440", + "magnet": "portBody", + "port": "POut156" + }, + "target": { + "id": "T421", + "magnet": "portBody", + "port": "PIn156" + }, + "id": "56", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T442", + "magnet": "portBody", + "port": "POut157" + }, + "target": { + "id": "T192", + "magnet": "portBody", + "port": "PIn157" + }, + "id": "57", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T444", + "magnet": "portBody", + "port": "POut158" + }, + "target": { + "id": "T192", + "magnet": "portBody", + "port": "PIn158" + }, + "id": "58", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T445", + "magnet": "portBody", + "port": "POut159" + }, + "target": { + "id": "T346", + "magnet": "portBody", + "port": "PIn159" + }, + "id": "59", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "[esr]='1'" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T446", + "magnet": "portBody", + "port": "POut160" + }, + "target": { + "id": "T448", + "magnet": "portBody", + "port": "PIn160" + }, + "id": "60", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "bg" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T446", + "magnet": "portBody", + "port": "POut161" + }, + "target": { + "id": "T461", + "magnet": "portBody", + "port": "PIn161" + }, + "id": "61", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "aq" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T448", + "magnet": "portBody", + "port": "POut162" + }, + "target": { + "id": "T450", + "magnet": "portBody", + "port": "PIn162" + }, + "id": "62", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "vg" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T448", + "magnet": "portBody", + "port": "POut163" + }, + "target": { + "id": "T461", + "magnet": "portBody", + "port": "PIn163" + }, + "id": "63", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T450", + "magnet": "portBody", + "port": "POut164" + }, + "target": { + "id": "T451", + "magnet": "portBody", + "port": "PIn164" + }, + "id": "64", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T451", + "magnet": "portBody", + "port": "POut165" + }, + "target": { + "id": "T461", + "magnet": "portBody", + "port": "PIn165" + }, + "id": "65", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T454", + "magnet": "portBody", + "port": "POut166" + }, + "target": { + "id": "T346", + "magnet": "portBody", + "port": "PIn166" + }, + "id": "66", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "xxas" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T461", + "magnet": "portBody", + "port": "POut167" + }, + "target": { + "id": "T462", + "magnet": "portBody", + "port": "PIn167" + }, + "id": "67", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "qsd" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T461", + "magnet": "portBody", + "port": "POut168" + }, + "target": { + "id": "T463", + "magnet": "portBody", + "port": "PIn168" + }, + "id": "68", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T462", + "magnet": "portBody", + "port": "POut169" + }, + "target": { + "id": "T461", + "magnet": "portBody", + "port": "PIn169" + }, + "id": "69", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "xsw" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T463", + "magnet": "portBody", + "port": "POut170" + }, + "target": { + "id": "T396", + "magnet": "portBody", + "port": "PIn170" + }, + "id": "70", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "ax" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T463", + "magnet": "portBody", + "port": "POut171" + }, + "target": { + "id": "T466", + "magnet": "portBody", + "port": "PIn171" + }, + "id": "71", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T466", + "magnet": "portBody", + "port": "POut172" + }, + "target": { + "id": "T396", + "magnet": "portBody", + "port": "PIn172" + }, + "id": "72", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T113", + "magnet": "portBody", + "port": "POut173" + }, + "target": { + "id": "T1", + "magnet": "portBody", + "port": "PIn173" + }, + "id": "L101", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + } + ] + }); + graph.getElements().forEach(element => { + const [firstInPort] = element.getGroupPorts('in'); + const linksToFix = graph.getConnectedLinks(element, { inbound: true }).filter(link => link.target().port !== firstInPort.id); + linksToFix.forEach(link => { + const oldTarget = link.target(); + const newTarget = Object.assign({}, oldTarget, { port: firstInPort.id }); + link.target(newTarget); + }); + }); + + // Finalize preparation of the paper. + canvas.nativeElement.appendChild(paper.el); paper.unfreeze(); + paper.fitToContent({ + useModelGeometry: true, + padding: 100, + allowNewOrigin: 'any', + }); + + // Enable the Avoid Router. + router.routeAll(); + router.enableListeners(); } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index b1c6c96..baf7a13 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,8 +1,14 @@ -import { NgModule } from '@angular/core'; +import { NgModule, APP_INITIALIZER } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; - import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; +import { AvoidRouterService } from './avoid-router.service'; + +export function avoidRouterInit(avoidRouterService: AvoidRouterService) { + return () => { + return avoidRouterService.load(); + }; +} @NgModule({ declarations: [ @@ -12,7 +18,14 @@ import { AppComponent } from './app.component'; BrowserModule, AppRoutingModule ], - providers: [], + providers: [ + { + provide: APP_INITIALIZER, + useFactory: avoidRouterInit, + multi: true, + deps: [AvoidRouterService] + } + ], bootstrap: [AppComponent] }) export class AppModule { } diff --git a/src/app/avoid-router.service.ts b/src/app/avoid-router.service.ts new file mode 100644 index 0000000..1fd3c9a --- /dev/null +++ b/src/app/avoid-router.service.ts @@ -0,0 +1,22 @@ +import { Injectable } from '@angular/core'; +import { AvoidRouter } from '../shared/avoid-router'; + +@Injectable({ + providedIn: 'root' +}) +export class AvoidRouterService { + public isLoaded: boolean; + + constructor() {} + + load(): Promise { + + const promise = AvoidRouter.load() + .then(() => { + this.isLoaded = true; + return true; + }); + + return promise; + } +} diff --git a/src/assets/wasm/libavoid.wasm b/src/assets/wasm/libavoid.wasm new file mode 100644 index 0000000..0018725 Binary files /dev/null and b/src/assets/wasm/libavoid.wasm differ diff --git a/src/shared/TestJsonData.json b/src/shared/TestJsonData.json new file mode 100644 index 0000000..2744301 --- /dev/null +++ b/src/shared/TestJsonData.json @@ -0,0 +1,4159 @@ +{ + "cells": [ + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "S100", + "magnet": "portBody", + "port": "POut100" + }, + "target": { + "id": "T0", + "magnet": "portBody", + "port": "PIn100" + }, + "id": "L100", + "z": 1, + "attrs": {} + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn100" + }, + { + "group": "out", + "id": "POut101" + } + ] + }, + "position": { + "x": 500, + "y": 0 + }, + "id": "T0", + "z": 2, + "attrs": { + "label": { + "text": "Init" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn101" + }, + { + "group": "out", + "id": "POut106" + } + ] + }, + "position": { + "x": 500, + "y": 250 + }, + "id": "T139", + "z": 3, + "attrs": { + "label": { + "text": "Ven" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn106" + }, + { + "group": "out", + "id": "POut102" + } + ] + }, + "position": { + "x": 500, + "y": 500 + }, + "id": "T112", + "z": 4, + "attrs": { + "label": { + "text": "Schr" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 448, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn102" + }, + { + "group": "out", + "id": "POut103" + }, + { + "group": "out", + "id": "POut104" + }, + { + "group": "out", + "id": "POut173" + } + ] + }, + "position": { + "x": 500, + "y": 750 + }, + "id": "T113", + "z": 5, + "attrs": { + "label": { + "text": "Ver" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn103" + }, + { + "group": "out", + "id": "POut105" + } + ] + }, + "position": { + "x": 106, + "y": 1000 + }, + "id": "T134", + "z": 6, + "attrs": { + "label": { + "text": "Box" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn105" + }, + { + "group": "out", + "id": "POut107" + } + ] + }, + "position": { + "x": 303, + "y": 1250 + }, + "id": "T141", + "z": 7, + "attrs": { + "label": { + "text": "Vert" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn107" + }, + { + "group": "out", + "id": "POut108" + } + ] + }, + "position": { + "x": 303, + "y": 1500 + }, + "id": "T142", + "z": 8, + "attrs": { + "label": { + "text": "Dok" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn108" + }, + { + "group": "out", + "id": "POut137" + } + ] + }, + "position": { + "x": 303, + "y": 1750 + }, + "id": "T383", + "z": 9, + "attrs": { + "label": { + "text": "Ke" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn137" + }, + { + "group": "out", + "id": "POut134" + } + ] + }, + "position": { + "x": 303, + "y": 2000 + }, + "id": "T370", + "z": 10, + "attrs": { + "label": { + "text": "Info" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn134" + }, + { + "group": "out", + "id": "POut135" + } + ] + }, + "position": { + "x": 303, + "y": 2250 + }, + "id": "T371", + "z": 11, + "attrs": { + "label": { + "text": "Ep" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn104" + }, + { + "group": "out", + "id": "POut136" + } + ] + }, + "position": { + "x": 600, + "y": 1000 + }, + "id": "T373", + "z": 12, + "attrs": { + "label": { + "text": "Scu" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn109" + }, + { + "group": "in", + "id": "PIn136" + }, + { + "group": "out", + "id": "POut111" + } + ] + }, + "position": { + "x": 797, + "y": 1250 + }, + "id": "T157", + "z": 13, + "attrs": { + "label": { + "text": "VerTest" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn111" + }, + { + "group": "out", + "id": "POut112" + } + ] + }, + "position": { + "x": 797, + "y": 1500 + }, + "id": "T158", + "z": 14, + "attrs": { + "label": { + "text": "V" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn112" + }, + { + "group": "out", + "id": "POut113" + } + ] + }, + "position": { + "x": 797, + "y": 1750 + }, + "id": "T191", + "z": 15, + "attrs": { + "label": { + "text": "Sc" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn113" + }, + { + "group": "out", + "id": "POut142" + }, + { + "group": "out", + "id": "POut143" + } + ] + }, + "position": { + "x": 797, + "y": 2000 + }, + "id": "T402", + "z": 16, + "attrs": { + "label": { + "text": "Re" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn142" + }, + { + "group": "out", + "id": "POut153" + }, + { + "group": "out", + "id": "POut154" + } + ] + }, + "position": { + "x": 797, + "y": 2250 + }, + "id": "T427", + "z": 17, + "attrs": { + "label": { + "text": "Ber" + } + } + }, + { + "type": "app.FlowchartStart", + "size": { + "width": 48, + "height": 48 + }, + "ports": { + "items": [ + { + "group": "out", + "id": "POut100" + } + ] + }, + "position": { + "x": 500, + "y": -160 + }, + "id": "S100", + "z": 18, + "attrs": { + "label": { + "text": "Start" + }, + "data": { + + }, + "additional_info": { + "text": "" + }, + "workflowDetails": { + "workflowName": "Stest", + "workflowVersion": "4.39", + "author": "" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn153" + }, + { + "group": "out", + "id": "POut155" + }, + { + "group": "out", + "id": "POut156" + } + ] + }, + "position": { + "x": 797, + "y": 2500 + }, + "id": "T440", + "z": 18, + "attrs": { + "label": { + "text": "Ve" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn155" + }, + { + "group": "out", + "id": "POut149" + }, + { + "group": "out", + "id": "POut150" + } + ] + }, + "position": { + "x": 303, + "y": 2750 + }, + "id": "T422", + "z": 19, + "attrs": { + "label": { + "text": "GV" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn150" + }, + { + "group": "out", + "id": "POut144" + }, + { + "group": "out", + "id": "POut145" + } + ] + }, + "position": { + "x": 600, + "y": 3000 + }, + "id": "T404", + "z": 20, + "attrs": { + "label": { + "text": "Ren" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn144" + }, + { + "group": "out", + "id": "POut157" + } + ] + }, + "position": { + "x": 600, + "y": 3250 + }, + "id": "T442", + "z": 21, + "attrs": { + "label": { + "text": "GV" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn156" + }, + { + "group": "out", + "id": "POut147" + }, + { + "group": "out", + "id": "POut148" + } + ] + }, + "position": { + "x": 797, + "y": 2750 + }, + "id": "T421", + "z": 22, + "attrs": { + "label": { + "text": "G 3b" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn148" + }, + { + "group": "out", + "id": "POut151" + }, + { + "group": "out", + "id": "POut152" + } + ] + }, + "position": { + "x": 1094, + "y": 3000 + }, + "id": "T425", + "z": 23, + "attrs": { + "label": { + "text": "R" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn151" + }, + { + "group": "out", + "id": "POut158" + } + ] + }, + "position": { + "x": 1094, + "y": 3250 + }, + "id": "T444", + "z": 24, + "attrs": { + "label": { + "text": "GV" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn143" + }, + { + "group": "in", + "id": "PIn145" + }, + { + "group": "in", + "id": "PIn147" + }, + { + "group": "in", + "id": "PIn149" + }, + { + "group": "in", + "id": "PIn152" + }, + { + "group": "in", + "id": "PIn154" + }, + { + "group": "in", + "id": "PIn157" + }, + { + "group": "in", + "id": "PIn158" + }, + { + "group": "out", + "id": "POut114" + }, + { + "group": "out", + "id": "POut115" + } + ] + }, + "position": { + "x": 106, + "y": 3000 + }, + "id": "T192", + "z": 25, + "attrs": { + "label": { + "text": "Za" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn114" + }, + { + "group": "out", + "id": "POut116" + } + ] + }, + "position": { + "x": 106, + "y": 3250 + }, + "id": "T194", + "z": 26, + "attrs": { + "label": { + "text": "Kontr" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn116" + }, + { + "group": "out", + "id": "POut146" + } + ] + }, + "position": { + "x": 500, + "y": 3500 + }, + "id": "T411", + "z": 27, + "attrs": { + "label": { + "text": "Buc" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 448, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn115" + }, + { + "group": "in", + "id": "PIn146" + }, + { + "group": "out", + "id": "POut117" + }, + { + "group": "out", + "id": "POut118" + }, + { + "group": "out", + "id": "POut119" + } + ] + }, + "position": { + "x": 500, + "y": 3750 + }, + "id": "T325", + "z": 28, + "attrs": { + "label": { + "text": "Ahl" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn117" + }, + { + "group": "out", + "id": "POut120" + } + ] + }, + "position": { + "x": 303, + "y": 4000 + }, + "id": "T330", + "z": 29, + "attrs": { + "label": { + "text": "Scha" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn119" + }, + { + "group": "out", + "id": "POut121" + } + ] + }, + "position": { + "x": 797, + "y": 4000 + }, + "id": "T333", + "z": 30, + "attrs": { + "label": { + "text": "Um" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn118" + }, + { + "group": "in", + "id": "PIn120" + }, + { + "group": "in", + "id": "PIn121" + }, + { + "group": "out", + "id": "POut160" + }, + { + "group": "out", + "id": "POut161" + } + ] + }, + "position": { + "x": 500, + "y": 4250 + }, + "id": "T446", + "z": 31, + "attrs": { + "label": { + "text": "ER" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn160" + }, + { + "group": "out", + "id": "POut162" + }, + { + "group": "out", + "id": "POut163" + } + ] + }, + "position": { + "x": 500, + "y": 4500 + }, + "id": "T448", + "z": 32, + "attrs": { + "label": { + "text": "E" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn162" + }, + { + "group": "out", + "id": "POut164" + } + ] + }, + "position": { + "x": 500, + "y": 4750 + }, + "id": "T450", + "z": 33, + "attrs": { + "label": { + "text": "ES" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn164" + }, + { + "group": "out", + "id": "POut165" + } + ] + }, + "position": { + "x": 500, + "y": 5000 + }, + "id": "T451", + "z": 34, + "attrs": { + "label": { + "text": "Dru" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn161" + }, + { + "group": "in", + "id": "PIn163" + }, + { + "group": "in", + "id": "PIn165" + }, + { + "group": "in", + "id": "PIn169" + }, + { + "group": "out", + "id": "POut167" + }, + { + "group": "out", + "id": "POut168" + } + ] + }, + "position": { + "x": 500, + "y": 5250 + }, + "id": "T461", + "z": 35, + "attrs": { + "label": { + "text": "Che" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn167" + }, + { + "group": "out", + "id": "POut169" + } + ] + }, + "position": { + "x": 303, + "y": 5500 + }, + "id": "T462", + "z": 36, + "attrs": { + "label": { + "text": "Me" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn168" + }, + { + "group": "out", + "id": "POut170" + }, + { + "group": "out", + "id": "POut171" + } + ] + }, + "position": { + "x": 797, + "y": 5500 + }, + "id": "T463", + "z": 37, + "attrs": { + "label": { + "text": "Mit" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn171" + }, + { + "group": "out", + "id": "POut172" + } + ] + }, + "position": { + "x": 797, + "y": 5750 + }, + "id": "T466", + "z": 38, + "attrs": { + "label": { + "text": "Pl" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn170" + }, + { + "group": "in", + "id": "PIn172" + }, + { + "group": "out", + "id": "POut138" + }, + { + "group": "out", + "id": "POut139" + } + ] + }, + "position": { + "x": 303, + "y": 5750 + }, + "id": "T396", + "z": 39, + "attrs": { + "label": { + "text": "Aut" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn138" + }, + { + "group": "out", + "id": "POut140" + } + ] + }, + "position": { + "x": 303, + "y": 6000 + }, + "id": "T398", + "z": 40, + "attrs": { + "label": { + "text": "A" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn139" + }, + { + "group": "out", + "id": "POut141" + } + ] + }, + "position": { + "x": 797, + "y": 6000 + }, + "id": "T401", + "z": 41, + "attrs": { + "label": { + "text": "Ma" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn140" + }, + { + "group": "in", + "id": "PIn141" + }, + { + "group": "out", + "id": "POut109" + }, + { + "group": "out", + "id": "POut110" + } + ] + }, + "position": { + "x": 500, + "y": 6250 + }, + "id": "T156", + "z": 42, + "attrs": { + "label": { + "text": "No" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 760, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn110" + }, + { + "group": "out", + "id": "POut124" + }, + { + "group": "out", + "id": "POut125" + }, + { + "group": "out", + "id": "POut126" + }, + { + "group": "out", + "id": "POut127" + }, + { + "group": "out", + "id": "POut128" + }, + { + "group": "out", + "id": "POut129" + } + ] + }, + "position": { + "x": 500, + "y": 6500 + }, + "id": "T357", + "z": 43, + "attrs": { + "label": { + "text": "G" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn124" + }, + { + "group": "out", + "id": "POut130" + } + ] + }, + "position": { + "x": -485, + "y": 6750 + }, + "id": "T359", + "z": 44, + "attrs": { + "label": { + "text": "Da" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn125" + }, + { + "group": "out", + "id": "POut131" + } + ] + }, + "position": { + "x": 9, + "y": 6750 + }, + "id": "T361", + "z": 45, + "attrs": { + "label": { + "text": "Da" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn126" + }, + { + "group": "out", + "id": "POut132" + } + ] + }, + "position": { + "x": 503, + "y": 6750 + }, + "id": "T363", + "z": 46, + "attrs": { + "label": { + "text": "Da" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn127" + }, + { + "group": "out", + "id": "POut133" + } + ] + }, + "position": { + "x": 997, + "y": 6750 + }, + "id": "T369", + "z": 47, + "attrs": { + "label": { + "text": "D" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn128" + }, + { + "group": "out", + "id": "POut159" + } + ] + }, + "position": { + "x": 1491, + "y": 6750 + }, + "id": "T445", + "z": 48, + "attrs": { + "label": { + "text": "Ser" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn129" + }, + { + "group": "out", + "id": "POut166" + } + ] + }, + "position": { + "x": 1985, + "y": 6750 + }, + "id": "T454", + "z": 49, + "attrs": { + "label": { + "text": "P" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn130" + }, + { + "group": "in", + "id": "PIn131" + }, + { + "group": "in", + "id": "PIn132" + }, + { + "group": "in", + "id": "PIn133" + }, + { + "group": "in", + "id": "PIn159" + }, + { + "group": "in", + "id": "PIn166" + }, + { + "group": "out", + "id": "POut122" + } + ] + }, + "position": { + "x": 500, + "y": 7000 + }, + "id": "T346", + "z": 50, + "attrs": { + "label": { + "text": "In" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn122" + }, + { + "group": "out", + "id": "POut123" + } + ] + }, + "position": { + "x": 500, + "y": 7250 + }, + "id": "T347", + "z": 51, + "attrs": { + "label": { + "text": "Ep" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn173" + } + ] + }, + "position": { + "x": 1094, + "y": 1000 + }, + "id": "T1", + "z": 52, + "attrs": { + "label": { + "text": "Test1" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn123" + } + ] + }, + "position": { + "x": 500, + "y": 7500 + }, + "id": "T467", + "z": 53, + "attrs": { + "label": { + "text": "end" + } + } + }, + { + "type": "app.Message", + "size": { + "width": 344, + "height": 80 + }, + "ports": { + "items": [ + { + "group": "in", + "id": "PIn135" + } + ] + }, + "position": { + "x": 303, + "y": 2500 + }, + "id": "E10", + "z": 54, + "attrs": { + "label": { + "text": "Ende" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T0", + "magnet": "portBody", + "port": "POut101" + }, + "target": { + "id": "T139", + "magnet": "portBody", + "port": "PIn101" + }, + "id": "1", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T112", + "magnet": "portBody", + "port": "POut102" + }, + "target": { + "id": "T113", + "magnet": "portBody", + "port": "PIn102" + }, + "id": "2", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "u " + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T113", + "magnet": "portBody", + "port": "POut103" + }, + "target": { + "id": "T134", + "magnet": "portBody", + "port": "PIn103" + }, + "id": "3", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "pp " + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T113", + "magnet": "portBody", + "port": "POut104" + }, + "target": { + "id": "T373", + "magnet": "portBody", + "port": "PIn104" + }, + "id": "4", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T134", + "magnet": "portBody", + "port": "POut105" + }, + "target": { + "id": "T141", + "magnet": "portBody", + "port": "PIn105" + }, + "id": "5", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T139", + "magnet": "portBody", + "port": "POut106" + }, + "target": { + "id": "T112", + "magnet": "portBody", + "port": "PIn106" + }, + "id": "6", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T141", + "magnet": "portBody", + "port": "POut107" + }, + "target": { + "id": "T142", + "magnet": "portBody", + "port": "PIn107" + }, + "id": "7", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T142", + "magnet": "portBody", + "port": "POut108" + }, + "target": { + "id": "T383", + "magnet": "portBody", + "port": "PIn108" + }, + "id": "8", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "tt" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T156", + "magnet": "portBody", + "port": "POut109" + }, + "target": { + "id": "T157", + "magnet": "portBody", + "port": "PIn109" + }, + "id": "9", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "yt" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T156", + "magnet": "portBody", + "port": "POut110" + }, + "target": { + "id": "T357", + "magnet": "portBody", + "port": "PIn110" + }, + "id": "10", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T157", + "magnet": "portBody", + "port": "POut111" + }, + "target": { + "id": "T158", + "magnet": "portBody", + "port": "PIn111" + }, + "id": "11", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T158", + "magnet": "portBody", + "port": "POut112" + }, + "target": { + "id": "T191", + "magnet": "portBody", + "port": "PIn112" + }, + "id": "12", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T191", + "magnet": "portBody", + "port": "POut113" + }, + "target": { + "id": "T402", + "magnet": "portBody", + "port": "PIn113" + }, + "id": "13", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "rrq" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T192", + "magnet": "portBody", + "port": "POut114" + }, + "target": { + "id": "T194", + "magnet": "portBody", + "port": "PIn114" + }, + "id": "14", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "re" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T192", + "magnet": "portBody", + "port": "POut115" + }, + "target": { + "id": "T325", + "magnet": "portBody", + "port": "PIn115" + }, + "id": "15", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T194", + "magnet": "portBody", + "port": "POut116" + }, + "target": { + "id": "T411", + "magnet": "portBody", + "port": "PIn116" + }, + "id": "16", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "as" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T325", + "magnet": "portBody", + "port": "POut117" + }, + "target": { + "id": "T330", + "magnet": "portBody", + "port": "PIn117" + }, + "id": "17", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "dw" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "cd" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T325", + "magnet": "portBody", + "port": "POut118" + }, + "target": { + "id": "T446", + "magnet": "portBody", + "port": "PIn118" + }, + "id": "18", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "ww" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T325", + "magnet": "portBody", + "port": "POut119" + }, + "target": { + "id": "T333", + "magnet": "portBody", + "port": "PIn119" + }, + "id": "19", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T330", + "magnet": "portBody", + "port": "POut120" + }, + "target": { + "id": "T446", + "magnet": "portBody", + "port": "PIn120" + }, + "id": "20", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T333", + "magnet": "portBody", + "port": "POut121" + }, + "target": { + "id": "T446", + "magnet": "portBody", + "port": "PIn121" + }, + "id": "21", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T346", + "magnet": "portBody", + "port": "POut122" + }, + "target": { + "id": "T347", + "magnet": "portBody", + "port": "PIn122" + }, + "id": "22", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T347", + "magnet": "portBody", + "port": "POut123" + }, + "target": { + "id": "T467", + "magnet": "portBody", + "port": "PIn123" + }, + "id": "23", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "qa" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T357", + "magnet": "portBody", + "port": "POut124" + }, + "target": { + "id": "T359", + "magnet": "portBody", + "port": "PIn124" + }, + "id": "24", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "qsd" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "qasd" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T357", + "magnet": "portBody", + "port": "POut125" + }, + "target": { + "id": "T361", + "magnet": "portBody", + "port": "PIn125" + }, + "id": "25", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "xc" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "bh" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T357", + "magnet": "portBody", + "port": "POut126" + }, + "target": { + "id": "T363", + "magnet": "portBody", + "port": "PIn126" + }, + "id": "26", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "vf" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "qas" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T357", + "magnet": "portBody", + "port": "POut127" + }, + "target": { + "id": "T369", + "magnet": "portBody", + "port": "PIn127" + }, + "id": "27", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "xc" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "qsd" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T357", + "magnet": "portBody", + "port": "POut128" + }, + "target": { + "id": "T445", + "magnet": "portBody", + "port": "PIn128" + }, + "id": "28", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "cf" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T357", + "magnet": "portBody", + "port": "POut129" + }, + "target": { + "id": "T454", + "magnet": "portBody", + "port": "PIn129" + }, + "id": "29", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T359", + "magnet": "portBody", + "port": "POut130" + }, + "target": { + "id": "T346", + "magnet": "portBody", + "port": "PIn130" + }, + "id": "30", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T361", + "magnet": "portBody", + "port": "POut131" + }, + "target": { + "id": "T346", + "magnet": "portBody", + "port": "PIn131" + }, + "id": "31", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T363", + "magnet": "portBody", + "port": "POut132" + }, + "target": { + "id": "T346", + "magnet": "portBody", + "port": "PIn132" + }, + "id": "32", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T369", + "magnet": "portBody", + "port": "POut133" + }, + "target": { + "id": "T346", + "magnet": "portBody", + "port": "PIn133" + }, + "id": "33", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T370", + "magnet": "portBody", + "port": "POut134" + }, + "target": { + "id": "T371", + "magnet": "portBody", + "port": "PIn134" + }, + "id": "34", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T371", + "magnet": "portBody", + "port": "POut135" + }, + "target": { + "id": "E10", + "magnet": "portBody", + "port": "PIn135" + }, + "id": "35", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T373", + "magnet": "portBody", + "port": "POut136" + }, + "target": { + "id": "T157", + "magnet": "portBody", + "port": "PIn136" + }, + "id": "36", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T383", + "magnet": "portBody", + "port": "POut137" + }, + "target": { + "id": "T370", + "magnet": "portBody", + "port": "PIn137" + }, + "id": "37", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "qxd" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T396", + "magnet": "portBody", + "port": "POut138" + }, + "target": { + "id": "T398", + "magnet": "portBody", + "port": "PIn138" + }, + "id": "38", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "cgw" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T396", + "magnet": "portBody", + "port": "POut139" + }, + "target": { + "id": "T401", + "magnet": "portBody", + "port": "PIn139" + }, + "id": "39", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T398", + "magnet": "portBody", + "port": "POut140" + }, + "target": { + "id": "T156", + "magnet": "portBody", + "port": "PIn140" + }, + "id": "40", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T401", + "magnet": "portBody", + "port": "POut141" + }, + "target": { + "id": "T156", + "magnet": "portBody", + "port": "PIn141" + }, + "id": "41", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "qxd" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T402", + "magnet": "portBody", + "port": "POut142" + }, + "target": { + "id": "T427", + "magnet": "portBody", + "port": "PIn142" + }, + "id": "42", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "nj" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T402", + "magnet": "portBody", + "port": "POut143" + }, + "target": { + "id": "T192", + "magnet": "portBody", + "port": "PIn143" + }, + "id": "43", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "xde" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T404", + "magnet": "portBody", + "port": "POut144" + }, + "target": { + "id": "T442", + "magnet": "portBody", + "port": "PIn144" + }, + "id": "44", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "as" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T404", + "magnet": "portBody", + "port": "POut145" + }, + "target": { + "id": "T192", + "magnet": "portBody", + "port": "PIn145" + }, + "id": "45", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T411", + "magnet": "portBody", + "port": "POut146" + }, + "target": { + "id": "T325", + "magnet": "portBody", + "port": "PIn146" + }, + "id": "46", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "bq" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T421", + "magnet": "portBody", + "port": "POut147" + }, + "target": { + "id": "T192", + "magnet": "portBody", + "port": "PIn147" + }, + "id": "47", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "zq" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T421", + "magnet": "portBody", + "port": "POut148" + }, + "target": { + "id": "T425", + "magnet": "portBody", + "port": "PIn148" + }, + "id": "48", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "zq" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T422", + "magnet": "portBody", + "port": "POut149" + }, + "target": { + "id": "T192", + "magnet": "portBody", + "port": "PIn149" + }, + "id": "49", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "zqw" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T422", + "magnet": "portBody", + "port": "POut150" + }, + "target": { + "id": "T404", + "magnet": "portBody", + "port": "PIn150" + }, + "id": "50", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "zq" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T425", + "magnet": "portBody", + "port": "POut151" + }, + "target": { + "id": "T444", + "magnet": "portBody", + "port": "PIn151" + }, + "id": "51", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "vre" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T425", + "magnet": "portBody", + "port": "POut152" + }, + "target": { + "id": "T192", + "magnet": "portBody", + "port": "PIn152" + }, + "id": "52", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "9" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T427", + "magnet": "portBody", + "port": "POut153" + }, + "target": { + "id": "T440", + "magnet": "portBody", + "port": "PIn153" + }, + "id": "53", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "xq" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T427", + "magnet": "portBody", + "port": "POut154" + }, + "target": { + "id": "T192", + "magnet": "portBody", + "port": "PIn154" + }, + "id": "54", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "zx" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T440", + "magnet": "portBody", + "port": "POut155" + }, + "target": { + "id": "T422", + "magnet": "portBody", + "port": "PIn155" + }, + "id": "55", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "xcf" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T440", + "magnet": "portBody", + "port": "POut156" + }, + "target": { + "id": "T421", + "magnet": "portBody", + "port": "PIn156" + }, + "id": "56", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T442", + "magnet": "portBody", + "port": "POut157" + }, + "target": { + "id": "T192", + "magnet": "portBody", + "port": "PIn157" + }, + "id": "57", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T444", + "magnet": "portBody", + "port": "POut158" + }, + "target": { + "id": "T192", + "magnet": "portBody", + "port": "PIn158" + }, + "id": "58", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T445", + "magnet": "portBody", + "port": "POut159" + }, + "target": { + "id": "T346", + "magnet": "portBody", + "port": "PIn159" + }, + "id": "59", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "[esr]='1'" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T446", + "magnet": "portBody", + "port": "POut160" + }, + "target": { + "id": "T448", + "magnet": "portBody", + "port": "PIn160" + }, + "id": "60", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "bg" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T446", + "magnet": "portBody", + "port": "POut161" + }, + "target": { + "id": "T461", + "magnet": "portBody", + "port": "PIn161" + }, + "id": "61", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "aq" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T448", + "magnet": "portBody", + "port": "POut162" + }, + "target": { + "id": "T450", + "magnet": "portBody", + "port": "PIn162" + }, + "id": "62", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "vg" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T448", + "magnet": "portBody", + "port": "POut163" + }, + "target": { + "id": "T461", + "magnet": "portBody", + "port": "PIn163" + }, + "id": "63", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T450", + "magnet": "portBody", + "port": "POut164" + }, + "target": { + "id": "T451", + "magnet": "portBody", + "port": "PIn164" + }, + "id": "64", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T451", + "magnet": "portBody", + "port": "POut165" + }, + "target": { + "id": "T461", + "magnet": "portBody", + "port": "PIn165" + }, + "id": "65", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T454", + "magnet": "portBody", + "port": "POut166" + }, + "target": { + "id": "T346", + "magnet": "portBody", + "port": "PIn166" + }, + "id": "66", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "xxas" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T461", + "magnet": "portBody", + "port": "POut167" + }, + "target": { + "id": "T462", + "magnet": "portBody", + "port": "PIn167" + }, + "id": "67", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "qsd" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T461", + "magnet": "portBody", + "port": "POut168" + }, + "target": { + "id": "T463", + "magnet": "portBody", + "port": "PIn168" + }, + "id": "68", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T462", + "magnet": "portBody", + "port": "POut169" + }, + "target": { + "id": "T461", + "magnet": "portBody", + "port": "PIn169" + }, + "id": "69", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "xsw" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T463", + "magnet": "portBody", + "port": "POut170" + }, + "target": { + "id": "T396", + "magnet": "portBody", + "port": "PIn170" + }, + "id": "70", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "ax" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T463", + "magnet": "portBody", + "port": "POut171" + }, + "target": { + "id": "T466", + "magnet": "portBody", + "port": "PIn171" + }, + "id": "71", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T466", + "magnet": "portBody", + "port": "POut172" + }, + "target": { + "id": "T396", + "magnet": "portBody", + "port": "PIn172" + }, + "id": "72", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + }, + { + "type": "app.Link", + "labels": [ + { + "attrs": { + "labelText": { + "text": "" + } + }, + "position": { + "distance": 0.25 + } + } + ], + "source": { + "id": "T113", + "magnet": "portBody", + "port": "POut173" + }, + "target": { + "id": "T1", + "magnet": "portBody", + "port": "PIn173" + }, + "id": "L101", + "z": 54, + "attrs": { + "condition": { + "conditionDetails": "Empty" + } + } + } + ] +} \ No newline at end of file diff --git a/src/shared/avoid-router.ts b/src/shared/avoid-router.ts new file mode 100644 index 0000000..0d55b4e --- /dev/null +++ b/src/shared/avoid-router.ts @@ -0,0 +1,569 @@ +import { AvoidLib, ShapeRef, ConnRef, Router, PolyLine } from 'libavoid-js'; +import { g, util, mvc, dia } from '@joint/core'; + +const defaultPin = 1; + +export class AvoidRouter { + graph: dia.Graph; + connDirections: { + top: number; + right: number; + bottom: number; + left: number; + all: number; + }; + shapeRefs: { [key: string]: ShapeRef }; + edgeRefs: { [key: string]: ConnRef }; + pinIds: { [key: string]: number }; + linksByPointer: { [key: number]: dia.Link }; + avoidConnectorCallback: (connRefPtr: number) => void; + id: number; + listenersEnabled: boolean; + margin: number; + portOverflow: number; + avoidRouter: Router; + graphListener?: mvc.Listener; + + static async load() { + // Note: load() accepts a filepath to the libavoid.wasm file. + await AvoidLib.load('../assets/wasm/libavoid.wasm'); + } + + constructor(graph: dia.Graph, options = {}) { + const Avoid = AvoidLib.getInstance(); + + this.graph = graph; + + this.connDirections = { + top: Avoid.ConnDirUp, + right: Avoid.ConnDirRight, + bottom: Avoid.ConnDirDown, + left: Avoid.ConnDirLeft, + all: Avoid.ConnDirAll, + }; + + this.shapeRefs = { + // [element.id]: shapeRef + }; + + this.edgeRefs = { + // [link.id]: connRef + }; + + // We use this structure to map the JointJS port id + // to the libavoid pin id (which must be a number) + this.pinIds = { + // [element.id + port.id]: number + } + + + // libavoid-js seems not to work properly + // if you add-remove-add a connRef with a same `id`. + // That's the reason we do not assign set connRef's `id` + // to JointJS link and let the libavoid to generate an `id`. + // We use this structure to find JointJS link from a pointer. + // (i.e. we can not use `connRef.id()` as explained above and + // we don't want to create a new function bind to a specific link + // for every connRef callback (see `avoidConnectorCallback`) + this.linksByPointer = { + // [Avoid.getPointer(connRef)]: link + }; + + this.avoidConnectorCallback = this.onAvoidConnectorChange.bind(this); + + this.id = 100000; + + this.listenersEnabled = false; + + this.createAvoidRouter(options); + } + + createAvoidRouter(options: { shapeBufferDistance?: number; portOverflow?: number; idealNudgingDistance?: number; } = {}) { + const { + shapeBufferDistance = 0, + portOverflow = 0, + idealNudgingDistance = 10, + } = options; + + this.margin = shapeBufferDistance; + this.portOverflow = portOverflow; + + const Avoid = AvoidLib.getInstance(); + + const router = new Avoid.Router(Avoid.OrthogonalRouting); + + // Avoid Router Parameter + + /* + This parameter defines the spacing distance that will be used for nudging + apart overlapping corners and line segments of connectors. + + By default, this distance is set to a value of 4. + */ + router.setRoutingParameter( + Avoid.idealNudgingDistance, + idealNudgingDistance + ); + + /* + This parameter defines the spacing distance that will be added to the sides of each shape + when determining obstacle sizes for routing. This controls how closely connectors pass shapes, + and can be used to prevent connectors overlapping with shape boundaries. + + By default, this distance is set to a value of 0. + */ + router.setRoutingParameter( + Avoid.shapeBufferDistance, + shapeBufferDistance + ); + + // Avoid Router Options + + /* + This option can be used to control whether collinear line segments that touch + just at their ends will be nudged apart. The overlap will usually be resolved + in the other dimension, so this is not usually required. + + Defaults to false. + + Note: If enabled it moves the anchor points of links even for single links. + It's not suitable for links connected to ports. + */ + router.setRoutingOption( + Avoid.nudgeOrthogonalTouchingColinearSegments, + false + ); + + /* + This option can be used to control whether the router performs a preprocessing step + before orthogonal nudging where is tries to unify segments and centre them in free space. + This generally results in better quality ordering and nudging. + + Defaults to true. + + You may wish to turn this off for large examples where it can be very slow + and will make little difference. + */ + router.setRoutingOption( + Avoid.performUnifyingNudgingPreprocessingStep, + true + ); + + router.setRoutingOption(Avoid.nudgeSharedPathsWithCommonEndPoint, true); + + router.setRoutingOption( + Avoid.nudgeOrthogonalSegmentsConnectedToShapes, + true + ); + + this.avoidRouter = router; + } + + getAvoidRectFromElement(element: any) { + const Avoid = AvoidLib.getInstance(); + const { x, y, width, height } = element.getBBox(); + return new Avoid.Rectangle( + new Avoid.Point(x, y), + new Avoid.Point(x + width, y + height) + ); + } + + getVerticesFromAvoidRoute(route: any) { + const vertices = []; + for (let i = 1; i < route.size() - 1; i++) { + const { x, y } = route.get_ps(i); + vertices.push({ x, y }); + } + return vertices; + } + + updateShape(element: any) { + const Avoid = AvoidLib.getInstance(); + const { shapeRefs, avoidRouter } = this; + const shapeRect = this.getAvoidRectFromElement(element); + if (shapeRefs[element.id]) { + // Only update the position and size of the shape. + const shapeRef = shapeRefs[element.id]; + avoidRouter.moveShape(shapeRef, shapeRect); + return; + } + + const shapeRef = new Avoid.ShapeRef(avoidRouter, shapeRect); + + shapeRefs[element.id] = shapeRef; + + const centerPin = new Avoid.ShapeConnectionPin( + shapeRef, + defaultPin, // one central pin for each shape + 0.5, + 0.5, + true, + 0, + Avoid.ConnDirAll // All directions + ); + centerPin.setExclusive(false); + + // Note: we could add more pins. For example, we could add pins + // to each element's side. This way, we could route links to + // specific sides of the element. + + // Add pins to each port of the element. + const portGroups = element.prop('ports/groups'); + if (portGroups) { + const keys = Object.keys(element.prop('ports/groups')); + keys.forEach((group) => { + const portsPositions = element.getPortsPositions(group); + const { width, height } = element.size(); + const rect = new g.Rect(0, 0, width, height); + Object.keys(portsPositions).forEach((portId) => { + const { x, y } = portsPositions[portId]; + const side = rect.sideNearestToPoint({ x, y }); + const pin = new Avoid.ShapeConnectionPin( + shapeRef, + this.getConnectionPinId(element.id, portId), + x / width, + y / height, + true, + // x, y, false, (support offset on ports) + 0, + this.connDirections[side] + ); + pin.setExclusive(false); + }); + }); + } + } + + // This method is used to map the JointJS port id to the libavoid pin id. + getConnectionPinId(elementId: any, portId: any) { + // `libavoid-js` requires the pin id to be a number. + // Note: It does not have to be unique across the whole diagram, just + // unique for the shape (but we use unique id across the whole diagram). + const pinKey = `${elementId}:${portId}`; + if (pinKey in this.pinIds) return this.pinIds[pinKey]; + const pinId = this.id++; + this.pinIds[pinKey] = pinId; + return pinId; + } + + updateConnector(link: any) { + const Avoid = AvoidLib.getInstance(); + const { shapeRefs, edgeRefs } = this; + + const { id: sourceId, port: sourcePortId = null } = link.source(); + const { id: targetId, port: targetPortId = null } = link.target(); + + if (!sourceId || !targetId) { + // It is possible to have a link without source or target in libavoid. + // But we do not support it in this example. + this.deleteConnector(link); + return null; + } + + let connRef; + + const sourceConnEnd = new Avoid.ConnEnd( + shapeRefs[sourceId], + sourcePortId ? this.getConnectionPinId(sourceId, sourcePortId) : defaultPin + ); + const targetConnEnd = new Avoid.ConnEnd( + shapeRefs[targetId], + targetPortId ? this.getConnectionPinId(targetId, targetPortId) : defaultPin + ); + + if (edgeRefs[link.id]) { + connRef = edgeRefs[link.id]; + } else { + connRef = new Avoid.ConnRef(this.avoidRouter); + this.linksByPointer[Avoid.getPointer(connRef)] = link; + } + + connRef.setSourceEndpoint(sourceConnEnd); + connRef.setDestEndpoint(targetConnEnd); + + if (edgeRefs[link.id]) { + // It was already created, we just updated + // the source and target endpoints. + return connRef; + } + + edgeRefs[link.id] = connRef; + + connRef.setCallback(this.avoidConnectorCallback, connRef); + + // Custom vertices (checkpoints) are not supported yet. + // const checkpoint1 = new Avoid.Checkpoint( + // new Avoid.Point(400, 200), + // ); + // Method does not exists in libavoid-js v4. + // connRef.setRoutingCheckpoints([checkpoint1]); + + return connRef; + } + + deleteConnector(link: dia.Link) { + const Avoid = AvoidLib.getInstance(); + const connRef = this.edgeRefs[link.id]; + if (!connRef) return; + this.avoidRouter.deleteConnector(connRef); + delete this.linksByPointer[Avoid.getPointer(connRef)]; + delete this.edgeRefs[link.id]; + } + + deleteShape(element: dia.Element) { + const shapeRef = this.shapeRefs[element.id]; + if (!shapeRef) return; + this.avoidRouter.deleteShape(shapeRef); + delete this.shapeRefs[element.id]; + } + + getLinkAnchorDelta(element: dia.Element, portId: string | null, point: g.Point) { + let anchorPosition; + const bbox = element.getBBox(); + if (portId) { + const port = element.getPort(portId); + const portPosition = element.getPortsPositions(port.group as string)[portId]; + anchorPosition = element.position().offset(portPosition); + } else { + anchorPosition = bbox.center(); + } + return point.difference(anchorPosition); + } + + // This method is used to route a link. + routeLink(link: dia.Link) { + const connRef = this.edgeRefs[link.id]; + if (!connRef) return; + + const route = connRef.displayRoute(); + const sourcePoint = new g.Point(route.get_ps(0)); + const targetPoint = new g.Point(route.get_ps(route.size() - 1)); + + const { id: sourceId, port: sourcePortId = null } = link.source(); + const { id: targetId, port: targetPortId = null } = link.target(); + + const sourceElement = link.getSourceElement(); + const targetElement = link.getTargetElement(); + const sourceAnchorDelta = this.getLinkAnchorDelta( + sourceElement as dia.Element, + sourcePortId, + sourcePoint + ); + const targetAnchorDelta = this.getLinkAnchorDelta( + targetElement as dia.Element, + targetPortId, + targetPoint + ); + + const linkAttributes: dia.Link.Attributes = { + source: { + id: sourceId, + port: sourcePortId || null, + anchor: { + name: 'modelCenter', + }, + }, + target: { + id: targetId, + port: targetPortId || null, + anchor: { + name: 'modelCenter', + }, + }, + }; + + if ( + this.isRouteValid( + route, + sourceElement as dia.Element, + targetElement as dia.Element, + sourcePortId, + targetPortId + ) + ) { + link.attr('line/stroke', 'black') + // We have a valid route. + // We update the link with the route. + linkAttributes.source.anchor.args = { + dx: sourceAnchorDelta.x, + dy: sourceAnchorDelta.y, + }; + linkAttributes.target.anchor.args = { + dx: targetAnchorDelta.x, + dy: targetAnchorDelta.y, + }; + linkAttributes.vertices = this.getVerticesFromAvoidRoute(route); + linkAttributes.router = null; + } else { + console.log('fail') + link.attr('line/stroke', 'red') + // Fallback route (we use the `rightAngle` router for the fallback route) + // The right angle automatic directions works the same way as in this example. + linkAttributes.vertices = []; + linkAttributes.router = { + name: 'manhattan', + args: { + // The margin is computed from the border of the port in case + // of the `rightAngle` router. + // In the case of libavoid, it is computed from the center + // of the port. + // Note: it depends on what portion of the port is overlapping + // the element. In this example, it is exactly the half of the port. + step: 20, + padding: this.margin - this.portOverflow, + maximumLoops: 50000 + }, + }; + } + + link.set(linkAttributes, { avoidRouter: true }); + } + + // This method is used to route links + routeAll() { + const { graph, avoidRouter } = this; + graph.getElements().forEach((element) => this.updateShape(element)); + graph.getLinks().forEach((link) => this.updateConnector(link)); + avoidRouter.processTransaction(); + } + + // This method is used to reset the link to a straight line + // (if the link is not connected to an element). + resetLink(link: dia.Link) { + const newAttributes = util.cloneDeep(link.attributes); + newAttributes.vertices = []; + newAttributes.router = null; + delete newAttributes.source.anchor; + delete newAttributes.target.anchor; + link.set(newAttributes, { avoidRouter: true }); + } + + enableListeners() { + this.listenersEnabled = true; + } + + disableListeners() { + this.listenersEnabled = false; + } + + // Start listening to the graph changes and automatically + // update the libavoid router. + addGraphListeners() { + this.removeGraphListeners(); + + const listener = new mvc.Listener(); + listener.listenTo(this.graph, { + remove: (cell) => this.onCellRemoved(cell), + add: (cell) => this.onCellAdded(cell), + change: (cell, opt) => this.onCellChanged(cell, opt), + }); + + this.graphListener = listener; + } + + // Stop listening to the graph changes. + removeGraphListeners() { + this.graphListener?.stopListening(); + delete this.graphListener; + } + + onCellRemoved(cell: dia.Cell) { + if (!this.listenersEnabled) return; + if (cell.isElement()) { + this.deleteShape(cell as dia.Element); + } else { + this.deleteConnector(cell as dia.Link); + } + this.avoidRouter.processTransaction(); + } + + onCellAdded(cell: dia.Cell) { + if (!this.listenersEnabled) return; + if (cell.isElement()) { + this.updateShape(cell as dia.Element); + } else { + this.updateConnector(cell as dia.Link); + } + this.avoidRouter.processTransaction(); + } + + onCellChanged(cell: dia.Cell, opt: dia.Cell.Options) { + if (opt.avoidRouter) return; + if (!this.listenersEnabled) return; + let needsRerouting = false; + if ('source' in cell.changed || 'target' in cell.changed) { + if (!cell.isLink()) return; + if (!this.updateConnector(cell)) { + // The link is routed with libavoid, + // we reset the link to a straight line. + this.resetLink(cell); + } + needsRerouting = true; + } + if ('position' in cell.changed || 'size' in cell.changed) { + if (!cell.isElement()) return; + this.updateShape(cell); + // TODO: we should move the pins if their position is + // not defined proportionally to the shape. + needsRerouting = true; + } + // TODO: + // if ("ports" in cell.changed) {} + if (needsRerouting) { + this.avoidRouter.processTransaction(); + } + } + + onAvoidConnectorChange(connRefPtr: number) { + const link = this.linksByPointer[connRefPtr]; + if (!link) return; + this.routeLink(link); + } + + // This method is used to check if the route is valid. + // It is used to determine if we should use the libavoid route + // or the rightAngle router. + // Unfortunately, the libavoid does not provide a method to check + // if the route is valid, so we must use heuristics. + isRouteValid( + route: PolyLine, + sourceElement: dia.Element, + targetElement: dia.Element, + sourcePortId: string | null, + targetPortId: string | null + ) { + /*const size = route.size(); + if (size > 2) { + // when the libavoid route has more than 2 points, + // we consider it valid. + return true; + } + + const sourcePs = route.get_ps(0); + const targetPs = route.get_ps(size - 1); + if (sourcePs.x !== targetPs.x && sourcePs.y !== targetPs.y) { + // The route is not straight. + return false; + } + + const margin = this.margin; + + if ( + sourcePortId && + targetElement.getBBox().inflate(margin).containsPoint(sourcePs) + ) { + // The source point is inside the target element. + return false; + } + + if ( + targetPortId && + sourceElement.getBBox().inflate(margin).containsPoint(targetPs) + ) { + // The target point is inside the source element. + return false; + }*/ + + return true; + } +} diff --git a/src/shared/resize-tool.ts b/src/shared/resize-tool.ts new file mode 100644 index 0000000..1427ed2 --- /dev/null +++ b/src/shared/resize-tool.ts @@ -0,0 +1,17 @@ +import { elementTools, dia } from '@joint/plus'; + +export default class ResizeTool extends elementTools.Control { + getPosition(view: dia.ElementView) { + const model = view.model; + const { width, height } = model.size(); + return { x: width, y: height }; + } + + setPosition(view: dia.ElementView, coordinates: { x: number, y: number }) { + const model = view.model; + model.resize( + Math.max(Math.round(coordinates.x / 2) * 2, 10), + Math.max(Math.round(coordinates.y / 2) * 2, 10) + ); + } +} diff --git a/src/shared/shapes.ts b/src/shared/shapes.ts new file mode 100644 index 0000000..61477f5 --- /dev/null +++ b/src/shared/shapes.ts @@ -0,0 +1,736 @@ +// @ts-nocheck +import { dia, shapes, g, util } from '@joint/plus'; + +const MAX_PORT_COUNT = 10; +const FONT_FAMILY = 'sans-serif'; +const OUT_PORT_HEIGHT = 10; +const OUT_PORT_WIDTH = 10; +const OUT_PORT_LABEL = 'O'; +const PORT_BORDER_RADIUS = 5; +const PADDING_L = 5; +const PADDING_S = 5; +const ADD_PORT_SIZE = 20; +const REMOVE_PORT_SIZE = 20; +const BACKGROUND_COLOR = 'white'; +const LIGHT_COLOR = 'lightgray'; +const DARK_COLOR = 'black'; +const MAIN_COLOR = 'gray'; +const LINE_WIDTH = 1; + +export enum ShapeTypesEnum { + BASE = "app.Base", + MESSAGE = "app.Message", + FLOWCHART_START = "app.FlowchartStart", + FLOWCHART_END = "app.FlowchartEnd", + LINK = "app.Link", + } + + export let OutportsData: { id: any; width: any }[] = []; + + export function resetOutportsData() { + OutportsData = []; + } + + const outputPortPosition = ( + portsArgs: dia.Element.Port[], + elBBox: dia.BBox + ): g.Point[] => { + const step = OUT_PORT_WIDTH + PADDING_S; + return portsArgs.map( + (port: dia.Element.Port, index: number) => + new g.Point({ + x: PADDING_L + OUT_PORT_WIDTH / 2 + index * step, + y: elBBox.height, + }) + ); + }; + let L_COUNT = 100; + let A_COUNT = 0; + let S_COUNT = 100; + let PORT_COUNT = 100; + let counter = 0; + + const Base = dia.Element.define( + ShapeTypesEnum.BASE, + { + // no default attributes + }, + { + getBoundaryPadding: function () { + return util.normalizeSides(this.boundaryPadding); + }, + + toJSON: function () { + // Simplify the element resulting JSON + const json = dia.Element.prototype.toJSON.call(this); + // Remove port groups and angle for better readability + delete json.ports.groups; + delete json.angle; + return json; + } + }, + { + fromStencilShape: function(element: dia.Element, id?: string) { + const attrs = { + label: { + text: element.attr(['label', 'text']) + }, + body: { + stroke: element.attr(['body', 'stroke']), + fill: element.attr(['body', 'fill']) + }, + icon: { + xlinkHref: element.attr(['icon', 'xlinkHref']) + } + }; + return new this({ id, attrs }); + } + } + ); + + export const Message = Base.define( + ShapeTypesEnum.MESSAGE, + { + size: { width: 368, height: 80 }, + ports: { + groups: { + in: { + position: { + name: "manual", + args: { + x: PADDING_L, + y: 0, + }, + }, + size: { + width: 16, + height: 16, + }, + attrs: { + portBody: { + magnet: "passive", + width: "calc(w)", + height: "calc(h)", + y: "calc(-0.5 * h)", + rx: PORT_BORDER_RADIUS, + ry: PORT_BORDER_RADIUS, + fill: LIGHT_COLOR, + stroke: DARK_COLOR, + strokeWidth: LINE_WIDTH, + }, + }, + markup: [ + { + tagName: "rect", + selector: "portBody", + }, + ], + }, + out: { + position: outputPortPosition, + size: { + width: OUT_PORT_WIDTH, + height: OUT_PORT_HEIGHT, + }, + attrs: { + portBody: { + magnet: "active", + width: "calc(w)", + height: "calc(h)", + x: "calc(-0.5 * w)", + y: "calc(-0.5 * h)", + fill: DARK_COLOR, + ry: PORT_BORDER_RADIUS, + rx: PORT_BORDER_RADIUS, + }, + portLabel: { + pointerEvents: "none", + fontFamily: FONT_FAMILY, + fontWeight: 400, + fontSize: 13, + fill: LIGHT_COLOR, + textAnchor: "start", + textVerticalAnchor: "middle", + textWrap: { + width: -REMOVE_PORT_SIZE - PADDING_L - PADDING_S, + maxLineCount: 1, + ellipsis: true, + }, + x: PADDING_L - OUT_PORT_WIDTH / 2, + }, + portRemoveButton: { + cursor: "pointer", + event: "element:port:remove", + transform: `translate(calc(0.5 * w - ${PADDING_L}), 0)`, + dataTooltip: "Remove Output Port", + dataTooltipPosition: "top", + }, + // portRemoveButtonBody: { + // width: REMOVE_PORT_SIZE, + // height: REMOVE_PORT_SIZE, + // x: -REMOVE_PORT_SIZE / 2, + // y: -REMOVE_PORT_SIZE / 2, + // fill: LIGHT_COLOR, + // rx: PORT_BORDER_RADIUS, + // ry: PORT_BORDER_RADIUS, + // }, + // portRemoveButtonIcon: { + // d: "M -4 -4 4 4 M -4 4 4 -4", + // stroke: DARK_COLOR, + // strokeWidth: LINE_WIDTH, + // }, + }, + markup: [ + { + tagName: "rect", + selector: "portBody", + }, + { + tagName: "text", + selector: "portLabel", + }, + { + tagName: "g", + selector: "portRemoveButton", + children: [ + { + tagName: "rect", + selector: "portRemoveButtonBody", + }, + { + tagName: "path", + selector: "portRemoveButtonIcon", + }, + ], + }, + ], + }, + }, + items: [ + { + group: "in" + }, + { + group: "out", + attrs: { portLabel: { text: OUT_PORT_LABEL } }, + }, + ], + }, + attrs: { + + body: { + width: "calc(w)", + height: "calc(h)", + fill: LIGHT_COLOR, + strokeWidth: LINE_WIDTH / 2, + stroke: "#333333", + rx: 3, + ry: 3, + }, + label: { + x: 54, + y: PADDING_L, + fontFamily: FONT_FAMILY, + fontWeight: 600, + fontSize: 16, + fill: "#322A49", + text: "Label", + textWrap: { + width: -54 - PADDING_L, + maxLineCount: 1, + ellipsis: true, + }, + textVerticalAnchor: "top", + }, + + label2: { + x: 54, + y: PADDING_L, + fontFamily: FONT_FAMILY, + fontWeight: 600, + fontSize: 16, + fill: "#322A49", + text: "labello2", + textWrap: { + width: -54 - PADDING_L, + maxLineCount: 1, + ellipsis: true, + }, + textVerticalAnchor: "top", + }, + + selectedInpin: { + fontFamily: FONT_FAMILY, + fontWeight: 400, + fontSize: 13, + lineHeight: 13, + fill: "#655E77", + textVerticalAnchor: "top", + text: "selectedInpin", + textWrap: { + width: -54 - PADDING_L, + maxLineCount: 2, + ellipsis: true, + }, + }, + selectedOutpin: { + fontFamily: FONT_FAMILY, + fontWeight: 400, + fontSize: 13, + lineHeight: 13, + fill: "#655E77", + textVerticalAnchor: "top", + text: "selectedOutpin", + textWrap: { + width: -54 - PADDING_L, + maxLineCount: 2, + ellipsis: true, + }, + }, + inpinValue1: { + fontFamily: FONT_FAMILY, + fontWeight: 400, + fontSize: 14, + lineHeight: 13, + fill: "#655E77", + textVerticalAnchor: "top", + text: "rrrtt", + textWrap: { + width: -54 - PADDING_L, + maxLineCount: 2, + ellipsis: true, + }, + }, + outpinValue: { + fontFamily: FONT_FAMILY, + fontWeight: 400, + fontSize: 14, + lineHeight: 13, + fill: "#655E77", + textVerticalAnchor: "top", + text: "outpinValue", + textWrap: { + width: -54 - PADDING_L, + maxLineCount: 2, + ellipsis: true, + }, + }, + icon: { + width: 20, + height: 20, + x: PADDING_L, + y: 24, + xlinkHref: "https://image.flaticon.com/icons/svg/151/151795.svg", + }, + portAddButton: { + cursor: "pointer", + fill: MAIN_COLOR, + event: "element:port:add", + transform: "translate(calc(w - 28), calc(h))", + dataTooltip: "Add Output Port", + dataTooltipPosition: "top", + }, + portAddButtonBody: { + width: ADD_PORT_SIZE, + height: ADD_PORT_SIZE, + rx: PORT_BORDER_RADIUS, + ry: PORT_BORDER_RADIUS, + x: -ADD_PORT_SIZE / 2, + y: -ADD_PORT_SIZE / 2, + }, + portAddButtonIcon: { + d: "M -4 0 4 0 M 0 -4 0 4", + stroke: "#FFFFFF", + strokeWidth: LINE_WIDTH, + }, + }, + }, + { + markup: [ + { + tagName: "rect", + selector: "body", + }, + { + tagName: "text", + selector: "label", + }, + + { + tagName: "image", + selector: "icon", + }, + { + tagName: "g", + selector: "portAddButton", + children: [ + { + tagName: "rect", + selector: "portAddButtonBody", + }, + { + tagName: "path", + selector: "portAddButtonIcon", + }, + ], + }, + ], + // old code starts + // generateId: function () { + // const prefix = "T"; + // const count = A_COUNT; + // A_COUNT += 1; + + // return prefix + "" + count; + // }, + // generatePortId: function(){ + // let portcount = PORT_COUNT; + // PORT_COUNT += 1; + // return "PORT" + portcount; + // }, + // old code ends + + boundaryPadding: { + horizontal: PADDING_L, + top: PADDING_L, + bottom: OUT_PORT_HEIGHT / 2 + PADDING_L, + }, + + // @roman + initialize() { + Base.prototype.initialize.apply(this, arguments); + this.on('change:ports', (cell: dia.Cell, ports: any, opt: any) => this.onPortsChange(opt)); + this.onPortsChange(); + }, + generateId: function () { + const missingIDs = [];//sharedService.getMissingIDs(); + /*if (missingIDs.length > 0) { + // Take the first missing ID and remove it from the list + const idToReturn = missingIDs[0]; + missingIDs.shift(); + sharedService.setMissingIDs(missingIDs); + return idToReturn; + }*/ + const prefix = "T"; + const count = A_COUNT; + A_COUNT += 1; + return prefix + "" + count; + }, + + // generateId() { + // return `T${counter++}`; + // }, + + generatePortId: function() { + return util.uuid(); + }, + + // @roman + onPortsChange(opt?: any) { + + const outports = this.getPorts().filter((port: any) => port.group === "out"); + const actiID = this.id; + const count = Math.max(3, outports.length + 1); + const width = PADDING_L + count * (OUT_PORT_WIDTH + PADDING_S) + PADDING_L; + const currentWidth = this.prop('size/width'); + this.prop('size/width', Math.max(width, currentWidth), opt); + OutportsData.push({ id: actiID, width }); + // console.log('OutportsData',OutportsData) + }, + + + addDefaultPort: function () { + if (!this.canAddPort("out")) return; + this.addPort({ + group: "out", + attrs: { portLabel: { text: OUT_PORT_LABEL } }, + }); + }, + + canAddPort: function (group: string): boolean { + return Object.keys(this.getGroupPorts(group)).length < MAX_PORT_COUNT; + }, + + toggleAddPortButton: function (group: string): void { + const buttonAttributes = this.canAddPort(group) + ? { fill: MAIN_COLOR, cursor: "pointer" } + : { fill: "#BEBEBE", cursor: "not-allowed" }; + this.attr(["portAddButton"], buttonAttributes, { + dry: true /* to be ignored by the Command Manager */, + }); + }, + } + ); + + export const FlowchartStart = Base.define( + ShapeTypesEnum.FLOWCHART_START, + { + size: { width: 48, height: 48 }, + ports: { + groups: { + out: { + position: { name: "bottom" }, + attrs: { + portBody: { + fill: DARK_COLOR, + stroke: BACKGROUND_COLOR, + strokeWidth: 6, + paintOrder: "stroke", + magnet: "active", + r: "calc(0.5 * d)", + }, + }, + size: { width: 10, height: 10 }, + markup: [ + { + tagName: "circle", + selector: "portBody", + }, + ], + }, + }, + items: [{ group: "out" }], + }, + attrs: { + body: { + fill: MAIN_COLOR, + stroke: "none", + cx: "calc(0.5 * w)", + cy: "calc(0.5 * h)", + r: 24, + }, + icon: { + d: "M 2 8 L 4.29 5.71 L 1.41 2.83 L 2.83 1.41 L 5.71 4.29 L 8 2 L 8 8 Z M -2 8 L -8 8 L -8 2 L -5.71 4.29 L -1 -0.41 L -1 -8 L 1 -8 L 1 0.41 L -4.29 5.71 Z", + fill: LIGHT_COLOR, + transform: "translate(calc(0.5 * w), calc(0.5 * h))", + }, + label: { + text: "Flowchart start", + textWrap: { + width: 200, + height: 100, + ellipsis: true, + }, + x: "calc(0.5 * w)", + y: -PADDING_L, + textAnchor: "middle", + textVerticalAnchor: "bottom", + fill: "#55627B", + fontFamily: FONT_FAMILY, + fontSize: 13, + }, + }, + }, + { + markup: [ + { + tagName: "circle", + selector: "body", + }, + { + tagName: "path", + selector: "icon", + }, + { + tagName: "text", + selector: "label", + }, + ], + generateId: function () { + const prefix = "S"; + const count = S_COUNT; + S_COUNT += 1; + return prefix + "" + count; + }, + boundaryPadding: { + horizontal: PADDING_L, + top: PADDING_S, + bottom: PADDING_L, + }, + } + ); + + export const FlowchartEnd = Base.define( + ShapeTypesEnum.FLOWCHART_END, + { + size: { width: 48, height: 48 }, + ports: { + groups: { + in: { + position: { name: "top" }, + attrs: { + portBody: { + fill: DARK_COLOR, + stroke: BACKGROUND_COLOR, + strokeWidth: 6, + paintOrder: "stroke", + magnet: "passive", + r: "calc(0.5 * d)", + }, + }, + size: { width: 10, height: 10 }, + markup: [ + { + tagName: "circle", + selector: "portBody", + }, + ], + }, + }, + items: [{ group: "in" }], + }, + attrs: { + body: { + fill: MAIN_COLOR, + stroke: "none", + cx: "calc(0.5 * w)", + cy: "calc(0.5 * h)", + r: 24, + }, + icon: { + d: "M 5 -8.45 L 6.41 -7.04 L 3 -3.635 L 1.59 -5.04 Z M -4.5 3.95 L -1 3.95 L -1 -1.63 L -6.41 -7.04 L -5 -8.45 L 1 -2.45 L 1 3.95 L 4.5 3.95 L 0 8.45 Z", + fill: LIGHT_COLOR, + transform: "translate(calc(0.5 * w), calc(0.5 * h))", + }, + label: { + text: "Flowchart end", + textWrap: { + width: 200, + height: 100, + ellipsis: true, + }, + x: "calc(0.5 * w)", + y: `calc(h + ${PADDING_L})`, + textAnchor: "middle", + textVerticalAnchor: "top", + fill: "#55627B", + fontFamily: FONT_FAMILY, + fontSize: 13, + }, + }, + }, + { + markup: [ + { + tagName: "circle", + selector: "body", + }, + { + tagName: "path", + selector: "icon", + }, + { + tagName: "text", + selector: "label", + }, + ], + boundaryPadding: { + horizontal: PADDING_L, + top: PADDING_L, + bottom: PADDING_S, + }, + } + ); + + export const Link = dia.Link.define( + ShapeTypesEnum.LINK, + { + attrs: { + root: { + cursor: "pointer", + }, + line: { + fill: "none", + connection: true, + stroke: '#008ac5', + strokeWidth: LINE_WIDTH, + }, + wrapper: { + fill: "none", + connection: true, + stroke: "transparent", + strokeWidth: 10, + }, + arrowhead: { + d: "M -5 -2.5 0 0 -5 2.5 Z", + stroke: DARK_COLOR, + fill: DARK_COLOR, + atConnectionRatio: 0.55, + strokeWidth: LINE_WIDTH, + }, + }, + + labels: [ + { + attrs: { + labelText: { + text: "Label", + }, + }, + position: { + distance: 0.25, + }, + }, + ], + }, + { + markup: [ + { + tagName: "path", + selector: "line", + }, + { + tagName: "path", + selector: "wrapper", + }, + { + tagName: "path", + selector: "arrowhead", + }, + ], + generateId: function () { + const prefix = "L"; + const count = L_COUNT; + L_COUNT += 1; + return prefix + "" + count; + }, + defaultLabel: { + markup: [ + { + tagName: "rect", + selector: "labelBody", + }, + { + tagName: "text", + selector: "labelText", + }, + ], + attrs: { + labelText: { + fontFamily: FONT_FAMILY, + fontSize: 13, + textWrap: { + width: 200, + height: 100, + ellipsis: true, + }, + cursor: "pointer", + fill: DARK_COLOR, + textAnchor: "middle", + textVerticalAnchor: "middle", + pointerEvents: "none", + }, + labelBody: { + ref: "labelText", + fill: BACKGROUND_COLOR, + stroke: BACKGROUND_COLOR, + strokeWidth: 2, + width: "calc(w)", + height: "calc(h)", + x: "calc(x)", + y: "calc(y)", + }, + }, + }, + } + );