Lines Matching +full:x +full:- +full:view

2  * Copyright (c) 2006-2012, JGraph Ltd
5 // see https://code.google.com/p/google-caja/issues/detail?can=2&q=&colspec=ID%20Type%20Status%20Pr…
61 + '-' + pad( this.getUTCMonth() + 1 )
62 + '-' + pad( this.getUTCDate() )
82 …tps://stackoverflow.com/questions/36810940/alternative-or-polyfill-for-array-from-on-the-internet-
93 return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
95 var maxSafeInteger = Math.pow(2, 53) - 1;
111 throw new TypeError("Array.from requires an array-like object - not null or undefined");
141 // 17. Repeat, while k < len… (also steps a - h)
188 mxGraph.prototype.pageFormat = (lang === 'en-us' || lang === 'en-ca' || lang === 'es-mx') ?
198 // Matches label positions of mxGraph 1.x
329 var s = this.view.scale;
363 var box = new mxRectangle(me.getGraphX() - 1, me.getGraphY() - 1);
365 mxShape.prototype.svgStrokeTolerance - 1 :
378 if ((mxUtils.intersects(box, new mxRectangle(state.x, state.y - 2, g.width * s, 3)) &&
380 state.x, state.y + g.height - 2, g.width, 3)) ||
381 (mxUtils.intersects(box, new mxRectangle(state.x - 2, state.y, 2, g.height * s)) &&
383 state.x + g.width * s - 2, state.y, 2, g.height * s)))
414 if (((offset.x > 0 || offset.width > 0) && mxUtils.intersects(box, new mxRectangle(
415 current.x + (offset.x - offset.width - 1) * s + ((offset.x == 0) ? current.width : 0),
417 mxUtils.intersects(box, new mxRectangle(current.x, current.y + (offset.y -
418 offset.height - 1) * s + ((offset.y == 0) ? current.height : 0), current.width, 1))))
426 var handle = mxEvent.CUSTOM_HANDLE - handler.customHandles.length + 1;
433 current = this.view.getState(this.model.getParent(current.cell));
467 if (Math.abs(start.point.x - me.getGraphX()) > tol ||
468 Math.abs(start.point.y - me.getGraphY()) > tol)
480 var edgeStyle = this.view.getEdgeStyle(state);
490 …if (!entity || handle == 0 || handle == handler.bends.length - 1 || handle == mxEvent.LABEL_HANDLE)
495 handle == handler.bends.length - 1 || state.visibleTargetState != null)
511 var box = new mxRectangle(start.point.x, start.point.y);
514 if (mxUtils.contains(box, pts[0].x, pts[0].y))
519 else if (mxUtils.contains(box, pts[pts.length - 1].x, pts[pts.length - 1].y))
522 handle = handler.bends.length - 1;
528 ((Math.round(pts[0].x - pts[1].x) == 0 && Math.round(pts[1].x - pts[2].x) == 0) ||
529 (Math.round(pts[0].y - pts[1].y) == 0 && Math.round(pts[1].y - pts[2].y) == 0))));
539 handle = mxUtils.findNearestSegment(state, start.point.x, start.point.y);
544 handle = mxEvent.VIRTUAL_HANDLE - handle;
627 else if (mxUtils.contains(box, pts[0].x, pts[0].y) ||
628 mxUtils.contains(box, pts[pts.length - 1].x, pts[pts.length - 1].y))
635 var tmp = this.view.getEdgeStyle(state);
642 if (idx < pts.length - 1 && idx >= 0)
644 cursor = (Math.round(pts[idx].x - pts[idx + 1].x) == 0) ?
645 'col-resize' : 'row-resize';
653 var box = new mxRectangle(me.getGraphX() - 1, me.getGraphY() - 1);
663 if ((mxUtils.intersects(box, new mxRectangle(state.x - 2, state.y, 2, state.height)) &&
665 new mxRectangle(state.x + state.width - 2, state.y, 2, state.height)))
667 cursor ='col-resize';
669 … else if ((mxUtils.intersects(box, new mxRectangle(state.x, state.y - 2, state.width, 3)) &&
671 new mxRectangle(state.x, state.y + state.height - 2, state.width, 3)))
673 cursor ='row-resize';
687 var s = this.view.scale;
689 if ((offset.x > 0 || offset.width > 0) && mxUtils.intersects(box, new mxRectangle(
690 … current.x + (offset.x - offset.width - 1) * s + ((offset.x == 0) ? current.width * s : 0),
693 cursor ='col-resize';
696 …current.x, current.y + (offset.y - offset.height - 1) * s + ((offset.y == 0) ? current.height : 0),
699 cursor ='row-resize';
703 current = this.view.getState(this.model.getParent(current.cell));
732 if (state.view.graph.isHtmlLabel(state.cell))
740 result = state.view.graph.sanitizeHtml(result);
768 // Disables built-in connection starts
797 var t = this.graph.view.translate;
798 var s = this.graph.view.scale;
804 guides.push(new mxRectangle(((layout.x + i) * pw + t.x) * s,
810 guides.push(new mxRectangle((layout.x * pw + t.x) * s,
875 this.graphHandler.start = function(cell, x, y, cells) argument
915 // Timer-based activation of outline connect in connection handler
933 timeOnTarget = new Date().getTime() - startTime;
996 // Handles links if graph is read-only or cell is locked
1104 …var cells = this.getCells(rect.x, rect.y, rect.width, rect.height, null, null, isect, function(sta…
1186 rubberband.start(pt.x, pt.y);
1212 var graph = state.view.graph;
1275 Graph.translateDiagram = urlParams['translate-diagram'] == '1';
1280 Graph.diagramLanguage = (urlParams['diagram-language'] != null) ? urlParams['diagram-language'] : m…
1315 Graph.foreignObjectWarningLink = 'https://www.diagrams.net/doc/faq/svg-export-text-problems';
1320 Graph.xmlDeclaration = '<?xml version="1.0" encoding="UTF-8"?>';
1325 Graph.svgDoctype = '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ' +
1331 Graph.svgFileComment = '<!-- Do not edit this file with editors other than diagrams.net -->'
1345 * Creates a temporary graph instance for rendering off-screen content.
1446 return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) {
1457 return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)
1504 var c0 = str.charCodeAt(0), j = 1, p = -1;
1516 for (var i = p + 1; p > -1 && i < uint8Array.byteLength && i < p + str.length - 1; i++)
1526 return j == str.length - 1? p : -1;
1579 'all ' + delay + 'ms ease-in-out');
1647 // Uses https://code.google.com/p/google-caja/wiki/JsHtmlSanitizer
1649 // data URIs for images, mailto and special data:-links.
1708 // LATER Add workaround for non-default NS declarations with empty URI not allowed in IE11
1744 if (w != null && w.charAt(w.length - 1) != '%')
1753 if (h != null && h.charAt(h.length - 1) != '%')
1779 div.getElementsByTagName('svg')[0].setAttribute('viewBox', size.x +
1819 if (text.charAt(text.length - 1) == '\'')
1821 text = text.substring(0, text.length - 1);
1829 if (text.charAt(text.length - 1) == '"')
1831 text = text.substring(0, text.length - 1);
1849 removeLink.style.marginBottom = '-1px';
1868 * See https://stackoverflow.com/questions/5717093/check-if-a-javascript-string-is-a-url
1879 '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|'+ // domain name
1881 '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*'+ // port and path
1882 '(\\?[;&a-z\\d%_.~+=-]*)?'+ // query string
1883 '(\\#[-a-z\\d_]*)?$','i'); // fragment locator
1919 * Scrollbars are enabled on non-touch devices (not including Firefox because touch events
1963 * enough to reduce the number of repaints that is caused for auto-
2002 Graph.prototype.absoluteUrlPattern = new RegExp('^(?:[a-z]+:)?//', 'i');
2028 * Defines the built-in properties to be ignored in tooltips.
2057 var tol = state.view.graph.tolerance;
2070 Math.abs(first.x - mxEvent.getClientX(evt)) < tol &&
2071 Math.abs(first.y - mxEvent.getClientY(evt)) < tol;
2084 state.view.graph.labelLinkClicked(state, elt, evt);
2147 * in read-only as there are fewer issues with the mxCellState not being scaled
2151 * - Apply CSS transforms to HTML labels in IE11
2194 var state = this.view.getState(cells[i]);
2359 * https://devhost.jgraph.com/git/drawio/etc/embed/sf-math-fo-clipping.html?dev=1
2372 Graph.prototype.getCellAt = function(x, y, parent, vertices, edges, ignoreFn) argument
2376 x = x / this.currentScale - this.currentTranslate.x;
2377 y = y / this.currentScale - this.currentTranslate.y;
2388 Graph.prototype.getScaledCellAt = function(x, y, parent, vertices, edges, ignoreFn) argument
2407 for (var i = childCount - 1; i >= 0; i--)
2410 var result = this.getScaledCellAt(x, y, cell, vertices, edges, ignoreFn);
2419 var state = this.view.getState(cell);
2421 if (state != null && (ignoreFn == null || !ignoreFn(state, x, y)) &&
2422 this.intersects(state, x, y))
2524 r = new mxRectangle((r.x + 2 * t.x) * s - t.x,
2525 (r.y + 2 * t.y) * s - t.y,
2535 * Updates the highlight after a change of the model or view.
2564 (b.x + t.x) * s, (b.y + t.y) * s,
2590 * Overrides validate to normalize validation view state and pass
2599 this.graph.currentTranslate.x = this.translate.x;
2603 this.translate.x = 0;
2614 this.translate.x = this.graph.currentTranslate.x;
2671 var temp = this.view.getDrawPane();
2687 var dx = Math.round(this.currentTranslate.x * 100) / 100;
2726 var useCssTranforms = this.useCssTransforms, scale = this.view.scale,
2727 translate = this.view.translate;
2731 this.view.scale = 1;
2732 this.view.translate = new mxPoint(0, 0);
2740 this.view.scale = scale;
2741 this.view.translate = translate;
3050 var state = this.view.getState(cells[i]);
3084 var state = this.view.getState(cells[i]);
3126 f = 1 - f;
3133 if (dist <= segs[i - 1])
3135 pts2.push(new mxPoint(pts[i - 1].x + (pts[i].x - pts[i - 1].x) * dist / segs[i - 1],
3136 pts[i - 1].y + (pts[i].y - pts[i - 1].y) * dist / segs[i - 1]));
3142 dist -= segs[i - 1];
3195 f = 1 - f;
3198 state.shape.bounds = new mxRectangle(bds.x, bds.y, bds.width * f, bds.height);
3282 * background pages, where x and y are the position of the top,
3297 var x0 = Math.floor(Math.ceil(bounds.x / this.view.scale -
3298 this.view.translate.x) / size.width);
3299 var y0 = Math.floor(Math.ceil(bounds.y / this.view.scale -
3300 this.view.translate.y) / size.height);
3301 var w0 = Math.ceil((Math.floor((bounds.x + bounds.width) / this.view.scale) -
3302 this.view.translate.x) / size.width) - x0;
3303 var h0 = Math.ceil((Math.floor((bounds.y + bounds.height) / this.view.scale) -
3304 this.view.translate.y) / size.height) - y0;
3332 this.view.invalidate(cell, false, false);
3339 this.view.validate();
3465 * Returns the first non-null link for the cell or its ancestors.
3469 * cell - <mxCell> whose link should be returned.
3509 var fmt = name.substring(5, name.length - 1);
3517 * Formats a date, see http://blog.stevenlevithan.com/archives/date-time-format
3545 isoDate: "yyyy-mm-dd",
3547 isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
3548 isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
3555 …ain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
3556 timezoneClip = /[^-+\dA-Z]/g,
3618 … o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
3619 S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
3624 return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
3696 inp.style.top = '-2px';
3755 if (match.index > last && str.charAt(match.index - 1) == '%')
3761 var name = val.substring(1, val.length - 1);
3857 hoverIcons.update(hoverIcons.getState(this.view.getState(cells[1])));
3912 new mxPoint(source.parent.geometry.width * source.geometry.x,
3914 new mxPoint(composite.geometry.x, composite.geometry.y);
3918 pt.x += composite.geometry.width / 2;
3919 pt.y -= length ;
3923 pt.x += composite.geometry.width / 2;
3928 pt.x -= length;
3933 pt.x += composite.geometry.width + length;
3937 var parentState = this.view.getState(this.model.getParent(source));
3938 var s = this.view.scale;
3939 var t = this.view.translate;
3940 var dx = t.x * s;
3945 dx = parentState.x;
3952 pt.x += source.parent.geometry.x;
3957 var rect = (!ignoreCellAt) ? new mxRectangle(dx + pt.x * s, dy + pt.y * s).grow(40 * s) : null;
3959 var sourceState = this.view.getState(source);
3982 var targetState = this.view.getState(tempCells[i]);
3999 pt.y -= source.geometry.height / 2;
4007 pt.x -= source.geometry.width / 2;
4011 pt.x += source.geometry.width / 2;
4046 pt.y -= geo.height / 2;
4054 pt.x -= geo.width / 2;
4058 pt.x += geo.width / 2;
4062 geo.x = pt.x - geo.width / 2;
4063 geo.y = pt.y - geo.height / 2;
4147 createTarget(dx + pt.x * s, dy + pt.y * s, execute);
4180 label = mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g, ' '));
4372 var state = this.view.getState(cells[i]);
4377 var dx = Math.round(geo.width - state.width / this.view.scale);
4378 var dy = Math.round(geo.height - state.height / this.view.scale);
4424 var cells = this.getCellsBeyond(state.x, state.y, parent, true, true);
4430 var tmp = this.view.getState(cells[i]);
4436 geo.translate(Math.round(dx * Math.max(0, Math.min(1, (tmp.x - state.x) / state.width))),
4437 Math.round(dy * Math.max(0, Math.min(1, (tmp.y - state.y) / state.height))));
4466 var pstate = this.view.getState(parent);
4474 pgeo.width += dx + Math.min(0, pstate.width / this.view.scale - pgeo.width);
4478 pgeo.height += dy + Math.min(0, pstate.height / this.view.scale - pgeo.height);
4496 * Disables drill-down for non-swimlanes.
4543 * parent - Optional <mxCell> whose children should be selected.
4566 * vertices - Boolean indicating if vertices should be selected.
4567 * edges - Boolean indicating if edges should be selected.
4568 * parent - Optional <mxCell> that acts as the root of the recursion.
4584 * Returns the bottom-most swimlane that intersects the given point (x, y)
4589 * x - X-coordinate of the location to be checked.
4590 * y - Y-coordinate of the location to be checked.
4591 * parent - <mxCell> that should be used as the root of the recursion.
4594 Graph.prototype.getSwimlaneAt = function (x, y, parent) argument
4607 * Disables folding for non-swimlanes.
4640 * Overridden to limit zoom to 1% - 16.000%.
4644 factor = Math.max(0.01, Math.min(this.view.scale * factor, 160)) / this.view.scale;
4657 if (this.view.scale < 0.15)
4659 this.zoom((this.view.scale + 0.01) / this.view.scale);
4665 this.zoom((Math.round(this.view.scale * this.zoomFactor * 20) / 20) / this.view.scale);
4677 if (this.view.scale <= 0.15)
4679 this.zoom((this.view.scale - 0.01) / this.view.scale);
4685 this.zoom((Math.round(this.view.scale * (1 / this.zoomFactor) * 20) / 20) / this.view.scale);
4698 var cw = this.container.clientWidth - border;
4699 var ch = this.container.clientHeight - border;
4705 var t = this.view.translate;
4706 this.container.scrollTop = (bounds.y + t.y) * scale -
4707 Math.max((ch - bounds.height * scale) / 2 + border / 2, 0);
4708 this.container.scrollLeft = (bounds.x + t.x) * scale -
4709 Math.max((cw - bounds.width * scale) / 2 + border / 2, 0);
4769 return -1;
4792 tip = tip.substring(0, tip.length - 1);
4796 tip = '<div style="max-width:360px;text-overflow:ellipsis;overflow:hidden;">' +
4817 'geEditorFlowAnimation-' + Editor.guid());
4835 'animation-iteration-count: infinite;\n' +
4839 'stroke-dashoffset: ' + (this.view.scale * -16) + ';\n' +
4954 HoverIcons.prototype.triangleUp = (!mxClient.IS_SVG) ? new mxImage(IMAGE_PATH + '/triangle-up.png',…
4961 HoverIcons.prototype.triangleRight = (!mxClient.IS_SVG) ? new mxImage(IMAGE_PATH + '/triangle-right…
4968 HoverIcons.prototype.triangleDown = (!mxClient.IS_SVG) ? new mxImage(IMAGE_PATH + '/triangle-down.p…
4975 HoverIcons.prototype.triangleLeft = (!mxClient.IS_SVG) ? new mxImage(IMAGE_PATH + '/triangle-left.p…
4982 HoverIcons.prototype.roundDrop = (!mxClient.IS_SVG) ? new mxImage(IMAGE_PATH + '/round-drop.png', 2…
5021 this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE, this.repaintHandler);
5022 this.graph.view.addListener(mxEvent.TRANSLATE, this.repaintHandler);
5023 this.graph.view.addListener(mxEvent.SCALE, this.repaintHandler);
5024 this.graph.view.addListener(mxEvent.DOWN, this.repaintHandler);
5025 this.graph.view.addListener(mxEvent.UP, this.repaintHandler);
5046 // Resets current state when in-place editor starts
5134 this.update(this.getState(this.graph.view.getState(
5194 this.drag(evt, this.mouseDownPoint.x, this.mouseDownPoint.y);
5326 HoverIcons.prototype.drag = function(evt, x, y) argument
5334 this.graph.connectionHandler.start(this.currentState, x, y);
5362 HoverIcons.prototype.getStateAt = function(state, x, y) argument
5364 return this.graph.view.getState(this.graph.getCellAt(x, y));
5373 var x = me.getGraphX();
5376 var tmp = this.getStateAt(state, x, y);
5465 bds.x -= handler.horizontalOffset / 2;
5466 bds.y -= handler.verticalOffset / 2;
5481 var positionArrow = mxUtils.bind(this, function(arrow, x, y) argument
5485 var bbox = new mxRectangle(x, y, arrow.clientWidth, arrow.clientHeight);
5491 y -= bbox.y + bbox.height - rotationBbox.y;
5495 x += rotationBbox.x + rotationBbox.width - bbox.x;
5499 y += rotationBbox.y + rotationBbox.height - bbox.y;
5503 x -= bbox.x + bbox.width - rotationBbox.x;
5508 arrow.style.left = x + 'px';
5514 Math.round(this.currentState.getCenterX() - this.triangleUp.width / 2 - this.tolerance),
5515 Math.round(bds.y - this.triangleUp.height - this.tolerance));
5517 positionArrow(this.arrowRight, Math.round(bds.x + bds.width - this.tolerance),
5518 Math.round(this.currentState.getCenterY() - this.triangleRight.height / 2 - this.tolerance));
5521 Math.round(bds.y + bds.height - this.tolerance));
5523 positionArrow(this.arrowLeft, Math.round(bds.x - this.triangleLeft.width - this.tolerance),
5528 var right = this.graph.getCellAt(bds.x + bds.width +
5530 …var left = this.graph.getCellAt(bds.x - this.triangleLeft.width / 2, this.currentState.getCenterY(…
5531 …var top = this.graph.getCellAt(this.currentState.getCenterX(), bds.y - this.triangleUp.height / 2)…
5668 state = this.graph.view.getState(cell);
5683 HoverIcons.prototype.update = function(state, x, y) argument
5721 this.update(state, x, y);
5728 timeOnTarget = new Date().getTime() - this.startTime;
5734 this.bbox != null && !mxUtils.contains(this.bbox, x, y))
5741 this.bbox == null || x == null || y == null || !mxUtils.contains(this.bbox, x, y)))
5794 geo.x += i * dx;
5894 colCount, w, 0), rowCount - 1, 0, h);
5974 if (index < rows.length - 1)
5983 geo.height -= dy;
5998 extend = row == rows[rows.length - 1];
6033 var lastColumn = index == cells.length - 1;
6062 if (index < cells.length - 1)
6070 geo.x += dx;
6074 geo.width -= dx;
6078 geo.alternateBounds.width -= dx;
6181 var rw = width - off.x - off.width;
6183 var x = off.x;
6191 x += (cell.alternateBounds != null ?
6194 result.push(Math.round(x));
6212 var x = off.x;
6218 positions.splice(0, 0, off.x);
6230 cell.height = height - off.y - off.height;
6234 cell.x = positions[i];
6235 cell.width = positions[i + 1] - cell.x;
6238 if (i == cells.length - 1 && i < positions.length - 2)
6240 cell.width = tw - cell.x - off.x - off.width;
6245 cell.x = x;
6246 x += cell.width;
6248 if (i == cells.length - 1)
6250 cell.width = tw - off.x - off.width - sw;
6273 upper.rowspan--;
6283 last.colspan--;
6338 var th = table.height - offset.y - offset.height;
6339 var tw = table.width - offset.x - offset.width;
6347 var row = this.graph.getCellGeometry(rows[rows.length - 1]);
6352 row.height = th - sh + row.height;
6353 model.setGeometry(rows[rows.length - 1], row);
6369 row.x = offset.x;
6382 row.height = Math.round(y) - row.y;
6400 table.width = sw + offset.width + offset.x + Graph.minTableColumnWidth;
6465 this.state.view.graph.enableFlowAnimation &&
6466 this.state.view.graph.model.isEdge(this.state.cell) &&
6475 paths[1].setAttribute('stroke-dasharray', (this.state.view.scale * 8));
6478 var anim = this.state.view.graph.getFlowAnimationStyle();
6535 function addPoint(type, x, y) argument
6537 var rpt = new mxPoint(x, y);
6541 var curr = (state.routedPoints != null) ? state.routedPoints[actual.length - 1] : null;
6543 return curr == null || curr.type != type || curr.x != x || curr.y != y;
6546 for (var i = 0; i < pts.length - 1; i++)
6555 while (i < pts.length - 2 &&
6556 mxUtils.ptSegDistSq(p0.x, p0.y, pn.x, pn.y,
6557 p1.x, p1.y) < 1 * this.scale * this.scale)
6564 changed = addPoint(0, p0.x, p0.y) || changed;
6575 for (var j = 0; j < pts2.length - 1; j++)
6583 while (j < pts2.length - 2 &&
6584 mxUtils.ptSegDistSq(p2.x, p2.y, pn.x, pn.y,
6585 p3.x, p3.y) < 1 * this.scale * this.scale)
6592 var pt = mxUtils.intersection(p0.x, p0.y, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y);
6595 if (pt != null && (Math.abs(pt.x - p0.x) > thresh ||
6596 Math.abs(pt.y - p0.y) > thresh) &&
6597 (Math.abs(pt.x - p1.x) > thresh ||
6598 Math.abs(pt.y - p1.y) > thresh) &&
6599 (Math.abs(pt.x - p2.x) > thresh ||
6600 Math.abs(pt.y - p2.y) > thresh) &&
6601 (Math.abs(pt.x - p3.x) > thresh ||
6602 Math.abs(pt.y - p3.y) > thresh))
6604 var dx = pt.x - p0.x;
6605 var dy = pt.y - p0.y;
6606 var temp = {distSq: dx * dx + dy * dy, x: pt.x, y: pt.y}; property
6622 list[list.length - 1].x !== temp.x ||
6623 list[list.length - 1].y !== temp.y))
6635 changed = addPoint(1, list[j].x, list[j].y) || changed;
6639 var pt = pts[pts.length - 1];
6640 changed = addPoint(0, pt.x, pt.y) || changed;
6673 Graph.defaultJumpSize)) - 2) / 2 + this.strokewidth;
6685 var pt = new mxPoint(rpt.x / this.scale, rpt.y / this.scale);
6687 // Takes first and last point from passed-in array
6692 else if (i == this.state.routedPoints.length - 1)
6694 pt = absPts[absPts.length - 1];
6704 var dx = next.x / this.scale - pt.x;
6705 var dy = next.y / this.scale - pt.y;
6710 n = new mxPoint(pt.x - last.x, pt.y - last.y);
6711 len = Math.sqrt(n.x * n.x + n.y * n.y);
6715 n.x = n.x * size / len;
6726 var dx = last.x - pt.x;
6727 var dy = last.y - pt.y;
6732 var p0 = new mxPoint(pt.x - n.x, pt.y - n.y);
6733 var p1 = new mxPoint(pt.x + n.x, pt.y + n.y);
6738 var f = (Math.round(n.x) < 0 || (Math.round(n.x) == 0
6739 && Math.round(n.y) <= 0)) ? 1 : -1;
6744 c.lineTo(p0.x - n.y * f, p0.y + n.x * f);
6745 c.lineTo(p1.x - n.y * f, p1.y + n.x * f);
6746 c.lineTo(p1.x, p1.y);
6750 c.moveTo(p0.x + n.y * f, p0.y - n.x * f);
6751 c.lineTo(p0.x - n.y * f, p0.y + n.x * f);
6752 c.moveTo(p1.x - n.y * f, p1.y + n.x * f);
6753 c.lineTo(p1.x + n.y * f, p1.y - n.x * f);
6754 c.moveTo(p1.x, p1.y);
6759 c.curveTo(p0.x - n.y * f, p0.y + n.x * f,
6760 p1.x - n.y * f, p1.y + n.x * f,
6761 p1.x, p1.y);
6765 c.moveTo(p1.x, p1.y);
6828 var cos = Math.cos(-alpha);
6829 var sin = Math.sin(-alpha);
6870 var tmp = (cp.x - pt.x) * (cp.x - pt.x) + (cp.y - pt.y) * (cp.y - pt.y);
6902 result = shape.state.view.graph.replacePlaceholders(shape.state.cell, result);
6927 var stencil = shape.substring(8, shape.length - 1);
7006 if (fname.toLowerCase().substring(fname.length - 4, fname.length) == '.xml')
7010 else if (fname.toLowerCase().substring(fname.length - 3, fname.length) == '.js')
7047 // Replaces '_-_' with '_'
7048 basename = basename.replace('_-_', '_');
7073 for (var i = 2; i < parts.length - 1; i++)
7246 // Enables snapping to off-grid terminals for edge waypoints
7258 // Alt-move disables guides
7306 var state = new mxCellState(this.graph.view, edge, this.graph.getCellStyle(edge));
7598 this.moveCells(cells, dx - bounds.x, dy - bounds.y);
7615 * @param {number} dx X-coordinate of the translation.
7616 * @param {number} dy Y-coordinate of the translation.
7640 var state = this.view.getState(cells[i]);
7651 geo.x = state.x / state.view.scale - state.view.translate.x;
7652 geo.y = state.y / state.view.scale - state.view.translate.y;
7706 Graph.prototype.splitEdge = function(edge, cells, newEdge, dx, dy, x, y, parent) argument
7714 parent = this.getCellAt(x, y, null, true, false);
7723 var newEdge = graphSplitEdge.apply(this, [edge, cells, newEdge, dx, dy, x, y, parent]);
7729 // LATER: Split and reposition labels based on x and y
7736 if (geo != null && geo.relative && geo.x > 0)
7748 if (geo != null && geo.relative && geo.x <= 0)
7806 if (this.view.getState(temp) != null &&
7814 index = cells.length - 1;
7836 index = mxUtils.mod(index + ((isNext) ? 1 : -1), cells.length)
7857 var targetState = this.view.getState(target);
7858 var sourceState = this.view.getState(cells[0]);
7871 ng2.x = ng1.x;
7873 ng1.x = g2.x;
7959 table.height -= row.height;
7981 var count = cols.length - sourceCols.length;
7987 var col = this.cloneCell(sourceCols[sourceCols.length - 1]);
7999 for (var j = 0; j > count; j--)
8001 this.model.remove(sourceCols[sourceCols.length + j - 1]);
8179 // Requires an array of arrays with x, y (0..1), an optional
8180 // [perimeter (0 or 1), dx, and dy] eg. points=[[0,0,1,-10,10],[0,1,0],[1,1]]
8253 * Disables drill-down for non-swimlanes.
8257 // Counts non-relative children
8280 * Disables drill-down for non-swimlanes.
8402 var edgeState = this.view.getState(cell);
8403 var sourceState = this.view.getState(src);
8404 var targetState = this.view.getState(trg);
8435 geo.x += geo.width / 2 - geo.height / 2;
8436 geo.y += geo.height / 2 - geo.width / 2;
8444 var state = this.view.getState(cell);
8454 ((backwards) ? -1 : 1), dirs.length)], [cell]);
8518 var state = this.view.getState(cell);
8522 this.view.invalidate(cell);
8549 var state = this.view.getState(desc[i]);
8558 this.view.invalidate(desc[i], false, false);
8718 var state = this.view.getState(parents[i]);
8757 this.view.getState(cells[i])))
8925 var state = (this.model.isEdge(cell)) ? this.view.getState(cell) : null;
8931 pt.x, pt.y) && !mxUtils.isAncestorNode(state.text.node, mxEvent.getSource(evt))))) &&
8935 (mxClient.IS_SVG && src == this.view.getCanvas().ownerSVGElement)))
8939 state = this.view.getState(this.getCellAt(pt.x, pt.y));
8942 cell = this.addText(pt.x, pt.y, state);
8955 var dx = this.container.scrollLeft / this.view.scale - this.view.translate.x;
8956 var dy = this.container.scrollTop / this.view.scale - this.view.translate.y;
8962 dx = Math.max(dx, layout.x * page.width);
8974 var view = this.view;
8978 // Places at same x-coord and 2 grid sizes below existing graph
8979 var x = this.snap(Math.round(Math.max(pt.x, bds.x / view.scale - view.translate.x +
8981 … var y = this.snap(Math.round(Math.max(pt.y, (bds.y + bds.height) / view.scale - view.translate.y +
8984 return new mxPoint(x, y);
8998 this.view.scale - this.view.translate.x - bbox.width / 2)),
9000 this.view.scale - this.view.translate.y - bbox.height / 2)));
9005 this.snap(Math.round(this.container.clientWidth / 2 / this.view.scale -
9006 this.view.translate.x - bbox.width / 2)),
9007 this.snap(Math.round(this.container.clientHeight / 2 / this.view.scale -
9008 this.view.translate.y - bbox.height / 2)));
9026 Graph.prototype.addText = function(x, y, state) argument
9042 var pt2 = this.view.getRelativePoint(state, x, y);
9043 label.geometry.x = Math.round(pt2.x * 10000) / 10000;
9048 pt2 = this.view.getPoint(state, label.geometry);
9050 var scale = this.view.scale;
9051 …label.geometry.offset = new mxPoint(Math.round((x - pt2.x) / scale), Math.round((y - pt2.y) / scal…
9055 var tr = this.view.translate;
9059 label.geometry.x = Math.round(x / this.view.scale) -
9060 tr.x - ((state != null) ? state.origin.x : 0);
9061 label.geometry.y = Math.round(y / this.view.scale) -
9062 tr.y - ((state != null) ? state.origin.y : 0);
9088 // Replaces links in labels for consistent right-clicks
9138 … var cell = graph.getCellAt(me.getGraphX(), me.getGraphY(), null, null, null, function(state, x, y) argument
9143 … tmp = (tmp != null && !graph.model.isAncestor(cell, tmp.cell)) ? null : graph.view.getState(cell);
9181 var dx = Math.abs(this.startX - me.getGraphX());
9182 var dy = Math.abs(this.startY - me.getGraphY());
9236 (((Math.abs(this.scrollLeft - graph.container.scrollLeft) < tol &&
9237 Math.abs(this.scrollTop - graph.container.scrollTop) < tol) &&
9263 (Math.abs(this.scrollLeft - graph.container.scrollLeft) < tol &&
9264 Math.abs(this.scrollTop - graph.container.scrollTop) < tol) &&
9265 (Math.abs(this.startX - me.getGraphX()) < tol &&
9266 Math.abs(this.startY - me.getGraphY()) < tol))
9312 // Ignores built-in click handling
9431 for (var i = newImages.length - 1; i >= 0; i--)
9433 if (i == 0 || newImages[i] != oldImages[i - 1])
9479 for (var i = newLinks.length - 1; i >= 0; i--)
9481 if (newLinks[i] != oldLinks[i - 1])
9535 * horizontal - Boolean that specifies the direction of the distribution.
9536 * cells - Optional array of <mxCells> to be distributed. Edges are ignored.
9555 var state = this.view.getState(cells[i]);
9572 return (horizontal) ? a.x - b.x : a.y - b.y;
9575 var t = this.view.translate;
9576 var s = this.view.scale;
9578 min = min / s - ((horizontal) ? t.x : t.y);
9579 max = max / s - ((horizontal) ? t.x : t.y);
9584 var dt = (max - min) / (vertices.length - 1);
9587 for (var i = 1; i < vertices.length - 1; i++)
9589 var pstate = this.view.getState(this.model.getParent(vertices[i].cell));
9599 geo.x = Math.round(t0 - geo.width / 2) - pstate.origin.x;
9603 geo.y = Math.round(t0 - geo.height / 2) - pstate.origin.y;
9621 * Adds meta-drag an Mac.
9633 * @param {number} dx X-coordinate of the translation.
9634 * @param {number} dy Y-coordinate of the translation.
9676 * @param {number} dx X-coordinate of the translation.
9677 * @param {number} dy Y-coordinate of the translation.
9701 this.view.revalidate();
9714 var bounds = (exportType == 'page') ? this.view.getBackgroundPageBounds() :
9718 var vs = this.view.scale;
9724 (this.view.translate.x + this.backgroundImage.x) * vs,
9725 (this.view.translate.y + this.backgroundImage.y) * vs,
9748 root.setAttribute('style', 'background-color:' + background);
9759 // KNOWN: Ignored in IE9-11, adds namespace for each image element instead. No workaround.
9772 root.setAttribute('viewBox', ((crisp) ? '-0.5 -0.5' : '0 0') + ' ' + w + ' ' + h);
9782 svgCanvas.foOffset = (crisp) ? -0.5 : 0;
9783 svgCanvas.textOffset = (crisp) ? -0.5 : 0;
9784 svgCanvas.imageOffset = (crisp) ? -0.5 : 0;
9785 svgCanvas.translate(Math.floor(border / scale - bounds.x / vs),
9786 Math.floor(border / scale - bounds.y / vs));
9793 svgCanvas.getAlternateText = function(fo, x, y, w, h, str, argument
9842 if (result.length < str.length && str.length - result.length > 1)
9866 var tr = this.view.translate;
9867 var tmp = new mxRectangle((bgImg.x + tr.x) * s2, (bgImg.y + tr.y) * s2,
9873 svgCanvas.image(bgImg.x + tr.x, bgImg.y + tr.y,
9891 return (result != null && !state.view.graph.isCustomLink(result)) ? result : null;
9896 return state.view.graph.getLinkTargetForCell(state.cell);
9902 var graph = state.view.graph;
9933 this.view.revalidate();
9944 if (urlParams['svg-warning'] != '0' && root.getElementsByTagName('foreignObject').length > 0)
9950 a.setAttribute('transform', 'translate(0,-5)');
9966 text.setAttribute('text-anchor', 'middle');
9967 text.setAttribute('font-size', '10px');
9968 text.setAttribute('x', '50%');
10127 // IE9 and non-IE
10176 table.height -= row.height;
10242 index = model.getChildCells(cell, true).length - 1;
10319 lane = lanes[lanes.length - 1];
10349 lane = lanes[(before) ? 0 : lanes.length - 1];
10392 row = rows[(before) ? 0 : rows.length - 1];
10481 var index = cells.length - 1;
10508 tableGeo.width -= width;
10555 row = rows[rows.length - 1];
10573 tableGeo.height -= height;
10605 mxUtils.br(row.insertCell(-1));
10645 return bd.rows[0].cells[(index >= 0) ? index : bd.rows[0].cells.length - 1];
10675 // IE9 and non-IE
10734 str.substring(str.length - Math.round(max / 4));
10800 me.state = this.view.getState(cell);
10860 this.popupMenuHandler.popup(me.getX() + origin.x + 1,
10871 * HTML in-place editor
10875 var state = this.graph.view.getState(this.editingCell);
10931 spaces--;
10949 * text and invokes the built-in alignment function.
10951 * Only the built-in function is invoked if shift is pressed or
11084 * HTML in-place editor
11100 var state = this.graph.view.getState(cell);
11140 * HTML in-place editor
11251 this.textarea.innerHTML.indexOf('<!--[if !mso]>') >= 0)
11267 var state = this.graph.view.getState(this.editingCell);
11322 if (content.length > 0 && content.charAt(content.length - 1) == '\n')
11324 content = content.substring(0, content.length - 1);
11348 txtDecor.push('line-through');
11395 var scale = state.view.scale;
11413 this.bounds.x += m.x * this.bounds.width;
11417 this.textarea.style.width = Math.round((this.bounds.width - 4) / scale) + 'px';
11418 this.textarea.style.height = Math.round((this.bounds.height - 4) / scale) + 'px';
11424 …ht = Math.round((this.bounds.height / scale)) + (this.textarea.offsetHeight - this.textarea.client…
11430 …idth = Math.round((this.bounds.width / scale)) + (this.textarea.offsetWidth - this.textarea.client…
11434 this.textarea.style.left = Math.round(this.bounds.x) + 'px';
11497 // Restores default view mode before applying value
11635 var t = this.graph.view.translate;
11636 var s = this.graph.view.scale;
11637 var x = this.roundLength((this.bounds.x + this.currentDx) / s - t.x);
11638 var y = this.roundLength((this.bounds.y + this.currentDy) / s - t.y);
11639 var unit = this.graph.view.unit;
11641 this.hint.innerHTML = formatHintText(x, unit) + ', ' + formatHintText(y, unit);
11643 this.hint.style.left = (this.pBounds.x + this.currentDx +
11644 Math.round((this.pBounds.width - this.hint.clientWidth) / 2)) + 'px';
11693 geo.width = bounds.width + start.x + start.width + 2 * border;
11772 mxVertexHandler.prototype.rotationHandleVSpacing = -12;
11777 …return new mxPoint(this.bounds.x + this.bounds.width - this.rotationHandleVSpacing + padding.x / 2,
11778 this.bounds.y + this.rotationHandleVSpacing - padding.y / 2)
11822 …return this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.c…
11879 -this.getSelectionBorderInset());
11904 var rows = graph.view.getCellStates(model.getChildCells(this.state.cell, true));
11915 var colState = graph.view.getState(cols[index]);
11921 colState = new mxCellState(graph.view, cols[index],
11923 colState.x = tableState.x + geo.x * graph.view.scale;
11924 colState.y = tableState.y + geo.y * graph.view.scale;
11925 colState.width = g.width * graph.view.scale;
11926 colState.height = g.height * graph.view.scale;
11930 var nextCol = (index < cols.length - 1) ? cols[index + 1] : null;
11939 var handle = new mxHandle(colState, 'col-resize', null, shape);
11952 this.shape.bounds.x = this.state.x + (g.width +
11953 dx) * this.graph.view.scale;
11955 this.shape.bounds.y = tableState.y + ((index == cols.length - 1) ?
11956 0 : start.y * this.graph.view.scale);
11957 this.shape.bounds.height = tableState.height -
11958 ((index == cols.length - 1) ? 0 :
11959 (start.height + start.y) * this.graph.view.scale);
11968 dx = Math.max(Graph.minTableColumnWidth - g.width,
11969 pt.x - bounds.x - g.width);
11974 dx = Math.min(dx, ng.width - Graph.minTableColumnWidth);
12020 var handle = new mxHandle(rowState, 'row-resize', null, shape);
12032 this.shape.bounds.x = this.state.x;
12035 dy * this.graph.view.scale;
12043 dy = Math.max(Graph.minTableRowHeight - bounds.height,
12044 pt.y - bounds.y - bounds.height);
12175 }))(this.graph.view.getState(model.getChildAt(this.state.cell, i)));
12233 if ((Math.abs(this.state.x - px) < b.width / 2) ||
12234 (Math.abs(this.state.y - py) < b.height / 2) ||
12235 (Math.abs(this.state.x + this.state.width - px) < b.width / 2) ||
12236 (Math.abs(this.state.y + this.state.height - py) < b.height / 2))
12257 result.x = this.sizers[0].bounds.width + tol;
12278 this.state.view.graph.container.appendChild(this.hint);
12287 var s = this.state.view.scale;
12288 var unit = this.state.view.unit;
12289 this.hint.innerHTML = formatHintText(this.roundLength(this.bounds.width / s), unit) + ' x ' +
12301 this.hint.style.left = bb.x + Math.round((bb.width - this.hint.clientWidth) / 2) + 'px';
12363 this.state.view.graph.container.appendChild(this.hint);
12366 var t = this.graph.view.translate;
12367 var s = this.graph.view.scale;
12368 var x = this.roundLength(point.x / s - t.x);
12369 var y = this.roundLength(point.y / s - t.y);
12370 var unit = this.graph.view.unit;
12372 this.hint.innerHTML = formatHintText(x, unit) + ', ' + formatHintText(y, unit);
12381 this.hint.innerHTML = '[' + Math.round(pt.x * 100) + '%, '+ Math.round(pt.y * 100) + '%]';
12389 this.hint.style.left = Math.round(me.getGraphX() - this.hint.clientWidth / 2) + 'px';
12404 * Defines the handles for the UI. Uses data-URIs to speed-up loading time where supported.
12407 …HoverIcons.prototype.mainHandle = (!mxClient.IS_SVG) ? new mxImage(IMAGE_PATH + '/handle-main.png'…
12408 …="9" cy="9" r="5" stroke="#fff" fill="' + HoverIcons.prototype.arrowFill + '" stroke-width="1"/>');
12409 …HoverIcons.prototype.secondaryHandle = (!mxClient.IS_SVG) ? new mxImage(IMAGE_PATH + '/handle-seco…
12411 …HoverIcons.prototype.fixedHandle = (!mxClient.IS_SVG) ? new mxImage(IMAGE_PATH + '/handle-fixed.pn…
12412 …Graph.createSvgImage(22, 22, '<circle cx="11" cy="11" r="6" stroke="#fff" fill="#01bd22" stroke-wi…
12413 …HoverIcons.prototype.terminalHandle = (!mxClient.IS_SVG) ? new mxImage(IMAGE_PATH + '/handle-termi…
12414 …11" r="6" stroke="#fff" fill="' + HoverIcons.prototype.arrowFill + '" stroke-width="1"/><circle cx…
12415 …HoverIcons.prototype.rotationHandle = (!mxClient.IS_SVG) ? new mxImage(IMAGE_PATH + '/handle-rotat…
12418-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89…
12424 …'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke-width="2" style="stroke-opacity:0.4" stroke="#ffffff"/>'…
12447 // Pre-fetches images (only needed for non data-uris)
12511 mxVertexHandler.prototype.rotationHandleVSpacing = -16;
12598 x0 = this.first.x;
12600 dx = (this.currentX - x0) / this.graph.view.scale;
12601 dy = (this.currentY - y0) / this.graph.view.scale;
12638 var tmp = this.graph.view.getState(cells[i]);
12657 var rect = new mxRectangle(this.x, this.y, this.width, this.height);
12673 origin.x -= offset.x;
12674 origin.y -= offset.y;
12675 var x = me.getX() + origin.x;
12677 var dx = this.first.x - x;
12678 var dy = this.first.y - y;
12691 this.update(x, y);
12695 var right = this.x + this.width;
12697 var scale = this.graph.view.scale;
12717 if (this.x < this.first.x)
12719 this.x = right - this.width;
12724 this.y = bottom - this.height;
12730 this.div.style.left = this.x + 'px';
12742 this.secondDiv.style.left = this.x + 'px';
12780 // Timer-based activation of outline connect in connection handler
12797 timeOnTarget = new Date().getTime() - startTime;
12803 // Timer-based outline connect
12818 var c = (index != null && (index == 0 || index >= this.state.absolutePoints.length - 1 ||
12840 s -= 1;
12867 var state = this.graph.view.getState(cells[0]);
12912 …return new mxRectangle(Math.round(bbox.x), Math.round(bbox.y), Math.round(bbox.width), Math.round(…
12945 if (this.state.view.graph.model.isVertex(this.state.cell) &&
12949 this.state.view.graph.setCellStyles(mxConstants.STYLE_ROTATION, angle, [this.state.cell]);
12953 this.state.view.graph.turnShapes([this.state.cell]);
13026 shape.init(this.graph.view.getOverlayPane());
13120 changeLink.style.marginBottom = '-1px';
13172 return this.state.view.graph.connectionHandler.isEnabled();
13232 this.moveHandles[i].style.left = (this.moveHandles[i].rowState.x +
13233 this.moveHandles[i].rowState.width - 5) + 'px';
13235 this.moveHandles[i].rowState.height / 2 - 6) + 'px';
13246 ch[0].bounds.x = this.state.x - w + inset;
13247 ch[0].bounds.y = this.state.y - h + inset;
13249 ch[1].bounds.x = ch[0].bounds.x + this.state.width - 2 * inset;
13252 ch[2].bounds.x = ch[0].bounds.x;
13253 ch[2].bounds.y = this.state.y + this.state.height - 2 * inset;
13255 ch[3].bounds.x = ch[1].bounds.x;
13278 …var tmp = new mxRectangle(this.state.x, this.state.y - 22, this.state.width + 24, this.state.heigh…
13296 …this.linkHint.style.left = Math.max(0, Math.round(rs.x + (rs.width - this.linkHint.clientWidth) / …
13373 b = new mxRectangle(b.x, b.y, b.width, b.height);
13377 …this.linkHint.style.left = Math.max(0, Math.round(b.x + (b.width - this.linkHint.clientWidth) / 2)…