Lines Matching +full:x +full:- +full:bo
2 * bpmn-js - bpmn-modeler v8.8.2
4 * Copyright (c) 2014-present, camunda Services GmbH
9 * Source Code: https://github.com/bpmn-io/bpmn-js
11 * Date: 2021-10-20
68 var rem = digits - Math.floor(digits);
73 var x = Math.floor(Math.random() * base).toString(base);
74 res = x + res;
79 var x = Math.floor(Math.random() * b).toString(base);
80 res = x + res;
311 var idx = isArray$2(collection) ? -1 : undefined;
340 * (non-undefined) will stop iteration.
512 …for (var _len = arguments.length, collections = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key…
513 collections[_key - 1] = arguments[_key];
619 var scheduledDiff = lastNow + timeout - now;
689 …for (var _len = arguments.length, others = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _l…
690 others[_key - 1] = arguments[_key];
727 if (properties.indexOf(key) === -1) {
766 return -1;
1084 if (forceCaptureEvents.indexOf(type) !== -1) {
1107 if (forceCaptureEvents.indexOf(type) !== -1) {
1149 // for script/link/style tags to work in IE6-8, you have to wrap
1150 // in a div with a non-whitespace character in front, ha!
1151 _default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']
1181 * @param {String} html - HTML string to "domify"
1182 * @param {Document} doc - The `document` instance to create the Node for
1215 while (depth--) el = el.lastChild;
1301 'alignment-baseline': 1,
1302 'baseline-shift': 1,
1304 'clip-path': 1,
1305 'clip-rule': 1,
1307 'color-interpolation': 1,
1308 'color-interpolation-filters': 1,
1309 'color-profile': 1,
1310 'color-rendering': 1,
1314 'dominant-baseline': 1,
1315 'enable-background': 1,
1317 'fill-opacity': 1,
1318 'fill-rule': 1,
1320 'flood-color': 1,
1321 'flood-opacity': 1,
1323 'font-family': 1,
1324 'font-size': LENGTH_ATTR,
1325 'font-size-adjust': 1,
1326 'font-stretch': 1,
1327 'font-style': 1,
1328 'font-variant': 1,
1329 'font-weight': 1,
1330 'glyph-orientation-horizontal': 1,
1331 'glyph-orientation-vertical': 1,
1332 'image-rendering': 1,
1334 'letter-spacing': 1,
1335 'lighting-color': 1,
1337 'marker-end': 1,
1338 'marker-mid': 1,
1339 'marker-start': 1,
1343 'pointer-events': 1,
1344 'shape-rendering': 1,
1345 'stop-color': 1,
1346 'stop-opacity': 1,
1348 'stroke-dasharray': 1,
1349 'stroke-dashoffset': 1,
1350 'stroke-linecap': 1,
1351 'stroke-linejoin': 1,
1352 'stroke-miterlimit': 1,
1353 'stroke-opacity': 1,
1354 'stroke-width': LENGTH_ATTR,
1355 'text-anchor': 1,
1356 'text-decoration': 1,
1357 'text-rendering': 1,
1358 'unicode-bidi': 1,
1360 'word-spacing': 1,
1361 'writing-mode': 1
1374 var hyphenated = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
1438 return -1;
1677 if (svg.indexOf(ns.svg) === -1) {
1860 output.push('<!--', escape$1(node.nodeValue, TEXT_ENTITIES), '-->');
1919 return node.nodeName === '#document-fragment';
2019 // - can't put into "function arg" comments
2027 // - can't reliably auto-annotate constructor; we'll match the
2098 var stack = currentlyResolving.join(' -> ');
2112 if (!providers[name] && name.indexOf('.') !== -1) {
2128 if (currentlyResolving.indexOf(name) !== -1) {
2216 if (forceNewInstances.indexOf(name) !== -1) {
2219 if (cacheIdx === -1) {
2236 /* jshint -W083 */
2238 if (provider[1].$scope.indexOf(scope) !== -1) {
2411 return elements.join(',').replace(/,?([A-z]),?/g, '$1');
2418 result += p.x + ',' + p.y + ' ';
2486 var canAdd = !unique || elements.indexOf(e) === -1;
2529 * @param {number} maxDepth the depth to search through or -1 for infinite
2543 if (maxDepth === -1 || depth < maxDepth) {
2565 return selfAndChildren(elements, !allowDuplicates, -1);
2679 var x = bbox.x,
2684 if (x < minX || minX === undefined) {
2685 minX = x;
2691 if ((x + width) > maxX || maxX === undefined) {
2692 maxX = x + width;
2700 x: minX,
2702 height: maxY - minY,
2703 width: maxX - minX
2712 * all elements with element.x/y > bbox.x/y
2713 * * If only bbox.x or bbox.y is specified, method return all elements with
2714 * e.x > bbox.x or e.y > bbox.y
2733 if (!isNumber(bbox.y) && (e.x > bbox.x)) {
2736 if (!isNumber(bbox.x) && (e.y > bbox.y)) {
2739 if (e.x > bbox.x && e.y > bbox.y) {
2741 e.width + e.x < bbox.width + bbox.x &&
2761 if ('x' in element) {
2794 this.CONNECTION_STYLE = styles.style([ 'no-fill' ], { strokeWidth: 5, stroke: 'fuchsia' });
2796 …this.FRAME_STYLE = styles.style([ 'no-fill' ], { stroke: 'fuchsia', strokeDasharray: 4, strokeWidt…
2810 x: 0, property
2837 var x = shape.x,
2843 ['M', x, y],
2846 ['l', -width, 0],
2864 connectionPath.push([ idx === 0 ? 'M' : 'L', point.x, point.y ]);
2880 'no-fill': {
2883 'no-border': {
2886 'no-events': {
2957 return -1;
2962 if (idx !== -1) {
2984 idx = -1;
2989 if (currentIdx !== -1) {
2997 if (idx !== -1) {
3009 if (idx !== -1) {
3027 * @return {number} the index or -1 if collection or element do
3033 return -1;
3049 return -1;
3053 Math.pow(a.x - b.x, 2) +
3054 Math.pow(a.y - b.y, 2)
3079 var val = (q.x - p.x) * (r.y - p.y) - (q.y - p.y) * (r.x - p.x),
3129 return Math.abs(firstPoint.y - point.y) <= ALIGNED_THRESHOLD;
3145 return Math.abs(firstPoint.x - point.x) <= ALIGNED_THRESHOLD;
3163 return p.x > rect.x - tolerance &&
3164 p.y > rect.y - tolerance &&
3165 p.x < rect.x + rect.width + tolerance &&
3179 x: Math.round(p.x + ((q.x - p.x) / 2.0)),
3180 y: Math.round(p.y + ((q.y - p.y) / 2.0))
3185 * This file contains source code adapted from Snap.svg (licensed Apache-2.0).
3187 * @see https://github.com/adobe-webplatform/Snap.svg/blob/master/src/path.js
3190 /* eslint no-fallthrough: "off" */
3192 var p2s = /,?([a-z]),?/gi,
3200 pathCommand = /([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/ig,
3201 pathValues = /(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/ig;
3319 p[key].sleep--;
3328 function rectBBox(x, y, width, height) { argument
3331 y = x.y;
3332 width = x.width;
3333 height = x.height;
3334 x = x.x;
3338 x: x,
3342 x2: x + width,
3358 var t1 = 1 - t,
3363 x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x,
3367 x: fixError(x),
3379 bbox.x1 - bbox.x0,
3380 bbox.y1 - bbox.y0
3384 function isPointInsideBBox$2(bbox, x, y) { argument
3385 return x >= bbox.x &&
3386 x <= bbox.x + bbox.width &&
3394 return isPointInsideBBox$2(bbox2, bbox1.x, bbox1.y)
3396 || isPointInsideBBox$2(bbox2, bbox1.x, bbox1.y2)
3398 || isPointInsideBBox$2(bbox1, bbox2.x, bbox2.y)
3400 || isPointInsideBBox$2(bbox1, bbox2.x, bbox2.y2)
3402 || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x
3403 || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x)
3409 var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4,
3410 t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;
3411 return t * t2 - 3 * p1 + 3 * p2;
3424 Tvalues = [-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],
3452 var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4),
3453 ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4),
3454 denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
3478 return { x: px, y: py };
3506 dots1.push({ x: p.x, y: p.y, t: i / n1 }); property
3511 dots2.push({ x: p.x, y: p.y, t: i / n2 }); property
3521 ci = abs$7(di1.x - di.x) < .01 ? 'y' : 'x',
3522 cj = abs$7(dj1.x - dj.x) < .01 ? 'y' : 'x',
3523 is = intersectLines(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y),
3527 key = is.x.toFixed(9) + '#' + is.y.toFixed(9);
3535 var t1 = di.t + abs$7((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t),
3536 t2 = dj.t + abs$7((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);
3544 x: is.x, property
3564 * A single intersection entry contains the intersection coordinates (x, y)
3580 * // { x: 50, y: 50, segment1: 1, segment2: 1, t1: 0.5, t2: 0.5 }
3672 x = 0,
3680 x = +pathArray[0][1]; property
3682 mx = x;
3685 res[0] = ['M', x, y];
3703 r[6] = +pa[6] + x;
3710 r[1] = +pa[1] + x;
3713 mx = +pa[1] + x;
3717 r[j] = +pa[j] + ((j % 2) ? x : y);
3729 x = +mx;
3733 x = r[1];
3739 mx = r[r.length - 2];
3740 my = r[r.length - 1];
3742 x = r[r.length - 2];
3743 y = r[r.length - 1];
3791 rotate = cacher(function(x, y, rad) { argument
3792 var X = x * math.cos(rad) - y * math.sin(rad),
3793 Y = x * math.sin(rad) + y * math.cos(rad);
3795 return { x: X, y: Y };
3799 xy = rotate(x1, y1, -rad);
3800 x1 = xy.x;
3802 xy = rotate(x2, y2, -rad);
3803 x2 = xy.x;
3806 var x = (x1 - x2) / 2,
3807 y = (y1 - y2) / 2;
3809 var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);
3819 k = (large_arc_flag == sweep_flag ? -1 : 1) *
3820 … math.sqrt(abs$7((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))),
3822 cy = k * -ry * x / rx + (y1 + y2) / 2,
3823 f1 = math.asin(((y1 - cy) / ry).toFixed(9)),
3824 f2 = math.asin(((y2 - cy) / ry).toFixed(9));
3826 f1 = x1 < cx ? PI - f1 : f1;
3827 f2 = x2 < cx ? PI - f2 : f2;
3832 f1 = f1 - PI * 2;
3835 f2 = f2 - PI * 2;
3844 var df = f2 - f1;
3851 f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);
3857 df = f2 - f1;
3867 m2 = [x1 + hx * s1, y1 - hy * c1],
3868 m3 = [x2 + hx * s2, y2 - hy * c2],
3871 m2[0] = 2 * m1[0] - m2[0];
3872 m2[1] = 2 * m1[1] - m2[1];
3881 newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;
3889 // Source: http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
3900 b = 6 * x0 - 12 * x1 + 6 * x2;
3901 a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;
3902 c = 3 * x1 - 3 * x0;
3904 b = 6 * y0 - 12 * y1 + 6 * y2;
3905 a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;
3906 c = 3 * y1 - 3 * y0;
3909 if (abs$7(a) < 1e-12) {
3911 if (abs$7(b) < 1e-12) {
3915 t = -c / b;
3924 b2ac = b * b - 4 * c * a;
3931 t1 = (-b + sqrtb2ac) / (2 * a);
3937 t2 = (-b - sqrtb2ac) / (2 * a);
3948 while (j--) {
3950 mt = 1 - t;
3979 attrs = { x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null }, property
3984 return ['C', d.x, d.y, d.x, d.y, d.x, d.y];
3991 d.X = path[1];
3995 path = ['C'].concat(arcToCurve.apply(0, [d.x, d.y].concat(path.slice(1))));
4001 nx = d.x * 2 - d.bx;
4004 ny = d.y * 2 - d.by;
4011 nx = d.x;
4020 d.qx = d.x * 2 - d.qx;
4023 d.qy = d.y * 2 - d.qy;
4030 d.qx = d.x;
4033 path = ['C'].concat(qubicToCurve(d.x, d.y, d.qx, d.qy, path[1], path[2]));
4038 path = ['C'].concat(qubicToCurve(d.x, d.y, path[1], path[2], path[3], path[4]));
4041 path = ['C'].concat(lineToCurve(d.x, d.y, path[1], path[2]));
4044 path = ['C'].concat(lineToCurve(d.x, d.y, path[1], d.y));
4047 path = ['C'].concat(lineToCurve(d.x, d.y, d.x, path[1]));
4050 path = ['C'].concat(lineToCurve(d.x, d.y, d.X, d.Y));
4083 i && (pathCommand = pathCommands[i - 1]); // Get previous path command pathCommand
4096 attrs.x = seg[seglen - 2];
4097 attrs.y = seg[seglen - 1];
4098 attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;
4099 attrs.by = toFloat(seg[seglen - 3]) || attrs.y;
4112 x: Math.round(bounds.x),
4123 x: Math.round(point.x),
4139 right: bounds.x + (bounds.width || 0),
4141 left: bounds.x
4155 x: trbl.left,
4157 width: trbl.right - trbl.left,
4158 height: trbl.bottom - trbl.top
4172 x: bounds.x + (bounds.width || 0) / 2, property
4191 * @return {string} the orientation; one of top, top-left, left, ..., bottom, right or intersect.
4198 // for individual { x, y } padding
4200 padding = { x: padding, y: padding }; property
4208 right = rectOrientation.left - padding.x >= referenceOrientation.right,
4209 bottom = rectOrientation.top - padding.y >= referenceOrientation.bottom,
4210 left = rectOrientation.right + padding.x <= referenceOrientation.left;
4216 return vertical + '-' + horizontal;
4239 // only one -> choose
4240 // two close together -> choose first
4241 // two or more distinct -> pull out appropriate one
4242 // none -> ok (fallback to point itself)
4254 distance = 100 - distance;
4264 return roundPoint(intersections[cropStart ? 0 : intersections.length - 1]);
4288 previousPoint = waypoints[idx - 1];
4295 // or on line with {previousPoint} -> {point} -> {nextPoint}
4338 parent.setAttribute('class', 'djs-container');
4356 var index = childIndex !== undefined ? childIndex : parent.childNodes.length - 1;
4359 // cf. https://developer.mozilla.org/en-US/docs/Web/API/Node/insertBefore
4366 var HIDDEN_MARKER = 'djs-element-hidden';
4370 shape: [ 'x', 'y', 'width', 'height' ],
4408 * (It is not possible to get the size of a svg element cross browser @ 2014-04-01)
4410 * <div class="djs-container" style="width: {desired-width}, height: {desired-height}">
4534 * Non-existing layers retrieved through this method
4589 group: createGroup(this._viewport, 'layer-' + name, childIndex),
4788 * integrate extension into the marker life-cycle, too.
4791 * canvas.addMarker('foo', 'some-marker');
4795 * fooGfx; // <g class="... some-marker"> ... </g>
4809 * integrate extension into the marker life-cycle, too.
4838 * integrate extension into the marker life-cycle, too.
4973 * This wires the parent <-> child relationship between the element and
5064 // unset parent <-> child relationship
5172 // triggers a viewbox re-computation
5194 * canvas.viewbox({ x: 100, y: 100, width: 500, height: 500 })
5196 * // sets the visible area of the diagram to (100|100) -> (600|100)
5206 * // x, y,
5216 * x: 0,
5223 * @param {number} box.x the top left X coordinate of the canvas visible in view box
5242 x, y;
5255 x = round$b(-matrix.e || 0, 1000);
5256 y = round$b(-matrix.f || 0, 1000);
5259 x: x ? x / scale : 0, property
5267 x: innerBox.x, property
5281 .translate(-box.x, -box.y);
5314 return { x: matrix.e, y: matrix.f };
5356 viewboxBounds.x += padding.left / zoom;
5357 viewboxBounds.width -= (padding.right + padding.left) / zoom;
5358 viewboxBounds.height -= (padding.bottom + padding.top) / zoom;
5366 // top-left when element can't fit
5367 dx = elementBounds.x - viewboxBounds.x;
5368 dy = elementBounds.y - viewboxBounds.y;
5372 var dRight = Math.max(0, elementTrbl.right - viewboxTrbl.right),
5373 dLeft = Math.min(0, elementTrbl.left - viewboxTrbl.left),
5374 dBottom = Math.max(0, elementTrbl.bottom - viewboxTrbl.bottom),
5375 dTop = Math.min(0, elementTrbl.top - viewboxTrbl.top);
5382 this.scroll({ dx: -dx * zoom, dy: -dy * zoom });
5393 …* or `fit-viewport` to adjust the size to fit the current viewpo…
5394 …* @param {string|Point} [center] the reference point { x: .., y: ..} to zoom to, 'auto' to zoom in…
5404 if (newScale === 'fit-viewport') {
5417 x: outer.width / 2, property
5448 if (inner.x >= 0 &&
5450 inner.x + inner.width <= outer.width &&
5455 x: 0, property
5457 width: Math.max(inner.width + inner.x, outer.width),
5464 x: inner.x + (center ? inner.width / 2 - outer.width / newScale / 2 : 0), property
5465 y: inner.y + (center ? inner.height / 2 - outer.height / newScale / 2 : 0),
5503 .translate(originalPoint.x, originalPoint.y)
5505 .translate(-originalPoint.x, -originalPoint.y);
5559 var x = bbox.x * vbox.scale - vbox.x * vbox.scale;
5560 var y = bbox.y * vbox.scale - vbox.y * vbox.scale;
5566 x: x,
5585 var ELEMENT_ID = 'data-element-id';
5873 if (idx !== -1) {
5893 return this.indexOf(element) !== -1;
5913 if (currentIdx !== -1) {
5923 if (currentIdx !== -1) {
5932 if (currentIdx === -1) {
6040 * @classdesc A bi-directional reference between two attributes.
6050 * var wheels = [{ pos: 'front-left' }, { pos: 'front-right' }];
6058 * car.wheels // [{ pos: 'front-left' }, { pos: 'front-right' }]
6081 * Binds one side of a bi-directional reference to a
6371 * var shape1 = Model.create('shape', { x: 10, y: 10, width: 100, height: 100 });
6372 * var shape2 = Model.create('shape', { x: 210, y: 210, width: 100, height: 100 });
6374 …* var connection = Model.create('connection', { waypoints: [ { x: 110, y: 55 }, {x: 210, y: 55 } ]…
6376 * @param {string} type lower-cased model name
6390 * A factory for diagram-js shapes
6415 * a number of pre-set attributes.
6674 * var event = { x: 10, y: 20 };
6975 * @param {number} x
6980 function transform(gfx, x, y, angle, amount) { argument
6982 translate.setTranslate(x, y);
6996 * @param {number} x
6999 function translate$2(gfx, x, y) { argument
7001 translate.setTranslate(x, y);
7045 classes(childrenGfx).add('djs-children');
7056 * cleared visual (the <g class="djs-visual" /> element).
7071 * <g class="djs-group">
7073 * <!-- the gfx -->
7074 * <g class="djs-element djs-(shape|connection|frame)">
7075 * <g class="djs-visual">
7076 * <!-- the renderer draws in here -->
7079 * <!-- extensions (overlays, click box, ...) goes here
7082 * <!-- the gfx child nodes -->
7083 * <g class="djs-children"></g>
7097 classes(outerGfx).add('djs-group');
7107 classes(gfx).add('djs-element');
7108 classes(gfx).add('djs-' + type);
7111 classes(gfx).add('djs-frame');
7118 classes(visual).add('djs-visual');
7203 translate$2(gfx, element.x, element.y);
7232 // https://github.com/bpmn-io/bpmn-js/issues/746
7332 * The main diagram-js entry point that bootstraps the diagram with the given
7343 * <caption>Creating a plug-in that logs whenever a shape is added to the canvas.</caption>
7345 * // plug-in implemenentation
7359 * // instantiate the diagram with the new plug-in
7361 * import MyLoggingModule from 'path-to-my-logging-plugin';
7371 * canvas.addShape({ x: 10, y: 10 });
7413 * An event indicating that all plug-ins are loaded.
7415 * Use this event to fire other events to interested plug-ins
7424 * eventBus.fire('my-custom-event', { foo: 'BAR' });
7518 * Built-in moddle types
7553 * Return whether the given type is built-in
7684 if (idx === -1) {
7996 this.definePackage(descriptor, descriptor.allTypes[descriptor.allTypes.length - 1].$pkg);
8223 * Creates an any-element type to be used within model instances.
8225 * This can be used to create custom elements that lie outside the meta-model.
8226 * The created element contains all the meta-data required to serialize it
8227 * as part of meta-model elements.
8346 var ENTITY_PATTERN = /&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig;
8362 function replaceEntities(_, d, x, z) { argument
8381 return fromCharCode(parseInt(x, 16));
8387 * sub-set of reserved names (&) as well as
8395 if (s.length > 3 && s.indexOf('&') !== -1) {
8402 var XSI_URI = 'http://www.w3.org/2001/XMLSchema-instance';
8406 var NON_WHITESPACE_OUTSIDE_ROOT_NODE = 'non-whitespace outside of root node';
8668 x, y, q, w, v,
8738 w === 45 || // '-'
8773 if (j === -1) {
8776 if (j !== -1) {
8785 if (j === -1) {
8788 if (j !== -1) {
8809 if (j === -1) {
8846 // check attribute re-declaration
8925 if (w === -1) {
8946 if (w !== -1) {
8974 if (w !== -1) {
8992 if (w !== -1) {
9053 if (i == -1) {
9065 column = i - startOfLine;
9066 data = (j == -1 ? xml.substring(i) : xml.substring(i, j + 1));
9095 while (j !== -1) {
9104 if (i === -1) {
9153 if (j === -1) {
9169 if (q === 45 && xml.charCodeAt(i + 3) === 45) { // 45 == "-"
9170 j = xml.indexOf('-->', i);
9171 if (j === -1) {
9191 if (j === -1) {
9209 for (x = i + 1; ; x++) {
9210 v = xml.charCodeAt(x);
9212 j = -1;
9221 q = xml.indexOf('"', x + 1);
9222 x = q !== -1 ? q : x;
9224 q = xml.indexOf("'", x + 1);
9225 x = q !== -1 ? q : x;
9227 j = x;
9261 // verify open <-> close tag match
9262 x = elementName = nodeStack.pop();
9263 q = i + 2 + x.length;
9265 if (xml.substring(i + 2, q) !== x) {
9281 if (xml.charCodeAt(j - 1) === 47) { // .../>
9282 x = elementName = xml.substring(i + 1, j - 1);
9288 x = elementName = xml.substring(i + 1, j);
9298 for (q = 1, y = x.length; q < y; q++) {
9299 w = x.charCodeAt(q);
9306 elementName = x.substring(0, q);
9328 // unless we're self-closing
9338 if ((maybeNS = x.indexOf('xmlns', q) !== -1)) {
9340 attrsString = x;
9352 if (w !== -1) {
9381 attrsString = x;
9428 'xsi': 'http://www.w3.org/2001/XMLSchema-instance',
9554 // for QName validation as per http://www.w3.org/TR/REC-xml/#NT-NameChar
9555 if (!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(id)) {
9752 // IDREFS: parse references as whitespace-separated list
9771 // check whether attribute is defined in a well-known namespace
9926 // establish child -> parent relationship
10000 // establish child -> parent relationship
10014 * A reader for a meta-model
10039 * @property {Object} elementsById - a mapping containing each ID -> ModdleElement
10113 if (data.charAt(0) === '<' && data.indexOf(' ') !== -1) {
10169 // we replace an existing place holder (idx != -1) or
10171 if (idx === -1) {
10198 var UTF_8_PATTERN = /^utf-8$/i;
10216 'falling back to UTF-8'
10346 return this[this.length - 1];
10353 var XML_PREAMBLE = '<?xml version="1.0" encoding="UTF-8"?>\n';
10598 if (prop.type === 'String' && value.search(ESCAPE_CHARS) !== -1) {
10998 // IDREFS is a whitespace-separated list of references.
11165 * A writer for meta-model backed document trees
11216 * @property {Object} elementsById - a mapping containing each ID -> ModdleElement
14507 name: "x",
14524 name: "x",
14715 subsettedProperty: "DiagramElement-ownedElement",
14731 subsettedProperty: "DiagramElement-ownedElement",
14748 subsettedProperty: "DiagramElement-ownedElement",
14859 var uri$5 = "http://www.omg.org/spec/BPMN/non-normative/color/1.0";
14882 name: "background-color",
14887 name: "border-color",
14900 name: "border-color",
14949 * Returns true if an element has the given meta-model type
15094 if (diagram && diagrams.indexOf(diagram) === -1) {
15102 // no diagram -> nothing to import
15193 // we do this to pass the free-floating lane test cases in the MIWG test suite
15372 // wire the virtual flowNodeRefs <-> relationship
15484 // TODO(nikku): remove with future bpmn-js version
15489 * 1) If a callback is passed -> Warn users about callback deprecation.
15503 if (argLen >= 1 && isFunction(arguments[argLen - 1])) {
15505 var callback = arguments[argLen - 1];
15509 'Please switch to promises: https://bpmn.io/l/moving-to-promises.html'
15512 var argsWithoutCallback = Array.prototype.slice.call(arguments, 0, -1);
15544 …-align:middle"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0…
15557 'z-index: 1001',
15575 'transform: translate(-50%)',
15579 'box-shadow: 0 1px 4px rgba(0,0,0,0.3)',
15580 'font-family: Helvetica, Arial, sans-serif',
15581 'font-size: 14px',
15583 'line-height: 1.3'
15587 '<div class="bjs-powered-by-lightbox" style="' + LIGHTBOX_STYLES + '">' +
15590 …io" target="_blank" rel="noopener" style="margin: 15px 20px 15px 10px; align-self: center;' + LINK…
15594 'Web-based tooling for BPMN, DMN and CMMN diagrams ' +
15617 * The code in the <project-logo></project-logo> area
15645 /* <project-logo> */
15649 /* </project-logo> */
15678 * ## Life-Cycle Events
15680 * During import the viewer will fire life-cycle events:
15688 * You can use these events to hook into the life-cycle.
15703 // TODO(nikku): remove with future bpmn-js version
15726 // hook in pre-parse listeners +
15796 * ## Life-Cycle Events
15798 * During import the viewer will fire life-cycle events:
15803 * You can use these events to hook into the life-cycle.
15852 * ## Life-Cycle Events
15854 * During switch the viewer will fire life-cycle events:
15859 * You can use these events to hook into the life-cycle.
15923 * ## Life-Cycle Events
15925 * During XML saving the viewer will fire life-cycle events:
15931 * You can use these events to hook into the life-cycle.
16000 * ## Life-Cycle Events
16002 * During SVG saving the viewer will fire life-cycle events:
16007 * You can use these events to hook into the life-cycle.
16035 '<?xml version="1.0" encoding="utf-8"?>\n' +
16036 '<!-- created with bpmn-js / http://bpmn.io -->\n' +
16037 …'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"…
16040 … 'viewBox="' + bbox.x + ' ' + bbox.y + ' ' + bbox.width + ' ' + bbox.height + '" version="1.1">' +
16121 var bo = element.businessObject;
16123 if (bo && bo.di) {
16124 delete bo.di;
16160 * De-register an event listener
16253 var container = domify('<div class="bjs-container"></div>');
16343 'class="bjs-powered-by" ' +
16345 … 'style="position: absolute; bottom: 15px; right: 15px; z-index: 100; ' + LINK_STYLES + '">' +
16360 /* </project-logo> */
16439 var bo = getBusinessObject(element);
16441 return bo && (typeof bo.$instanceOf === 'function') && bo.$instanceOf(type);
16482 var bo = getBusinessObject(element),
16485 if (bo.eventDefinitions) {
16486 forEach(bo.eventDefinitions, function(event) {
16588 /* jshint -W116 */
16622 return di.get('color:background-color') || di.get('bioc:fill') || defaultColor || 'white';
16628 return di.get('color:border-color') || di.get('bioc:stroke') || defaultColor || 'black';
16643 var cx = shape.x + shape.width / 2,
16649 ['m', 0, -radius],
16651 ['a', radius, radius, 0, 1, 1, 0, -2 * radius],
16660 var x = shape.x,
16666 ['M', x + borderRadius, y],
16667 ['l', width - borderRadius * 2, 0],
16669 ['l', 0, height - borderRadius * 2],
16670 ['a', borderRadius, borderRadius, 0, 0, 1, -borderRadius, borderRadius],
16671 ['l', borderRadius * 2 - width, 0],
16672 ['a', borderRadius, borderRadius, 0, 0, 1, -borderRadius, -borderRadius],
16673 ['l', 0, borderRadius * 2 - height],
16674 ['a', borderRadius, borderRadius, 0, 0, 1, borderRadius, -borderRadius],
16685 x = shape.x,
16691 ['M', x + halfWidth, y],
16693 ['l', -halfWidth, halfHeight],
16694 ['l', -halfWidth, -halfHeight],
16702 var x = shape.x,
16708 ['M', x, y],
16711 ['l', -width, 0],
16752 var ref = options.ref || { x: 0, y: 0 };
16771 refX: ref.x,
16794 return str.replace(/[^0-9a-zA-z]+/g, '_');
16798 var id = type + '-' + colorEscape(fill) + '-' + colorEscape(stroke) + '-' + rendererId;
16809 if (type === 'sequenceflow-end') {
16815 ref: { x: 11, y: 10 }, property
16824 if (type === 'messageflow-start') {
16834 ref: { x: 6, y: 6 } property
16838 if (type === 'messageflow-end') {
16840 attr(messageflowEnd, { d: 'm 1 5 l 0 -3 l 7 3 l -7 3 z' });
16849 ref: { x: 8.5, y: 5 } property
16853 if (type === 'association-start') {
16864 ref: { x: 1, y: 10 }, property
16869 if (type === 'association-end') {
16880 ref: { x: 12, y: 10 }, property
16885 if (type === 'conditional-flow-marker') {
16895 ref: { x: -1, y: 10 }, property
16900 if (type === 'conditional-default-flow-marker') {
16909 ref: { x: 0, y: 10 }, property
16941 r: Math.round((width + height) / 4 - offset)
16967 x: offset, property
16969 width: width - offset * 2,
16970 height: height - offset * 2,
16986 var points = [{ x: x_2, y: 0 }, { x: width, y: y_2 }, { x: x_2, y: height }, { x: 0, y: y_2 }]; property
16989 return point.x + ',' + point.y;
17010 attrs = computeStyle(attrs, [ 'no-fill' ], {
17025 attrs = computeStyle(attrs, [ 'no-fill' ], {
17040 return drawPath(parentGfx, path, assign({ 'data-marker': type }, attrs));
17120 classes(text).add('djs-label');
17145 x: element.width / 2 + element.x, property
17168 align: 'center-middle',
17174 var top = -1 * element.height;
17176 transform(textBox, 0, -top, 270);
17182 var pathData = 'm ' + waypoints[0].x + ',' + waypoints[0].y;
17184 pathData += 'L' + waypoints[i].x + ',' + waypoints[i].y + ' ';
17379 my: -0.055
17532 renderEmbeddedLabel(parentGfx, element, 'center-middle');
17542 x: 12, property
17555 x: 17.2, property
17567 x: 17, property
17583 var x = 15;
17588 x: x, property
17601 x: x, property
17614 x: x, property
17632 x: 17, property
17678 x: 7.77, property
17709 x: 15, property
17726 x: 8, property
17740 x: 8, property
17769 renderEmbeddedLabel(parentGfx, element, expanded ? 'center-top' : 'center-middle');
17785 var innerAttrs = styles.style([ 'no-fill', 'no-events' ], {
17789 …/* inner path */ drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS - 2, INNER_…
17812 { x: 30, y: 0 }, property
17813 { x: 30, y: element.height } property
17824 box: element, align: 'center-middle',
18024 markerEnd: marker('sequenceflow-end', fill, stroke),
18040 markerStart: marker('conditional-flow-marker', fill, stroke)
18048 markerStart: marker('conditional-default-flow-marker', fill, stroke)
18071 attrs.markerEnd = marker('association-end', fill, stroke);
18075 attrs.markerStart = marker('association-start', fill, stroke);
18085 markerEnd: marker('association-end', fill, stroke)
18093 markerEnd: marker('association-end', fill, stroke)
18107 markerEnd: marker('messageflow-end', fill, stroke),
18108 markerStart: marker('messageflow-start', fill, stroke),
18123 x: midPoint.x, property
18142 align: 'center-top',
18152 var translateX = midPoint.x - labelBounds.width / 2,
18254 // apply no-fill
18308 align: 'left-top',
18325 my: (element.height - 15) / element.height
18329 drawMarker('participant-multiplicity', parentGfx, markerPath, {
18344 translate$2(markerRect, element.width / 2 - 7.5, element.height - 20);
18352 mx: (element.width / 2 - 7.5) / element.width,
18353 my: (element.height - 20) / element.height
18357 drawMarker('sub-process', parentGfx, markerPath, {
18370 my: (element.height - 20) / element.height
18387 my: (element.height - 19) / element.height
18404 my: (element.height - 13) / element.height
18422 my: (element.height - 7) / element.height
18442 my: (element.height - 15) / element.height
18457 var subprocess = taskMarkers && taskMarkers.indexOf('SubProcessMarker') !== -1;
18462 seq: -21,
18463 parallel: -22,
18464 compensation: -42,
18465 loop: -18,
18470 seq: -3,
18471 parallel: -6,
18472 compensation: -27,
18511 var yPosition = (element.height - 18) / element.height;
18556 /* jshint -W040 */
18564 /* jshint -W040 */
18595 var parts = align.split('-');
18636 width: textBBox.width + textBBox.x * 2,
18709 var parts = line.split(/(\s|-|\u00AD)/g),
18724 if (part === '-' || part === SOFT_BREAK) {
18733 var last = shortenedParts[shortenedParts.length - 1];
18737 shortenedParts[shortenedParts.length - 1] = '-';
18753 shortenedLine = line.slice(0, Math.max(Math.round(length - 1), 1));
18761 var helperSvg = document.getElementById('helper-svg');
18767 id: 'helper-svg',
18795 align: 'center-top'
18831 * Any of { 'center-middle', 'center-top' },
18832 * defaults to 'center-top'.
18853 var maxWidth = box.width - padding.left - padding.right;
18857 attr(helperText, { x: 0, y: 0 }); property
18884 y += (box.height - totalHeight) / 2;
18888 y -= (lineHeight || layouted[0].height) / 4;
18899 var x;
18905 x = padding.left;
18909 x = ((fitBox ? maxLineWidth : maxWidth)
18910 - padding.right - line.width);
18916 x = Math.max((((fitBox ? maxLineWidth : maxWidth)
18917 - line.width) / 2 + padding.left), 0);
18921 attr(tspan, { x: x, y: y }); property
18957 fontFamily: 'Arial, sans-serif',
18963 var fontSize = parseInt(defaultStyle.fontSize, 10) - 1;
18988 x: bounds.width / 2 + bounds.x, property
18996 x: Math.round(bounds.x + bounds.width / 2 - layoutedDimensions.width / 2),
19017 align: 'left-top',
19022 x: bounds.x,
19074 * d: 'm {mx},{my} {e.x0},0 0,{e.x1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
19075 '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
19084 * height and width that is set as scale target (Note x,y coordinates will be scaled with
19093 …* <li>The values for the x axis can be accessed in the path string using {e.x0}, {e.x1}, ....</…
19100 d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
19107 d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z',
19114 d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z',
19121 d: 'M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z ' +
19134 … d: 'm {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z',
19141 …d: 'm {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},…
19148 d: 'm {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
19149 '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
19156 …d: 'm {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3}…
19163 d: 'M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ',
19171 'm {e.x0},{e.y0} l -{e.x1},{e.y1} ',
19178 d:'m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z',
19185 d:'m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
19186 '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
19198 heightElements: [8.5, 6.5312, -6.5312, -8.5],
19199 widthElements: [6.5, -6.5, 3, -3, 5, -5]
19202 d:'m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
19203 '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
19213 heightElements: [-6, 6, 12, -12],
19214 widthElements: [9, -3, -12]
19217 d:'m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} ' +
19218 …'{e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1}…
19219 … '{e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} ' +
19220 '-{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z',
19227 d:'m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0',
19234 d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',
19241 d:'m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z',
19251 'l 0,-{e.y2} ' +
19252 'c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0' +
19254 'm -{e.x2},{e.y0}' +
19256 'm -{e.x2},{e.y0}' +
19264 d: 'm {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0',
19271 d: 'm{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0',
19278 d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',
19285 d: 'm{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0',
19292 d: 'm {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z',
19299 …d: 'm {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661…
19300 '-6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 ' +
19302 'l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902',
19309 …d: 'm {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.051…
19310 …579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 ' +
19311 …'1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393…
19312 … '-3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 ' +
19313 …'-2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.9678299…
19320 d: 'm {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}',
19327 d: 'm {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 ' +
19328 'c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z ' +
19329 'm -7,-12 l 5,0 ' +
19330 'm -4.5,3 l 4.5,0 ' +
19331 'm -3,3 l 5,0' +
19332 'm -4,3 l 5,0',
19339 d: 'm {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 ' +
19340 '-4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 ' +
19341 '0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 ' +
19342 'h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 z' +
19343 'm -8,6 l 0,5.5 m 11,0 l 0,-5'
19346 d: 'm {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 ' +
19347 '-2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 '
19350 … d: 'm {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 ' +
19351 '4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 ' +
19352 '-4.20799998,3.36699999 -4.20699998,4.34799999 z'
19355 …d: 'm {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.8…
19356 …'-0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0…
19357 …'0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1…
19358 …'-1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 '…
19359 …'0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 ' +
19360 … '-10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 ' +
19361 …'2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.51…
19362 …'-0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 ' +
19363 …'-1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 '…
19364 …'-0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.1…
19365 … '0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 ' +
19366 '-5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z'
19369 d: 'm {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6'
19372 d: 'm {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 ' +
19373 … '0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 ' +
19374 … '-1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 ' +
19375 'v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 ' +
19376 …'-0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 ' +
19377 …'-1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 ' +
19378 …'h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.1…
19379 …'-0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 ' +
19380 'c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 ' +
19381 … 'l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 ' +
19382 … '0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 ' +
19383 'c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z ' +
19384 … 'm 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
19385 '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
19386 '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
19389 … d: 'm {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
19390 '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
19391 '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
19394 d: 'm {mx},{my} 0,4 20,0 0,-4 z'
19397 d: 'm {mx},{my} 0,12 20,0 0,-12 z' +
19399 'm -13,-4 l 0,8'
19402 d: 'm {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6'
19418 * the option 'non-scaling-stroke' to prevent this.
19442 * <li>position.x * containerWidth</li>
19467 mx = param.abspos.x;
19489 coordinates['x' + widthIndex] = rawPath.widthElements[widthIndex] * widthRatio;
19507 // copied and adjusted from https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js
19541 * A simple translation stub to be used for multi-language support
19616 var mid = waypoints.length / 2 - 1;
19625 var angle = Math.atan((second.y - first.y) / (second.x - first.x));
19627 var x = position.x,
19631 y -= FLOW_LABEL_INDENT;
19633 x += FLOW_LABEL_INDENT;
19636 return { x: x, y: y };
19648 var mid = waypoints.length / 2 - 1;
19654 x: first.x + (second.x - first.x) / 2,
19655 y: first.y + (second.y - first.y) / 2
19666 x: element.x + element.width / 2,
19671 x: element.x + element.width / 2,
19702 x: bounds.x + bounds.width / 2, property
19713 x: mid.x - size.width / 2, property
19714 y: mid.y - size.height / 2
19730 function getWaypoints(bo, source, target) { argument
19732 var waypoints = bo.di.waypoint;
19739 return { x: p.x, y: p.y };
19820 x: Math.round(bounds.x), property
19926 if (attachers.indexOf(boundaryElement) === -1) {
19955 x: Math.round(bounds.x), property
20023 var x = point.x,
20026 return x >= bbox.x &&
20027 x <= bbox.x + bbox.width &&
20081 x: event.clientX,
20096 // button === 0 -> left áka primary mouse button
20102 // button === 1 -> auxiliary áka wheel button
20265 var ELEMENT_SELECTOR = 'svg, .djs-element';
20323 // Update djs-hit on change.
20324 // A low priortity is necessary, because djs-hit of labels has to be updated
20354 var STROKE_HIT_STYLE = createHitStyle('djs-hit djs-hit-stroke');
20356 var CLICK_STROKE_HIT_STYLE = createHitStyle('djs-hit djs-hit-click-stroke');
20358 var ALL_HIT_STYLE = createHitStyle('djs-hit djs-hit-all');
20362 'click-stroke': CLICK_STROKE_HIT_STYLE,
20373 return styles.cls(classNames, [ 'no-fill', 'no-border' ], attrs);
20405 var hits = all('.djs-hit', gfx);
20467 x: 0, property
20492 var hit = query('.djs-hit', gfx);
20628 var OUTLINE_STYLE = styles.cls('djs-outline', [ 'no-fill' ]);
20636 x: 10, property
20653 var outline = query('.djs-outline', gfx);
20666 var outline = query('.djs-outline', gfx);
20687 x: -this.offset, property
20688 y: -this.offset,
20708 x: bbox.x - this.offset, property
20709 y: bbox.y - this.offset,
20759 if (idx !== -1) {
20774 return this._selectedElements.indexOf(element) !== -1;
20809 if (selectedElements.indexOf(element) !== -1) {
20874 if (newSelection.indexOf(e) === -1) {
20880 if (oldSelection.indexOf(e) === -1) {
21026 this._prefix = (prefix ? prefix + '-' : '') + Math.floor(Math.random() * 1000000000) + '-';
21056 * top: -5,
21057 * left: -5
21064 * overlays.add('some-element-id', {
21066 * top: -5,
21067 * left: -5
21076 * top: -5,
21077 * left: -5
21128 * Mapping overlayId -> overlay
21133 * Mapping elementId -> overlay container
21159 * overlays.get('some-id');
21168 * overlays.get({ element: 'element-id', type: 'badge' });
21302 if (idx !== -1) {
21332 // update container left,top according to the elements x,y coordinates
21335 var x = element.x,
21340 x = bbox.x;
21344 setPosition$1(html, x, y);
21346 attr$1(container.html, 'data-container-id', element.id);
21373 left = position.right * -1 + width;
21386 top = position.bottom * -1 + height;
21394 var html = domify('<div class="djs-overlays" style="position: absolute" />');
21421 -1 * viewbox.x * scale,
21422 -1 * viewbox.y * scale
21465 …htmlContainer = domify('<div class="djs-overlay" data-overlay-id="' + id + '" style="position: abs…
21470 classes$1(htmlContainer).add('djs-overlay-' + overlay.type);
21599 if (i !== -1) {
21650 '<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'
21658 function setPosition$1(el, x, y) { argument
21659 assign(el.style, { left: x + 'px', top: y + 'px' });
21668 el.style['transform-origin'] = 'top left';
21670 [ '', '-ms-', '-webkit-' ].forEach(function(prefix) {
21775 return keys.indexOf(event.key) !== -1 || keys.indexOf(event.keyCode) !== -1;
21788 var HANDLE_MODIFIER_ATTRIBUTE = 'input-handle-modified-keys';
21803 * - keyboard.bind
21804 * - keyboard.unbind
21805 * - keyboard.init
21806 * - keyboard.destroy
22096 // cf: https://github.com/bpmn-io/bpmn-js/issues/1362#issuecomment-722989754
22105 // CTRL + -
22110 if (isKey([ '-', 'Subtract' ], event) && isCmd(event)) {
22111 editorActions.trigger('stepZoom', { value: -1 });
22246 dx = -actualSpeed;
22249 dy = -actualSpeed;
22276 var CURSOR_CLS_PATTERN = /^djs-cursor-.*$/;
22285 classes.add('djs-cursor-' + mode);
22317 x: bounds.x + (bounds.width / 2),
22325 x: a.x - b.x,
22326 y: a.y - b.y
22376 dx: delta$1.x,
22399 // event is already handled by '.djs-draggable'
22400 if (closest(event.target, '.djs-draggable')) {
22440 return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));
22449 * Get the logarithm of x with base 10
22452 function log10(x) { argument
22453 return Math.log(x) / Math.log(10);
22478 return n >= 0 ? 1 : -1;
22534 this._canvas.zoom('fit-viewport');
22562 // event is already handled by '.djs-scrollable'
22563 if (closest(event.target, '.djs-scrollable', true)) {
22578 var factor = -1 * this._scale,
22591 x: event.clientX - elementRect.left, property
22592 y: event.clientY - elementRect.top
22602 // zoom in relative to diagram {x,y} coordinates
22625 * @param {number} delta - Zoom delta (1 for zooming in, -1 for out).
22646 var direction = delta > 0 ? 1 : -1;
22728 /*! Hammer.JS - v2.0.7 - 2016-04-22
22812 var e = new Error('get-stack-trace');
22990 return str.indexOf(find) > -1;
23020 return -1;
23025 * convert array-like objects to real arrays
23137 var PROPS_XY = ['x', 'y'];
23225 var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));
23226 …var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));
23277 input.deltaTime = input.timeStamp - firstInput.timeStamp;
23286 input.overallVelocityX = overallVelocity.x;
23288 …input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : ov…
23314 x: prevInput.deltaX || 0,
23319 x: center.x,
23324 input.deltaX = prevDelta.x + (center.x - offset.x);
23325 input.deltaY = prevDelta.y + (center.y - offset.y);
23329 * velocity is calculated every x ms
23335 deltaTime = input.timeStamp - last.timeStamp,
23339 var deltaX = input.deltaX - last.deltaX;
23340 var deltaY = input.deltaY - last.deltaY;
23343 velocityX = v.x;
23345 velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;
23393 * @return {Object} center contains `x` and `y` properties
23401 x: round(pointers[0].clientX),
23406 var x = 0, y = 0, i = 0;
23408 x += pointers[i].clientX;
23414 x: round(x / pointersLength),
23422 * @param {Number} x
23424 * @return {Object} velocity `x` and `y`
23426 function getVelocity(deltaTime, x, y) { argument
23428 x: x / deltaTime || 0,
23435 * @param {Number} x
23439 function getDirection(x, y) { argument
23440 if (x === y) {
23444 if (abs(x) >= abs(y)) {
23445 return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
23452 * @param {Object} p1 {x, y}
23453 * @param {Object} p2 {x, y}
23454 * @param {Array} [props] containing x and y keys
23461 var x = p2[props[0]] - p1[props[0]],
23462 y = p2[props[1]] - p1[props[1]];
23464 return Math.sqrt((x * x) + (y * y));
23471 * @param {Array} [props] containing x and y keys
23478 var x = p2[props[0]] - p1[props[0]],
23479 y = p2[props[1]] - p1[props[1]];
23480 return Math.atan2(y, x) * 180 / Math.PI;
23581 // IE10 has prefixed support, and case-sensitive
23623 storeIndex = store.length - 1;
23690 if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
23730 * Multi-user touch events input
23858 // when we're in a touch event, record touches to de-dupe synthetic mouse event
23890 var lastTouch = {x: touch.clientX, y: touch.clientY}; property
23895 if (i > -1) {
23904 var x = eventData.srcEvent.clientX, y = eventData.srcEvent.clientY;
23907 var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y);
23923 var TOUCH_ACTION_PAN_X = 'pan-x';
23924 var TOUCH_ACTION_PAN_Y = 'pan-y';
23945 // find out the touch-action by the event handlers
23957 * just re-set the touchAction value
24009 // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent
24044 // if both pan-x and pan-y are set (different recognizers
24046 // we need none (as otherwise with pan-x pan-y combined none of these
24052 // pan-x OR pan-y
24071 ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function(val) {
24073 // If css.supports is not supported but there is native touch-action assume it supports
24075 touchMap[val] = cssSupports ? window.CSS.supports('touch-action', val) : true;
24084 * Example session for mouse-input: mousedown -> mousemove -> mouseup
24094 * +-----+---------------+
24096 * +-----+-----+ |
24099 * +-------+------+
24203 if (inArray(requireFail, otherRecognizer) === -1) {
24222 if (index > -1) {
24344 * return the preferred touch-action
24511 var x = input.deltaX;
24517 … direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;
24518 hasMoved = x != this.pX;
24551 …* Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-o…
24576 (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
24590 * Recognized when the pointer is down for x ms without any movement.
24748 …* between the given interval and position. The delay option can be used to recognize multi-taps wi…
24752 * multi-taps being recognized.
24778 interval: 300, // max time between the multi-tap taps
24781 posThreshold: 10 // a multi-tap can be a bit off the initial position
24808 … var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;
24906 * EXPERIMENTAL FEATURE -- can be removed/changed
25066 // run the touch-action polyfill
25170 if (index !== -1) {
25512 var node = closest(target, 'svg, .djs-element', true);
25531 var dx = e.deltaX - lx,
25532 dy = e.deltaY - ly;
25571 var ratio = 1 - (1 - e.scale) / 1.50,
25612 var node = document.elementFromPoint(position.x, position.y),
25712 class: 'outer-bound-marker'
25717 x: -10000, property
25728 x: 10000, property
25752 return arr && arr[arr.length - 1];
25760 return element.x;
25774 return element.x + element.width;
25800 axis = 'x',
25803 if (vertical.indexOf(type) !== -1) {
25815 return types.indexOf(type) !== -1;
25957 * @param {Object} [nextPositionDirection.x]
25965 x: previousPosition.x, property
25969 [ 'x', 'y' ].forEach(function(axis) {
25977 var dimension = axis === 'x' ? 'width' : 'height';
25984 connectedAtPosition[ axis ] + margin - element[ dimension ] / 2,
25985 previousPosition[ axis ] - minDistance + margin
26008 x: position.x - (element.width / 2), property
26009 y: position.y - (element.height / 2),
26030 * Assumes left-to-right and top-to-down modeling.
26050 return connection.source === source ? 1 : -1;
26067 return asTRBL(a).top - asTRBL(b).bottom;
26069 return asTRBL(a).top - getMid(b).y;
26071 return asTRBL(a).top - asTRBL(b).top;
26075 return asTRBL(a).left - asTRBL(b).right;
26077 return asTRBL(a).left - getMid(b).x;
26079 return asTRBL(a).left - asTRBL(b).left;
26083 return asTRBL(b).top - asTRBL(a).bottom;
26085 return getMid(b).y - asTRBL(a).bottom;
26087 return asTRBL(b).bottom - asTRBL(a).bottom;
26091 return asTRBL(b).left - asTRBL(a).right;
26093 return getMid(b).x - asTRBL(a).right;
26095 return asTRBL(b).right - asTRBL(a).right;
26167 * - connected elements
26168 * - host connected elements
26169 * - attachers connected elements
26299 x: sourceTrbl.right + distance + element.width / 2,
26411 orientation = getOrientation(source, source.host, -25);
26413 if (orientation.indexOf('top') !== -1) {
26414 margin *= -1;
26419 x: sourceTrbl.right + horizontalDistance + element.width / 2, property
26435 if (orientation.indexOf('top') != -1) {
26436 return -1 * minDistance;
26437 } else if (orientation.indexOf('bottom') != -1) {
26453 x: sourceTrbl.right + element.width / 2, property
26454 y: sourceTrbl.top - 50 - element.height / 2
26459 margin: -30,
26476 x: sourceTrbl.right - 10 + element.width / 2, property
26481 x: { property
26491 * BPMN auto-place behavior.
26515 * A utility that can be used to plug-in into the command execution for
26524 * import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
26530 * console.log('command pre-execute', event);
26771 if (elementsTrbl.top - targetTrbl.top < padding.top) {
26772 newTrbl.top = elementsTrbl.top - offset.top;
26775 if (elementsTrbl.left - targetTrbl.left < padding.left) {
26776 newTrbl.left = elementsTrbl.left - offset.left;
26779 if (targetTrbl.right - elementsTrbl.right < padding.right) {
26783 if (targetTrbl.bottom - elementsTrbl.bottom < padding.bottom) {
26819 …var resizeDirections = getResizeDirections(pick(target, [ 'x', 'y', 'width', 'height' ]), newBound…
26875 newBounds.x !== oldBounds.x ||
27120 * @see http://stackoverflow.com/questions/7448468/why-cant-i-reliably-capture-a-mouseout-event
27162 // 3) re-trigger move event
27246 target = document.elementFromPoint(position.x, position.y);
27263 return closest(target, 'svg, .djs-element', true);
27275 var DRAG_ACTIVE_CLS = 'djs-drag-active';
27290 return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));
27295 * the general "drag-and-drop" look and feel.
27311 * ## Life-cycle events
27325 * life-cycle events with the `drag.` prefix _and_ events namespaced
27350 * console.log('canvas local coordinates', event.x, event.y, event.dx, event.dy);
27392 x: viewbox.x + (globalPosition.x - clientRect.left) / viewbox.scale,
27393 y: viewbox.y + (globalPosition.y - clientRect.top) / viewbox.scale
27449 x: round$a(localStart.x + displacement.x), property
27484 x: round$a(localCurrent.x + displacement.x), property
27486 dx: round$a(localDelta.x),
27591 // life-cycle methods
27718 globalStart = { x: 0, y: 0 }; property
27865 * @param {Object} point { x: X, y: Y }
27876 point.x,
27878 clientRect.width - point.x,
27879 clientRect.height - point.y
27894 dx = -opts.scrollStep;
27896 dy = -opts.scrollStep;
27949 x: globalPosition.x - clientRect.left,
27950 y: globalPosition.y - clientRect.top
28019 var x = center.x,
28023 ['M', x, y],
28024 ['m', 0, -r],
28026 ['a', r, r, 0, 1, 1, 0, -2 * r],
28035 segments.push([ idx === 0 ? 'M' : 'L', p.x, p.y ]);
28067 b = intersections[intersections.length - 1],
28083 idx = max$6(a.segment2, b.segment2) - 1;
28094 x: (round$9(a.x + b.x) / 2),
28103 x: round$9(a.x), property
28122 var BENDPOINT_CLS = 'djs-bendpoint';
28123 var SEGMENT_DRAGGER_CLS = 'djs-segment-dragger';
28134 x: clientRect.left, property
28143 x: viewbox.x + (position.x - offset.x) / viewbox.scale, property
28144 y: viewbox.y + (position.y - offset.y) / viewbox.scale
28167 classes(visual).add('djs-visual');
28177 classes(hit).add('djs-hit');
28201 x: -width / 2, property
28202 y: -height / 2,
28206 classes(visual).add('djs-visual');
28212 x: -hitWidth / 2, property
28213 y: -hitHeight / 2,
28217 classes(hit).add('djs-hit');
28240 translate$2(groupGfx, mid.x, mid.y);
28258 var segmentLengthXAxis = segmentEnd.x - segmentStart.x,
28259 segmentLengthYAxis = segmentEnd.y - segmentStart.y;
28283 // https://drafts.csswg.org/cssom/#serialize-an-identifier
28290 var index = -1;
28296 // Note: there’s no need to special-case astral symbols, surrogate
28307 // If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
28310 // If the character is the first character and is in the range [0-9]
28313 // If the character is the second character and is in the range [0-9]
28314 // (U+0030 to U+0039) and the first character is a `-` (U+002D), […]
28321 // https://drafts.csswg.org/cssom/#escape-a-character-as-code-point
28327 // If the character is the first character and is a `-` (U+002D), and
28338 // greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or
28339 // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to
28340 // U+005A), or [a-z] (U+0061 to U+007A), […]
28355 // https://drafts.csswg.org/cssom/#escape-a-character
28410 p0 = waypoints[idx - 1];
28414 xDelta = Math.abs(p.x - mid.x);
28415 yDelta = Math.abs(p.y - mid.y);
28421 * Calculates the threshold from a connection's middle which fits the two-third-region
28433 start: waypoints[intersection.index - 1],
28444 segmentLength = relevantSegment.end.x - relevantSegment.start.x;
28446 segmentLength = relevantSegment.end.y - relevantSegment.start.y;
28487 gfx = query('.djs-bendpoints[data-element-id="' + cssEscape(element.id) + '"]', layer);
28491 attr(gfx, { 'data-element-id': element.id });
28492 classes(gfx).add('djs-bendpoints');
28506 '.djs-segment-dragger[data-segment-idx="' + idx + '"]',
28517 translate$2(bendpoint, p.x, p.y);
28534 segmentStart = waypoints[i - 1];
28540 attr(segmentDraggerGfx, { 'data-segment-idx': i });
28593 translate$2(floating, point.x, point.y);
28600 segmentStart = waypoints[intersection.index - 1],
28614 x: point.x - mid.x, property
28615 y: point.y - mid.y
28622 x: relativePosition.y, property
28623 y: relativePosition.x
28627 translate$2(draggerVisual, relativePosition.x, relativePosition.y);
28732 attr(bendpointContainer, { 'data-element-id': newId });
28758 return query('.djs-visual', draggerGfx);
28784 if (!insert && bendpointIndex === waypoints.length - 1) {
28900 x: round$8(event.x), property
29004 var MARKER_OK$4 = 'connect-ok',
29005 MARKER_NOT_OK$4 = 'connect-not-ok',
29006 MARKER_CONNECT_HOVER$1 = 'connect-hover',
29007 MARKER_CONNECT_UPDATING$1 = 'djs-updating',
29008 MARKER_ELEMENT_HIDDEN = 'djs-element-hidden';
29033 newWaypoints.splice(bendpointIndex, 0, { x: event.x, y: event.y }); property
29041 classes(draggerGfx).add('djs-dragging');
29095 bendpoint = { x: event.x, y: event.y }, property
29153 translate$2(draggerGfx, event.x, event.y);
29193 var MARKER_CONNECT_HOVER = 'connect-hover',
29194 MARKER_CONNECT_UPDATING = 'djs-updating';
29203 x: (axis === 'x' ? value : point.x),
29215 var fencedValue = Math.min(Math.max(minValue + padding, position[axis]), maxValue - padding);
29221 return axis === 'x' ? 'y' : 'x';
29231 * @param {string} moveAxis (x|y)
29267 segmentStartIndex = idx - 1,
29283 axis = direction === 'v' ? 'x' : 'y';
29289 if (segmentEndIndex === waypoints.length - 1) {
29299 x: (segmentStart.x + segmentEnd.x) / 2, property
29315 cursor: axis === 'x' ? 'resize-ew' : 'resize-ns',
29373 translate$2(context.draggerGfx, draggerPosition.x, draggerPosition.y);
29390 if (pointsOnLine(waypoints[idx - 1], waypoints[idx + 1], r)) {
29393 segmentOffset = idx <= segmentStartIndex ? segmentOffset - 1 : segmentOffset;
29417 classes(context.draggerGfx).add('djs-dragging');
29459 segmentOffset--;
29473 if (segmentEndIndex > waypointCount - 3) {
29477 if (segmentEndIndex === waypointCount - 2) {
29481 newWaypoints[newWaypoints.length - 1] = newSegmentEnd;
29563 x: Math.round(p.x),
29617 if (abs$6(snapValue - value) <= tolerance) {
29626 x: bounds.x,
29633 x: bounds.x + bounds.width,
29640 if (!bounds || isNaN(bounds.x) || isNaN(bounds.y)) {
29645 x: round$7(bounds.x + bounds.width / 2),
29671 return snapped.x && snapped.y;
29678 * This method may change the x and/or y position of the shape
29689 throw new Error('axis must be in [x, y]');
29707 delta = value - previousValue;
29740 while (i--) if (abs$5(values[i] - value) <= TOLERANCE) {
29748 return value - rem;
29751 if (rem > values - TOLERANCE) {
29752 return value - rem + values;
29762 x: round$6(element.width / 2 + element.x),
29786 waypoints[segmentStartIndex - 1],
29796 if (segmentEndIndex > waypoints.length - 3) {
29813 if (axis === 'x') {
29814 snapPoints.vertical.push(p.x);
29825 x = event.x,
29834 sx = snapTo(snapPoints.vertical, x);
29838 // correction x/y
29839 var cx = (x - sx),
29840 cy = (y - sy);
29844 dx: event.dx - cx,
29845 dy: event.dy - cy,
29846 x: sx, property
29851 if (cx || snapPoints.vertical.indexOf(x) !== -1) {
29852 setSnapped(event, 'x', sx);
29855 if (cy || snapPoints.horizontal.indexOf(y) !== -1) {
29873 var referenceWaypoints = [ waypoints[bendpointIndex - 1], waypoints[bendpointIndex + 1] ];
29885 snapPoints.vertical.push(p.x);
29899 x = event.x,
29908 sx = snapTo(hoverMid ? snapPoints.vertical.concat([ hoverMid.x ]) : snapPoints.vertical, x);
29911 // correction x/y
29912 var cx = (x - sx),
29913 cy = (y - sy);
29917 dx: event.dx - cx,
29918 dy: event.dy - cy,
29919 x: event.x - cx, property
29920 y: event.y - cy
29924 if (cx || snapPoints.vertical.indexOf(x) !== -1) {
29925 setSnapped(event, 'x', sx);
29928 if (cy || snapPoints.horizontal.indexOf(y) !== -1) {
30019 x: event.x, property
30093 var MARKER_OK$3 = 'connect-ok',
30094 MARKER_NOT_OK$3 = 'connect-not-ok';
30116 x: event.x,
30184 var MARKER_CONNECTION_PREVIEW = 'djs-connection-preview';
30408 'pointer-events': 'none'
30411 attr(connection, { 'points': [ start.x, start.y, end.x, end.y ] });
30493 * resize-handle
30504 '<div class="djs-direct-editing-parent">' +
30505 '<div class="djs-direct-editing-content" contenteditable="true"></div>' +
30523 * @param {Number} bounds.x absolute x position
30573 left: bounds.x + 'px',
30579 boxSizing: 'border-box',
30598 boxSizing: 'border-box',
30601 wordWrap: 'break-word'
30608 transform: 'translate(0, -50%)'
30751 content.scrollHeight < parent.offsetHeight - fontSize) {
30761 dy: height - bounds.height
30782 '<div class="djs-direct-editing-resize-handle"></div>'
30807 var newWidth = min$3(max$5(startWidth + e.clientX - startX, minWidth), maxWidth);
30808 var newHeight = min$3(max$5(startHeight + e.clientY - startY, minHeight), maxHeight);
30816 dx: e.clientX - startX,
30817 dy: e.clientY - startY
30836 cursor: 'nwse-resize',
30940 * an activation context ({ bounds: {x, y, width, height }, text }) if
31010 x: newBounds.left - containerBounds.left, property
31011 y: newBounds.top - containerBounds.top,
31133 right: -9,
31134 top: -6
31205 * 'entry-1': {
31278 entry = entries[attr$1(button, 'data-action')];
31337 attr$1(control, 'data-action', id);
31339 container = query('[data-group=' + grouping + ']', html);
31341 container = domify('<div class="group" data-group="' + grouping + '"></div>');
31381 var html = domify('<div class="djs-context-pad"></div>');
31400 this._overlayId = overlays.add(element, 'context-pad', overlaysConfig);
31462 'marker-start',
31463 'marker-mid',
31464 'marker-end'
31535 attr(dragger, this._styles.cls('djs-dragger', [], {
31536 x: bbox.top, property
31556 class: 'djs-resize-overlay',
31559 x: shape.x,
31614 var clonedMarkerId = markerId + '-clone';
31619 .add('djs-dragger')
31620 .add('djs-dragger-marker');
31688 return NODES_CAN_HAVE_MARKER.indexOf(node.nodeName) !== -1;
31696 var MARKER_OK$2 = 'drop-ok',
31697 MARKER_NOT_OK$2 = 'drop-not-ok',
31698 MARKER_ATTACH$2 = 'attach-ok',
31699 MARKER_NEW_PARENT$1 = 'new-parent';
31744 return !element.parent && !(isLabel$5(element) && elements.indexOf(labelTarget) !== -1);
31843 x: event.x, property
31886 x: event.x, property
31959 // make sure each element has x and y
31961 if (!isNumber(element.x)) {
31962 element.x = 0;
31977 x: waypoint.x - bbox.x - bbox.width / 2,
31978 y: waypoint.y - bbox.y - bbox.height / 2
31984 x: element.x - bbox.x - bbox.width / 2, property
31985 y: element.y - bbox.y - bbox.height / 2
32020 event.x = Math.max(event.x, createConstraints.left);
32024 event.x = Math.min(event.x, createConstraints.right);
32061 attr(dragGroup, styles.cls('djs-drag-group', [ 'no-events' ]));
32083 translate$2(gfx, element.x, element.y);
32114 translate$2(dragGroup, event.x, event.y);
32153 var DATA_REF = 'data-id';
32211 * 'entry-1': {
32308 this._createEntries(headerEntries, 'djs-popup-header')
32314 this._createEntries(entries, 'djs-popup-body')
32491 var container = domify('<div class="djs-popup">'),
32497 left: position.x + 'px',
32578 * @param {Position} cursor {x, y}
32592 x: cursor.x - clientRect.left, property
32593 y: cursor.y - clientRect.top
32597 overAxis.x = true;
32604 if (overAxis.x && overAxis.y) {
32605 left = cursorPosition.x - containerWidth + 'px';
32606 top = cursorPosition.y - containerHeight + 'px';
32607 } else if (overAxis.x) {
32608 left = cursorPosition.x - containerWidth + 'px';
32611 left = cursorPosition.x + 'px';
32614 left = cursorPosition.x + 'px';
32615 top = cursorPosition.y - containerHeight + 'px';
32618 assign(container.style, { left: left, top: top }, { visibility: 'visible', 'z-index': 1000 });
32703 * Remove the auto-closing listener.
32714 element.style['transform-origin'] = 'top left';
32716 [ '', '-ms-', '-webkit-' ].forEach(function(prefix) {
32786 function createMoveEvent(x, y) { argument
32789 var screenX = x,
32791 clientX = x,
32828 * @returns {Array<djs.model.Base>|boolean} - Return elements to be copied or false to disallow
32853 * @param {Object} context.cache - Already created elements.
32861 * @param {Object} context.hints - Add hints before pasting.
32939 forEach([ 'x', 'y', 'width', 'height' ], function(property) {
33012 * @param {djs.model.base} [context.element] - Parent.
33013 * @param {Point} [context.point] - Position.
33014 * @param {Object} [context.hints] - Hints.
33051 // make sure each element has x and y
33053 if (!isNumber(element.x)) {
33054 element.x = 0;
33069 x: waypoint.x - bbox.x - bbox.width / 2,
33070 y: waypoint.y - bbox.y - bbox.height / 2
33076 x: element.x - bbox.x - bbox.width / 2, property
33077 y: element.y - bbox.y - bbox.height / 2
33206 * Create a tree-like structure from elements.
33273 if (index !== -1) {
33398 if (index === -1) {
33461 'background-color',
33462 'border-color',
33601 * @returns {Array<string>|boolean} - Return properties to be copied or false to disallow
33613 * @returns {*|boolean} - Return copied property or false to disallow
33625 * @returns {boolean} - Return false to disallow
33660 if (propertyName && DISALLOWED_PROPERTIES.indexOf(propertyName) !== -1) {
33886 * @param {Element} oldElement - Element to be replaced
33887 * @param {Object} newElementData - Containing information about the new element,
33889 …* @param {Object} options - Custom options that will be attached to the context. It can be used t…
33906 x = newElementData.x || oldElement.x,
33908 centerX = round$5(x + width / 2),
33920 x: centerX, property
34140 // retain default flow's reference between inclusive <-> exclusive gateways and activities
34165 // This ensures that they stay centered on the x axis when replaced
34170 newElement.x = element.x + (element.width - newElement.width) / 2;
34179 'background-color',
34180 'border-color',
34207 function isSubProcess(bo) { argument
34208 return is$1(bo, 'bpmn:SubProcess');
34213 var bo = getBusinessObject(element);
34215 return type && bo.get('eventDefinitions').some(function(definition) {
34225 return a2.indexOf(el) !== -1;
34277 actionName: 'replace-with-none-start',
34278 className: 'bpmn-icon-start-event-none',
34285 actionName: 'replace-with-none-intermediate-throwing',
34286 className: 'bpmn-icon-intermediate-event-none',
34293 actionName: 'replace-with-none-end',
34294 className: 'bpmn-icon-end-event-none',
34301 actionName: 'replace-with-message-start',
34302 className: 'bpmn-icon-start-event-message',
34310 actionName: 'replace-with-timer-start',
34311 className: 'bpmn-icon-start-event-timer',
34319 actionName: 'replace-with-conditional-start',
34320 className: 'bpmn-icon-start-event-condition',
34328 actionName: 'replace-with-signal-start',
34329 className: 'bpmn-icon-start-event-signal',
34340 actionName: 'replace-with-none-start',
34341 className: 'bpmn-icon-start-event-none',
34348 actionName: 'replace-with-none-intermediate-throwing',
34349 className: 'bpmn-icon-intermediate-event-none',
34356 actionName: 'replace-with-none-end',
34357 className: 'bpmn-icon-end-event-none',
34367 actionName: 'replace-with-none-start',
34368 className: 'bpmn-icon-start-event-none',
34375 actionName: 'replace-with-none-intermediate-throw',
34376 className: 'bpmn-icon-intermediate-event-none',
34383 actionName: 'replace-with-none-end',
34384 className: 'bpmn-icon-end-event-none',
34391 actionName: 'replace-with-message-intermediate-catch',
34392 className: 'bpmn-icon-intermediate-event-catch-message',
34400 actionName: 'replace-with-message-intermediate-throw',
34401 className: 'bpmn-icon-intermediate-event-throw-message',
34409 actionName: 'replace-with-timer-intermediate-catch',
34410 className: 'bpmn-icon-intermediate-event-catch-timer',
34418 actionName: 'replace-with-escalation-intermediate-throw',
34419 className: 'bpmn-icon-intermediate-event-throw-escalation',
34427 actionName: 'replace-with-conditional-intermediate-catch',
34428 className: 'bpmn-icon-intermediate-event-catch-condition',
34436 actionName: 'replace-with-link-intermediate-catch',
34437 className: 'bpmn-icon-intermediate-event-catch-link',
34448 actionName: 'replace-with-link-intermediate-throw',
34449 className: 'bpmn-icon-intermediate-event-throw-link',
34460 actionName: 'replace-with-compensation-intermediate-throw',
34461 className: 'bpmn-icon-intermediate-event-throw-compensation',
34469 actionName: 'replace-with-signal-intermediate-catch',
34470 className: 'bpmn-icon-intermediate-event-catch-signal',
34478 actionName: 'replace-with-signal-intermediate-throw',
34479 className: 'bpmn-icon-intermediate-event-throw-signal',
34490 actionName: 'replace-with-none-start',
34491 className: 'bpmn-icon-start-event-none',
34498 actionName: 'replace-with-none-intermediate-throw',
34499 className: 'bpmn-icon-intermediate-event-none',
34506 actionName: 'replace-with-none-end',
34507 className: 'bpmn-icon-end-event-none',
34514 actionName: 'replace-with-message-end',
34515 className: 'bpmn-icon-end-event-message',
34523 actionName: 'replace-with-escalation-end',
34524 className: 'bpmn-icon-end-event-escalation',
34532 actionName: 'replace-with-error-end',
34533 className: 'bpmn-icon-end-event-error',
34541 actionName: 'replace-with-cancel-end',
34542 className: 'bpmn-icon-end-event-cancel',
34550 actionName: 'replace-with-compensation-end',
34551 className: 'bpmn-icon-end-event-compensation',
34559 actionName: 'replace-with-signal-end',
34560 className: 'bpmn-icon-end-event-signal',
34568 actionName: 'replace-with-terminate-end',
34569 className: 'bpmn-icon-end-event-terminate',
34580 actionName: 'replace-with-exclusive-gateway',
34581 className: 'bpmn-icon-gateway-xor',
34588 actionName: 'replace-with-parallel-gateway',
34589 className: 'bpmn-icon-gateway-parallel',
34596 actionName: 'replace-with-inclusive-gateway',
34597 className: 'bpmn-icon-gateway-or',
34604 actionName: 'replace-with-complex-gateway',
34605 className: 'bpmn-icon-gateway-complex',
34612 actionName: 'replace-with-event-based-gateway',
34613 className: 'bpmn-icon-gateway-eventbased',
34621 // Gateways deactivated until https://github.com/bpmn-io/bpmn-js/issues/194
34624 // actionName: 'replace-with-exclusive-event-based-gateway',
34625 // className: 'bpmn-icon-exclusive-event-based',
34635 // actionName: 'replace-with-parallel-event-based-instantiate-gateway',
34636 // className: 'bpmn-icon-parallel-event-based-instantiate-gateway',
34649 actionName: 'replace-with-transaction',
34650 className: 'bpmn-icon-transaction',
34658 actionName: 'replace-with-event-subprocess',
34659 className: 'bpmn-icon-event-subprocess-expanded',
34668 actionName: 'replace-with-collapsed-subprocess',
34669 className: 'bpmn-icon-subprocess-collapsed',
34680 actionName: 'replace-with-subprocess',
34681 className: 'bpmn-icon-subprocess-expanded',
34689 actionName: 'replace-with-event-subprocess',
34690 className: 'bpmn-icon-event-subprocess-expanded',
34702 actionName: 'replace-with-subprocess',
34703 className: 'bpmn-icon-subprocess-expanded',
34711 actionName: 'replace-with-transaction',
34712 className: 'bpmn-icon-transaction',
34723 actionName: 'replace-with-task',
34724 className: 'bpmn-icon-task',
34731 actionName: 'replace-with-send-task',
34732 className: 'bpmn-icon-send',
34739 actionName: 'replace-with-receive-task',
34740 className: 'bpmn-icon-receive',
34747 actionName: 'replace-with-user-task',
34748 className: 'bpmn-icon-user',
34755 actionName: 'replace-with-manual-task',
34756 className: 'bpmn-icon-manual',
34763 actionName: 'replace-with-rule-task',
34764 className: 'bpmn-icon-business-rule',
34771 actionName: 'replace-with-service-task',
34772 className: 'bpmn-icon-service',
34779 actionName: 'replace-with-script-task',
34780 className: 'bpmn-icon-script',
34787 actionName: 'replace-with-call-activity',
34788 className: 'bpmn-icon-call-activity',
34795 actionName: 'replace-with-collapsed-subprocess',
34796 className: 'bpmn-icon-subprocess-collapsed',
34804 actionName: 'replace-with-expanded-subprocess',
34805 className: 'bpmn-icon-subprocess-expanded',
34816 actionName: 'replace-with-data-store-reference',
34817 className: 'bpmn-icon-data-store',
34827 actionName: 'replace-with-data-object-reference',
34828 className: 'bpmn-icon-data-object',
34838 actionName: 'replace-with-message-boundary',
34839 className: 'bpmn-icon-intermediate-event-catch-message',
34847 actionName: 'replace-with-timer-boundary',
34848 className: 'bpmn-icon-intermediate-event-catch-timer',
34856 actionName: 'replace-with-escalation-boundary',
34857 className: 'bpmn-icon-intermediate-event-catch-escalation',
34865 actionName: 'replace-with-conditional-boundary',
34866 className: 'bpmn-icon-intermediate-event-catch-condition',
34874 actionName: 'replace-with-error-boundary',
34875 className: 'bpmn-icon-intermediate-event-catch-error',
34883 actionName: 'replace-with-cancel-boundary',
34884 className: 'bpmn-icon-intermediate-event-catch-cancel',
34892 actionName: 'replace-with-signal-boundary',
34893 className: 'bpmn-icon-intermediate-event-catch-signal',
34901 actionName: 'replace-with-compensation-boundary',
34902 className: 'bpmn-icon-intermediate-event-catch-compensation',
34909 label: 'Message Boundary Event (non-interrupting)',
34910 actionName: 'replace-with-non-interrupting-message-boundary',
34911 className: 'bpmn-icon-intermediate-event-catch-non-interrupting-message',
34919 label: 'Timer Boundary Event (non-interrupting)',
34920 actionName: 'replace-with-non-interrupting-timer-boundary',
34921 className: 'bpmn-icon-intermediate-event-catch-non-interrupting-timer',
34929 label: 'Escalation Boundary Event (non-interrupting)',
34930 actionName: 'replace-with-non-interrupting-escalation-boundary',
34931 className: 'bpmn-icon-intermediate-event-catch-non-interrupting-escalation',
34939 label: 'Conditional Boundary Event (non-interrupting)',
34940 actionName: 'replace-with-non-interrupting-conditional-boundary',
34941 className: 'bpmn-icon-intermediate-event-catch-non-interrupting-condition',
34949 label: 'Signal Boundary Event (non-interrupting)',
34950 actionName: 'replace-with-non-interrupting-signal-boundary',
34951 className: 'bpmn-icon-intermediate-event-catch-non-interrupting-signal',
34963 actionName: 'replace-with-message-start',
34964 className: 'bpmn-icon-start-event-message',
34972 actionName: 'replace-with-timer-start',
34973 className: 'bpmn-icon-start-event-timer',
34981 actionName: 'replace-with-conditional-start',
34982 className: 'bpmn-icon-start-event-condition',
34990 actionName: 'replace-with-signal-start',
34991 className: 'bpmn-icon-start-event-signal',
34999 actionName: 'replace-with-error-start',
35000 className: 'bpmn-icon-start-event-error',
35008 actionName: 'replace-with-escalation-start',
35009 className: 'bpmn-icon-start-event-escalation',
35017 actionName: 'replace-with-compensation-start',
35018 className: 'bpmn-icon-start-event-compensation',
35025 label: 'Message Start Event (non-interrupting)',
35026 actionName: 'replace-with-non-interrupting-message-start',
35027 className: 'bpmn-icon-start-event-non-interrupting-message',
35035 label: 'Timer Start Event (non-interrupting)',
35036 actionName: 'replace-with-non-interrupting-timer-start',
35037 className: 'bpmn-icon-start-event-non-interrupting-timer',
35045 label: 'Conditional Start Event (non-interrupting)',
35046 actionName: 'replace-with-non-interrupting-conditional-start',
35047 className: 'bpmn-icon-start-event-non-interrupting-condition',
35055 label: 'Signal Start Event (non-interrupting)',
35056 actionName: 'replace-with-non-interrupting-signal-start',
35057 className: 'bpmn-icon-start-event-non-interrupting-signal',
35065 label: 'Escalation Start Event (non-interrupting)',
35066 actionName: 'replace-with-non-interrupting-escalation-start',
35067 className: 'bpmn-icon-start-event-non-interrupting-escalation',
35079 actionName: 'replace-with-sequence-flow',
35080 className: 'bpmn-icon-connection'
35084 actionName: 'replace-with-default-flow',
35085 className: 'bpmn-icon-default-flow'
35089 actionName: 'replace-with-conditional-flow',
35090 className: 'bpmn-icon-conditional-flow'
35097 actionName: 'replace-with-expanded-pool',
35098 className: 'bpmn-icon-participant',
35114 actionName: 'replace-with-collapsed-pool',
35117 className: 'bpmn-icon-lane',
35158 this._popupMenu.registerProvider('bpmn-replace', this);
35434 case 'replace-with-default-flow':
35446 case 'replace-with-conditional-flow':
35561 id: 'toggle-parallel-mi',
35562 className: 'bpmn-icon-parallel-mi-marker',
35572 id: 'toggle-sequential-mi',
35573 className: 'bpmn-icon-sequential-mi-marker',
35583 id: 'toggle-loop',
35584 className: 'bpmn-icon-loop-marker',
35620 id: 'toggle-is-collection',
35621 className: 'bpmn-icon-parallel-mi-marker',
35660 id: 'toggle-participant-multiplicity',
35661 className: 'bpmn-icon-parallel-mi-marker',
35687 id: 'toggle-adhoc',
35688 className: 'bpmn-icon-ad-hoc-marker',
35689 title: translate('Ad-hoc'),
35734 top: trblA.top - trblB.top,
35735 right: trblA.right - trblB.right,
35736 bottom: trblA.bottom - trblB.bottom,
35737 left: trblA.left - trblB.left
35751 var dx = delta.x,
35755 x: bounds.x, property
35761 if (direction.indexOf('n') !== -1) {
35763 newBounds.height = bounds.height - dy;
35764 } else if (direction.indexOf('s') !== -1) {
35768 if (direction.indexOf('e') !== -1) {
35770 } else if (direction.indexOf('w') !== -1) {
35771 newBounds.x = bounds.x + dx;
35772 newBounds.width = bounds.width - dx;
35790 x: bounds.x + (resize.left || 0),
35792 width: bounds.width - (resize.left || 0) + (resize.right || 0),
35793 height: bounds.height - (resize.top || 0) + (resize.bottom || 0)
35837 top: /n/.test(direction) ? currentBox.bottom - minDimensions.height : currentBox.top,
35838 left: /w/.test(direction) ? currentBox.right - minDimensions.width : currentBox.left,
35876 x: bbox.x - left,
35877 y: bbox.y - top,
36040 if (abs$4(otherTrbl.bottom - shapeTrbl.top) < 10) {
36041 bottomResize = shapeNewTrbl.top - otherTrbl.bottom;
36044 if (abs$4(otherTrbl.top - shapeTrbl.top) < 5) {
36045 topResize = shapeNewTrbl.top - otherTrbl.top;
36050 if (abs$4(otherTrbl.top - shapeTrbl.bottom) < 10) {
36051 topResize = shapeNewTrbl.bottom - otherTrbl.top;
36054 if (abs$4(otherTrbl.bottom - shapeTrbl.bottom) < 5) {
36055 bottomResize = shapeNewTrbl.bottom - otherTrbl.bottom;
36178 var top = padRect.top - diagramRect.top;
36179 var left = padRect.left - diagramRect.left;
36182 x: left, property
36253 'lane-insert-above': {
36254 group: 'lane-insert-above',
36255 className: 'bpmn-icon-lane-insert-above',
36269 'lane-divide-two': {
36270 group: 'lane-divide',
36271 className: 'bpmn-icon-lane-divide-two',
36282 'lane-divide-three': {
36283 group: 'lane-divide',
36284 className: 'bpmn-icon-lane-divide-three',
36295 'lane-insert-below': {
36296 group: 'lane-insert-below',
36297 className: 'bpmn-icon-lane-insert-below',
36314 'append.receive-task': appendAction(
36316 'bpmn-icon-receive-task',
36319 'append.message-intermediate-event': appendAction(
36321 'bpmn-icon-intermediate-event-catch-message',
36325 'append.timer-intermediate-event': appendAction(
36327 'bpmn-icon-intermediate-event-catch-timer',
36331 'append.condition-intermediate-event': appendAction(
36333 'bpmn-icon-intermediate-event-catch-condition',
36337 'append.signal-intermediate-event': appendAction(
36339 'bpmn-icon-intermediate-event-catch-signal',
36349 'append.compensation-activity':
36352 'bpmn-icon-task',
36367 'append.end-event': appendAction(
36369 'bpmn-icon-end-event-none',
36374 'bpmn-icon-gateway-none',
36377 'append.append-task': appendAction(
36379 'bpmn-icon-task',
36382 'append.intermediate-event': appendAction(
36384 'bpmn-icon-intermediate-event-none',
36391 if (!popupMenu.isEmpty(element, 'bpmn-replace')) {
36397 className: 'bpmn-icon-screw-wrench',
36403 cursor: { x: event.x, y: event.y } property
36406 popupMenu.open(element, 'bpmn-replace', position);
36422 'append.text-annotation': appendAction(
36424 'bpmn-icon-text-annotation'
36429 className: 'bpmn-icon-connection-multi',
36449 className: 'bpmn-icon-connection-multi',
36463 className: 'bpmn-icon-connection-multi',
36475 'append.text-annotation': appendAction('bpmn:TextAnnotation', 'bpmn-icon-text-annotation')
36492 className: 'bpmn-icon-trash',
36536 horizontal: [ 'x', 'width' ],
36679 // sort by 'left->right' or 'top->bottom'
36686 var previous = rangeGroups[rangeGroups.length - 1];
36689 rangeGroups[rangeGroups.length - 1].elements.push(element);
36743 max: axis + dimension - THRESHOLD
36799 * ## Life-Cycle and configuration
37203 { x: -boundingBox.x, y: -boundingBox.y }, property
37235 context.gridSnappingContext.snapLocation = 'top-left';
37298 [ 'x', 'y' ].forEach(function(axis) {
37323 * Snap an events x or y with optional min, max and offset.
37388 value -= offset;
37450 snapConstraints.x.min = createConstraints.left;
37451 snapConstraints.x.max = createConstraints.right;
37466 snapConstraints.x.max = minResizeConstraints.left;
37468 snapConstraints.x.min = minResizeConstraints.right;
37486 snapConstraints.x.min = maxResizeConstraints.left;
37488 snapConstraints.x.max = maxResizeConstraints.right;
37552 if (axis === 'x') {
37554 snapOffset[ axis ] -= shape.width / 2;
37560 snapOffset[ axis ] -= shape.height / 2;
37570 return axis === 'x';
37574 return direction.indexOf('n') !== -1;
37578 return direction.indexOf('w') !== -1;
37638 newBounds.x = shape.x + (shape.width / 2) - (newBounds.width / 2);
37639 newBounds.y = shape.y + (shape.height / 2) - (newBounds.height / 2);
37645 * Snap x, y, width and height according to given directions.
37648 * @param {string} directions - Directions as {n|w|s|e}.
37668 * @param {string} directions - Directions as {n|w|s|e}.
37687 snappedNewBounds.x = gridSnapping.snapValue(newBounds.x, {
37688 max: newBounds.x
37691 snappedNewBounds.width += gridSnapping.snapValue(newBounds.x - snappedNewBounds.x, {
37692 min: newBounds.x - snappedNewBounds.x
37698 newBounds.x = newBounds.x + newBounds.width - snappedNewBounds.width;
37702 // assign snapped x and width
37712 * @param {string} directions - Directions as {n|w|s|e}.
37735 snappedNewBounds.height += gridSnapping.snapValue(newBounds.y - snappedNewBounds.y, {
37736 min: newBounds.y - snappedNewBounds.y
37742 newBounds.y = newBounds.y + newBounds.height - snappedNewBounds.height;
37772 if (axis === 'x') {
37774 // snap delta x to multiple of 10
37777 event.x = event.x + snapped - event.dx;
37784 event.y = event.y + snapped - event.dy;
37821 [ 'x', 'y' ].forEach(function(axis) {
37824 // do not snap if x/y equal
37838 options.offset = -shape.width / 2;
37840 options.offset = -shape.height / 2;
37862 return axis === 'x';
37955 for (var i = 1; i < waypoints.length - 2; i++) {
38024 snapped.x = gridSnapping.snapValue(segmentStart.x);
38027 if ('x' in snapped || 'y' in snapped) {
38060 * BPMN-specific hit zones and interaction fixes.
38122 this._interactionEvents.createBoxHit(gfx, 'click-stroke', {
38143 this._interactionEvents.createBoxHit(gfx, 'click-stroke', {
38351 x: -speed,
38357 x: 0,
38358 y: -speed
38363 x: speed,
38369 x: 0,
38675 x: event.dx, property
38766 return shape.x !== newBounds.x ||
38777 x: mid.x, property
38781 if (direction.indexOf('n') !== -1) {
38783 } else if (direction.indexOf('s') !== -1) {
38787 if (direction.indexOf('e') !== -1) {
38788 referencePoint.x = trbl.right;
38789 } else if (direction.indexOf('w') !== -1) {
38790 referencePoint.x = trbl.left;
38797 var prefix = 'resize-';
38810 var MARKER_RESIZING$1 = 'djs-resizing',
38811 MARKER_RESIZE_NOT_OK = 'resize-not-ok';
38843 attr(frame, { x: bounds.x, width: bounds.width }); property
38891 var HANDLE_OFFSET = -6,
38895 var CLS_RESIZER = 'djs-resizer';
38955 ResizeHandles.prototype._createResizer = function(element, x, y, direction) { argument
38963 classes(group).add(CLS_RESIZER + '-' + element.id);
38964 classes(group).add(CLS_RESIZER + '-' + direction);
38971 x: -HANDLE_SIZE / 2 + offset.x, property
38972 y: -HANDLE_SIZE / 2 + offset.y,
38977 classes(visual).add(CLS_RESIZER + '-visual');
38984 x: -HANDLE_HIT_SIZE / 2 + offset.x, property
38985 y: -HANDLE_HIT_SIZE / 2 + offset.y,
38990 classes(hit).add(CLS_RESIZER + '-hit');
38994 transform(group, x, y);
39002 var resizer = this._createResizer(element, point.x, point.y, direction);
39052 x: 0, property
39056 if (direction.indexOf('e') !== -1) {
39057 offset.x = -HANDLE_OFFSET;
39058 } else if (direction.indexOf('w') !== -1) {
39059 offset.x = HANDLE_OFFSET;
39062 if (direction.indexOf('s') !== -1) {
39063 offset.y = -HANDLE_OFFSET;
39064 } else if (direction.indexOf('n') !== -1) {
39121 // listen to dblclick on non-root elements
39290 x: bbox.x + bbox.width / 2, property
39295 var bounds = { x: bbox.x, y: bbox.y }; property
39319 x: bbox.x - bbox.height / 2 + (15 * zoom), property
39320 y: mid.y - (30 * zoom) / 2
39330 transform: 'rotate(-90deg)'
39361 x: bbox.x property
39383 x: mid.x - width / 2, property
39384 y: bbox.y - paddingTop
39403 x: externalLabelMid.x, property
39414 x: absoluteBBox.x - width / 2, property
39415 y: absoluteBBox.y - height / 2
39462 x: element.x, property
39517 var MARKER_HIDDEN = 'djs-element-hidden',
39518 MARKER_LABEL_HIDDEN = 'djs-label-hidden';
39565 translate$2(gfx, element.x, element.y);
39635 var bo = getBusinessObject(element);
39637 return bo.di.get('stroke') || defaultColor || 'black';
39722 // skip non-existing labels
39755 x: elementMid.x, property
39756 y: elementTrbl.top - ELEMENT_LABEL_DISTANCE - label.height / 2
39764 x: elementTrbl.left - ELEMENT_LABEL_DISTANCE - label.width / 2, property
39773 x: elementMid.x, property
39782 x: elementTrbl.right + ELEMENT_LABEL_DISTANCE + label.width / 2, property
39821 // check whether there is a multi-orientation, e.g. 'top-left'
39822 if (hostOrientation.indexOf('-') >= 0) {
39823 freeAlignments = hostOrientation.split('-');
39830 return freeAlignments.indexOf(alignment) === -1;
39850 return c.waypoints[c.waypoints.length - 2 ];
39892 return takenAlignments.indexOf(alignment) === -1;
39896 if (freeAlignments.indexOf(labelOrientation) !== -1) {
39908 return ALIGNMENTS.indexOf(orientation) !== -1;
39926 x: source.x + source.width / 2 + 75, property
39927 y: source.y - (50) - shape.height / 2
39931 x: source.x + source.width + 80 + shape.width / 2, property
39959 modeling.moveConnection(association, { x: 0, y: 0 }, newParent); property
40076 // remove after connecting to event-based gateway
40092 // remove after replacing connected gateway with event-based gateway
40363 'global-connect.hover',
40364 'global-connect.out',
40365 'global-connect.end',
40366 'global-connect.cleanup'
40467 * BPMN-specific behavior for creating participants.
40544 // re-use process when creating first participant
40568 // re-use process when creating first participant
40579 // re-use process when creating first participant
40593 modeling.moveElements(processChildren, { x: 0, y: 0 }, shape); property
40613 // re-use process when creating first participant
40626 // re-use process when creating first participant
40642 modeling.moveElements(processChildren, { x: 0, y: 0 }, participant);
40669 x: -width / 2,
40670 y: -height / 2,
40680 bottom: childrenBBox.top + shape.height / 2 - VERTICAL_PARTICIPANT_PADDING,
40681 left: childrenBBox.right - shape.width / 2 + HORIZONTAL_PARTICIPANT_PADDING,
40682 top: childrenBBox.bottom - shape.height / 2 + VERTICAL_PARTICIPANT_PADDING,
40683 …right: childrenBBox.left + shape.width / 2 - HORIZONTAL_PARTICIPANT_PADDING - PARTICIPANT_BORDER_W…
40913 // disable auto-resize for data stores
40932 // disable auto-resize for data stores
41014 // update data store parents on collaboration -> process
41116 topAffected, 'y', offset, shape.y - 10);
41121 { x: 0, y: offset }, 's'); property
41126 bottomAffected, 'y', -offset, shape.y + shape.height + 10);
41131 { x: 0, y: -offset }, 'n'); property
41249 return array.indexOf(item) !== -1;
41295 if (!isPointInsideBBox(shape, waypointsBefore[waypointsBefore.length-1])) {
41310 // reconnect source -> inserted shape
41320 // reconnect inserted shape -> end
41366 x: shapeMid.x + delta.x, property
41432 var x = point.x,
41435 return x >= bbox.x &&
41436 x <= bbox.x + bbox.width &&
41450 * Remove existing sequence flows of event-based target before connecting
41451 * from event-based gateway.
41477 * After replacing shape with event-based gateway, remove incoming sequence
41478 * flows of event-based targets which do not belong to event-based gateway
41642 * re-attach removed category
41731 // if the lines intersect, the result contains the x and y of the
41736 denominator = ((l2e.y - l2s.y) * (l1e.x - l1s.x)) - ((l2e.x - l2s.x) * (l1e.y - l1s.y));
41742 a = l1s.y - l2s.y;
41743 b = l1s.x - l2s.x;
41744 numerator = ((l2e.x - l2s.x) * a) - ((l2e.y - l2s.y) * b);
41751 x: Math.round(l1s.x + (c * (l1e.x - l1s.x))),
41752 y: Math.round(l1s.y + (c * (l1e.y - l1s.y)))
41766 x: elementMid.x, property
41767 y: elementMid.y - 50
41771 x: elementMid.x - 50, property
41804 waypoints[waypoints.length - 1],
41805 waypoints[waypoints.length - 2],
41828 return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
41847 var bo = getBusinessObject(event.context.shape);
41849 if (isAny(bo, elementTypesToUpdate) && !bo.di.get('isHorizontal')) {
41852 bo.di.set('isHorizontal', true);
41869 return Math.sqrt(Math.pow(v.x, 2) + Math.pow(v.y, 2));
41881 // return value is between 0, 180 and -180, -0
41883 return Math.atan((line[1].y - line[0].y) / (line[1].x - line[0].x));
41896 x: Math.cos(angle) * vector.x - Math.sin(angle) * vector.y,
41897 y: Math.sin(angle) * vector.x + Math.cos(angle) * vector.y
41915 { n: a[0] - c[0], lambda: b[0] },
41916 { n: a[1] - c[1], lambda: b[1] }
41923 return -n/l;
41939 var bd = { x: b.x - a.x, y: b.y - a.y }; property
41942 var r = solveLambaSystem([ a.x, a.y ], [ bd.x, bd.y ], [ point.x, point.y ]);
41944 return { x: a.x + r*bd.x, y: a.y + r*bd.y };
41961 x: pfPoint.x - point.x, property
41962 y: pfPoint.y - point.y
41979 x: point1.x - point2.x, property
41980 y: point1.y - point2.y
42009 return sqrt(sq(p1.x - p2.x) + sq(p1.y - p2.y));
42022 * position: { x: 10, y: 10 } // the attach point on the line
42029 * position: { x: 10, y: 10 } // the attach point on the line
42053 for (idx = 0; idx < line.length - 1; idx++) {
42070 throw new Error('expected between [1, 2] circle -> line intersections');
42073 // one intersection -> bendpoint attachment
42083 // two intersections -> segment attachment
42119 var baX = s2.x - s1.x;
42120 var baY = s2.y - s1.y;
42121 var caX = cc.x - s1.x;
42122 var caY = cc.y - s1.y;
42126 var c = caX * caX + caY * caY - cr * cr;
42131 var disc = pBy2 * pBy2 - q;
42134 // negative, very close to zero results (-4e-15)
42136 if (disc < 0 && disc > -0.000001) {
42146 var abScalingFactor1 = -pBy2 + tmpSqrt;
42147 var abScalingFactor2 = -pBy2 - tmpSqrt;
42150 x: s1.x - baX * abScalingFactor1, property
42151 y: s1.y - baY * abScalingFactor1
42159 x: s1.x - baX * abScalingFactor2, property
42160 y: s1.y - baY * abScalingFactor2
42172 fenced(p.x, segmentStart.x, segmentEnd.x) &&
42183 n >= min$1(rangeStart, rangeEnd) - EQUAL_THRESHOLD &&
42199 x: (p1.x + p2.x) / 2,
42209 abs$3(p1.x - p2.x) <= EQUAL_THRESHOLD &&
42210 abs$3(p1.y - p2.y) <= EQUAL_THRESHOLD
42218 var offset = newWaypoints.length - oldWaypoints.length;
42254 newIndex = insert ? index + 1 : index - 1;
42263 if (insert && attachment.type !== 'bendpoint' && bendpointIndex-1 === index) {
42286 return (index === oldWaypoints.length - 2) ? newWaypoints.length - 2 : null;
42307 var x = 0,
42318 return { x: x, y: y };
42324 newLabelLineIndex > newWaypoints.length - 2) {
42325 return { x: x, y: y };
42338 var offset = newWaypoints.length - oldWaypoints.length,
42343 if (newWaypoints.indexOf(oldBendpoint) !== -1) {
42344 return { x: x, y: y };
42352 x: newBendpoint.x - attachment.position.x,
42353 y: newBendpoint.y - attachment.position.y
42358 if (offset < 0 && oldBendpointIndex !== 0 && oldBendpointIndex < oldWaypoints.length - 1) {
42364 x: (newLabelLine[1].x - newLabelLine[0].x) * relativeFootPosition + newLabelLine[0].x, property
42365 y: (newLabelLine[1].y - newLabelLine[0].y) * relativeFootPosition + newLabelLine[0].y
42370 x: labelPosition.x - oldFoot.x, property
42371 y: labelPosition.y - oldFoot.y
42375 x = newFoot.x + newLabelVector.x - labelPosition.x;
42376 y = newFoot.y + newLabelVector.y - labelPosition.y;
42379 x: x, property
42389 var distanceSegment1 = getDistancePointPoint(waypoints[idx-1], waypoints[idx]),
42399 x: label.x + label.width / 2,
42407 return a2 - a1;
42437 x: oldDelta.x * (newBounds.width / oldBounds.width), property
42442 x: newCenter.x + newDelta.x, property
42471 x: oldCenterDelta.x * (newBounds.width / oldBounds.width), property
42476 x: newCenter.x + newCenterDelta.x, property
42481 x: newShapeCenter.x + shapeDelta.x - shape.x, property
42482 y: newShapeCenter.y + shapeDelta.y - shape.y
42501 x: 0, property
42502 y: newTRBL.bottom - oldTRBL.bottom
42506 x: 0, property
42507 y: newTRBL.top - oldTRBL.top
42511 x: newTRBL.left - oldTRBL.left, property
42516 x: newTRBL.right - oldTRBL.right, property
42521 // fallback to proportional movement for corner-placed attachments
42526 x: oldShapeCenter.x + stickyPositionDelta.x, property
42592 x: element.x, property
42627 // we don't care about x and y
42682 x: element.x, property
42729 // Cf. https://github.com/bpmn-io/bpmn-js/pull/1227
42752 newShape.label.x = oldShape.label.x;
42844 x: bounds.x, property
42848 x: bounds.x + (bounds.width || 0), property
42854 x: bounds.x + (bounds.width || 0),
42858 x: bounds.x + (bounds.width || 0),
42864 x: bounds.x,
42868 x: bounds.x + (bounds.width || 0),
42874 x: bounds.x,
42878 x: bounds.x,
42914 return waypointsInsideNewBounds[ waypointsInsideNewBounds.length - 1 ];
42925 oldAnchor = waypoints[waypoints.length - 1];
42950 oldAnchor = waypoints[ waypoints.length - 1 ];
42960 x: bounds.x - delta.x,
42961 y: bounds.y - delta.y,
43009 * BPMN-specific message flow behavior.
43090 x: position.x + 5, property
43131 // behaviors plugged-in before)
43222 // monkey-patch selection saved in dragging in order to re-select it when operation is finished
43235 if (index === -1) {
43332 * BPMN-specific replace behavior.
43348 // replace elements on create, e.g. during copy-paste
43536 minTrbl.left = laneTrbl.right - LANE_MIN_DIMENSIONS.width;
43545 if (otherTrbl.top < (laneTrbl.top - 10)) {
43550 if (balanced && abs$2(laneTrbl.top - otherTrbl.bottom) < 10) {
43555 if (abs$2(laneTrbl.top - otherTrbl.top) < 5) {
43556 addMin(minTrbl, 'top', otherTrbl.bottom - LANE_MIN_DIMENSIONS.height);
43567 if (balanced && abs$2(laneTrbl.bottom - otherTrbl.top) < 10) {
43568 addMin(maxTrbl, 'bottom', otherTrbl.bottom - LANE_MIN_DIMENSIONS.height);
43572 if (abs$2(laneTrbl.bottom - otherTrbl.bottom) < 5) {
43588 addMin(minTrbl, 'top', flowElementTrbl.top - LANE_TOP_PADDING);
43600 addMin(minTrbl, 'left', flowElementTrbl.left - LANE_LEFT_PADDING);
43677 // only handle [a] -> [shape] -> [b] patterns
43720 getDocking$1(inWaypoints[inWaypoints.length - 2]),
43721 getDocking$1(inWaypoints[inWaypoints.length - 1]),
43727 inWaypoints.slice(0, inWaypoints.length - 1),
43733 getDocking$1(outWaypoints[outWaypoints.length - 1])
43782 return axis === 'x';
43818 return participant.height - resizedLane.height + LANE_MIN_DIMENSIONS.height;
43886 x: shape.x + shape.width / 6,
43927 newBounds.x = visibleBBox.x + (visibleBBox.width - newBounds.width) / 2;
43928 newBounds.y = visibleBBox.y + (visibleBBox.height - newBounds.height) / 2;
43932 newBounds.x = shape.x + (shape.width - newBounds.width) / 2;
43933 newBounds.y = shape.y + (shape.height - newBounds.height) / 2;
43942 x: shape.x + (shape.width - defaultSize.width) / 2,
43943 y: shape.y + (shape.height - defaultSize.height) / 2,
44220 this.counter--;
44349 var orientation = getOrientation(position, targetBounds, -15);
44645 var bo = getBusinessObject(element);
44647 return !!find(bo.eventDefinitions || [], function(definition) {
44653 var bo = getBusinessObject(element);
44655 return (bo.eventDefinitions || []).every(function(definition) {
44720 return allParents.indexOf(possibleParent) !== -1;
44878 var bo = getBusinessObject(element);
44880 return bo && !(bo.eventDefinitions && bo.eventDefinitions.length);
44914 // only (re-)attach one element at a time
44992 // replace a non-interrupting start event by a blank interrupting start event
45150 // don't connect parent <-> child
45168 // https://github.com/bpmn-io/bpmn-js/issues/1033
45247 return (elements && element) && elements.indexOf(element) !== -1;
45475 { type: 'bpmn:Participant', order: { level: -2 } },
45476 { type: 'bpmn:Lane', order: { level: -1 } }
45532 index: -1
45560 // before being re-inserted
45561 if (insertIndex !== -1) {
45562 if (currentIndex !== -1 && currentIndex < insertIndex) {
45563 insertIndex -= 1;
45587 * A service that offers un- and redoable execution of commands.
45590 * in a un- and redoable manner. To do this it delegates the actual
45594 * {@link CommandHandler#revert(ctx)} methods to un- and redo a command
45598 * ## Life-Cycle events
45600 * In the process the command stack fires a number of life-cycle events
45638 * that may be re- and undone atomically.
45683 this._stackIdx = -1;
45786 this._stackIdx = -1;
46079 this._stackIdx--;
46109 '<div class="djs-tooltip-container" style="position: absolute; width: 0; height: 0;" />'
46118 function setPosition(el, x, y) { argument
46119 assign(el.style, { left: x + 'px', top: y + 'px' });
46127 var tooltipClass = 'djs-tooltip',
46143 * x: 50,
46152 * top: -5,
46153 * left: -5
46182 * Mapping tooltipId -> tooltip
46225 * @param {number} [tooltip.timeout=-1]
46258 var tooltip = this.get(attr$1(node, 'data-tooltip-id'));
46358 …var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d)…
46361 this._tooltipRoot.style['-ms-transform'] = matrix;
46383 …htmlContainer = domify('<div data-tooltip-id="' + id + '" class="' + tooltipClass + '" style="posi…
46388 classes$1(htmlContainer).add('djs-tooltip-' + tooltip.type);
46410 // update overlay html based on tooltip x, y
46412 setPosition(htmlContainer, position.x, position.y);
46464 * This is a null-safe operation that ensures elements
46538 if (!label.hidden && context.shapes.indexOf(label) === -1) {
46647 return elements.indexOf(element.labelTarget) === -1;
46659 var MARKER_ATTACH$1 = 'attach-ok';
46665 * Optionally depends on `diagram-js/lib/features/move` to render
46668 * Optionally depends on `diagram-js/lib/features/label-support`
46713 // add attach-ok marker to current host
46969 return array.indexOf(item) !== -1;
46983 * The tool manager acts as middle-man between the available tool's and the Palette,
47025 eventBus.fire('tool-manager.update', { tool: tool });
47058 // We defer the de-activation of the tool to the .activate phase,
47087 return target && closest(target, '.group[data-group="tools"]');
47108 if (axis === 'x') {
47167 return array.indexOf(item) !== -1;
47174 * @param {number} bounds.x
47180 * @param {number} delta.x
47186 var x = bounds.x,
47190 dx = delta.x,
47196 x: x,
47199 height: height - dy
47203 x: x,
47210 x: x + dx,
47212 width: width - dx,
47217 x: x,
47231 x: 'width', property
47321 x: 0, property
47387 * @param {number} delta.x
47405 var axis = abs$1(event.dx) > abs$1(event.dy) ? 'x' : 'y',
47407 start = event[ axis ] - delta;
47415 delta *= -1;
47420 delta *= -1;
47451 set('resize-' + (axis === 'x' ? 'ew' : 'ns'));
47522 top: trbl.top - PADDING,
47525 left: trbl.left - PADDING
47537 var x, y;
47540 x = Math.max(event.x, spaceToolConstraints.left);
47542 event.dx = event.dx + x - event.x;
47543 event.x = x;
47547 x = Math.min(event.x, spaceToolConstraints.right);
47549 event.dx = event.dx + x - event.x;
47550 event.x = x;
47556 event.dy = event.dy + y - event.y;
47563 event.dy = event.dy + y - event.y;
47603 minOrMax = start -
47621 minOrMax = start -
47641 resizingShape[ AXIS_TO_DIMENSION [ axis ] ] -
47647 resizingShape[ AXIS_TO_DIMENSION [ axis ] ] -
47652 minOrMax = start -
47658 minOrMax = start -
47671 return array.indexOf(item) !== -1;
47682 var MARKER_DRAGGING$1 = 'djs-dragging',
47683 MARKER_RESIZING = 'djs-resizing';
47716 x: 'M 0,-10000 L 0,10000', property
47717 y: 'M -10000,0 L 10000,0'
47721 attr(crosshairGroup, styles.cls('djs-crosshair-group', [ 'no-events' ]));
47727 attr(pathX, 'd', orientation.x);
47728 classes(pathX).add('djs-crosshair');
47735 classes(pathY).add('djs-crosshair');
47746 translate$2(crosshairGroup, event.x, event.y);
47777 classes(line).add('djs-crosshair');
47784 attr(dragGroup, styles.cls('djs-drag-group', [ 'no-events' ]));
47846 attr(frameGroup, styles.cls('djs-frame-group', [ 'no-events' ]));
47870 x: 'M' + event.x + ', -10000 L' + event.x + ', 10000', property
47871 y: 'M -10000, ' + event.y + ' L 10000, ' + event.y
47876 var opposite = { x: 'y', y: 'x' }; property
47877 var delta = { x: event.dx, y: event.dy }; property
47881 translate$2(context.dragGroup, delta.x, delta.y);
47892 width: max(initialBounds.width + delta.x, 5)
47895 width = max(initialBounds.width - delta.x, 5);
47899 x: initialBounds.x + initialBounds.width - width
47908 height = max(initialBounds.height - delta.y, 5);
47912 y: initialBounds.y + initialBounds.height - height
48017 // bpmn:SequenceFlow -> SequenceFlow_ID
48079 return this.create('dc:Point', pick(point, [ 'x', 'y' ]));
48180 * When morphing a Process into a Collaboration or vice-versa,
48424 x: shape.x, property
48570 // unwrap Lane -> LaneSet -> (Lane | FlowElementsContainer)
48782 * A bpmn-aware factory for diagram-js shapes
49037 x: 0, property
49042 delta.x = alignment.left - element.x;
49045 delta.x = (alignment.right - element.width) - element.x;
49048 delta.x = (alignment.center - Math.round(element.width / 2)) - element.x;
49051 delta.y = alignment.top - element.y;
49054 delta.y = (alignment.bottom - element.height) - element.y;
49057 delta.y = (alignment.middle - Math.round(element.height / 2)) - element.y;
49216 // make sure each element has x and y
49218 if (!isNumber(element.x)) {
49219 element.x = 0;
49234 x: round$3(waypoint.x - bbox.x - bbox.width / 2 + position.x),
49235 y: round$3(waypoint.y - bbox.y - bbox.height / 2 + position.y)
49241 x: round$3(element.x - bbox.x - bbox.width / 2 + position.x), property
49242 y: round$3(element.y - bbox.y - bbox.height / 2 + position.y)
49274 if (parents.indexOf(element) === -1) {
49281 pick(element, [ 'x', 'y', 'width', 'height' ]),
49288 pick(element, [ 'x', 'y', 'width', 'height' ]),
49348 x: positionOrBounds.x - round$2(shape.width / 2), property
49349 y: positionOrBounds.y - round$2(shape.height / 2)
49538 * - Remove connections
49539 * - Remove all direct children
49623 x: 'y', property
49624 y: 'x'
49644 return arr.length - 1;
49648 return range.max - range.min;
49654 delta[axis] = refCenter - center(element);
49678 if (idx && idx !== groups.length - 1) {
49716 if (idx && idx !== groups.length - 1) {
49721 spaceInBetween = Math.abs(lastGroup.range.min - firstGroup.range.max);
49723 margin = Math.round((spaceInBetween - groupsSize) / (groups.length - 1));
49725 if (margin < groups.length - 1) {
49737 prevGroup = groups[groupIdx - 1];
49743 delta[axis] = (prevGroup.range.max - element[axis]) + margin;
49746 delta[axis] += element[axis] - group.range.min;
49826 p.x += delta.x;
49830 p.original.x += delta.x;
49857 p.x -= delta.x;
49858 p.y -= delta.y;
49861 p.original.x -= delta.x;
49862 p.original.y -= delta.y;
50035 context.oldBounds = pick(shape, [ 'x', 'y', 'width', 'height']);
50047 x: shape.x + delta.x, property
50095 x: shape.x - delta.x, property
50096 y: shape.y - delta.y
50179 …|| getDocking(isArray$2(dockingOrPoints) ? dockingOrPoints[ dockingOrPoints.length - 1 ] : docking…
50243 * @param {number} context.newData.x
50267 x: newData.x, property
50272 x: oldShape.x, property
50293 modeling.moveElements(children, { x: 0, y: 0 }, newShape, hints);
50375 * x: 5,
50386 if (newBounds.x === undefined || newBounds.y === undefined ||
50388 throw new Error('newBounds must have {x, y, width, height} properties');
50403 x: shape.x, property
50411 x: newBounds.x, property
50452 x: oldBounds.x, property
50531 * 2. Only one of source and target is moved/resized => re-layout connection with moved start/end
50578 // re-layout connection with moved start/end
50623 return 'x';
50627 return 'x';
50642 return array.indexOf(item) !== -1;
50647 x: shape.x,
50705 * Return a map { elementId -> hiddenState}.
51433 * Use respective diagram-js provided handlers if you would
51755 x: shape.x + LANE_INDENTATION, property
51757 width: shape.width - LANE_INDENTATION,
51782 var offset = location === 'top' ? -120 : 120,
51784 spacePos = lanePosition + (location === 'top' ? 10 : -10),
51792 { x: 0, y: offset }, property
51799 x: shape.x + (isRoot ? LANE_INDENTATION : 0), property
51800 y: lanePosition - (location === 'top' ? 120 : 0),
51801 width: shape.width - (isRoot ? LANE_INDENTATION : 0),
51807 * A handler that splits a lane into a number of sub-lanes,
51857 if (idx === newLanesCount - 1) {
51858 laneHeight = shape.height - (newLanesHeight * idx);
51864 x: shape.x + LANE_INDENTATION, property
51866 width: shape.width - LANE_INDENTATION,
51976 spacePos = shape.y + (trblDiff.bottom ? shape.height : 0) + (trblDiff.bottom ? -10 : 10);
51979 offset = trblDiff.top > 0 || trblDiff.bottom < 0 ? -change : change;
51983 …spaceTool.makeSpace(adjustments.movingShapes, adjustments.resizingShapes, { x: 0, y: change }, dir… property
51990 spacePos = shape.x + (trblDiff.right ? shape.width : 0) + (trblDiff.right ? -10 : 100);
51993 offset = trblDiff.left > 0 || trblDiff.right < 0 ? -change : change;
51995 adjustments = spaceTool.calculateAdjustments(allLanes, 'x', offset, spacePos);
51997 …spaceTool.makeSpace(adjustments.movingShapes, adjustments.resizingShapes, { x: change, y: 0 }, dir… property
52032 x: element.x + element.width / 2, property
52036 return elementMid.x > laneTrbl.left &&
52037 elementMid.x < laneTrbl.right &&
52043 if (handledNodes.indexOf(flowNodeShape) === -1) {
52077 if (!root || handledNodes.indexOf(root) !== -1) {
52108 // lane got removed XX-)
52256 'background-color': this._normalizeColor(colors.fill) });
52261 'border-color': this._normalizeColor(colors.stroke) });
52265 var assignedDi = isConnection$3(element) ? pick(di, [ 'border-color' ]) : di;
52283 * Cf. https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-fillstyle
52307 // (2) Return null for non-hex serialization result.
52308 return /^#[0-9a-fA-F]{6}$/.test(context.fillStyle) ? context.fillStyle : null;
52317 * @param {{ 'border-color': string?, 'background-color': string? }} di
52320 if ('border-color' in di) {
52321 di.stroke = di['border-color'];
52324 if ('background-color' in di) {
52325 di.fill = di['background-color'];
52376 x: labelCenter.x, property
52419 // resize element based on label _or_ pre-defined bounds
52679 'h:v': -10,
52680 'v:h': -10
52710 var xmid = round$1((b.x - a.x) / 2 + a.x),
52711 ymid = round$1((b.y - a.y) / 2 + a.y);
52722 segmentEnd = layoutHorizontal ? { x: xmid, y: a.y } : { x: a.x, y: ymid };
52736 x: a.x + MIN_SEGMENT_LENGTH * (/l/.test(startDirection) ? -1 : 1), property
52740 turnNextDirections = xmid === a.x;
52743 x: turnNextDirections ? xmid + MIN_SEGMENT_LENGTH : xmid, property
52744 y: a.y + MIN_SEGMENT_LENGTH * (/t/.test(startDirection) ? -1 : 1)
52750 x: xmid, property
52793 startSegment.waypoints[startSegment.waypoints.length - 1],
52813 var xmid = round$1((b.x - a.x) / 2 + a.x),
52814 ymid = round$1((b.y - a.y) / 2 + a.y);
52818 return [ { x: b.x, y: a.y } ];
52823 return [ { x: a.x, y: b.y } ];
52829 { x: xmid, y: a.y },
52830 { x: xmid, y: b.y }
52837 { x: a.x, y: ymid },
52838 { x: b.x, y: ymid }
52851 * [a]----[x]
52853 * [x]----[b]
52857 * [a]----[x]
52863 * [a]----[x]
52865 * [b]-[x]
52997 preferStraight = preferredLayouts.indexOf('straight') !== -1,
53000 // just layout non-existing or simple connections
53040 x: 'width', property
53072 primaryAxis = 'x';
53089 x: axis.x !== undefined ? axis.x : start.x, property
53092 x: axis.x !== undefined ? axis.x : start.x, property
53097 x: end.x, property
53112 x: start.x, property
53116 x: axis.x !== undefined ? axis.x : end.x, property
53119 x: axis.x !== undefined ? axis.x : end.x, property
53184 var q = points[idx - 1];
53198 return { x: newPeer.x, y: candidate.y };
53202 return { x: candidate.x, y: newPeer.y };
53205 return { x: candidate.x, y: candidate. y };
53211 for (i = points.length - 2; i !== 0; i--) {
53270 * getDirections('top'); // -> 'v:v'
53271 * getDirections('intersect'); // -> 't:t'
53273 * getDirections('top-right', 'v:h'); // -> 'v:h'
53274 * getDirections('top-right', 'h:h'); // -> 'h:h'
53301 // 'top-left'
53302 // 'top-right'
53303 // 'bottom-left'
53304 // 'bottom-right'
53324 'top-left': 'bottom-right',
53325 'bottom-right': 'top-left',
53326 'top-right': 'bottom-left',
53327 'bottom-left': 'top-right',
53345 return { original: point, x: point.x, y: rectangle.y };
53349 return { original: point, x: rectangle.x + rectangle.width, y: point.y };
53353 return { original: point, x: point.x, y: rectangle.y + rectangle.height };
53357 return { original: point, x: rectangle.x, y: point.y };
53371 * [x] ----- [x] ------ [x]
53373 * [x] ----- [x] - [x]
53377 * [x] ---------------- [x]
53379 * [x] ----------- [x]
53388 var previous = points[points.length - 1],
53399 var ATTACH_ORIENTATION_PADDING = -10,
53404 'top-right': 'bottom-left',
53405 'top-left': 'bottom-right',
53408 'bottom-right': 'top-left',
53409 'bottom-left': 'top-right',
53445 connectionEnd = getConnectionDocking(waypoints && waypoints[ waypoints.length - 1 ], target);
53455 return [].concat([ connectionStart ], waypoints.slice(1, -1), [ connectionEnd ]);
53464 // (1) outgoing of boundary events -> layout based on attach orientation and target orientation
53465 // (2) incoming/outgoing of gateways -> v:h for outgoing, h:v for incoming
53535 // (2) docking element connected to expanded sub-process has precedence
53586 return orientations.indexOf(orientation) !== -1;
53610 return b.indexOf(oppositeHorizontalOrientation) !== -1;
53618 return b.indexOf(oppositeVerticalOrientation) !== -1;
53653 x: source.width / 2 + target.width / 2, property
53679 targetLayout = shouldConnectToSameSide('x', source, target, end) ? 'v' : 'l';
53694 x: target.x + target.width, property
53702 return Math.abs(a[ axis ] - b[ axis ]) < threshold;
53712 // attached to either top-right, top-left, bottom-right or bottom-left corner
53762 // attached to either top-right, top-left, bottom-right or bottom-left corner
53828 dockingIdx = dockStart ? 0 : waypoints.length - 1;
53898 x: element.x + round(element.width / 2),
53950 if (shapes.indexOf(shape) === -1) {
53994 delta = { x: event.dx, y: event.dy }, property
53995 position = { x: event.x, y: event.y }, property
54029 delta.x = round(delta.x);
54032 if (delta.x === 0 && delta.y === 0) {
54137 var MARKER_DRAGGING = 'djs-dragging',
54138 MARKER_OK$1 = 'drop-ok',
54139 MARKER_NOT_OK$1 = 'drop-not-ok',
54140 MARKER_NEW_PARENT = 'new-parent',
54141 MARKER_ATTACH = 'attach-ok';
54223 attr(dragGroup, styles.cls('djs-drag-group', [ 'no-events' ]));
54381 var TOGGLE_SELECTOR = '.djs-palette-toggle',
54386 PALETTE_TWO_COLUMN_CLS = 'two-column';
54401 eventBus.on('tool-manager.update', function(event) {
54434 * 'entry-1': {
54583 var entriesContainer = query('.djs-palette-entries', this._container),
54592 var container = query('[data-group=' + grouping + ']', entriesContainer);
54594 container = domify('<div class="group" data-group="' + grouping + '"></div>');
54608 attr$1(control, 'data-action', id);
54646 entry = entries[attr$1(button, 'data-action')];
54733 entriesContainer = query('.djs-palette-entries', this._container);
54735 this._toolsContainer = query('[data-group=tools]', entriesContainer);
54741 var actionName = tool.getAttribute('data-action');
54749 actionName = actionName.replace('-tool', '');
54752 toolClasses.add('highlighted-entry');
54754 toolClasses.remove('highlighted-entry');
54790 '<div class="djs-palette">' +
54791 '<div class="djs-palette-entries"></div>' +
54792 '<div class="djs-palette-toggle"></div>' +
54855 class: 'djs-lasso-overlay',
54858 x: 0,
54870 x: bbox.x, property
55018 x: event.x - event.dx, property
55019 y: event.y - event.dy
55023 x: event.x, property
55029 if ((start.x <= end.x && start.y < end.y) ||
55030 (start.x < end.x && start.y <= end.y)) {
55033 x: start.x, property
55035 width: end.x - start.x,
55036 height: end.y - start.y
55038 } else if ((start.x >= end.x && start.y < end.y) ||
55039 (start.x > end.x && start.y <= end.y)) {
55042 x: end.x, property
55044 width: start.x - end.x,
55045 height: end.y - start.y
55047 } else if ((start.x <= end.x && start.y > end.y) ||
55048 (start.x < end.x && start.y >= end.y)) {
55051 x: start.x, property
55053 width: end.x - start.x,
55054 height: start.y - end.y
55056 } else if ((start.x >= end.x && start.y > end.y) ||
55057 (start.x > end.x && start.y >= end.y)) {
55060 x: end.x, property
55062 width: start.x - end.x,
55063 height: start.y - end.y
55068 x: end.x, property
55249 var MARKER_OK = 'connect-ok',
55250 MARKER_NOT_OK = 'connect-not-ok';
55275 toolManager.registerTool('global-connect', {
55276 tool: 'global-connect',
55277 dragging: 'global-connect.drag'
55280 eventBus.on('global-connect.hover', function(event) {
55297 eventBus.on([ 'global-connect.out', 'global-connect.cleanup' ], function(event) {
55307 eventBus.on([ 'global-connect.ended' ], function(event) {
55311 x: event.x, property
55323 eventBus.fire('global-connect.drag.ended');
55347 this._dragging.init(event, 'global-connect', {
55370 return context && /^global-connect/.test(context.prefix);
55465 x: 0, property
55472 x: 40, property
55489 'hand-tool': {
55491 className: 'bpmn-icon-hand-tool',
55499 'lasso-tool': {
55501 className: 'bpmn-icon-lasso-tool',
55509 'space-tool': {
55511 className: 'bpmn-icon-space-tool',
55519 'global-connect-tool': {
55521 className: 'bpmn-icon-connection-multi',
55529 'tool-separator': {
55533 'create.start-event': createAction(
55534 'bpmn:StartEvent', 'event', 'bpmn-icon-start-event-none',
55537 'create.intermediate-event': createAction(
55538 'bpmn:IntermediateThrowEvent', 'event', 'bpmn-icon-intermediate-event-none',
55541 'create.end-event': createAction(
55542 'bpmn:EndEvent', 'event', 'bpmn-icon-end-event-none',
55545 'create.exclusive-gateway': createAction(
55546 'bpmn:ExclusiveGateway', 'gateway', 'bpmn-icon-gateway-none',
55550 'bpmn:Task', 'activity', 'bpmn-icon-task',
55553 'create.data-object': createAction(
55554 'bpmn:DataObjectReference', 'data-object', 'bpmn-icon-data-object',
55557 'create.data-store': createAction(
55558 'bpmn:DataStoreReference', 'data-store', 'bpmn-icon-data-store',
55561 'create.subprocess-expanded': {
55563 className: 'bpmn-icon-subprocess-expanded',
55570 'create.participant-expanded': {
55572 className: 'bpmn-icon-participant',
55580 'bpmn:Group', 'artifact', 'bpmn-icon-group',
55635 assign(newElement, { x: element.x, y: element.y }); property
55643 var gfx = query('[data-element-id="' + cssEscape(element.id) + '"]', context.dragGroup);
55669 var originalGfx = query('[data-element-id="' + cssEscape(id) + '"]', context.dragGroup);
55727 var AXES = [ 'x', 'y' ];
55802 // un-snap source
55820 } else if (event[ axis ] > target[ axis ] + dimensionForAxis - padding) {
55821 setSnapped(event, axis, target[ axis ] + dimensionForAxis - padding);
55848 orientation = getOrientation(sourceMid, target, -10),
55852 axes.push('x');
55862 if (abs(coordinate - sourceMid[ axis ]) < BOUNDARY_TO_HOST_THRESHOLD) {
55867 newCoordinate = sourceMid[ axis ] - BOUNDARY_TO_HOST_THRESHOLD;
55876 setSnapped(event, 'x', position.x);
55891 return axis === 'x' ? element.width : element.height;
55904 && event[ axis ] < target[ axis ] + getDimensionForAxis(axis, target) - TARGET_CENTER_PADDING;
55961 if (this._snapLocations.indexOf(snapLocation) === -1) {
55980 * top-left, mid, bottom-right and so forth.
56028 * Map<String, Map<(x|y), Array<number>>> mapping snap locations,
56029 * i.e. top-left, bottom-right, center to actual snap values.
56041 snapValues = this._snapValues[snapLocation] = { x: [], y: [] };
56044 if (snapValues.x.indexOf(point.x) === -1) {
56045 snapValues.x.push(point.x);
56048 if (snapValues.y.indexOf(point.y) === -1) {
56163 x: event.x + mid$2(shape).x, property
56169 x: shapeMid.x - shape.width / 2, property
56170 y: shapeMid.y - shape.height / 2
56173 x: shapeMid.x + shape.width / 2, property
56178 x: shapeMid.x - event.x, property
56179 y: shapeMid.y - event.y
56187 snapContext.setSnapOrigin('top-left', {
56188 x: shapeTopLeft.x - event.x, property
56189 y: shapeTopLeft.y - event.y
56192 snapContext.setSnapOrigin('bottom-right', {
56193 x: shapeBottomRight.x - event.x, property
56194 y: shapeBottomRight.y - event.y
56224 var waypoints = snapTarget.waypoints.slice(1, -1);
56237 if (!isNumber(shape.x) || !isNumber(shape.y)) {
56323 …snapContext.setSnapOrigin(connection.id + '-docking', getDockingSnapOrigin(docking, isMove, event)…
56327 var docking = connection.waypoints[connection.waypoints.length - 1];
56331 …snapContext.setSnapOrigin(connection.id + '-docking', getDockingSnapOrigin(docking, isMove, event)…
56337 snapContext.setSnapLocations([ 'top-left', 'bottom-right', 'mid' ]);
56355 snapPoints.add('top-left', topLeft(snapTarget));
56356 snapPoints.add('bottom-right', bottomRight(snapTarget));
56371 snapPoints.add(connection.id + '-docking', docking.original || docking);
56382 var docking = connection.waypoints[ connection.waypoints.length - 1 ];
56384 snapPoints.add(connection.id + '-docking', docking.original || docking);
56418 offset = { x: 0, y: 0 }; property
56424 setSnapped(event, 'y', targetTRBL.top - offset.y);
56426 setSnapped(event, 'y', targetTRBL.bottom - offset.y);
56430 setSnapped(event, 'x', targetTRBL.left - offset.x);
56432 setSnapped(event, 'x', targetTRBL.right - offset.x);
56464 if ((left && left >= event.x) || (right && right <= event.x)) {
56465 setSnapped(event, 'x', event.x);
56474 return array.indexOf(value) !== -1;
56480 x: docking.x - event.x, property
56481 y: docking.y - event.y
56484 x: docking.x,
56532 setSnapped(event, 'x', event.x);
56560 x: snapOrigin.x - event.x, property
56561 y: snapOrigin.y - event.y
56601 x: mid.x, property
56605 if (direction.indexOf('n') !== -1) {
56607 } else if (direction.indexOf('s') !== -1) {
56611 if (direction.indexOf('e') !== -1) {
56612 snapOrigin.x = trbl.right;
56613 } else if (direction.indexOf('w') !== -1) {
56614 snapOrigin.x = trbl.left;
56676 x: isSnapped(event, 'x'), property
56684 x: event.x + snapOrigin.x, property
56689 forEach([ 'x', 'y' ], function(axis) {
56698 originValue: locationSnapping - snapOrigin[axis]
56705 if (snapping.x && snapping.y) {
56711 this.showSnapLine('vertical', snapping.x && snapping.x.value);
56715 forEach([ 'x', 'y' ], function(axis) {
56731 classes(line).add('djs-snap-line');
56743 d: 'M-100000,' + position + ' L+100000,' + position,
56748 d: 'M ' + position + ',-100000 L ' + position + ', +100000',
57014 var bottomScroll = nodeOffset - this._resultsContainer.clientHeight + node.clientHeight;
57082 * SearchProvider.find - provides search function over own elements
57249 bottom: h - offset,
57250 right: w - offset
57297 SearchPad.CONTAINER_SELECTOR = '.djs-search-container';
57298 SearchPad.INPUT_SELECTOR = '.djs-search-input input';
57299 SearchPad.RESULTS_CONTAINER_SELECTOR = '.djs-search-results';
57300 SearchPad.RESULT_SELECTOR = '.djs-search-result';
57301 SearchPad.RESULT_SELECTED_CLASS = 'djs-search-result-selected';
57303 SearchPad.RESULT_ID_ATTRIBUTE = 'data-result-id';
57304 SearchPad.RESULT_HIGHLIGHT_CLASS = 'djs-search-highlight';
57305 SearchPad.OVERLAY_CLASS = 'djs-search-overlay';
57308 '<div class="djs-search-container djs-draggable djs-scrollable">' +
57309 '<div class="djs-search-input">' +
57312 '<div class="djs-search-results"></div>' +
57316 '<div class="djs-search-result"></div>';
57319 '<div class="djs-search-result-primary"></div>';
57322 '<p class="djs-search-result-secondary"></p>';
57391 // exclude non-matched elements
57426 if (i > -1) {
57460 '<?xml version="1.0" encoding="UTF-8"?>' +
57461 '<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
57473 '<dc:Bounds height="36.0" width="36.0" x="173.0" y="102.0"/>' +
57590 // non-modeling components
57629 // - viewer modules
57630 // - interaction modules
57631 // - modeling modules