bpmn-auto-layout 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/dist/index.esm.js +578 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +580 -0
- package/dist/index.js.map +1 -0
- package/package.json +20 -8
- package/index.js +0 -1
- package/lib/AutoLayout.js +0 -514
- package/lib/DiFactory.js +0 -152
- package/lib/DiUtil.js +0 -263
- package/lib/Tree.js +0 -335
package/dist/index.js
ADDED
|
@@ -0,0 +1,580 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var BPMNModdle = require('bpmn-moddle');
|
|
4
|
+
var minDash = require('min-dash');
|
|
5
|
+
|
|
6
|
+
function isConnection(element) {
|
|
7
|
+
return !!element.sourceRef;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function isBoundaryEvent(element) {
|
|
11
|
+
return !!element.attachedToRef;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
class Grid {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.grid = [];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
add(element) {
|
|
20
|
+
this._addStart(element);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
_addStart(element) {
|
|
24
|
+
this.grid.push([ element ]);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
addAfter(element, newElement) {
|
|
28
|
+
if (!element) {
|
|
29
|
+
this._addStart(newElement);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const [ row, col ] = this.find(element);
|
|
33
|
+
this.grid[row].splice(col + 1, 0, newElement);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
addBelow(element, newElement) {
|
|
37
|
+
if (!element) {
|
|
38
|
+
this._addStart(newElement);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const [ row, col ] = this.find(element);
|
|
42
|
+
|
|
43
|
+
// We are at the bottom of the current grid - add empty row below
|
|
44
|
+
if (!this.grid[row + 1]) {
|
|
45
|
+
this.grid[row + 1] = [];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// The element below is already occupied - insert new row
|
|
49
|
+
if (this.grid[row + 1][col]) {
|
|
50
|
+
this.grid.splice(row + 1, 0, []);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (this.grid[row + 1][col]) {
|
|
54
|
+
throw new Error('Grid is occupied and we could not find a place - this should not happen');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
this.grid[row + 1][col] = newElement;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
find(element) {
|
|
61
|
+
let row, col;
|
|
62
|
+
row = this.grid.findIndex((row) => {
|
|
63
|
+
col = row.findIndex((el) => {
|
|
64
|
+
return el === element;
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
return col !== -1;
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
return [ row, col ];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
get(row, col) {
|
|
74
|
+
return (this.grid[row] || [])[col];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
getElementsInRange({ row: startRow, col: startCol }, { row: endRow, col: endCol }) {
|
|
78
|
+
const elements = [];
|
|
79
|
+
|
|
80
|
+
if (startRow > endRow) {
|
|
81
|
+
[ startRow, endRow ] = [ endRow, startRow ];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (startCol > endCol) {
|
|
85
|
+
[ startCol, endCol ] = [ endCol, startCol ];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
for (let row = startRow; row <= endRow; row++) {
|
|
89
|
+
for (let col = startCol; col <= endCol; col++) {
|
|
90
|
+
const element = this.get(row, col);
|
|
91
|
+
|
|
92
|
+
if (element) {
|
|
93
|
+
elements.push(element);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return elements;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
elementsByPosition() {
|
|
102
|
+
const elements = [];
|
|
103
|
+
|
|
104
|
+
this.grid.forEach((row, rowIndex) => {
|
|
105
|
+
row.forEach((element, colIndex) => {
|
|
106
|
+
if (!element) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
elements.push({
|
|
110
|
+
element,
|
|
111
|
+
row: rowIndex,
|
|
112
|
+
col: colIndex
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
return elements;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
class DiFactory {
|
|
122
|
+
constructor(moddle) {
|
|
123
|
+
this.moddle = moddle;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
create(type, attrs) {
|
|
127
|
+
return this.moddle.create(type, attrs || {});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
createDiBounds(bounds) {
|
|
131
|
+
return this.create('dc:Bounds', bounds);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
createDiLabel() {
|
|
135
|
+
return this.create('bpmndi:BPMNLabel', {
|
|
136
|
+
bounds: this.createDiBounds()
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
createDiShape(semantic, bounds, attrs) {
|
|
141
|
+
return this.create('bpmndi:BPMNShape', minDash.assign({
|
|
142
|
+
bpmnElement: semantic,
|
|
143
|
+
bounds: this.createDiBounds(bounds)
|
|
144
|
+
}, attrs));
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
createDiWaypoints(waypoints) {
|
|
148
|
+
var self = this;
|
|
149
|
+
|
|
150
|
+
return minDash.map(waypoints, function(pos) {
|
|
151
|
+
return self.createDiWaypoint(pos);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
createDiWaypoint(point) {
|
|
156
|
+
return this.create('dc:Point', minDash.pick(point, [ 'x', 'y' ]));
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
createDiEdge(semantic, waypoints, attrs) {
|
|
160
|
+
return this.create('bpmndi:BPMNEdge', minDash.assign({
|
|
161
|
+
bpmnElement: semantic,
|
|
162
|
+
waypoint: this.createDiWaypoints(waypoints)
|
|
163
|
+
}, attrs));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
createDiPlane(attrs) {
|
|
167
|
+
return this.create('bpmndi:BPMNPlane', attrs);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
createDiDiagram(attrs) {
|
|
171
|
+
return this.create('bpmndi:BPMNDiagram', attrs);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function getDefaultSize(element) {
|
|
176
|
+
if (is(element, 'bpmn:SubProcess')) {
|
|
177
|
+
return { width: 100, height: 80 };
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (is(element, 'bpmn:Task')) {
|
|
181
|
+
return { width: 100, height: 80 };
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (is(element, 'bpmn:Gateway')) {
|
|
185
|
+
return { width: 50, height: 50 };
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (is(element, 'bpmn:Event')) {
|
|
189
|
+
return { width: 36, height: 36 };
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (is(element, 'bpmn:Participant')) {
|
|
193
|
+
return { width: 400, height: 100 };
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (is(element, 'bpmn:Lane')) {
|
|
197
|
+
return { width: 400, height: 100 };
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if (is(element, 'bpmn:DataObjectReference')) {
|
|
201
|
+
return { width: 36, height: 50 };
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if (is(element, 'bpmn:DataStoreReference')) {
|
|
205
|
+
return { width: 50, height: 50 };
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (is(element, 'bpmn:TextAnnotation')) {
|
|
209
|
+
return { width: 100, height: 30 };
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return { width: 100, height: 80 };
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function is(element, type) {
|
|
216
|
+
return element.$instanceOf(type);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const DEFAULT_CELL_WIDTH = 150;
|
|
220
|
+
const DEFAULT_CELL_HEIGHT = 110;
|
|
221
|
+
|
|
222
|
+
function getMid(bounds) {
|
|
223
|
+
return {
|
|
224
|
+
x: bounds.x + bounds.width / 2,
|
|
225
|
+
y: bounds.y + bounds.height / 2
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function getDockingPoint(point, rectangle, dockingDirection = 'r', targetOrientation = 'top-left') {
|
|
230
|
+
|
|
231
|
+
// ensure we end up with a specific docking direction
|
|
232
|
+
// based on the targetOrientation, if <h|v> is being passed
|
|
233
|
+
|
|
234
|
+
if (dockingDirection === 'h') {
|
|
235
|
+
dockingDirection = /left/.test(targetOrientation) ? 'l' : 'r';
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (dockingDirection === 'v') {
|
|
239
|
+
dockingDirection = /top/.test(targetOrientation) ? 't' : 'b';
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (dockingDirection === 't') {
|
|
243
|
+
return { original: point, x: point.x, y: rectangle.y };
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
if (dockingDirection === 'r') {
|
|
247
|
+
return { original: point, x: rectangle.x + rectangle.width, y: point.y };
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (dockingDirection === 'b') {
|
|
251
|
+
return { original: point, x: point.x, y: rectangle.y + rectangle.height };
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (dockingDirection === 'l') {
|
|
255
|
+
return { original: point, x: rectangle.x, y: point.y };
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
throw new Error('unexpected dockingDirection: <' + dockingDirection + '>');
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Modified Manhattan layout: Uses space between grid coloumns to route connections
|
|
263
|
+
* if direct connection is not possible.
|
|
264
|
+
* @param {*} source
|
|
265
|
+
* @param {*} target
|
|
266
|
+
* @returns waypoints
|
|
267
|
+
*/
|
|
268
|
+
function connectElements(source, target, layoutGrid) {
|
|
269
|
+
const sourceDi = source.di;
|
|
270
|
+
const targetDi = target.di;
|
|
271
|
+
|
|
272
|
+
const sourceBounds = sourceDi.get('bounds');
|
|
273
|
+
const targetBounds = targetDi.get('bounds');
|
|
274
|
+
|
|
275
|
+
const sourceMid = getMid(sourceBounds);
|
|
276
|
+
const targetMid = getMid(targetBounds);
|
|
277
|
+
|
|
278
|
+
const dX = target.gridPosition.col - source.gridPosition.col;
|
|
279
|
+
const dY = target.gridPosition.row - source.gridPosition.row;
|
|
280
|
+
|
|
281
|
+
const dockingSource = `${(dY > 0 ? 'bottom' : 'top')}-${dX > 0 ? 'right' : 'left'}`;
|
|
282
|
+
const dockingTarget = `${(dY > 0 ? 'top' : 'bottom')}-${dX > 0 ? 'left' : 'right'}`;
|
|
283
|
+
|
|
284
|
+
// Source === Target ==> Build loop
|
|
285
|
+
if (dX === 0 && dY === 0) {
|
|
286
|
+
return [
|
|
287
|
+
getDockingPoint(sourceMid, sourceBounds, 'r', dockingSource),
|
|
288
|
+
{ x: sourceMid.x + DEFAULT_CELL_WIDTH / 2, y: sourceMid.y },
|
|
289
|
+
{ x: sourceMid.x + DEFAULT_CELL_WIDTH / 2, y: sourceMid.y - DEFAULT_CELL_HEIGHT / 2 },
|
|
290
|
+
{ x: targetMid.x, y: sourceMid.y - DEFAULT_CELL_HEIGHT / 2 },
|
|
291
|
+
getDockingPoint(targetMid, targetBounds, 't', dockingTarget)
|
|
292
|
+
];
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// connect horizontally
|
|
296
|
+
if (dY === 0) {
|
|
297
|
+
if (layoutGrid.getElementsInRange(source.gridPosition, target.gridPosition).length > 2) {
|
|
298
|
+
|
|
299
|
+
// Route on top
|
|
300
|
+
return [
|
|
301
|
+
getDockingPoint(sourceMid, sourceBounds, 't'),
|
|
302
|
+
{ x: sourceMid.x, y: sourceMid.y - DEFAULT_CELL_HEIGHT / 2 },
|
|
303
|
+
{ x: targetMid.x, y: sourceMid.y - DEFAULT_CELL_HEIGHT / 2 },
|
|
304
|
+
getDockingPoint(targetMid, targetBounds, 't')
|
|
305
|
+
];
|
|
306
|
+
} else {
|
|
307
|
+
|
|
308
|
+
// if space is clear, connect directly
|
|
309
|
+
return [
|
|
310
|
+
getDockingPoint(sourceMid, sourceBounds, 'h', dockingSource),
|
|
311
|
+
getDockingPoint(targetMid, targetBounds, 'h', dockingTarget)
|
|
312
|
+
];
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// connect vertically
|
|
317
|
+
if (dX === 0) {
|
|
318
|
+
if (layoutGrid.getElementsInRange(source.gridPosition, target.gridPosition).length > 2) {
|
|
319
|
+
|
|
320
|
+
// Route parallel
|
|
321
|
+
const yOffset = -Math.sign(dY) * DEFAULT_CELL_HEIGHT / 2;
|
|
322
|
+
return [
|
|
323
|
+
getDockingPoint(sourceMid, sourceBounds, 'r'),
|
|
324
|
+
{ x: sourceMid.x + DEFAULT_CELL_WIDTH / 2, y: sourceMid.y }, // out right
|
|
325
|
+
{ x: targetMid.x + DEFAULT_CELL_WIDTH / 2, y: targetMid.y + yOffset },
|
|
326
|
+
{ x: targetMid.x, y: targetMid.y + yOffset },
|
|
327
|
+
getDockingPoint(targetMid, targetBounds, Math.sign(yOffset) > 0 ? 'b' : 't')
|
|
328
|
+
];
|
|
329
|
+
} else {
|
|
330
|
+
|
|
331
|
+
// if space is clear, connect directly
|
|
332
|
+
return [ getDockingPoint(sourceMid, sourceBounds, 'v', dockingSource),
|
|
333
|
+
getDockingPoint(targetMid, targetBounds, 'v', dockingTarget)
|
|
334
|
+
];
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
const yOffset = -Math.sign(dY) * DEFAULT_CELL_HEIGHT / 2;
|
|
339
|
+
|
|
340
|
+
return [
|
|
341
|
+
getDockingPoint(sourceMid, sourceBounds, 'r', dockingSource),
|
|
342
|
+
{ x: sourceMid.x + DEFAULT_CELL_WIDTH / 2, y: sourceMid.y }, // out right
|
|
343
|
+
{ x: sourceMid.x + DEFAULT_CELL_WIDTH / 2, y: targetMid.y + yOffset }, // to target row
|
|
344
|
+
{ x: targetMid.x - DEFAULT_CELL_WIDTH / 2, y: targetMid.y + yOffset }, // to target column
|
|
345
|
+
{ x: targetMid.x - DEFAULT_CELL_WIDTH / 2, y: targetMid.y }, // to mid
|
|
346
|
+
getDockingPoint(targetMid, targetBounds, 'l', dockingTarget)
|
|
347
|
+
];
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// helpers /////
|
|
351
|
+
function getBounds(element, row, col, attachedTo) {
|
|
352
|
+
const { width, height } = getDefaultSize(element);
|
|
353
|
+
|
|
354
|
+
// Center in cell
|
|
355
|
+
if (!attachedTo) {
|
|
356
|
+
return {
|
|
357
|
+
width, height,
|
|
358
|
+
x: (col * DEFAULT_CELL_WIDTH) + (DEFAULT_CELL_WIDTH - width) / 2,
|
|
359
|
+
y: row * DEFAULT_CELL_HEIGHT + (DEFAULT_CELL_HEIGHT - height) / 2
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
const hostBounds = getBounds(attachedTo, row, col);
|
|
364
|
+
|
|
365
|
+
return {
|
|
366
|
+
width, height,
|
|
367
|
+
x: Math.round(hostBounds.x + hostBounds.width / 2 - width / 2),
|
|
368
|
+
y: Math.round(hostBounds.y + hostBounds.height - height / 2)
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
class Layouter {
|
|
373
|
+
constructor() {
|
|
374
|
+
this.moddle = new BPMNModdle();
|
|
375
|
+
this.diFactory = new DiFactory(this.moddle);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
async layoutProcess(xml) {
|
|
379
|
+
const { rootElement } = await this.moddle.fromXML(xml);
|
|
380
|
+
|
|
381
|
+
this.diagram = rootElement;
|
|
382
|
+
|
|
383
|
+
const root = this.getProcess();
|
|
384
|
+
|
|
385
|
+
this.cleanDi();
|
|
386
|
+
this.handlePlane(root);
|
|
387
|
+
|
|
388
|
+
return (await this.moddle.toXML(this.diagram, { format: true })).xml;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
handlePlane(planeElement) {
|
|
392
|
+
const layout = this.createGridLayout(planeElement);
|
|
393
|
+
this.generateDi(planeElement, layout);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
cleanDi() {
|
|
397
|
+
this.diagram.diagrams = [];
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
createGridLayout(root) {
|
|
401
|
+
const grid = new Grid();
|
|
402
|
+
|
|
403
|
+
// const process = this.getProcess();
|
|
404
|
+
const flowElements = root.flowElements;
|
|
405
|
+
|
|
406
|
+
const startingElements = flowElements.filter(el => {
|
|
407
|
+
return !isConnection(el) && !isBoundaryEvent(el) && (!el.incoming || el.length === 0);
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
const boundaryEvents = flowElements.filter(el => isBoundaryEvent(el));
|
|
411
|
+
boundaryEvents.forEach(boundaryEvent => {
|
|
412
|
+
const attachedTask = boundaryEvent.attachedToRef;
|
|
413
|
+
const attachers = attachedTask.attachers || [];
|
|
414
|
+
attachers.push(boundaryEvent);
|
|
415
|
+
attachedTask.attachers = attachers;
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
// Depth-first-search
|
|
419
|
+
const stack = [ ...startingElements ];
|
|
420
|
+
const visited = new Set();
|
|
421
|
+
|
|
422
|
+
startingElements.forEach(el => {
|
|
423
|
+
grid.add(el);
|
|
424
|
+
visited.add(el);
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
while (stack.length > 0) {
|
|
428
|
+
const currentElement = stack.pop();
|
|
429
|
+
|
|
430
|
+
if (is(currentElement, 'bpmn:SubProcess')) {
|
|
431
|
+
this.handlePlane(currentElement);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// Handle outgoing paths
|
|
435
|
+
const outgoing = (currentElement.outgoing || [])
|
|
436
|
+
.map(out => out.targetRef)
|
|
437
|
+
.filter(el => el);
|
|
438
|
+
|
|
439
|
+
let previousElement = null;
|
|
440
|
+
outgoing.forEach((nextElement, index, arr) => {
|
|
441
|
+
if (visited.has(nextElement)) {
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
if (!previousElement) {
|
|
446
|
+
grid.addAfter(currentElement, nextElement);
|
|
447
|
+
}
|
|
448
|
+
else {
|
|
449
|
+
grid.addBelow(arr[index - 1], nextElement);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// Is self-looping
|
|
453
|
+
if (nextElement !== currentElement) {
|
|
454
|
+
previousElement = nextElement;
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
const attachedOutgoing = (currentElement.attachers || [])
|
|
459
|
+
.map(att => att.outgoing)
|
|
460
|
+
.flat()
|
|
461
|
+
.map(out => out.targetRef);
|
|
462
|
+
|
|
463
|
+
// handle boundary events
|
|
464
|
+
attachedOutgoing.forEach((nextElement, index, arr) => {
|
|
465
|
+
if (visited.has(nextElement)) {
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
const below = arr[index - 1] || currentElement;
|
|
470
|
+
grid.addBelow(below, nextElement);
|
|
471
|
+
stack.push(nextElement);
|
|
472
|
+
visited.add(nextElement);
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
// add to stack in reverse order: first element should be first of the stack
|
|
476
|
+
outgoing.reverse().forEach(el => {
|
|
477
|
+
if (visited.has(el)) {
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
visited.add(el);
|
|
481
|
+
stack.push(el);
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
return grid;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
generateDi(root, layoutGrid) {
|
|
489
|
+
const diFactory = this.diFactory;
|
|
490
|
+
|
|
491
|
+
// Step 0: Create Root element
|
|
492
|
+
const diagram = this.diagram;
|
|
493
|
+
|
|
494
|
+
var planeDi = diFactory.createDiPlane({
|
|
495
|
+
id: 'BPMNPlane_' + root.id,
|
|
496
|
+
bpmnElement: root
|
|
497
|
+
});
|
|
498
|
+
var diagramDi = diFactory.createDiDiagram({
|
|
499
|
+
id: 'BPMNDiagram_' + root.id,
|
|
500
|
+
plane: planeDi
|
|
501
|
+
});
|
|
502
|
+
|
|
503
|
+
// deepest subprocess is added first - insert at the front
|
|
504
|
+
diagram.diagrams.unshift(diagramDi);
|
|
505
|
+
|
|
506
|
+
const planeElement = planeDi.get('planeElement');
|
|
507
|
+
|
|
508
|
+
// Step 1: Create DI for all elements
|
|
509
|
+
layoutGrid.elementsByPosition().forEach(({ element, row, col }) => {
|
|
510
|
+
const bounds = getBounds(element, row, col);
|
|
511
|
+
|
|
512
|
+
const shapeDi = diFactory.createDiShape(element, bounds, {
|
|
513
|
+
id: element.id + '_di'
|
|
514
|
+
});
|
|
515
|
+
element.di = shapeDi;
|
|
516
|
+
element.gridPosition = { row, col };
|
|
517
|
+
|
|
518
|
+
planeElement.push(shapeDi);
|
|
519
|
+
|
|
520
|
+
// handle attachers
|
|
521
|
+
(element.attachers || []).forEach(att => {
|
|
522
|
+
att.gridPosition = { row, col };
|
|
523
|
+
const attacherBounds = getBounds(att, row, col, element);
|
|
524
|
+
|
|
525
|
+
const attacherDi = diFactory.createDiShape(att, attacherBounds, {
|
|
526
|
+
id: att.id + '_di'
|
|
527
|
+
});
|
|
528
|
+
att.di = attacherDi;
|
|
529
|
+
att.gridPosition = { row, col };
|
|
530
|
+
|
|
531
|
+
planeElement.push(attacherDi);
|
|
532
|
+
});
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
// Step 2: Create DI for all connections
|
|
536
|
+
layoutGrid.elementsByPosition().forEach(({ element, row, col }) => {
|
|
537
|
+
const outgoing = element.outgoing || [];
|
|
538
|
+
|
|
539
|
+
outgoing.forEach(out => {
|
|
540
|
+
const target = out.targetRef;
|
|
541
|
+
const waypoints = connectElements(element, target, layoutGrid);
|
|
542
|
+
|
|
543
|
+
const connectionDi = diFactory.createDiEdge(out, waypoints, {
|
|
544
|
+
id: out.id + '_di'
|
|
545
|
+
});
|
|
546
|
+
|
|
547
|
+
planeElement.push(connectionDi);
|
|
548
|
+
});
|
|
549
|
+
|
|
550
|
+
// handle attachers
|
|
551
|
+
(element.attachers || []).forEach(att => {
|
|
552
|
+
const outgoing = att.outgoing || [];
|
|
553
|
+
|
|
554
|
+
outgoing.forEach(out => {
|
|
555
|
+
const target = out.targetRef;
|
|
556
|
+
const waypoints = connectElements(att, target, layoutGrid);
|
|
557
|
+
|
|
558
|
+
const connectionDi = diFactory.createDiEdge(out, waypoints, {
|
|
559
|
+
id: out.id + '_di'
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
planeElement.push(connectionDi);
|
|
563
|
+
});
|
|
564
|
+
});
|
|
565
|
+
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
getProcess() {
|
|
571
|
+
return this.diagram.get('rootElements').find(el => el.$type === 'bpmn:Process');
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
function layoutProcess(xml) {
|
|
576
|
+
return new Layouter().layoutProcess(xml);
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
exports.layoutProcess = layoutProcess;
|
|
580
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../lib/utils/elementUtils.js","../lib/Grid.js","../lib/di/DiFactory.js","../lib/di/DiUtil.js","../lib/utils/layoutUtil.js","../lib/Layouter.js","../lib/index.js"],"sourcesContent":["export function isConnection(element) {\n return !!element.sourceRef;\n}\n\nexport function isBoundaryEvent(element) {\n return !!element.attachedToRef;\n}","export class Grid {\n constructor() {\n this.grid = [];\n }\n\n add(element) {\n this._addStart(element);\n }\n\n _addStart(element) {\n this.grid.push([ element ]);\n }\n\n addAfter(element, newElement) {\n if (!element) {\n this._addStart(newElement);\n }\n\n const [ row, col ] = this.find(element);\n this.grid[row].splice(col + 1, 0, newElement);\n }\n\n addBelow(element, newElement) {\n if (!element) {\n this._addStart(newElement);\n }\n\n const [ row, col ] = this.find(element);\n\n // We are at the bottom of the current grid - add empty row below\n if (!this.grid[row + 1]) {\n this.grid[row + 1] = [];\n }\n\n // The element below is already occupied - insert new row\n if (this.grid[row + 1][col]) {\n this.grid.splice(row + 1, 0, []);\n }\n\n if (this.grid[row + 1][col]) {\n throw new Error('Grid is occupied and we could not find a place - this should not happen');\n }\n\n this.grid[row + 1][col] = newElement;\n }\n\n find(element) {\n let row, col;\n row = this.grid.findIndex((row) => {\n col = row.findIndex((el) => {\n return el === element;\n });\n\n return col !== -1;\n });\n\n return [ row, col ];\n }\n\n get(row, col) {\n return (this.grid[row] || [])[col];\n }\n\n getElementsInRange({ row: startRow, col: startCol }, { row: endRow, col: endCol }) {\n const elements = [];\n\n if (startRow > endRow) {\n [ startRow, endRow ] = [ endRow, startRow ];\n }\n\n if (startCol > endCol) {\n [ startCol, endCol ] = [ endCol, startCol ];\n }\n\n for (let row = startRow; row <= endRow; row++) {\n for (let col = startCol; col <= endCol; col++) {\n const element = this.get(row, col);\n\n if (element) {\n elements.push(element);\n }\n }\n }\n\n return elements;\n }\n\n elementsByPosition() {\n const elements = [];\n\n this.grid.forEach((row, rowIndex) => {\n row.forEach((element, colIndex) => {\n if (!element) {\n return;\n }\n elements.push({\n element,\n row: rowIndex,\n col: colIndex\n });\n });\n });\n\n return elements;\n }\n}\n\n","import { assign, map, pick } from 'min-dash';\n\n\nexport class DiFactory {\n constructor(moddle) {\n this.moddle = moddle;\n }\n\n create(type, attrs) {\n return this.moddle.create(type, attrs || {});\n }\n\n createDiBounds(bounds) {\n return this.create('dc:Bounds', bounds);\n }\n\n createDiLabel() {\n return this.create('bpmndi:BPMNLabel', {\n bounds: this.createDiBounds()\n });\n }\n\n createDiShape(semantic, bounds, attrs) {\n return this.create('bpmndi:BPMNShape', assign({\n bpmnElement: semantic,\n bounds: this.createDiBounds(bounds)\n }, attrs));\n }\n\n createDiWaypoints(waypoints) {\n var self = this;\n\n return map(waypoints, function(pos) {\n return self.createDiWaypoint(pos);\n });\n }\n\n createDiWaypoint(point) {\n return this.create('dc:Point', pick(point, [ 'x', 'y' ]));\n }\n\n createDiEdge(semantic, waypoints, attrs) {\n return this.create('bpmndi:BPMNEdge', assign({\n bpmnElement: semantic,\n waypoint: this.createDiWaypoints(waypoints)\n }, attrs));\n }\n\n createDiPlane(attrs) {\n return this.create('bpmndi:BPMNPlane', attrs);\n }\n\n createDiDiagram(attrs) {\n return this.create('bpmndi:BPMNDiagram', attrs);\n }\n}","export function getDefaultSize(element) {\n if (is(element, 'bpmn:SubProcess')) {\n return { width: 100, height: 80 };\n }\n\n if (is(element, 'bpmn:Task')) {\n return { width: 100, height: 80 };\n }\n\n if (is(element, 'bpmn:Gateway')) {\n return { width: 50, height: 50 };\n }\n\n if (is(element, 'bpmn:Event')) {\n return { width: 36, height: 36 };\n }\n\n if (is(element, 'bpmn:Participant')) {\n return { width: 400, height: 100 };\n }\n\n if (is(element, 'bpmn:Lane')) {\n return { width: 400, height: 100 };\n }\n\n if (is(element, 'bpmn:DataObjectReference')) {\n return { width: 36, height: 50 };\n }\n\n if (is(element, 'bpmn:DataStoreReference')) {\n return { width: 50, height: 50 };\n }\n\n if (is(element, 'bpmn:TextAnnotation')) {\n return { width: 100, height: 30 };\n }\n\n return { width: 100, height: 80 };\n}\n\nexport function is(element, type) {\n return element.$instanceOf(type);\n}\n","import { getDefaultSize } from '../di/DiUtil';\n\nexport const DEFAULT_CELL_WIDTH = 150;\nexport const DEFAULT_CELL_HEIGHT = 110;\n\nexport function getMid(bounds) {\n return {\n x: bounds.x + bounds.width / 2,\n y: bounds.y + bounds.height / 2\n };\n}\n\nexport function getDockingPoint(point, rectangle, dockingDirection = 'r', targetOrientation = 'top-left') {\n\n // ensure we end up with a specific docking direction\n // based on the targetOrientation, if <h|v> is being passed\n\n if (dockingDirection === 'h') {\n dockingDirection = /left/.test(targetOrientation) ? 'l' : 'r';\n }\n\n if (dockingDirection === 'v') {\n dockingDirection = /top/.test(targetOrientation) ? 't' : 'b';\n }\n\n if (dockingDirection === 't') {\n return { original: point, x: point.x, y: rectangle.y };\n }\n\n if (dockingDirection === 'r') {\n return { original: point, x: rectangle.x + rectangle.width, y: point.y };\n }\n\n if (dockingDirection === 'b') {\n return { original: point, x: point.x, y: rectangle.y + rectangle.height };\n }\n\n if (dockingDirection === 'l') {\n return { original: point, x: rectangle.x, y: point.y };\n }\n\n throw new Error('unexpected dockingDirection: <' + dockingDirection + '>');\n}\n\n/**\n * Modified Manhattan layout: Uses space between grid coloumns to route connections\n * if direct connection is not possible.\n * @param {*} source\n * @param {*} target\n * @returns waypoints\n */\nexport function connectElements(source, target, layoutGrid) {\n const sourceDi = source.di;\n const targetDi = target.di;\n\n const sourceBounds = sourceDi.get('bounds');\n const targetBounds = targetDi.get('bounds');\n\n const sourceMid = getMid(sourceBounds);\n const targetMid = getMid(targetBounds);\n\n const dX = target.gridPosition.col - source.gridPosition.col;\n const dY = target.gridPosition.row - source.gridPosition.row;\n\n const dockingSource = `${(dY > 0 ? 'bottom' : 'top')}-${dX > 0 ? 'right' : 'left'}`;\n const dockingTarget = `${(dY > 0 ? 'top' : 'bottom')}-${dX > 0 ? 'left' : 'right'}`;\n\n // Source === Target ==> Build loop\n if (dX === 0 && dY === 0) {\n return [\n getDockingPoint(sourceMid, sourceBounds, 'r', dockingSource),\n { x: sourceMid.x + DEFAULT_CELL_WIDTH / 2, y: sourceMid.y },\n { x: sourceMid.x + DEFAULT_CELL_WIDTH / 2, y: sourceMid.y - DEFAULT_CELL_HEIGHT / 2 },\n { x: targetMid.x, y: sourceMid.y - DEFAULT_CELL_HEIGHT / 2 },\n getDockingPoint(targetMid, targetBounds, 't', dockingTarget)\n ];\n }\n\n // connect horizontally\n if (dY === 0) {\n if (layoutGrid.getElementsInRange(source.gridPosition, target.gridPosition).length > 2) {\n\n // Route on top\n return [\n getDockingPoint(sourceMid, sourceBounds, 't'),\n { x: sourceMid.x, y: sourceMid.y - DEFAULT_CELL_HEIGHT / 2 },\n { x: targetMid.x, y: sourceMid.y - DEFAULT_CELL_HEIGHT / 2 },\n getDockingPoint(targetMid, targetBounds, 't')\n ];\n } else {\n\n // if space is clear, connect directly\n return [\n getDockingPoint(sourceMid, sourceBounds, 'h', dockingSource),\n getDockingPoint(targetMid, targetBounds, 'h', dockingTarget)\n ];\n }\n }\n\n // connect vertically\n if (dX === 0) {\n if (layoutGrid.getElementsInRange(source.gridPosition, target.gridPosition).length > 2) {\n\n // Route parallel\n const yOffset = -Math.sign(dY) * DEFAULT_CELL_HEIGHT / 2;\n return [\n getDockingPoint(sourceMid, sourceBounds, 'r'),\n { x: sourceMid.x + DEFAULT_CELL_WIDTH / 2, y: sourceMid.y }, // out right\n { x: targetMid.x + DEFAULT_CELL_WIDTH / 2, y: targetMid.y + yOffset },\n { x: targetMid.x, y: targetMid.y + yOffset },\n getDockingPoint(targetMid, targetBounds, Math.sign(yOffset) > 0 ? 'b' : 't')\n ];\n } else {\n\n // if space is clear, connect directly\n return [ getDockingPoint(sourceMid, sourceBounds, 'v', dockingSource),\n getDockingPoint(targetMid, targetBounds, 'v', dockingTarget)\n ];\n }\n }\n\n const yOffset = -Math.sign(dY) * DEFAULT_CELL_HEIGHT / 2;\n\n return [\n getDockingPoint(sourceMid, sourceBounds, 'r', dockingSource),\n { x: sourceMid.x + DEFAULT_CELL_WIDTH / 2, y: sourceMid.y }, // out right\n { x: sourceMid.x + DEFAULT_CELL_WIDTH / 2, y: targetMid.y + yOffset }, // to target row\n { x: targetMid.x - DEFAULT_CELL_WIDTH / 2, y: targetMid.y + yOffset }, // to target column\n { x: targetMid.x - DEFAULT_CELL_WIDTH / 2, y: targetMid.y }, // to mid\n getDockingPoint(targetMid, targetBounds, 'l', dockingTarget)\n ];\n}\n\n// helpers /////\nexport function getBounds(element, row, col, attachedTo) {\n const { width, height } = getDefaultSize(element);\n\n // Center in cell\n if (!attachedTo) {\n return {\n width, height,\n x: (col * DEFAULT_CELL_WIDTH) + (DEFAULT_CELL_WIDTH - width) / 2,\n y: row * DEFAULT_CELL_HEIGHT + (DEFAULT_CELL_HEIGHT - height) / 2\n };\n }\n\n const hostBounds = getBounds(attachedTo, row, col);\n\n return {\n width, height,\n x: Math.round(hostBounds.x + hostBounds.width / 2 - width / 2),\n y: Math.round(hostBounds.y + hostBounds.height - height / 2)\n };\n}","import BPMNModdle from 'bpmn-moddle';\nimport { isBoundaryEvent, isConnection } from './utils/elementUtils';\nimport { Grid } from './Grid';\nimport { DiFactory } from './di/DiFactory';\nimport { connectElements, getBounds } from './utils/layoutUtil';\nimport { is } from './di/DiUtil';\n\nexport class Layouter {\n constructor() {\n this.moddle = new BPMNModdle();\n this.diFactory = new DiFactory(this.moddle);\n }\n\n async layoutProcess(xml) {\n const { rootElement } = await this.moddle.fromXML(xml);\n\n this.diagram = rootElement;\n\n const root = this.getProcess();\n\n this.cleanDi();\n this.handlePlane(root);\n\n return (await this.moddle.toXML(this.diagram, { format: true })).xml;\n }\n\n handlePlane(planeElement) {\n const layout = this.createGridLayout(planeElement);\n this.generateDi(planeElement, layout);\n }\n\n cleanDi() {\n this.diagram.diagrams = [];\n }\n\n createGridLayout(root) {\n const grid = new Grid();\n\n // const process = this.getProcess();\n const flowElements = root.flowElements;\n\n const startingElements = flowElements.filter(el => {\n return !isConnection(el) && !isBoundaryEvent(el) && (!el.incoming || el.length === 0);\n });\n\n const boundaryEvents = flowElements.filter(el => isBoundaryEvent(el));\n boundaryEvents.forEach(boundaryEvent => {\n const attachedTask = boundaryEvent.attachedToRef;\n const attachers = attachedTask.attachers || [];\n attachers.push(boundaryEvent);\n attachedTask.attachers = attachers;\n });\n\n // Depth-first-search\n const stack = [ ...startingElements ];\n const visited = new Set();\n\n startingElements.forEach(el => {\n grid.add(el);\n visited.add(el);\n });\n\n while (stack.length > 0) {\n const currentElement = stack.pop();\n\n if (is(currentElement, 'bpmn:SubProcess')) {\n this.handlePlane(currentElement);\n }\n\n // Handle outgoing paths\n const outgoing = (currentElement.outgoing || [])\n .map(out => out.targetRef)\n .filter(el => el);\n\n let previousElement = null;\n outgoing.forEach((nextElement, index, arr) => {\n if (visited.has(nextElement)) {\n return;\n }\n\n if (!previousElement) {\n grid.addAfter(currentElement, nextElement);\n }\n else {\n grid.addBelow(arr[index - 1], nextElement);\n }\n\n // Is self-looping\n if (nextElement !== currentElement) {\n previousElement = nextElement;\n }\n });\n\n const attachedOutgoing = (currentElement.attachers || [])\n .map(att => att.outgoing)\n .flat()\n .map(out => out.targetRef);\n\n // handle boundary events\n attachedOutgoing.forEach((nextElement, index, arr) => {\n if (visited.has(nextElement)) {\n return;\n }\n\n const below = arr[index - 1] || currentElement;\n grid.addBelow(below, nextElement);\n stack.push(nextElement);\n visited.add(nextElement);\n });\n\n // add to stack in reverse order: first element should be first of the stack\n outgoing.reverse().forEach(el => {\n if (visited.has(el)) {\n return;\n }\n visited.add(el);\n stack.push(el);\n });\n }\n\n return grid;\n }\n\n generateDi(root, layoutGrid) {\n const diFactory = this.diFactory;\n\n // Step 0: Create Root element\n const diagram = this.diagram;\n\n var planeDi = diFactory.createDiPlane({\n id: 'BPMNPlane_' + root.id,\n bpmnElement: root\n });\n var diagramDi = diFactory.createDiDiagram({\n id: 'BPMNDiagram_' + root.id,\n plane: planeDi\n });\n\n // deepest subprocess is added first - insert at the front\n diagram.diagrams.unshift(diagramDi);\n\n const planeElement = planeDi.get('planeElement');\n\n // Step 1: Create DI for all elements\n layoutGrid.elementsByPosition().forEach(({ element, row, col }) => {\n const bounds = getBounds(element, row, col);\n\n const shapeDi = diFactory.createDiShape(element, bounds, {\n id: element.id + '_di'\n });\n element.di = shapeDi;\n element.gridPosition = { row, col };\n\n planeElement.push(shapeDi);\n\n // handle attachers\n (element.attachers || []).forEach(att => {\n att.gridPosition = { row, col };\n const attacherBounds = getBounds(att, row, col, element);\n\n const attacherDi = diFactory.createDiShape(att, attacherBounds, {\n id: att.id + '_di'\n });\n att.di = attacherDi;\n att.gridPosition = { row, col };\n\n planeElement.push(attacherDi);\n });\n });\n\n // Step 2: Create DI for all connections\n layoutGrid.elementsByPosition().forEach(({ element, row, col }) => {\n const outgoing = element.outgoing || [];\n\n outgoing.forEach(out => {\n const target = out.targetRef;\n const waypoints = connectElements(element, target, layoutGrid);\n\n const connectionDi = diFactory.createDiEdge(out, waypoints, {\n id: out.id + '_di'\n });\n\n planeElement.push(connectionDi);\n });\n\n // handle attachers\n (element.attachers || []).forEach(att => {\n const outgoing = att.outgoing || [];\n\n outgoing.forEach(out => {\n const target = out.targetRef;\n const waypoints = connectElements(att, target, layoutGrid);\n\n const connectionDi = diFactory.createDiEdge(out, waypoints, {\n id: out.id + '_di'\n });\n\n planeElement.push(connectionDi);\n });\n });\n\n });\n }\n\n\n getProcess() {\n return this.diagram.get('rootElements').find(el => el.$type === 'bpmn:Process');\n }\n}\n","import { Layouter } from './Layouter';\n\nexport function layoutProcess(xml) {\n return new Layouter().layoutProcess(xml);\n}\n"],"names":["assign","map","pick"],"mappings":";;;;;AAAO,SAAS,YAAY,CAAC,OAAO,EAAE;AACtC,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;AAC7B,CAAC;AACD;AACO,SAAS,eAAe,CAAC,OAAO,EAAE;AACzC,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;AACjC;;ACNO,MAAM,IAAI,CAAC;AAClB,EAAE,WAAW,GAAG;AAChB,IAAI,IAAI,CAAC,IAAI,GA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