7.8.2 release

Former-commit-id: 57be0fe11e
This commit is contained in:
Gaudenz Alder 2017-12-03 15:52:50 +01:00
parent ae97b9bff8
commit 5c9898f94b
17 changed files with 3383 additions and 2834 deletions

View file

@ -1,3 +1,16 @@
03-DEC-2017: 7.8.2
- Adds select descendants for cells with outgoing edges
- Adds defaults for insert from custom library
- Adds search of metadata in find dialog
- Enables export URL for external domains
- Adds custom libraries to shape search index
- Uses mxGraph 3.8.1 beta 1
01-DEC-2017: 7.8.1
- Fixes Confluence Cloud revision history diagram display
30-NOV-2017: 7.8.0
- Uses mxGraph 3.8.0

View file

@ -19,7 +19,7 @@ The [mxGraph documentation](https://jgraph.github.io/mxgraph/) provides a lot of
Running
-------
The simplest way to run draw.io initially is to fork this project, [publish the master branch to GitHub pages](https://help.github.com/categories/github-pages-basics/) and the [pages sites](https://jgraph.github.io/draw.io/war/index.html) will have the full editor functionality (sans the integrations).
The simplest way to run draw.io initially is to fork this project, [publish the master branch to GitHub pages](https://help.github.com/categories/github-pages-basics/) and the [pages sites](https://jgraph.github.io/drawio/war/index.html) will have the full editor functionality (sans the integrations).
The full packaged .war of the client and servlets is built when the project is tagged and available on the [releases page](https://github.com/jgraph/draw.io/releases).

View file

@ -1 +1 @@
7.8.0
7.8.2

View file

@ -1,4 +1,4 @@
var mxClient={VERSION:"3.8.0",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
var mxClient={VERSION:"3.8.1",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
@ -612,15 +612,15 @@ mxFastOrganicLayout.prototype.iteration=0;mxFastOrganicLayout.prototype.allowedT
mxFastOrganicLayout.prototype.execute=function(a){var b=this.graph.getModel();this.vertexArray=[];for(var c=this.graph.getChildVertices(a),d=0;d<c.length;d++)this.isVertexIgnored(c[d])||this.vertexArray.push(c[d]);var e=this.useInputOrigin?this.graph.getBoundingBoxFromGeometry(this.vertexArray):null,f=this.vertexArray.length;this.indices=[];this.dispX=[];this.dispY=[];this.cellLocation=[];this.isMoveable=[];this.neighbours=[];this.radius=[];this.radiusSquared=[];.001>this.forceConstant&&(this.forceConstant=
.001);this.forceConstantSquared=this.forceConstant*this.forceConstant;for(d=0;d<this.vertexArray.length;d++){var g=this.vertexArray[d];this.cellLocation[d]=[];var k=mxObjectIdentity.get(g);this.indices[k]=d;var l=this.getVertexBounds(g),m=l.width,n=l.height,p=l.x,q=l.y;this.cellLocation[d][0]=p+m/2;this.cellLocation[d][1]=q+n/2;this.radius[d]=Math.min(m,n);this.radiusSquared[d]=this.radius[d]*this.radius[d]}b.beginUpdate();try{for(d=0;d<f;d++){this.dispX[d]=0;this.dispY[d]=0;this.isMoveable[d]=this.isVertexMovable(this.vertexArray[d]);
var r=this.graph.getConnections(this.vertexArray[d],a),c=this.graph.getOpposites(r,this.vertexArray[d]);this.neighbours[d]=[];for(m=0;m<c.length;m++){this.resetEdges&&this.graph.resetEdge(r[m]);this.disableEdgeStyle&&this.setEdgeStyleEnabled(r[m],!1);var k=mxObjectIdentity.get(c[m]),t=this.indices[k];this.neighbours[d][m]=null!=t?t:d}}this.temperature=this.initialTemp;0==this.maxIterations&&(this.maxIterations=20*Math.sqrt(f));for(this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun)return;
this.calcRepulsion();this.calcAttraction();this.calcPositions();this.reduceTemperature()}a=c=null;for(d=0;d<this.vertexArray.length;d++)g=this.vertexArray[d],this.isVertexMovable(g)&&(l=this.getVertexBounds(g),null!=l&&(this.cellLocation[d][0]-=l.width/2,this.cellLocation[d][1]-=l.height/2,p=this.graph.snap(this.cellLocation[d][0]),q=this.graph.snap(this.cellLocation[d][1]),this.setVertexLocation(g,p,q),c=null==c?p:Math.min(c,p),a=null==a?q:Math.min(a,q)));d=-(c||0)+1;g=-(a||0)+1;null!=e&&(d+=e.x,
g+=e.y);this.graph.moveCells(this.vertexArray,d,g)}finally{b.endUpdate()}};mxFastOrganicLayout.prototype.calcPositions=function(){for(var a=0;a<this.vertexArray.length;a++)if(this.isMoveable[a]){var b=Math.sqrt(this.dispX[a]*this.dispX[a]+this.dispY[a]*this.dispY[a]);.001>b&&(b=.001);var c=this.dispX[a]/b*Math.min(b,this.temperature),b=this.dispY[a]/b*Math.min(b,this.temperature);this.dispX[a]=0;this.dispY[a]=0;this.cellLocation[a][0]+=c;this.cellLocation[a][1]+=b}};
this.calcRepulsion();this.calcAttraction();this.calcPositions();this.reduceTemperature()}a=c=null;for(d=0;d<this.vertexArray.length;d++)g=this.vertexArray[d],this.isVertexMovable(g)&&(l=this.getVertexBounds(g),null!=l&&(this.cellLocation[d][0]-=l.width/2,this.cellLocation[d][1]-=l.height/2,p=this.graph.snap(Math.round(this.cellLocation[d][0])),q=this.graph.snap(Math.round(this.cellLocation[d][1])),this.setVertexLocation(g,p,q),c=null==c?p:Math.min(c,p),a=null==a?q:Math.min(a,q)));d=-(c||0)+1;g=-(a||
0)+1;null!=e&&(d+=e.x,g+=e.y);this.graph.moveCells(this.vertexArray,d,g)}finally{b.endUpdate()}};mxFastOrganicLayout.prototype.calcPositions=function(){for(var a=0;a<this.vertexArray.length;a++)if(this.isMoveable[a]){var b=Math.sqrt(this.dispX[a]*this.dispX[a]+this.dispY[a]*this.dispY[a]);.001>b&&(b=.001);var c=this.dispX[a]/b*Math.min(b,this.temperature),b=this.dispY[a]/b*Math.min(b,this.temperature);this.dispX[a]=0;this.dispY[a]=0;this.cellLocation[a][0]+=c;this.cellLocation[a][1]+=b}};
mxFastOrganicLayout.prototype.calcAttraction=function(){for(var a=0;a<this.vertexArray.length;a++)for(var b=0;b<this.neighbours[a].length;b++){var c=this.neighbours[a][b];if(a!=c&&this.isMoveable[a]&&this.isMoveable[c]){var d=this.cellLocation[a][0]-this.cellLocation[c][0],e=this.cellLocation[a][1]-this.cellLocation[c][1],f=d*d+e*e-this.radiusSquared[a]-this.radiusSquared[c];f<this.minDistanceLimitSquared&&(f=this.minDistanceLimitSquared);var g=Math.sqrt(f),f=f/this.forceConstant,d=d/g*f,e=e/g*f;
this.dispX[a]-=d;this.dispY[a]-=e;this.dispX[c]+=d;this.dispY[c]+=e}}};
mxFastOrganicLayout.prototype.calcRepulsion=function(){for(var a=this.vertexArray.length,b=0;b<a;b++)for(var c=b;c<a;c++){if(!this.allowedToRun)return;if(c!=b&&this.isMoveable[b]&&this.isMoveable[c]){var d=this.cellLocation[b][0]-this.cellLocation[c][0],e=this.cellLocation[b][1]-this.cellLocation[c][1];0==d&&(d=.01+Math.random());0==e&&(e=.01+Math.random());var f=Math.sqrt(d*d+e*e),g=f-this.radius[b]-this.radius[c];g>this.maxDistanceLimit||(g<this.minDistanceLimit&&(g=this.minDistanceLimit),g=this.forceConstantSquared/
g,d=d/f*g,e=e/f*g,this.dispX[b]+=d,this.dispY[b]+=e,this.dispX[c]-=d,this.dispY[c]-=e)}}};mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)};function mxCircleLayout(a,b){mxGraphLayout.call(this,a);this.radius=null!=b?b:100}mxCircleLayout.prototype=new mxGraphLayout;mxCircleLayout.prototype.constructor=mxCircleLayout;mxCircleLayout.prototype.radius=null;mxCircleLayout.prototype.moveCircle=!1;
mxCircleLayout.prototype.x0=0;mxCircleLayout.prototype.y0=0;mxCircleLayout.prototype.resetEdges=!0;mxCircleLayout.prototype.disableEdgeStyle=!0;
mxCircleLayout.prototype.execute=function(a){var b=this.graph.getModel();b.beginUpdate();try{for(var c=0,d=null,e=null,f=[],g=b.getChildCount(a),k=0;k<g;k++){var l=b.getChildAt(a,k);if(this.isVertexIgnored(l))this.isEdgeIgnored(l)||(this.resetEdges&&this.graph.resetEdge(l),this.disableEdgeStyle&&this.setEdgeStyleEnabled(l,!1));else{f.push(l);var m=this.getVertexBounds(l),d=null==d?m.y:Math.min(d,m.y),e=null==e?m.x:Math.min(e,m.x),c=Math.max(c,Math.max(m.width,m.height))}}var n=this.getRadius(f.length,
c);this.moveCircle&&(e=this.x0,d=this.y0);this.circle(f,n,e,d)}finally{b.endUpdate()}};mxCircleLayout.prototype.getRadius=function(a,b){return Math.max(a*b/Math.PI,this.radius)};mxCircleLayout.prototype.circle=function(a,b,c,d){for(var e=a.length,f=2*Math.PI/e,g=0;g<e;g++)this.isVertexMovable(a[g])&&this.setVertexLocation(a[g],c+b+b*Math.sin(g*f),d+b+b*Math.cos(g*f))};function mxParallelEdgeLayout(a){mxGraphLayout.call(this,a)}mxParallelEdgeLayout.prototype=new mxGraphLayout;
c);this.moveCircle&&(e=this.x0,d=this.y0);this.circle(f,n,e,d)}finally{b.endUpdate()}};mxCircleLayout.prototype.getRadius=function(a,b){return Math.max(a*b/Math.PI,this.radius)};mxCircleLayout.prototype.circle=function(a,b,c,d){for(var e=a.length,f=2*Math.PI/e,g=0;g<e;g++)this.isVertexMovable(a[g])&&this.setVertexLocation(a[g],Math.round(c+b+b*Math.sin(g*f)),Math.round(d+b+b*Math.cos(g*f)))};function mxParallelEdgeLayout(a){mxGraphLayout.call(this,a)}mxParallelEdgeLayout.prototype=new mxGraphLayout;
mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout;mxParallelEdgeLayout.prototype.spacing=20;mxParallelEdgeLayout.prototype.execute=function(a){a=this.findParallels(a);this.graph.model.beginUpdate();try{for(var b in a){var c=a[b];1<c.length&&this.layout(c)}}finally{this.graph.model.endUpdate()}};
mxParallelEdgeLayout.prototype.findParallels=function(a){for(var b=this.graph.getModel(),c=[],d=b.getChildCount(a),e=0;e<d;e++){var f=b.getChildAt(a,e);if(!this.isEdgeIgnored(f)){var g=this.getEdgeId(f);null!=g&&(null==c[g]&&(c[g]=[]),c[g].push(f))}}return c};mxParallelEdgeLayout.prototype.getEdgeId=function(a){var b=this.graph.getView(),c=b.getVisibleTerminal(a,!0);a=b.getVisibleTerminal(a,!1);return null!=c&&null!=a?(c=mxObjectIdentity.get(c),a=mxObjectIdentity.get(a),c>a?a+"-"+c:c+"-"+a):null};
mxParallelEdgeLayout.prototype.layout=function(a){var b=a[0],c=this.graph.getView(),d=this.graph.getModel(),e=d.getGeometry(c.getVisibleTerminal(b,!0)),d=d.getGeometry(c.getVisibleTerminal(b,!1));if(e==d)for(var b=e.x+e.width+this.spacing,c=e.y+e.height/2,f=0;f<a.length;f++)this.route(a[f],b,c),b+=this.spacing;else if(null!=e&&null!=d){var b=e.x+e.width/2,c=e.y+e.height/2,f=d.x+d.width/2-b,g=d.y+d.height/2-c,d=Math.sqrt(f*f+g*g);if(0<d)for(e=g*this.spacing/d,d=f*this.spacing/d,b=b+f/2+e*(a.length-
@ -1553,9 +1553,9 @@ this.verticalOffset/2,b.height+=this.verticalOffset;8<=this.sizers.length&&(b.wi
if(this.singleSizer)this.moveSizerTo(this.sizers[0],a,c);else{var d=b.x+b.width/2,e=b.y+b.height/2;if(8<=this.sizers.length){var f="nw-resize n-resize ne-resize e-resize se-resize s-resize sw-resize w-resize".split(" "),g=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),k=Math.cos(g),l=Math.sin(g),g=Math.round(4*g/Math.PI),m=new mxPoint(b.getCenterX(),b.getCenterY()),n=mxUtils.getRotatedPoint(new mxPoint(b.x,b.y),k,l,m);this.moveSizerTo(this.sizers[0],n.x,n.y);this.sizers[0].setCursor(f[mxUtils.mod(0+
g,f.length)]);n.x=d;n.y=b.y;n=mxUtils.getRotatedPoint(n,k,l,m);this.moveSizerTo(this.sizers[1],n.x,n.y);this.sizers[1].setCursor(f[mxUtils.mod(1+g,f.length)]);n.x=a;n.y=b.y;n=mxUtils.getRotatedPoint(n,k,l,m);this.moveSizerTo(this.sizers[2],n.x,n.y);this.sizers[2].setCursor(f[mxUtils.mod(2+g,f.length)]);n.x=b.x;n.y=e;n=mxUtils.getRotatedPoint(n,k,l,m);this.moveSizerTo(this.sizers[3],n.x,n.y);this.sizers[3].setCursor(f[mxUtils.mod(7+g,f.length)]);n.x=a;n.y=e;n=mxUtils.getRotatedPoint(n,k,l,m);this.moveSizerTo(this.sizers[4],
n.x,n.y);this.sizers[4].setCursor(f[mxUtils.mod(3+g,f.length)]);n.x=b.x;n.y=c;n=mxUtils.getRotatedPoint(n,k,l,m);this.moveSizerTo(this.sizers[5],n.x,n.y);this.sizers[5].setCursor(f[mxUtils.mod(6+g,f.length)]);n.x=d;n.y=c;n=mxUtils.getRotatedPoint(n,k,l,m);this.moveSizerTo(this.sizers[6],n.x,n.y);this.sizers[6].setCursor(f[mxUtils.mod(5+g,f.length)]);n.x=a;n.y=c;n=mxUtils.getRotatedPoint(n,k,l,m);this.moveSizerTo(this.sizers[7],n.x,n.y);this.sizers[7].setCursor(f[mxUtils.mod(4+g,f.length)]);this.moveSizerTo(this.sizers[8],
d+this.state.absoluteOffset.x,e+this.state.absoluteOffset.y)}else 2<=this.state.width&&2<=this.state.height?this.moveSizerTo(this.sizers[0],d+this.state.absoluteOffset.x,e+this.state.absoluteOffset.y):this.moveSizerTo(this.sizers[0],this.state.x,this.state.y)}}null!=this.rotationShape&&(g=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),k=Math.cos(g),l=Math.sin(g),m=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),n=mxUtils.getRotatedPoint(new mxPoint(b.x+
b.width/2,b.y+this.rotationHandleVSpacing),k,l,m),null!=this.rotationShape.node&&this.moveSizerTo(this.rotationShape,n.x,n.y));null!=this.selectionBorder&&(this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"));if(null!=this.edgeHandlers)for(b=0;b<this.edgeHandlers.length;b++)this.edgeHandlers[b].redraw();if(null!=this.customHandles)for(b=0;b<this.customHandles.length;b++)a=this.customHandles[b].shape.node.style.display,this.customHandles[b].redraw(),this.customHandles[b].shape.node.style.display=
a;this.updateParentHighlight()};
d+this.state.absoluteOffset.x,e+this.state.absoluteOffset.y)}else 2<=this.state.width&&2<=this.state.height?this.moveSizerTo(this.sizers[0],d+this.state.absoluteOffset.x,e+this.state.absoluteOffset.y):this.moveSizerTo(this.sizers[0],this.state.x,this.state.y)}}null!=this.rotationShape&&(g=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),k=Math.cos(g),l=Math.sin(g),m=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),n=mxUtils.getRotatedPoint(this.getRotationHandlePosition(),
k,l,m),null!=this.rotationShape.node&&this.moveSizerTo(this.rotationShape,n.x,n.y));null!=this.selectionBorder&&(this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"));if(null!=this.edgeHandlers)for(b=0;b<this.edgeHandlers.length;b++)this.edgeHandlers[b].redraw();if(null!=this.customHandles)for(b=0;b<this.customHandles.length;b++)a=this.customHandles[b].shape.node.style.display,this.customHandles[b].redraw(),this.customHandles[b].shape.node.style.display=a;this.updateParentHighlight()};
mxVertexHandler.prototype.getRotationHandlePosition=function(){return new mxPoint(this.bounds.x+this.bounds.width/2,this.bounds.y+this.rotationHandleVSpacing)};
mxVertexHandler.prototype.updateParentHighlight=function(){if(null!=this.selectionBorder)if(null!=this.parentHighlight){var a=this.graph.model.getParent(this.state.cell);if(this.graph.model.isVertex(a)){var a=this.graph.view.getState(a),b=this.parentHighlight.bounds;null==a||b.x==a.x&&b.y==a.y&&b.width==a.width&&b.height==a.height||(this.parentHighlight.bounds=a,this.parentHighlight.redraw())}else this.parentHighlight.destroy(),this.parentHighlight=null}else this.parentHighlightEnabled&&(a=this.graph.model.getParent(this.state.cell),
this.graph.model.isVertex(a)&&(a=this.graph.view.getState(a),null!=a&&(this.parentHighlight=this.createParentHighlightShape(a),this.parentHighlight.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.parentHighlight.pointerEvents=!1,this.parentHighlight.rotation=Number(a.style[mxConstants.STYLE_ROTATION]||"0"),this.parentHighlight.init(this.graph.getView().getOverlayPane()))))};
mxVertexHandler.prototype.drawPreview=function(){null!=this.preview&&(this.preview.bounds=this.bounds,this.preview.node.parentNode==this.graph.container&&(this.preview.bounds.width=Math.max(0,this.preview.bounds.width-1),this.preview.bounds.height=Math.max(0,this.preview.bounds.height-1)),this.preview.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.preview.redraw());this.selectionBorder.bounds=this.bounds;this.selectionBorder.redraw();null!=this.parentHighlight&&this.parentHighlight.redraw()};

View file

@ -1,7 +1,7 @@
CACHE MANIFEST
# THIS FILE WAS GENERATED. DO NOT MODIFY!
# 11/30/2017 11:54 AM
# 12/03/2017 03:46 PM
app.html
index.html?offline=1

405
war/export3.html Normal file
View file

@ -0,0 +1,405 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
var isLocalStorage = false;
var mxLoadStylesheets = false;
</script>
<!-- CSS for print output is needed for using current window -->
<style type="text/css">
@media print {
table.mxPageSelector { display: none; }
hr.mxPageBreak { display: none; }
}
@media screen {
table.mxPageSelector { position: fixed; right: 10px; top: 10px;font-family: Arial; font-size:10pt; border: solid 1px darkgray;background: white; border-collapse:collapse; }
table.mxPageSelector td { border: solid 1px gray; padding:4px; }
body.mxPage { background: gray; }
}
</style>
<link rel="stylesheet" href="mxgraph/css/common.css" charset="UTF-8" type="text/css">
<script src="js/app.min.js"></script>
<script>
// NOTE: SVG Output fixes missing symbols in AsciiMath
// but produces larger output with clipping problems
Editor.initMath();
// Workaround for varphi vs. phi export in MathJax on Phantom
// see https://github.com/mathjax/MathJax/issues/353
(function()
{
var authInit = MathJax.AuthorInit;
MathJax.AuthorInit = function()
{
authInit();
MathJax.Hub.Register.StartupHook('AsciiMath Jax Config', function()
{
var symbols = MathJax.InputJax.AsciiMath.AM.symbols;
for (var i = 0, m = symbols.length; i < m; i++)
{
if (symbols[i].input === 'phi')
{
symbols[i].output = '\u03C6'
}
else if (symbols[i].input === 'varphi')
{
symbols[i].output = '\u03D5'; i = m
}
}
});
};
})();
function render(data)
{
var graph = new Graph(document.getElementById('graph'));
data.border = parseInt(data.border) || 0;
data.w = parseFloat(data.w) || 0;
data.h = parseFloat(data.h) || 0;
data.scale = parseFloat(data.scale) || 1;
// Parses XML
var xmlDoc = mxUtils.parseXml(data.xml);
var diagrams = null;
var from = 0;
// Handles mxfile
if (xmlDoc.documentElement.nodeName == 'mxfile')
{
diagrams = xmlDoc.documentElement.getElementsByTagName('diagram');
if (diagrams.length > 0)
{
from = Math.max(0, Math.min(parseInt(data.from) || from, diagrams.length - 1));
var diagramNode = diagrams[from];
if (diagramNode != null)
{
xmlDoc = mxUtils.parseXml(graph.decompress(mxUtils.getTextContent(diagramNode)));
}
}
}
/**
* Implements %page% and %pagenumber% placeholders
*/
var graphGetGlobalVariable = graph.getGlobalVariable;
graph.getGlobalVariable = function(name)
{
if (name == 'page')
{
return (diagrams == null) ? 'Page-1' :
(diagrams[from].getAttribute('name') || ('Page-' + (from + 1)));
}
else if (name == 'pagenumber')
{
return from + 1;
}
return graphGetGlobalVariable.apply(this, arguments);
};
// Enables math typesetting
var math = xmlDoc.documentElement.getAttribute('math') == '1';
if (math)
{
mxClient.NO_FO = true;
}
// Createa graph instance
graph.foldingEnabled = false;
graph.setEnabled(false);
// Sets background image
var bgImg = xmlDoc.documentElement.getAttribute('backgroundImage');
if (bgImg != null)
{
bgImg = JSON.parse(bgImg);
graph.setBackgroundImage(new mxImage(bgImg.src, bgImg.width, bgImg.height));
}
// Parses XML into graph
var codec = new mxCodec(xmlDoc);
codec.decode(xmlDoc.documentElement, graph.getModel());
// Loads background color
var bg = (data.bg != null && data.bg.length > 0) ? data.bg : xmlDoc.documentElement.getAttribute('background');
// Normalizes values for transparent backgrounds
if (bg == 'none' || bg == '')
{
bg = null;
}
// Checks if export format supports transparent backgrounds
if (bg == null && data.format != 'gif' && data.format != 'png')
{
bg = '#ffffff';
}
// Sets background color on page
if (bg != null)
{
document.body.style.backgroundColor = bg;
}
// Sets initial value for PDF page background
graph.pdfPageVisible = false;
// Handles PDF output where the output should match the page format if the page is visible
if (data.format == 'pdf' && xmlDoc.documentElement.getAttribute('page') == '1' && data.w == 0 && data.h == 0)
{
var pw = xmlDoc.documentElement.getAttribute('pageWidth');
var ph = xmlDoc.documentElement.getAttribute('pageHeight');
graph.pdfPageVisible = true;
if (pw != null && ph != null)
{
graph.pageFormat = new mxRectangle(0, 0, parseFloat(pw), parseFloat(ph));
}
var ps = xmlDoc.documentElement.getAttribute('pageScale');
if (ps != null)
{
graph.pageScale = ps;
}
graph.getPageSize = function()
{
return new mxRectangle(0, 0, this.pageFormat.width * this.pageScale,
this.pageFormat.height * this.pageScale);
};
graph.getPageLayout = function()
{
var size = this.getPageSize();
var bounds = this.getGraphBounds();
if (bounds.width == 0 || bounds.height == 0)
{
return new mxRectangle(0, 0, 1, 1);
}
else
{
// Computes untransformed graph bounds
var x = Math.ceil(bounds.x / this.view.scale - this.view.translate.x);
var y = Math.ceil(bounds.y / this.view.scale - this.view.translate.y);
var w = Math.floor(bounds.width / this.view.scale);
var h = Math.floor(bounds.height / this.view.scale);
var x0 = Math.floor(x / size.width);
var y0 = Math.floor(y / size.height);
var w0 = Math.ceil((x + w) / size.width) - x0;
var h0 = Math.ceil((y + h) / size.height) - y0;
return new mxRectangle(x0, y0, w0, h0);
}
};
// Fits the number of background pages to the graph
graph.view.getBackgroundPageBounds = function()
{
var layout = this.graph.getPageLayout();
var page = this.graph.getPageSize();
return new mxRectangle(this.scale * (this.translate.x + layout.x * page.width),
this.scale * (this.translate.y + layout.y * page.height),
this.scale * layout.width * page.width,
this.scale * layout.height * page.height);
};
}
if (!graph.pdfPageVisible)
{
var b = graph.getGraphBounds();
// Floor is needed to keep rendering crisp
if (data.w > 0 && data.h > 0)
{
var s = Math.min(data.w / b.width, data.h / b.height);
graph.view.scaleAndTranslate(s,
Math.floor(data.border / s - b.x),
Math.floor(data.border / s - b.y));
}
else
{
graph.view.scaleAndTranslate(data.scale, Math.floor(data.border - b.x),
Math.floor(data.border - b.y));
}
}
else
{
// Disables border for PDF page export
data.border = 0;
// Moves to first page in page layout
var layout = graph.getPageLayout();
var page = graph.getPageSize();
var dx = layout.x * page.width;
var dy = layout.y * page.height;
if (dx != 0 || dy != 0)
{
graph.view.setTranslate(Math.floor(-dx), Math.floor(-dy));
}
}
// Gets the diagram bounds and sets the document size
var bounds = (graph.pdfPageVisible) ? graph.view.getBackgroundPageBounds() : graph.getGraphBounds();
bounds.width = Math.ceil(bounds.width + data.border);
bounds.height = Math.ceil(bounds.height + data.border);
// Waits for all images to finish loading
var cache = new Object();
var waitCounter = 1;
// Decrements waitCounter and invokes callback when finished
function decrementWaitCounter()
{
if (--waitCounter < 1)
{
//TODO handle bounds in a different way
//window.callPhantom(bounds);
var doneDiv = document.createElement("div");
doneDiv.id = 'LoadingComplete';
document.body.appendChild(doneDiv);
}
};
function waitForImages(tagName, attributeName)
{
var imgs = document.body.getElementsByTagName(tagName);
waitCounter += imgs.length;
for (var i = 0; i < imgs.length; i++)
{
// No load events for image elements in Phantom using indirection instead
var src = imgs[i].getAttribute(attributeName);
if (src != null && src.length > 0 && cache[src] == null)
{
cache[src] = new Image();
cache[src].onload = decrementWaitCounter;
cache[src].onerror = decrementWaitCounter;
cache[src].src = src;
}
else
{
decrementWaitCounter();
}
}
};
// Includes images in SVG and HTML labels
waitForImages('image', 'xlink:href');
waitForImages('img', 'src');
// Waits for MathJax to finish rendering
function renderMath(elt)
{
if (math && window.MathJax != null && window.MathJax.Hub != null)
{
waitCounter++;
Editor.MathJaxRender(elt);
// Asynchronous callback when MathJax has finished
window.MathJax.Hub.Queue(function ()
{
decrementWaitCounter();
});
}
}
// Converts the graph to a vertical sequence of pages for PDF export
if (graph.pdfPageVisible)
{
// Workaround to match available paper size
var printScale = 0.72
var pf = graph.pageFormat || mxConstants.PAGE_FORMAT_A4_PORTRAIT;
var scale = 1 / graph.pageScale;
var autoOrigin = false;
var border = 0;
// Negative coordinates are cropped or shifted if page visible
var gb = graph.getGraphBounds();
var x0 = 0;
var y0 = 0;
// Applies print scale
pf = mxRectangle.fromRectangle(pf);
pf.width = Math.ceil(pf.width * printScale);
pf.height = Math.ceil(pf.height * printScale);
scale *= printScale;
// Starts at first visible page
var layout = graph.getPageLayout();
x0 -= layout.x * pf.width;
y0 -= layout.y * pf.height;
var preview = new mxPrintPreview(graph, scale, pf, border, x0, y0);
preview.printBackgroundImage = true;
preview.autoOrigin = autoOrigin;
preview.backgroundColor = bg;
// Renders print output into this document and removes the graph container
preview.open(null, window);
graph.container.parentNode.removeChild(graph.container);
// Adds shadow
if (mxClient.IS_SVG && xmlDoc.documentElement.getAttribute('shadow') == '1')
{
var svgs = document.getElementsByTagName('svg');
for (var i = 0; i < svgs.length; i++)
{
var svg = svgs[i];
var filter = graph.addSvgShadow(svg, null, true);
filter.setAttribute('id', 'shadow-' + i);
svg.appendChild(filter);
svg.setAttribute('filter', 'url(#' + 'shadow-' + i + ')');
}
border = 7;
}
bounds = new mxRectangle(0, 0, pf.width, pf.height);
renderMath(graph.container.parentNode);
}
else
{
// Adds shadow
if (mxClient.IS_SVG && xmlDoc.documentElement.getAttribute('shadow') == '1')
{
graph.addSvgShadow(graph.view.canvas.ownerSVGElement, null, true);
graph.setShadowVisible(true);
bounds.width += 7;
bounds.height += 7;
}
renderMath(graph.container);
if (data.format != 'pdf')
{
document.body.style.width = Math.ceil(bounds.x + bounds.width) + 'px';
document.body.style.height = (Math.ceil(bounds.y + bounds.height) + 1) + 'px';
}
}
// Immediate return if not waiting for any content
decrementWaitCounter();
};
</script>
</head>
<body style="margin:0px;">
<div id="graph" style="width:100%;height:100%;"></div>
</body>
</html>

1212
war/js/app.min.js vendored

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

1474
war/js/atlas.min.js vendored

File diff suppressed because it is too large Load diff

View file

@ -1064,9 +1064,9 @@ var EmbedDialog = function(editorUi, result, timeout, ignoreSize, previewFn)
{
try
{
var win = window.open(value);
var win = editorUi.openLink(value);
if (timeout == null || timeout > 0)
if (win != null && (timeout == null || timeout > 0))
{
window.setTimeout(mxUtils.bind(this, function()
{
@ -5568,7 +5568,7 @@ var FindWindow = function(ui, x, y, w, h)
var tmp = document.createElement('div');
function testMeta(re, cell)
function testMeta(re, cell, search)
{
if (typeof cell.value === 'object' && cell.value.attributes != null)
{
@ -5576,10 +5576,16 @@ var FindWindow = function(ui, x, y, w, h)
for (var i = 0; i < attrs.length; i++)
{
if (attrs[i].nodeName != 'label' && re.test(attrs[i].nodeValue.toLowerCase()))
if (attrs[i].nodeName != 'label')
{
return true;
}
var value = mxUtils.trim(attrs[i].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g, ' ')).toLowerCase();
if ((re == null && value.substring(0, search.length) === search) ||
(re != null && re.test(value)))
{
return true;
}
}
}
}
@ -5622,8 +5628,8 @@ var FindWindow = function(ui, x, y, w, h)
label = mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g, ' ')).toLowerCase();
if ((re == null && label.substring(0, search.length) === search) ||
(re != null && (re.test(label) || testMeta(re, state.cell))))
if ((re == null && (label.substring(0, search.length) === search || testMeta(re, state.cell, search))) ||
(re != null && (re.test(label) || testMeta(re, state.cell, search))))
{
if (active)
{

View file

@ -168,7 +168,7 @@
*/
EditorUi.prototype.openLink = function(url)
{
window.open(url);
return window.open(url);
};
/**
@ -1659,7 +1659,7 @@
}
content.appendChild(this.sidebar.createVertexTemplate(s + 'image=' +
data, img.w, img.h, '', img.title || '', false, false, false));
data, img.w, img.h, '', img.title || '', false, false, true));
}
else if (img.xml != null)
{
@ -1668,12 +1668,52 @@
if (cells.length > 0)
{
content.appendChild(this.sidebar.createVertexTemplateFromCells(
cells, img.w, img.h, img.title || '', true, false, false));
cells, img.w, img.h, img.title || '', true, false, true));
}
}
}
}
});
// Adds entries to search index
// KNOWN: Existing entries are not replaced after edit of custom library
if (this.sidebar != null && images != null)
{
for (var i = 0; i < images.length; i++)
{
(mxUtils.bind(this, function(img)
{
var data = img.data;
if (data != null && img.title != null)
{
this.sidebar.addEntry(img.title, mxUtils.bind(this, function()
{
data = this.convertDataUri(data);
var s = 'shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;';
if (img.aspect == 'fixed')
{
s += 'aspect=fixed;'
}
return this.sidebar.createVertexTemplate(s + 'image=' +
data, img.w, img.h, '', img.title || '', false, false, true)
}));
}
else if (img.xml != null && img.title != null)
{
this.sidebar.addEntry(img.title, mxUtils.bind(this, function()
{
var cells = this.stringToCells(this.editor.graph.decompress(img.xml));
return this.sidebar.createVertexTemplateFromCells(
cells, img.w, img.h, img.title || '', true, false, true);
}));
}
}))(images[i]);
}
}
// Adds new sidebar entry for this library
var tmp = (optionalTitle != null && optionalTitle.length > 0) ? optionalTitle : file.getTitle();
@ -2261,16 +2301,31 @@
*/
EditorUi.prototype.hideFooter = function()
{
var footer = document.getElementById('geFooter');
var footer = document.getElementById('geFooter');
if (footer != null)
{
this.footerHeight = 0;
footer.style.display = 'none';
this.refresh();
}
if (footer != null)
{
this.footerHeight = 0;
footer.style.display = 'none';
this.refresh();
}
};
/**
* Shows the footer.
*/
EditorUi.prototype.showFooter = function(height)
{
var footer = document.getElementById('geFooter');
if (footer != null)
{
this.footerHeight = height;
footer.style.display = 'inline';
this.refresh();
}
};
/**
* Overrides image dialog to add image search and Google+.
*/
@ -3445,8 +3500,9 @@
{
params.push('title=' + encodeURIComponent(file.getTitle()));
}
return ((mxClient.IS_CHROMEAPP || EditorUi.isElectronApp) ? 'https://www.draw.io/' : 'https://' + location.host + '/') +
return ((mxClient.IS_CHROMEAPP || EditorUi.isElectronApp || !(/.*\.draw\.io$/.test(window.location.hostname))) ?
'https://www.draw.io/' : 'https://' + window.location.host + '/') +
((params.length > 0) ? '?' + params.join('&') : '') + data;
};
@ -5551,8 +5607,7 @@
*/
EditorUi.prototype.isRemoteFileFormat = function(data, filename)
{
return /(\.*<graphml xmlns=\".*)/.test(data) ||
/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(data) ||
return /(\"contentType\":\s*\"application\/gliffy\+json\")/.test(data) ||
(filename != null && /(\.vsdx)($|\?)/i.test(filename)) ||
(filename != null && /(\.vssx)($|\?)/i.test(filename));
};
@ -5604,7 +5659,7 @@
'verticalAlign=top;aspect=fixed;imageAspect=0;image=' + data + ';')];
}
}
else if (urlParams['dev'] == '1' && /(\.*<graphml )/.test(data))
else if (/(\.*<graphml )/.test(data))
{
new mxGraphMlCodec().decode(data, mxUtils.bind(this, function(xml)
{

View file

@ -146,6 +146,18 @@
editorUi.showDialog(dlg.container, 300, 146, true, true);
}));
editorUi.actions.put('exportUrl', new Action(mxResources.get('url') + '...', function()
{
editorUi.showPublishLinkDialog(mxResources.get('url'), true, null, null,
function(linkTarget, linkColor, allPages, lightbox, editLink, layers)
{
var dlg = new EmbedDialog(editorUi, editorUi.createLink(linkTarget,
linkColor, allPages, lightbox, editLink, layers, null, true));
editorUi.showDialog(dlg.container, 440, 240, true, true);
dlg.init();
});
}));
editorUi.actions.put('exportHtml', new Action(mxResources.get('formatHtmlEmbedded') + '...', function()
{
if (editorUi.spinner.spin(document.body, mxResources.get('loading')))
@ -534,7 +546,7 @@
}
}), true, false, 'png');
}
else
else if (!editorUi.isOffline() && (!mxClient.IS_IOS || !navigator.standalone))
{
editorUi.showRemoteExportDialog(mxResources.get('export'), null, mxUtils.bind(this, function(ignoreSelection, editable)
{
@ -543,6 +555,33 @@
}
}));
editorUi.actions.put('exportJpg', new Action(mxResources.get('formatJpg') + '...', function()
{
if (editorUi.isExportToCanvas())
{
editorUi.showExportDialog(mxResources.get('image'), false, mxResources.get('export'),
'https://support.draw.io/display/DO/Exporting+Files',
mxUtils.bind(this, function(scale, transparentBackground, ignoreSelection,
addShadow, editable, embedImages, border, cropImage, currentPage)
{
var val = parseInt(scale);
if (!isNaN(val) && val > 0)
{
editorUi.exportImage(val / 100, false, ignoreSelection,
addShadow, false, border, !cropImage, false, 'jpeg');
}
}), true, false, 'jpeg');
}
else if (!editorUi.isOffline() && (!mxClient.IS_IOS || !navigator.standalone))
{
editorUi.showRemoteExportDialog(mxResources.get('export'), null, mxUtils.bind(this, function(ignoreSelection, editable)
{
editorUi.downloadFile('jpeg', null, null, ignoreSelection);
}), true);
}
}));
action = editorUi.actions.put('shadowVisible', new Action(mxResources.get('shadow'), function()
{
graph.setShadowVisible(!graph.shadowVisible);
@ -1383,37 +1422,14 @@
if (editorUi.jpgSupported)
{
menu.addItem(mxResources.get('formatJpg') + '...', null, mxUtils.bind(this, function()
{
editorUi.showExportDialog(mxResources.get('image'), false, mxResources.get('export'),
'https://support.draw.io/display/DO/Exporting+Files',
mxUtils.bind(this, function(scale, transparentBackground, ignoreSelection,
addShadow, editable, embedImages, border, cropImage, currentPage)
{
var val = parseInt(scale);
if (!isNaN(val) && val > 0)
{
this.editorUi.exportImage(val / 100, false, ignoreSelection,
addShadow, false, border, !cropImage, false, 'jpeg');
}
}), true, false, 'jpeg');
}), parent);
this.addMenuItems(menu, ['exportJpg'], parent);
}
}
// Disabled for standalone mode in iOS because new tab cannot be closed
else if (!editorUi.isOffline() && (!mxClient.IS_IOS || !navigator.standalone))
{
this.addMenuItems(menu, ['exportPng'], parent);
menu.addItem(mxResources.get('formatJpg') + '...', null, mxUtils.bind(this, function()
{
editorUi.showRemoteExportDialog(mxResources.get('export'), null, mxUtils.bind(this, function(ignoreSelection, editable)
{
editorUi.downloadFile('jpeg', null, null, ignoreSelection);
}), true);
}), parent);
this.addMenuItems(menu, ['exportPng', 'exportJpg'], parent);
}
this.addMenuItems(menu, ['exportSvg', '-'], parent);
@ -1429,8 +1445,6 @@
this.addMenuItems(menu, ['exportPdf'], parent);
}
this.addMenuItems(menu, ['exportHtml'], parent);
// LATER: Fix namespace prefix (NS1, NS2..) in XML
// serializer for VSDX export in IE11 and earlier
if (!mxClient.IS_IE11 && !mxClient.IS_IE && (typeof(VsdxExport) !== 'undefined' || !editorUi.isOffline()))
@ -1438,24 +1452,8 @@
this.addMenuItems(menu, ['exportVsdx'], parent);
}
this.addMenuItems(menu, ['-', 'exportXml'], parent);
this.addMenuItems(menu, ['-', 'exportHtml', 'exportXml', 'exportUrl'], parent);
// Disables menu item for all external hosted integrations
if (mxClient.IS_CHROMEAPP || EditorUi.isElectronApp || /.*\.draw\.io$/.test(window.location.hostname))
{
menu.addItem(mxResources.get('url') + '...', null, mxUtils.bind(this, function()
{
editorUi.showPublishLinkDialog(mxResources.get('url'), true, null, null,
function(linkTarget, linkColor, allPages, lightbox, editLink, layers)
{
var dlg = new EmbedDialog(editorUi, editorUi.createLink(linkTarget,
linkColor, allPages, lightbox, editLink, layers, null, true));
editorUi.showDialog(dlg.container, 440, 240, true, true);
dlg.init();
});
}), parent);
}
if (!editorUi.isOffline())
{
menu.addSeparator(parent);

View file

@ -101,7 +101,7 @@
// Adds resources for actions
mxResources.parse('selectChildren=Select Children');
mxResources.parse('selectSiblings=Select Siblings');
mxResources.parse('selectSubtree=Select Subtree');
mxResources.parse('selectDescendants=Select Descendants');
mxResources.parse('selectParent=Select Parent');
function isTreeVertex(cell)
@ -150,7 +150,7 @@
{
uiCreatePopupMenu.apply(this, arguments);
if (isTreeVertex(graph.getSelectionCell()) && graph.getSelectionCount() == 1)
if (graph.getSelectionCount() == 1)
{
var cell = graph.getSelectionCell();
var sib = graph.getOutgoingEdges(cell);
@ -158,14 +158,22 @@
if (sib != null && sib.length > 0)
{
this.addMenuItems(menu, ['selectChildren', 'selectSubtree'], null, evt);
if (isTreeVertex(graph.getSelectionCell()))
{
this.addMenuItems(menu, ['selectChildren'], null, evt);
}
this.addMenuItems(menu, ['selectDescendants'], null, evt);
}
menu.addSeparator();
if (graph.getIncomingEdges(cell).length > 0)
if (isTreeVertex(graph.getSelectionCell()))
{
this.addMenuItems(menu, ['selectSiblings', 'selectParent'], null, evt);
menu.addSeparator();
if (graph.getIncomingEdges(cell).length > 0)
{
this.addMenuItems(menu, ['selectSiblings', 'selectParent'], null, evt);
}
}
}
};
@ -234,7 +242,7 @@
}
}, null, null, 'Alt+Shift+P');
ui.actions.addAction('selectSubtree', function()
ui.actions.addAction('selectDescendants', function()
{
if (graph.isEnabled() && graph.getSelectionCount() == 1)
{

View file

@ -57,27 +57,46 @@ mxGraphMlCodec.prototype.decode = function (xml, callback)
try
{
var cells = graph.getModel().cells;
var tr = graph.view.translate;
for (var id in cells)
{
var cell = cells[id];
var geo = cell.geometry;
var edge = cells[id];
if (cell.parent && cell.parent.edge && geo.relative)
if (edge.edge && edge.getChildCount() > 0)
{
var state = graph.view.getState(cell.parent);
var abdPs = state.absolutePoints;
var p0 = abdPs[0];
var pe = abdPs[abdPs.length - 1];
geo.relative = false;
var ratio = geo.x;
geo.x = p0.x + ratio * (pe.x - p0.x);
geo.y = p0.y + ratio * (pe.y - p0.y);
console.log(ratio);
}
for (var i = 0; i < edge.getChildCount(); i++)
{
var cell = edge.children[i];
var geo = cell.geometry;
if (!geo.adjustIt) continue;
var state = graph.view.getState(edge);
var abdPs = state.absolutePoints;
var p0 = abdPs[0];
var pe = abdPs[abdPs.length - 1];
var ratio = geo.x;
var dist = geo.y;
var dx = pe.x - p0.x
var dy = pe.y - p0.y
var x = p0.x + ratio * dx;
var y = p0.y + ratio * dy;
var d = Math.sqrt(dx*dx + dy*dy);
dx /= d;
dy /= d;
x -= dist * dy;
y += dist * dx;
var np = graph.view.getRelativePoint(state, x, y);
geo.x = np.x;
geo.y = np.y;
}
}
}
}
catch(e)
@ -559,6 +578,9 @@ mxGraphMlCodec.prototype.importNode = function (nodeElement, graph, parent, dx,
case "DashDotDot":
pattern = "3 1 1 1 1 1";
break;
case "Dash":
pattern = "3 1";
break;
default:
pattern = val.replace(/0/g, '1');
}
@ -1380,6 +1402,9 @@ mxGraphMlCodec.prototype.addEdgeStyle = function (edge, styleObj, styleMap)
case "DashDotDot":
pattern = "3 1 1 1 1 1";
break;
case "Dash":
pattern = "3 1";
break;
default:
pattern = val.replace(/0/g, '1');
}
@ -1685,16 +1710,16 @@ mxGraphMlCodec.prototype.addLabels = function (node, LblObj, nodeStyle)
else if (lblLayouts[i]["y:FreeEdgeLabelModelParameter"])
{
lGeo.relative = true;
lGeo.adjustIt = true;
var layout = lblLayouts[i]["y:FreeEdgeLabelModelParameter"];
var ratio = layout["Ratio"];
var distance = layout["Distance"];
var angle = layout["Angle"];
//This is just an approximation
//TODO calculate the absolute value based on edge start/end points only, then orthogonal distance. Finally, convert it back to mxGraph relative point
//The geometry is adjusted after finishing the graph import (in decode method)
if (ratio)
{
lGeo.x = parseFloat(ratio);//2 * parseFloat(ratio) - 2;
lGeo.x = parseFloat(ratio);
}
if (distance)
@ -1706,7 +1731,36 @@ mxGraphMlCodec.prototype.addLabels = function (node, LblObj, nodeStyle)
{
lblCell.style += ";rotation=" + (parseFloat(angle) * (180 / Math.PI));
}
lblCell.style += ";verticalAlign=middle;";
}
else if (lblLayouts[i]["y:EdgePathLabelModelParameter"])
{
lGeo.relative = true;
var layout = lblLayouts[i]["y:EdgePathLabelModelParameter"];
var side = layout["SideOfEdge"];
var ratio = layout["SegmentRatio"];
lGeo.x = ratio? (2 * parseFloat(ratio) - 1) : 0;
//TODO this is an approximation, it needs to take into consideration the segment direction and label size
if (side)
{
switch(side)
{
case "RightOfEdge":
lGeo.y = -15;
break;
case "LeftOfEdge":
lGeo.y = 15;
break;
}
}
lblCell.style += ";verticalAlign=middle;";
}
//y:SmartEdgeLabelModelParameter TODO
else if (node.isEdge)
{
lGeo.relative = true;

View file

@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+z.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"7.8.0",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"7.8.2",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
@ -672,15 +672,15 @@ mxFastOrganicLayout.prototype.iteration=0;mxFastOrganicLayout.prototype.allowedT
mxFastOrganicLayout.prototype.execute=function(a){var b=this.graph.getModel();this.vertexArray=[];for(var c=this.graph.getChildVertices(a),d=0;d<c.length;d++)this.isVertexIgnored(c[d])||this.vertexArray.push(c[d]);var e=this.useInputOrigin?this.graph.getBoundingBoxFromGeometry(this.vertexArray):null,f=this.vertexArray.length;this.indices=[];this.dispX=[];this.dispY=[];this.cellLocation=[];this.isMoveable=[];this.neighbours=[];this.radius=[];this.radiusSquared=[];.001>this.forceConstant&&(this.forceConstant=
.001);this.forceConstantSquared=this.forceConstant*this.forceConstant;for(d=0;d<this.vertexArray.length;d++){var g=this.vertexArray[d];this.cellLocation[d]=[];var h=mxObjectIdentity.get(g);this.indices[h]=d;var k=this.getVertexBounds(g),l=k.width,m=k.height,n=k.x,p=k.y;this.cellLocation[d][0]=n+l/2;this.cellLocation[d][1]=p+m/2;this.radius[d]=Math.min(l,m);this.radiusSquared[d]=this.radius[d]*this.radius[d]}b.beginUpdate();try{for(d=0;d<f;d++){this.dispX[d]=0;this.dispY[d]=0;this.isMoveable[d]=this.isVertexMovable(this.vertexArray[d]);
var r=this.graph.getConnections(this.vertexArray[d],a),c=this.graph.getOpposites(r,this.vertexArray[d]);this.neighbours[d]=[];for(l=0;l<c.length;l++){this.resetEdges&&this.graph.resetEdge(r[l]);this.disableEdgeStyle&&this.setEdgeStyleEnabled(r[l],!1);var h=mxObjectIdentity.get(c[l]),q=this.indices[h];this.neighbours[d][l]=null!=q?q:d}}this.temperature=this.initialTemp;0==this.maxIterations&&(this.maxIterations=20*Math.sqrt(f));for(this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun)return;
this.calcRepulsion();this.calcAttraction();this.calcPositions();this.reduceTemperature()}a=c=null;for(d=0;d<this.vertexArray.length;d++)g=this.vertexArray[d],this.isVertexMovable(g)&&(k=this.getVertexBounds(g),null!=k&&(this.cellLocation[d][0]-=k.width/2,this.cellLocation[d][1]-=k.height/2,n=this.graph.snap(this.cellLocation[d][0]),p=this.graph.snap(this.cellLocation[d][1]),this.setVertexLocation(g,n,p),c=null==c?n:Math.min(c,n),a=null==a?p:Math.min(a,p)));d=-(c||0)+1;g=-(a||0)+1;null!=e&&(d+=e.x,
g+=e.y);this.graph.moveCells(this.vertexArray,d,g)}finally{b.endUpdate()}};mxFastOrganicLayout.prototype.calcPositions=function(){for(var a=0;a<this.vertexArray.length;a++)if(this.isMoveable[a]){var b=Math.sqrt(this.dispX[a]*this.dispX[a]+this.dispY[a]*this.dispY[a]);.001>b&&(b=.001);var c=this.dispX[a]/b*Math.min(b,this.temperature),b=this.dispY[a]/b*Math.min(b,this.temperature);this.dispX[a]=0;this.dispY[a]=0;this.cellLocation[a][0]+=c;this.cellLocation[a][1]+=b}};
this.calcRepulsion();this.calcAttraction();this.calcPositions();this.reduceTemperature()}a=c=null;for(d=0;d<this.vertexArray.length;d++)g=this.vertexArray[d],this.isVertexMovable(g)&&(k=this.getVertexBounds(g),null!=k&&(this.cellLocation[d][0]-=k.width/2,this.cellLocation[d][1]-=k.height/2,n=this.graph.snap(Math.round(this.cellLocation[d][0])),p=this.graph.snap(Math.round(this.cellLocation[d][1])),this.setVertexLocation(g,n,p),c=null==c?n:Math.min(c,n),a=null==a?p:Math.min(a,p)));d=-(c||0)+1;g=-(a||
0)+1;null!=e&&(d+=e.x,g+=e.y);this.graph.moveCells(this.vertexArray,d,g)}finally{b.endUpdate()}};mxFastOrganicLayout.prototype.calcPositions=function(){for(var a=0;a<this.vertexArray.length;a++)if(this.isMoveable[a]){var b=Math.sqrt(this.dispX[a]*this.dispX[a]+this.dispY[a]*this.dispY[a]);.001>b&&(b=.001);var c=this.dispX[a]/b*Math.min(b,this.temperature),b=this.dispY[a]/b*Math.min(b,this.temperature);this.dispX[a]=0;this.dispY[a]=0;this.cellLocation[a][0]+=c;this.cellLocation[a][1]+=b}};
mxFastOrganicLayout.prototype.calcAttraction=function(){for(var a=0;a<this.vertexArray.length;a++)for(var b=0;b<this.neighbours[a].length;b++){var c=this.neighbours[a][b];if(a!=c&&this.isMoveable[a]&&this.isMoveable[c]){var d=this.cellLocation[a][0]-this.cellLocation[c][0],e=this.cellLocation[a][1]-this.cellLocation[c][1],f=d*d+e*e-this.radiusSquared[a]-this.radiusSquared[c];f<this.minDistanceLimitSquared&&(f=this.minDistanceLimitSquared);var g=Math.sqrt(f),f=f/this.forceConstant,d=d/g*f,e=e/g*f;
this.dispX[a]-=d;this.dispY[a]-=e;this.dispX[c]+=d;this.dispY[c]+=e}}};
mxFastOrganicLayout.prototype.calcRepulsion=function(){for(var a=this.vertexArray.length,b=0;b<a;b++)for(var c=b;c<a;c++){if(!this.allowedToRun)return;if(c!=b&&this.isMoveable[b]&&this.isMoveable[c]){var d=this.cellLocation[b][0]-this.cellLocation[c][0],e=this.cellLocation[b][1]-this.cellLocation[c][1];0==d&&(d=.01+Math.random());0==e&&(e=.01+Math.random());var f=Math.sqrt(d*d+e*e),g=f-this.radius[b]-this.radius[c];g>this.maxDistanceLimit||(g<this.minDistanceLimit&&(g=this.minDistanceLimit),g=this.forceConstantSquared/
g,d=d/f*g,e=e/f*g,this.dispX[b]+=d,this.dispY[b]+=e,this.dispX[c]-=d,this.dispY[c]-=e)}}};mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)};function mxCircleLayout(a,b){mxGraphLayout.call(this,a);this.radius=null!=b?b:100}mxCircleLayout.prototype=new mxGraphLayout;mxCircleLayout.prototype.constructor=mxCircleLayout;mxCircleLayout.prototype.radius=null;mxCircleLayout.prototype.moveCircle=!1;
mxCircleLayout.prototype.x0=0;mxCircleLayout.prototype.y0=0;mxCircleLayout.prototype.resetEdges=!0;mxCircleLayout.prototype.disableEdgeStyle=!0;
mxCircleLayout.prototype.execute=function(a){var b=this.graph.getModel();b.beginUpdate();try{for(var c=0,d=null,e=null,f=[],g=b.getChildCount(a),h=0;h<g;h++){var k=b.getChildAt(a,h);if(this.isVertexIgnored(k))this.isEdgeIgnored(k)||(this.resetEdges&&this.graph.resetEdge(k),this.disableEdgeStyle&&this.setEdgeStyleEnabled(k,!1));else{f.push(k);var l=this.getVertexBounds(k),d=null==d?l.y:Math.min(d,l.y),e=null==e?l.x:Math.min(e,l.x),c=Math.max(c,Math.max(l.width,l.height))}}var m=this.getRadius(f.length,
c);this.moveCircle&&(e=this.x0,d=this.y0);this.circle(f,m,e,d)}finally{b.endUpdate()}};mxCircleLayout.prototype.getRadius=function(a,b){return Math.max(a*b/Math.PI,this.radius)};mxCircleLayout.prototype.circle=function(a,b,c,d){for(var e=a.length,f=2*Math.PI/e,g=0;g<e;g++)this.isVertexMovable(a[g])&&this.setVertexLocation(a[g],c+b+b*Math.sin(g*f),d+b+b*Math.cos(g*f))};function mxParallelEdgeLayout(a){mxGraphLayout.call(this,a)}mxParallelEdgeLayout.prototype=new mxGraphLayout;
c);this.moveCircle&&(e=this.x0,d=this.y0);this.circle(f,m,e,d)}finally{b.endUpdate()}};mxCircleLayout.prototype.getRadius=function(a,b){return Math.max(a*b/Math.PI,this.radius)};mxCircleLayout.prototype.circle=function(a,b,c,d){for(var e=a.length,f=2*Math.PI/e,g=0;g<e;g++)this.isVertexMovable(a[g])&&this.setVertexLocation(a[g],Math.round(c+b+b*Math.sin(g*f)),Math.round(d+b+b*Math.cos(g*f)))};function mxParallelEdgeLayout(a){mxGraphLayout.call(this,a)}mxParallelEdgeLayout.prototype=new mxGraphLayout;
mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout;mxParallelEdgeLayout.prototype.spacing=20;mxParallelEdgeLayout.prototype.execute=function(a){a=this.findParallels(a);this.graph.model.beginUpdate();try{for(var b in a){var c=a[b];1<c.length&&this.layout(c)}}finally{this.graph.model.endUpdate()}};
mxParallelEdgeLayout.prototype.findParallels=function(a){for(var b=this.graph.getModel(),c=[],d=b.getChildCount(a),e=0;e<d;e++){var f=b.getChildAt(a,e);if(!this.isEdgeIgnored(f)){var g=this.getEdgeId(f);null!=g&&(null==c[g]&&(c[g]=[]),c[g].push(f))}}return c};mxParallelEdgeLayout.prototype.getEdgeId=function(a){var b=this.graph.getView(),c=b.getVisibleTerminal(a,!0);a=b.getVisibleTerminal(a,!1);return null!=c&&null!=a?(c=mxObjectIdentity.get(c),a=mxObjectIdentity.get(a),c>a?a+"-"+c:c+"-"+a):null};
mxParallelEdgeLayout.prototype.layout=function(a){var b=a[0],c=this.graph.getView(),d=this.graph.getModel(),e=d.getGeometry(c.getVisibleTerminal(b,!0)),d=d.getGeometry(c.getVisibleTerminal(b,!1));if(e==d)for(var b=e.x+e.width+this.spacing,c=e.y+e.height/2,f=0;f<a.length;f++)this.route(a[f],b,c),b+=this.spacing;else if(null!=e&&null!=d){var b=e.x+e.width/2,c=e.y+e.height/2,f=d.x+d.width/2-b,g=d.y+d.height/2-c,d=Math.sqrt(f*f+g*g);if(0<d)for(e=g*this.spacing/d,d=f*this.spacing/d,b=b+f/2+e*(a.length-

View file

@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+z.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"7.8.0",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"7.8.2",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
@ -672,15 +672,15 @@ mxFastOrganicLayout.prototype.iteration=0;mxFastOrganicLayout.prototype.allowedT
mxFastOrganicLayout.prototype.execute=function(a){var b=this.graph.getModel();this.vertexArray=[];for(var c=this.graph.getChildVertices(a),d=0;d<c.length;d++)this.isVertexIgnored(c[d])||this.vertexArray.push(c[d]);var e=this.useInputOrigin?this.graph.getBoundingBoxFromGeometry(this.vertexArray):null,f=this.vertexArray.length;this.indices=[];this.dispX=[];this.dispY=[];this.cellLocation=[];this.isMoveable=[];this.neighbours=[];this.radius=[];this.radiusSquared=[];.001>this.forceConstant&&(this.forceConstant=
.001);this.forceConstantSquared=this.forceConstant*this.forceConstant;for(d=0;d<this.vertexArray.length;d++){var g=this.vertexArray[d];this.cellLocation[d]=[];var h=mxObjectIdentity.get(g);this.indices[h]=d;var k=this.getVertexBounds(g),l=k.width,m=k.height,n=k.x,p=k.y;this.cellLocation[d][0]=n+l/2;this.cellLocation[d][1]=p+m/2;this.radius[d]=Math.min(l,m);this.radiusSquared[d]=this.radius[d]*this.radius[d]}b.beginUpdate();try{for(d=0;d<f;d++){this.dispX[d]=0;this.dispY[d]=0;this.isMoveable[d]=this.isVertexMovable(this.vertexArray[d]);
var r=this.graph.getConnections(this.vertexArray[d],a),c=this.graph.getOpposites(r,this.vertexArray[d]);this.neighbours[d]=[];for(l=0;l<c.length;l++){this.resetEdges&&this.graph.resetEdge(r[l]);this.disableEdgeStyle&&this.setEdgeStyleEnabled(r[l],!1);var h=mxObjectIdentity.get(c[l]),q=this.indices[h];this.neighbours[d][l]=null!=q?q:d}}this.temperature=this.initialTemp;0==this.maxIterations&&(this.maxIterations=20*Math.sqrt(f));for(this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun)return;
this.calcRepulsion();this.calcAttraction();this.calcPositions();this.reduceTemperature()}a=c=null;for(d=0;d<this.vertexArray.length;d++)g=this.vertexArray[d],this.isVertexMovable(g)&&(k=this.getVertexBounds(g),null!=k&&(this.cellLocation[d][0]-=k.width/2,this.cellLocation[d][1]-=k.height/2,n=this.graph.snap(this.cellLocation[d][0]),p=this.graph.snap(this.cellLocation[d][1]),this.setVertexLocation(g,n,p),c=null==c?n:Math.min(c,n),a=null==a?p:Math.min(a,p)));d=-(c||0)+1;g=-(a||0)+1;null!=e&&(d+=e.x,
g+=e.y);this.graph.moveCells(this.vertexArray,d,g)}finally{b.endUpdate()}};mxFastOrganicLayout.prototype.calcPositions=function(){for(var a=0;a<this.vertexArray.length;a++)if(this.isMoveable[a]){var b=Math.sqrt(this.dispX[a]*this.dispX[a]+this.dispY[a]*this.dispY[a]);.001>b&&(b=.001);var c=this.dispX[a]/b*Math.min(b,this.temperature),b=this.dispY[a]/b*Math.min(b,this.temperature);this.dispX[a]=0;this.dispY[a]=0;this.cellLocation[a][0]+=c;this.cellLocation[a][1]+=b}};
this.calcRepulsion();this.calcAttraction();this.calcPositions();this.reduceTemperature()}a=c=null;for(d=0;d<this.vertexArray.length;d++)g=this.vertexArray[d],this.isVertexMovable(g)&&(k=this.getVertexBounds(g),null!=k&&(this.cellLocation[d][0]-=k.width/2,this.cellLocation[d][1]-=k.height/2,n=this.graph.snap(Math.round(this.cellLocation[d][0])),p=this.graph.snap(Math.round(this.cellLocation[d][1])),this.setVertexLocation(g,n,p),c=null==c?n:Math.min(c,n),a=null==a?p:Math.min(a,p)));d=-(c||0)+1;g=-(a||
0)+1;null!=e&&(d+=e.x,g+=e.y);this.graph.moveCells(this.vertexArray,d,g)}finally{b.endUpdate()}};mxFastOrganicLayout.prototype.calcPositions=function(){for(var a=0;a<this.vertexArray.length;a++)if(this.isMoveable[a]){var b=Math.sqrt(this.dispX[a]*this.dispX[a]+this.dispY[a]*this.dispY[a]);.001>b&&(b=.001);var c=this.dispX[a]/b*Math.min(b,this.temperature),b=this.dispY[a]/b*Math.min(b,this.temperature);this.dispX[a]=0;this.dispY[a]=0;this.cellLocation[a][0]+=c;this.cellLocation[a][1]+=b}};
mxFastOrganicLayout.prototype.calcAttraction=function(){for(var a=0;a<this.vertexArray.length;a++)for(var b=0;b<this.neighbours[a].length;b++){var c=this.neighbours[a][b];if(a!=c&&this.isMoveable[a]&&this.isMoveable[c]){var d=this.cellLocation[a][0]-this.cellLocation[c][0],e=this.cellLocation[a][1]-this.cellLocation[c][1],f=d*d+e*e-this.radiusSquared[a]-this.radiusSquared[c];f<this.minDistanceLimitSquared&&(f=this.minDistanceLimitSquared);var g=Math.sqrt(f),f=f/this.forceConstant,d=d/g*f,e=e/g*f;
this.dispX[a]-=d;this.dispY[a]-=e;this.dispX[c]+=d;this.dispY[c]+=e}}};
mxFastOrganicLayout.prototype.calcRepulsion=function(){for(var a=this.vertexArray.length,b=0;b<a;b++)for(var c=b;c<a;c++){if(!this.allowedToRun)return;if(c!=b&&this.isMoveable[b]&&this.isMoveable[c]){var d=this.cellLocation[b][0]-this.cellLocation[c][0],e=this.cellLocation[b][1]-this.cellLocation[c][1];0==d&&(d=.01+Math.random());0==e&&(e=.01+Math.random());var f=Math.sqrt(d*d+e*e),g=f-this.radius[b]-this.radius[c];g>this.maxDistanceLimit||(g<this.minDistanceLimit&&(g=this.minDistanceLimit),g=this.forceConstantSquared/
g,d=d/f*g,e=e/f*g,this.dispX[b]+=d,this.dispY[b]+=e,this.dispX[c]-=d,this.dispY[c]-=e)}}};mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)};function mxCircleLayout(a,b){mxGraphLayout.call(this,a);this.radius=null!=b?b:100}mxCircleLayout.prototype=new mxGraphLayout;mxCircleLayout.prototype.constructor=mxCircleLayout;mxCircleLayout.prototype.radius=null;mxCircleLayout.prototype.moveCircle=!1;
mxCircleLayout.prototype.x0=0;mxCircleLayout.prototype.y0=0;mxCircleLayout.prototype.resetEdges=!0;mxCircleLayout.prototype.disableEdgeStyle=!0;
mxCircleLayout.prototype.execute=function(a){var b=this.graph.getModel();b.beginUpdate();try{for(var c=0,d=null,e=null,f=[],g=b.getChildCount(a),h=0;h<g;h++){var k=b.getChildAt(a,h);if(this.isVertexIgnored(k))this.isEdgeIgnored(k)||(this.resetEdges&&this.graph.resetEdge(k),this.disableEdgeStyle&&this.setEdgeStyleEnabled(k,!1));else{f.push(k);var l=this.getVertexBounds(k),d=null==d?l.y:Math.min(d,l.y),e=null==e?l.x:Math.min(e,l.x),c=Math.max(c,Math.max(l.width,l.height))}}var m=this.getRadius(f.length,
c);this.moveCircle&&(e=this.x0,d=this.y0);this.circle(f,m,e,d)}finally{b.endUpdate()}};mxCircleLayout.prototype.getRadius=function(a,b){return Math.max(a*b/Math.PI,this.radius)};mxCircleLayout.prototype.circle=function(a,b,c,d){for(var e=a.length,f=2*Math.PI/e,g=0;g<e;g++)this.isVertexMovable(a[g])&&this.setVertexLocation(a[g],c+b+b*Math.sin(g*f),d+b+b*Math.cos(g*f))};function mxParallelEdgeLayout(a){mxGraphLayout.call(this,a)}mxParallelEdgeLayout.prototype=new mxGraphLayout;
c);this.moveCircle&&(e=this.x0,d=this.y0);this.circle(f,m,e,d)}finally{b.endUpdate()}};mxCircleLayout.prototype.getRadius=function(a,b){return Math.max(a*b/Math.PI,this.radius)};mxCircleLayout.prototype.circle=function(a,b,c,d){for(var e=a.length,f=2*Math.PI/e,g=0;g<e;g++)this.isVertexMovable(a[g])&&this.setVertexLocation(a[g],Math.round(c+b+b*Math.sin(g*f)),Math.round(d+b+b*Math.cos(g*f)))};function mxParallelEdgeLayout(a){mxGraphLayout.call(this,a)}mxParallelEdgeLayout.prototype=new mxGraphLayout;
mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout;mxParallelEdgeLayout.prototype.spacing=20;mxParallelEdgeLayout.prototype.execute=function(a){a=this.findParallels(a);this.graph.model.beginUpdate();try{for(var b in a){var c=a[b];1<c.length&&this.layout(c)}}finally{this.graph.model.endUpdate()}};
mxParallelEdgeLayout.prototype.findParallels=function(a){for(var b=this.graph.getModel(),c=[],d=b.getChildCount(a),e=0;e<d;e++){var f=b.getChildAt(a,e);if(!this.isEdgeIgnored(f)){var g=this.getEdgeId(f);null!=g&&(null==c[g]&&(c[g]=[]),c[g].push(f))}}return c};mxParallelEdgeLayout.prototype.getEdgeId=function(a){var b=this.graph.getView(),c=b.getVisibleTerminal(a,!0);a=b.getVisibleTerminal(a,!1);return null!=c&&null!=a?(c=mxObjectIdentity.get(c),a=mxObjectIdentity.get(a),c>a?a+"-"+c:c+"-"+a):null};
mxParallelEdgeLayout.prototype.layout=function(a){var b=a[0],c=this.graph.getView(),d=this.graph.getModel(),e=d.getGeometry(c.getVisibleTerminal(b,!0)),d=d.getGeometry(c.getVisibleTerminal(b,!1));if(e==d)for(var b=e.x+e.width+this.spacing,c=e.y+e.height/2,f=0;f<a.length;f++)this.route(a[f],b,c),b+=this.spacing;else if(null!=e&&null!=d){var b=e.x+e.width/2,c=e.y+e.height/2,f=d.x+d.width/2-b,g=d.y+d.height/2-c,d=Math.sqrt(f*f+g*g);if(0<d)for(e=g*this.spacing/d,d=f*this.spacing/d,b=b+f/2+e*(a.length-

1383
war/js/viewer.min.js vendored

File diff suppressed because it is too large Load diff