2021-09-07 09:07:27 +00:00
|
|
|
import {
|
2022-01-08 01:49:35 +00:00
|
|
|
Editor,
|
2021-09-07 09:07:27 +00:00
|
|
|
ConnectionHandler,
|
|
|
|
ImageBox,
|
|
|
|
Perimeter,
|
|
|
|
Point,
|
2022-01-08 01:49:35 +00:00
|
|
|
constants,
|
|
|
|
cloneUtils,
|
2021-09-07 09:07:27 +00:00
|
|
|
EdgeStyle,
|
|
|
|
InternalEvent,
|
|
|
|
SwimlaneManager,
|
|
|
|
StackLayout,
|
|
|
|
LayoutManager,
|
|
|
|
} from '@maxgraph/core';
|
2021-04-24 12:30:27 +00:00
|
|
|
|
|
|
|
import { globalTypes } from '../.storybook/preview';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
title: 'Layouts/SwimLanes',
|
|
|
|
argTypes: {
|
2021-08-30 14:20:26 +00:00
|
|
|
...globalTypes,
|
|
|
|
},
|
2021-04-24 12:30:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const Template = ({ label, ...args }) => {
|
|
|
|
const container = document.createElement('div');
|
|
|
|
container.style.position = 'relative';
|
|
|
|
container.style.overflow = 'hidden';
|
|
|
|
container.style.width = `${args.width}px`;
|
|
|
|
container.style.height = `${args.height}px`;
|
|
|
|
container.style.background = 'url(/images/grid.gif)';
|
|
|
|
container.style.cursor = 'default';
|
|
|
|
|
|
|
|
// Defines an icon for creating new connections in the connection handler.
|
|
|
|
// This will automatically disable the highlighting of the source vertex.
|
2021-08-30 14:20:26 +00:00
|
|
|
ConnectionHandler.prototype.connectImage = new ImageBox('images/connector.gif', 16, 16);
|
2021-04-24 12:30:27 +00:00
|
|
|
|
|
|
|
// Creates a wrapper editor around a new graph inside
|
|
|
|
// the given container using an XML config for the
|
|
|
|
// keyboard bindings
|
2021-08-30 14:20:26 +00:00
|
|
|
// const config = utils
|
2021-04-24 12:30:27 +00:00
|
|
|
// .load('editors/config/keyhandler-commons.xml')
|
|
|
|
// .getDocumentElement();
|
2022-01-08 01:49:35 +00:00
|
|
|
// const editor = new Editor(config);
|
|
|
|
const editor = new Editor(null);
|
2021-04-24 12:30:27 +00:00
|
|
|
editor.setGraphContainer(container);
|
|
|
|
const { graph } = editor;
|
2022-01-08 01:49:35 +00:00
|
|
|
const model = graph.getDataModel();
|
2021-04-24 12:30:27 +00:00
|
|
|
|
|
|
|
// Auto-resizes the container
|
|
|
|
graph.border = 80;
|
2021-08-30 14:20:26 +00:00
|
|
|
graph.getView().translate = new Point(graph.border / 2, graph.border / 2);
|
2021-04-24 12:30:27 +00:00
|
|
|
graph.setResizeContainer(true);
|
2021-10-20 01:28:27 +00:00
|
|
|
|
2022-01-08 01:49:35 +00:00
|
|
|
const graphHandler = graph.getPlugin('SelectionHandler');
|
2021-10-20 01:28:27 +00:00
|
|
|
graphHandler.setRemoveCellsFromParent(false);
|
2021-04-24 12:30:27 +00:00
|
|
|
|
|
|
|
// Changes the default vertex style in-place
|
|
|
|
let style = graph.getStylesheet().getDefaultVertexStyle();
|
2022-01-08 01:49:35 +00:00
|
|
|
style.shape = constants.SHAPE.SWIMLANE;
|
2021-05-02 06:04:34 +00:00
|
|
|
style.verticalAlign = 'middle';
|
|
|
|
style.labelBackgroundColor = 'white';
|
|
|
|
style.fontSize = 11;
|
|
|
|
style.startSize = 22;
|
|
|
|
style.horizontal = false;
|
2021-05-02 13:56:17 +00:00
|
|
|
style.fontColor = 'black';
|
2021-05-02 06:04:34 +00:00
|
|
|
style.strokeColor = 'black';
|
2021-10-20 01:28:27 +00:00
|
|
|
// delete style.fillColor;
|
2021-04-24 12:30:27 +00:00
|
|
|
|
2022-01-08 01:49:35 +00:00
|
|
|
style = cloneUtils.clone(style);
|
|
|
|
style.shape = constants.SHAPE.RECTANGLE;
|
2021-05-02 06:04:34 +00:00
|
|
|
style.fontSize = 10;
|
|
|
|
style.rounded = true;
|
|
|
|
style.horizontal = true;
|
|
|
|
style.verticalAlign = 'middle';
|
|
|
|
delete style.startSize;
|
|
|
|
style.labelBackgroundColor = 'none';
|
2021-04-24 12:30:27 +00:00
|
|
|
graph.getStylesheet().putCellStyle('process', style);
|
|
|
|
|
2022-01-08 01:49:35 +00:00
|
|
|
style = cloneUtils.clone(style);
|
|
|
|
style.shape = constants.SHAPE.ELLIPSE;
|
2021-08-30 14:20:26 +00:00
|
|
|
style.perimiter = Perimeter.EllipsePerimeter;
|
2021-05-02 06:04:34 +00:00
|
|
|
delete style.rounded;
|
2021-04-24 12:30:27 +00:00
|
|
|
graph.getStylesheet().putCellStyle('state', style);
|
|
|
|
|
2022-01-08 01:49:35 +00:00
|
|
|
style = cloneUtils.clone(style);
|
|
|
|
style.shape = constants.SHAPE.RHOMBUS;
|
2021-08-30 14:20:26 +00:00
|
|
|
style.perimiter = Perimeter.RhombusPerimeter;
|
2021-05-02 06:04:34 +00:00
|
|
|
style.verticalAlign = 'top';
|
|
|
|
style.spacingTop = 40;
|
|
|
|
style.spacingRight = 64;
|
2021-04-24 12:30:27 +00:00
|
|
|
graph.getStylesheet().putCellStyle('condition', style);
|
|
|
|
|
2022-01-08 01:49:35 +00:00
|
|
|
style = cloneUtils.clone(style);
|
|
|
|
style.shape = constants.SHAPE.DOUBLE_ELLIPSE;
|
2021-08-30 14:20:26 +00:00
|
|
|
style.perimiter = Perimeter.EllipsePerimeter;
|
2021-05-02 06:04:34 +00:00
|
|
|
style.spacingTop = 28;
|
|
|
|
style.fontSize = 14;
|
|
|
|
style.fontStyle = 1;
|
|
|
|
delete style.spacingRight;
|
2021-04-24 12:30:27 +00:00
|
|
|
graph.getStylesheet().putCellStyle('end', style);
|
|
|
|
|
|
|
|
style = graph.getStylesheet().getDefaultEdgeStyle();
|
2021-08-30 14:20:26 +00:00
|
|
|
style.edge = EdgeStyle.ElbowConnector;
|
2022-01-08 01:49:35 +00:00
|
|
|
style.endArrow = constants.ARROW.BLOCK;
|
2021-05-02 06:04:34 +00:00
|
|
|
style.rounded = true;
|
2021-05-02 13:56:17 +00:00
|
|
|
style.fontColor = 'black';
|
2021-05-02 06:04:34 +00:00
|
|
|
style.strokeColor = 'black';
|
2021-04-24 12:30:27 +00:00
|
|
|
|
2022-01-08 01:49:35 +00:00
|
|
|
style = cloneUtils.clone(style);
|
2021-05-02 06:04:34 +00:00
|
|
|
style.dashed = true;
|
2022-01-08 01:49:35 +00:00
|
|
|
style.endArrow = constants.ARROW.OPEN;
|
|
|
|
style.startArrow = constants.ARROW.OVAL;
|
2021-04-24 12:30:27 +00:00
|
|
|
graph.getStylesheet().putCellStyle('crossover', style);
|
|
|
|
|
|
|
|
// Installs double click on middle control point and
|
|
|
|
// changes style of edges between empty and this value
|
|
|
|
graph.alternateEdgeStyle = 'elbow=vertical';
|
|
|
|
|
|
|
|
// Adds automatic layout and various switches if the
|
|
|
|
// graph is enabled
|
|
|
|
if (graph.isEnabled()) {
|
|
|
|
// Allows new connections but no dangling edges
|
|
|
|
graph.setConnectable(true);
|
|
|
|
graph.setAllowDanglingEdges(false);
|
|
|
|
|
|
|
|
// End-states are no valid sources
|
|
|
|
const previousIsValidSource = graph.isValidSource;
|
|
|
|
|
2021-08-30 14:20:26 +00:00
|
|
|
graph.isValidSource = function (cell) {
|
2021-04-24 12:30:27 +00:00
|
|
|
if (previousIsValidSource.apply(this, arguments)) {
|
2021-04-25 03:39:40 +00:00
|
|
|
const style = cell.getStyle();
|
2021-04-24 12:30:27 +00:00
|
|
|
|
2021-08-30 14:20:26 +00:00
|
|
|
return style == null || !(style == 'end' || style.indexOf('end') == 0);
|
2021-04-24 12:30:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Start-states are no valid targets, we do not
|
|
|
|
// perform a call to the superclass function because
|
|
|
|
// this would call isValidSource
|
|
|
|
// Note: All states are start states in
|
|
|
|
// the example below, so we use the state
|
|
|
|
// style below
|
2021-08-30 14:20:26 +00:00
|
|
|
graph.isValidTarget = function (cell) {
|
2021-04-25 03:39:40 +00:00
|
|
|
const style = cell.getStyle();
|
2021-04-24 12:30:27 +00:00
|
|
|
|
|
|
|
return (
|
2021-04-25 03:39:40 +00:00
|
|
|
!cell.isEdge() &&
|
2021-04-24 12:30:27 +00:00
|
|
|
!this.isSwimlane(cell) &&
|
|
|
|
(style == null || !(style == 'state' || style.indexOf('state') == 0))
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
// Allows dropping cells into new lanes and
|
|
|
|
// lanes into new pools, but disallows dropping
|
|
|
|
// cells on edges to split edges
|
|
|
|
graph.setDropEnabled(true);
|
|
|
|
graph.setSplitEnabled(false);
|
|
|
|
|
|
|
|
// Returns true for valid drop operations
|
2021-08-30 14:20:26 +00:00
|
|
|
graph.isValidDropTarget = function (target, cells, evt) {
|
2021-04-24 12:30:27 +00:00
|
|
|
if (this.isSplitEnabled() && this.isSplitTarget(target, cells, evt)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2022-01-08 01:49:35 +00:00
|
|
|
const model = this.getDataModel();
|
2021-04-24 12:30:27 +00:00
|
|
|
let lane = false;
|
|
|
|
let pool = false;
|
|
|
|
let cell = false;
|
|
|
|
|
|
|
|
// Checks if any lanes or pools are selected
|
|
|
|
for (let i = 0; i < cells.length; i++) {
|
2021-04-25 03:39:40 +00:00
|
|
|
const tmp = cells[i].getParent();
|
2021-04-24 12:30:27 +00:00
|
|
|
lane = lane || this.isPool(tmp);
|
|
|
|
pool = pool || this.isPool(cells[i]);
|
|
|
|
|
|
|
|
cell = cell || !(lane || pool);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
!pool &&
|
|
|
|
cell != lane &&
|
2021-08-30 14:20:26 +00:00
|
|
|
((lane && this.isPool(target)) || (cell && this.isPool(target.getParent())))
|
2021-04-24 12:30:27 +00:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
// Adds new method for identifying a pool
|
2021-08-30 14:20:26 +00:00
|
|
|
graph.isPool = function (cell) {
|
2022-01-08 01:49:35 +00:00
|
|
|
const model = this.getDataModel();
|
2021-04-25 03:39:40 +00:00
|
|
|
const parent = cell.getParent();
|
2021-04-24 12:30:27 +00:00
|
|
|
|
2021-04-25 03:39:40 +00:00
|
|
|
return parent != null && parent.getParent() == model.getRoot();
|
2021-04-24 12:30:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Keeps widths on collapse/expand
|
2021-08-30 14:20:26 +00:00
|
|
|
const foldingHandler = function (sender, evt) {
|
2021-04-24 12:30:27 +00:00
|
|
|
const cells = evt.getProperty('cells');
|
|
|
|
|
|
|
|
for (let i = 0; i < cells.length; i++) {
|
2021-04-25 03:39:40 +00:00
|
|
|
const geo = cells[i].getGeometry();
|
2021-04-24 12:30:27 +00:00
|
|
|
|
|
|
|
if (geo.alternateBounds != null) {
|
|
|
|
geo.width = geo.alternateBounds.width;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2021-08-30 14:20:26 +00:00
|
|
|
graph.addListener(InternalEvent.FOLD_CELLS, foldingHandler);
|
2021-04-24 12:30:27 +00:00
|
|
|
}
|
|
|
|
|
2021-04-25 03:39:40 +00:00
|
|
|
// Changes swimlane orientation while collapsed
|
2021-08-30 14:20:26 +00:00
|
|
|
const getStyle = function () {
|
2021-04-25 03:39:40 +00:00
|
|
|
// TODO super cannot be used here
|
|
|
|
// let style = super.getStyle();
|
|
|
|
let style;
|
2021-04-25 10:47:53 +00:00
|
|
|
if (this.isCollapsed()) {
|
2021-04-25 03:39:40 +00:00
|
|
|
if (style != null) {
|
|
|
|
style += ';';
|
|
|
|
} else {
|
|
|
|
style = '';
|
|
|
|
}
|
|
|
|
style += 'horizontal=1;align=left;spacingLeft=14;';
|
|
|
|
}
|
|
|
|
return style;
|
|
|
|
};
|
|
|
|
|
2021-04-24 12:30:27 +00:00
|
|
|
// Applies size changes to siblings and parents
|
2021-08-30 14:20:26 +00:00
|
|
|
new SwimlaneManager(graph);
|
2021-04-24 12:30:27 +00:00
|
|
|
|
|
|
|
// Creates a stack depending on the orientation of the swimlane
|
2021-08-30 14:20:26 +00:00
|
|
|
const layout = new StackLayout(graph, false);
|
2021-04-24 12:30:27 +00:00
|
|
|
|
|
|
|
// Makes sure all children fit into the parent swimlane
|
|
|
|
layout.resizeParent = true;
|
|
|
|
|
|
|
|
// Applies the size to children if parent size changes
|
|
|
|
layout.fill = true;
|
|
|
|
|
|
|
|
// Only update the size of swimlanes
|
2021-08-30 14:20:26 +00:00
|
|
|
layout.isVertexIgnored = function (vertex) {
|
2021-04-24 12:30:27 +00:00
|
|
|
return !graph.isSwimlane(vertex);
|
|
|
|
};
|
|
|
|
|
|
|
|
// Keeps the lanes and pools stacked
|
2021-08-30 14:20:26 +00:00
|
|
|
const layoutMgr = new LayoutManager(graph);
|
2021-04-24 12:30:27 +00:00
|
|
|
|
2021-08-30 14:20:26 +00:00
|
|
|
layoutMgr.getLayout = function (cell) {
|
2021-04-24 12:30:27 +00:00
|
|
|
if (
|
2021-04-25 03:39:40 +00:00
|
|
|
!cell.isEdge() &&
|
|
|
|
cell.getChildCount() > 0 &&
|
|
|
|
(cell.getParent() == model.getRoot() || graph.isPool(cell))
|
2021-04-24 12:30:27 +00:00
|
|
|
) {
|
|
|
|
layout.fill = graph.isPool(cell);
|
|
|
|
|
|
|
|
return layout;
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Gets the default parent for inserting new cells. This
|
|
|
|
// is normally the first child of the root (ie. layer 0).
|
|
|
|
const parent = graph.getDefaultParent();
|
|
|
|
|
2021-08-30 14:20:26 +00:00
|
|
|
const insertVertex = (options) => {
|
2021-04-25 03:39:40 +00:00
|
|
|
const v = graph.insertVertex(options);
|
|
|
|
v.getStyle = getStyle;
|
|
|
|
return v;
|
|
|
|
};
|
|
|
|
|
2021-08-30 14:20:26 +00:00
|
|
|
const insertEdge = (options) => {
|
2021-04-25 03:39:40 +00:00
|
|
|
const e = graph.insertEdge(options);
|
|
|
|
e.getStyle = getStyle;
|
|
|
|
return e;
|
|
|
|
};
|
|
|
|
|
2021-04-24 12:30:27 +00:00
|
|
|
// Adds cells to the model in a single step
|
2021-04-25 10:47:53 +00:00
|
|
|
graph.batchUpdate(() => {
|
2021-04-25 03:39:40 +00:00
|
|
|
const pool1 = insertVertex({
|
|
|
|
parent,
|
|
|
|
value: 'Pool 1',
|
|
|
|
position: [0, 0],
|
|
|
|
size: [640, 0],
|
|
|
|
});
|
2021-04-24 12:30:27 +00:00
|
|
|
pool1.setConnectable(false);
|
|
|
|
|
2021-04-25 03:39:40 +00:00
|
|
|
const lane1a = insertVertex({
|
|
|
|
parent: pool1,
|
|
|
|
value: 'Lane A',
|
|
|
|
position: [0, 0],
|
|
|
|
size: [640, 110],
|
|
|
|
});
|
2021-04-24 12:30:27 +00:00
|
|
|
lane1a.setConnectable(false);
|
|
|
|
|
2021-04-25 03:39:40 +00:00
|
|
|
const lane1b = insertVertex({
|
|
|
|
parent: pool1,
|
|
|
|
value: 'Lane B',
|
|
|
|
position: [0, 0],
|
|
|
|
size: [640, 110],
|
|
|
|
});
|
2021-04-24 12:30:27 +00:00
|
|
|
lane1b.setConnectable(false);
|
|
|
|
|
2021-04-25 03:39:40 +00:00
|
|
|
const pool2 = insertVertex({
|
|
|
|
parent,
|
|
|
|
value: 'Pool 2',
|
|
|
|
position: [0, 0],
|
|
|
|
size: [640, 0],
|
|
|
|
});
|
2021-04-24 12:30:27 +00:00
|
|
|
pool2.setConnectable(false);
|
|
|
|
|
2021-04-25 03:39:40 +00:00
|
|
|
const lane2a = insertVertex({
|
|
|
|
parent: pool2,
|
|
|
|
value: 'Lane A',
|
|
|
|
position: [0, 0],
|
|
|
|
size: [640, 140],
|
|
|
|
});
|
2021-04-24 12:30:27 +00:00
|
|
|
lane2a.setConnectable(false);
|
|
|
|
|
2021-04-25 03:39:40 +00:00
|
|
|
const lane2b = insertVertex({
|
|
|
|
parent: pool2,
|
|
|
|
value: 'Lane B',
|
|
|
|
position: [0, 0],
|
|
|
|
size: [640, 110],
|
|
|
|
});
|
2021-04-24 12:30:27 +00:00
|
|
|
lane2b.setConnectable(false);
|
|
|
|
|
2021-04-25 03:39:40 +00:00
|
|
|
const start1 = insertVertex({
|
|
|
|
parent: lane1a,
|
|
|
|
position: [40, 40],
|
|
|
|
size: [30, 30],
|
|
|
|
style: 'state',
|
|
|
|
});
|
|
|
|
const end1 = insertVertex({
|
|
|
|
parent: lane1a,
|
|
|
|
value: 'A',
|
|
|
|
position: [560, 40],
|
|
|
|
size: [30, 30],
|
|
|
|
style: 'end',
|
|
|
|
});
|
|
|
|
|
|
|
|
const step1 = insertVertex({
|
|
|
|
parent: lane1a,
|
|
|
|
value: 'Contact\nProvider',
|
|
|
|
position: [90, 30],
|
|
|
|
size: [80, 50],
|
|
|
|
style: 'process',
|
|
|
|
});
|
|
|
|
const step11 = insertVertex({
|
|
|
|
parent: lane1a,
|
|
|
|
value: 'Complete\nAppropriate\nRequest',
|
|
|
|
position: [190, 30],
|
|
|
|
size: [80, 50],
|
|
|
|
style: 'process',
|
|
|
|
});
|
|
|
|
const step111 = insertVertex({
|
|
|
|
parent: lane1a,
|
|
|
|
value: 'Receive and\nAcknowledge',
|
|
|
|
position: [385, 30],
|
|
|
|
size: [80, 50],
|
|
|
|
style: 'process',
|
|
|
|
});
|
|
|
|
|
|
|
|
const start2 = insertVertex({
|
|
|
|
parent: lane2b,
|
|
|
|
position: [40, 40],
|
|
|
|
size: [30, 30],
|
|
|
|
style: 'state',
|
|
|
|
});
|
|
|
|
|
|
|
|
const step2 = insertVertex({
|
|
|
|
parent: lane2b,
|
|
|
|
value: 'Receive\nRequest',
|
|
|
|
position: [90, 30],
|
|
|
|
size: [80, 50],
|
|
|
|
style: 'process',
|
|
|
|
});
|
|
|
|
const step22 = insertVertex({
|
|
|
|
parent: lane2b,
|
|
|
|
value: 'Refer to Tap\nSystems\nCoordinator',
|
|
|
|
position: [190, 30],
|
|
|
|
size: [80, 50],
|
|
|
|
style: 'process',
|
|
|
|
});
|
|
|
|
|
|
|
|
const step3 = insertVertex({
|
|
|
|
parent: lane1b,
|
|
|
|
value: 'Request 1st-\nGate\nInformation',
|
|
|
|
position: [190, 30],
|
|
|
|
size: [80, 50],
|
|
|
|
style: 'process',
|
|
|
|
});
|
|
|
|
const step33 = insertVertex({
|
|
|
|
parent: lane1b,
|
|
|
|
value: 'Receive 1st-\nGate\nInformation',
|
|
|
|
position: [290, 30],
|
|
|
|
size: [80, 50],
|
|
|
|
style: 'process',
|
|
|
|
});
|
|
|
|
|
|
|
|
const step4 = insertVertex({
|
|
|
|
parent: lane2a,
|
|
|
|
value: 'Receive and\nAcknowledge',
|
|
|
|
position: [290, 20],
|
|
|
|
size: [80, 50],
|
|
|
|
style: 'process',
|
|
|
|
});
|
|
|
|
const step44 = insertVertex({
|
|
|
|
parent: lane2a,
|
|
|
|
value: 'Contract\nConstraints?',
|
|
|
|
position: [400, 20],
|
|
|
|
size: [50, 50],
|
|
|
|
style: 'condition',
|
|
|
|
});
|
|
|
|
const step444 = insertVertex({
|
|
|
|
parent: lane2a,
|
|
|
|
value: 'Tap for gas\ndelivery?',
|
|
|
|
position: [480, 20],
|
|
|
|
size: [50, 50],
|
|
|
|
style: 'condition',
|
|
|
|
});
|
|
|
|
|
|
|
|
const end2 = insertVertex({
|
|
|
|
parent: lane2a,
|
|
|
|
value: 'B',
|
|
|
|
position: [560, 30],
|
|
|
|
size: [30, 30],
|
|
|
|
style: 'end',
|
|
|
|
});
|
|
|
|
const end3 = insertVertex({
|
|
|
|
parent: lane2a,
|
|
|
|
value: 'C',
|
|
|
|
position: [560, 84],
|
|
|
|
size: [30, 30],
|
|
|
|
style: 'end',
|
|
|
|
});
|
2021-04-24 12:30:27 +00:00
|
|
|
|
|
|
|
let e = null;
|
|
|
|
|
2021-04-25 03:39:40 +00:00
|
|
|
insertEdge({
|
|
|
|
parent: lane1a,
|
|
|
|
source: start1,
|
|
|
|
target: step1,
|
|
|
|
});
|
|
|
|
insertEdge({
|
|
|
|
parent: lane1a,
|
|
|
|
source: step1,
|
|
|
|
target: step11,
|
|
|
|
});
|
|
|
|
insertEdge({
|
|
|
|
parent: lane1a,
|
|
|
|
source: step11,
|
|
|
|
target: step111,
|
|
|
|
});
|
|
|
|
|
|
|
|
insertEdge({
|
|
|
|
parent: lane2b,
|
|
|
|
source: start2,
|
|
|
|
target: step2,
|
|
|
|
});
|
|
|
|
insertEdge({
|
|
|
|
parent: lane2b,
|
|
|
|
source: step2,
|
|
|
|
target: step22,
|
|
|
|
});
|
|
|
|
insertEdge({
|
|
|
|
parent,
|
|
|
|
source: step22,
|
|
|
|
target: step3,
|
|
|
|
});
|
|
|
|
|
|
|
|
insertEdge({
|
|
|
|
parent: lane1b,
|
|
|
|
source: step3,
|
|
|
|
target: step33,
|
|
|
|
});
|
|
|
|
insertEdge({
|
|
|
|
parent: lane2a,
|
|
|
|
source: step4,
|
|
|
|
target: step44,
|
|
|
|
});
|
|
|
|
insertEdge({
|
|
|
|
parent: lane2a,
|
|
|
|
value: 'No',
|
|
|
|
source: step44,
|
|
|
|
target: step444,
|
|
|
|
style: 'verticalAlign=bottom',
|
|
|
|
});
|
|
|
|
insertEdge({
|
2021-04-24 12:30:27 +00:00
|
|
|
parent,
|
2021-04-25 03:39:40 +00:00
|
|
|
value: 'Yes',
|
|
|
|
source: step44,
|
|
|
|
target: step111,
|
|
|
|
style: 'verticalAlign=bottom;horizontal=0;labelBackgroundColor=white;',
|
|
|
|
});
|
|
|
|
|
|
|
|
insertEdge({
|
|
|
|
parent: lane2a,
|
|
|
|
value: 'Yes',
|
|
|
|
source: step444,
|
|
|
|
target: end2,
|
|
|
|
style: 'verticalAlign=bottom',
|
|
|
|
});
|
|
|
|
e = insertEdge({
|
|
|
|
parent: lane2a,
|
|
|
|
value: 'No',
|
|
|
|
source: step444,
|
|
|
|
target: end3,
|
|
|
|
style: 'verticalAlign=top',
|
|
|
|
});
|
|
|
|
|
2021-04-24 12:30:27 +00:00
|
|
|
e.geometry.points = [
|
2021-08-30 14:20:26 +00:00
|
|
|
new Point(
|
2021-04-24 12:30:27 +00:00
|
|
|
step444.geometry.x + step444.geometry.width / 2,
|
|
|
|
end3.geometry.y + end3.geometry.height / 2
|
|
|
|
),
|
|
|
|
];
|
|
|
|
|
2021-04-25 03:39:40 +00:00
|
|
|
insertEdge({
|
|
|
|
parent,
|
|
|
|
source: step1,
|
|
|
|
target: step2,
|
|
|
|
style: 'crossover',
|
|
|
|
});
|
|
|
|
insertEdge({
|
|
|
|
parent,
|
|
|
|
source: step3,
|
|
|
|
target: step11,
|
|
|
|
style: 'crossover',
|
|
|
|
});
|
|
|
|
e = insertEdge({
|
|
|
|
parent: lane1a,
|
|
|
|
source: step11,
|
|
|
|
target: step33,
|
|
|
|
style: 'crossover',
|
|
|
|
});
|
|
|
|
|
2021-04-24 12:30:27 +00:00
|
|
|
e.geometry.points = [
|
2021-08-30 14:20:26 +00:00
|
|
|
new Point(
|
2021-04-24 12:30:27 +00:00
|
|
|
step33.geometry.x + step33.geometry.width / 2 + 20,
|
|
|
|
step11.geometry.y + (step11.geometry.height * 4) / 5
|
|
|
|
),
|
|
|
|
];
|
2021-04-25 03:39:40 +00:00
|
|
|
|
|
|
|
insertEdge({
|
|
|
|
parent,
|
|
|
|
source: step33,
|
|
|
|
target: step4,
|
|
|
|
});
|
|
|
|
insertEdge({
|
|
|
|
parent: lane1a,
|
|
|
|
source: step111,
|
|
|
|
target: end1,
|
|
|
|
});
|
|
|
|
});
|
2021-04-24 12:30:27 +00:00
|
|
|
|
|
|
|
return container;
|
2021-08-30 14:20:26 +00:00
|
|
|
};
|
2021-04-24 12:30:27 +00:00
|
|
|
|
2021-08-30 14:20:26 +00:00
|
|
|
export const Default = Template.bind({});
|