@pickaxeproject/react 4.1.4 → 4.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/Pickaxe/Addons/Document/hooks/useDocument.js +1 -1
- package/dist/cjs/node_modules/.pnpm/cose-base@1.0.3/node_modules/cose-base/cose-base.js +1 -1
- package/dist/cjs/node_modules/.pnpm/cose-base@2.2.0/node_modules/cose-base/cose-base.js +1 -1
- package/dist/cjs/node_modules/.pnpm/layout-base@1.0.2/node_modules/layout-base/layout-base.js +1 -1
- package/dist/cjs/node_modules/.pnpm/layout-base@2.0.1/node_modules/layout-base/layout-base.js +1 -1
- package/dist/cjs/src/types/history.d.ts +1 -1
- package/dist/cjs/src/types/pickaxe.d.ts +1 -1
- package/dist/esm/components/Pickaxe/Addons/Document/hooks/useDocument.js +1 -1
- package/dist/esm/node_modules/.pnpm/cose-base@1.0.3/node_modules/cose-base/cose-base.js +1 -1
- package/dist/esm/node_modules/.pnpm/cose-base@2.2.0/node_modules/cose-base/cose-base.js +1 -1
- package/dist/esm/node_modules/.pnpm/layout-base@1.0.2/node_modules/layout-base/layout-base.js +1 -1
- package/dist/esm/node_modules/.pnpm/layout-base@2.0.1/node_modules/layout-base/layout-base.js +1 -1
- package/dist/esm/src/types/history.d.ts +1 -1
- package/dist/esm/src/types/pickaxe.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{commonjsGlobal as t}from"../../../../../_virtual/_commonjsHelpers.js";import{__module as e}from"../../../../../_virtual/cose-base2.js";import{__require as r}from"../../../layout-base@1.0.2/node_modules/layout-base/layout-base.js";var i;function o(){return i||(i=1,t=e,e.exports,o=function(t){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.i=function(t){return t},r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=7)}([function(e,r){e.exports=t},function(t,e,r){var i=r(0).FDLayoutConstants;function o(){}for(var n in i)o[n]=i[n];o.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,o.DEFAULT_RADIAL_SEPARATION=i.DEFAULT_EDGE_LENGTH,o.DEFAULT_COMPONENT_SEPERATION=60,o.TILE=!0,o.TILING_PADDING_VERTICAL=10,o.TILING_PADDING_HORIZONTAL=10,o.TREE_REDUCTION_ON_INCREMENTAL=!1,t.exports=o},function(t,e,r){var i=r(0).FDLayoutEdge;function o(t,e,r){i.call(this,t,e,r)}for(var n in o.prototype=Object.create(i.prototype),i)o[n]=i[n];t.exports=o},function(t,e,r){var i=r(0).LGraph;function o(t,e,r){i.call(this,t,e,r)}for(var n in o.prototype=Object.create(i.prototype),i)o[n]=i[n];t.exports=o},function(t,e,r){var i=r(0).LGraphManager;function o(t){i.call(this,t)}for(var n in o.prototype=Object.create(i.prototype),i)o[n]=i[n];t.exports=o},function(t,e,r){var i=r(0).FDLayoutNode,o=r(0).IMath;function n(t,e,r,o){i.call(this,t,e,r,o)}for(var a in n.prototype=Object.create(i.prototype),i)n[a]=i[a];n.prototype.move=function(){var t=this.graphManager.getLayout();this.displacementX=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*o.sign(this.displacementY)),null==this.child||0==this.child.getNodes().length?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),t.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},n.prototype.propogateDisplacementToChildren=function(t,e){for(var r,i=this.getChild().getNodes(),o=0;o<i.length;o++)null==(r=i[o]).getChild()?(r.moveBy(t,e),r.displacementX+=t,r.displacementY+=e):r.propogateDisplacementToChildren(t,e)},n.prototype.setPred1=function(t){this.pred1=t},n.prototype.getPred1=function(){return pred1},n.prototype.getPred2=function(){return pred2},n.prototype.setNext=function(t){this.next=t},n.prototype.getNext=function(){return next},n.prototype.setProcessed=function(t){this.processed=t},n.prototype.isProcessed=function(){return processed},t.exports=n},function(t,e,r){var i=r(0).FDLayout,o=r(4),n=r(3),a=r(5),s=r(2),h=r(1),d=r(0).FDLayoutConstants,g=r(0).LayoutConstants,l=r(0).Point,p=r(0).PointD,c=r(0).Layout,u=r(0).Integer,f=r(0).IGeometry,v=r(0).LGraph,T=r(0).Transform;function E(){i.call(this),this.toBeTiled={}}for(var m in E.prototype=Object.create(i.prototype),i)E[m]=i[m];E.prototype.newGraphManager=function(){var t=new o(this);return this.graphManager=t,t},E.prototype.newGraph=function(t){return new n(null,this.graphManager,t)},E.prototype.newNode=function(t){return new a(this.graphManager,t)},E.prototype.newEdge=function(t){return new s(null,null,t)},E.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments),this.isSubLayout||(h.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=d.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=d.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=d.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=d.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=d.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},E.prototype.layout=function(){return g.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},E.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)h.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),e=new Set(this.getAllNodes()),r=this.nodesWithGravity.filter((function(t){return e.has(t)})),this.graphManager.setAllNodesToApplyGravitation(r));else{var t=this.getFlatForest();if(t.length>0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),r=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(r),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},E.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(e),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var r=!this.isTreeGrowing&&!this.isGrowthFinished,i=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(r,i),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},E.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},r=0;r<t.length;r++){var i=t[r].rect,o=t[r].id;e[o]={id:o,x:i.getCenterX(),y:i.getCenterY(),w:i.width,h:i.height}}return e},E.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var t=!1;if("during"===d.ANIMATE)this.emit("layoutstarted");else{for(;!t;)t=this.tick();this.graphManager.updateBounds()}},E.prototype.calculateNodesToApplyGravitationTo=function(){var t,e,r=[],i=this.graphManager.getGraphs(),o=i.length;for(e=0;e<o;e++)(t=i[e]).updateConnected(),t.isConnected||(r=r.concat(t.getNodes()));return r},E.prototype.createBendpoints=function(){var t=[];t=t.concat(this.graphManager.getAllEdges());var e,r=new Set;for(e=0;e<t.length;e++){var i=t[e];if(!r.has(i)){var o=i.getSource(),n=i.getTarget();if(o==n)i.getBendpoints().push(new p),i.getBendpoints().push(new p),this.createDummyNodesForBendpoints(i),r.add(i);else{var a=[];if(a=(a=a.concat(o.getEdgeListToNode(n))).concat(n.getEdgeListToNode(o)),!r.has(a[0])){var s;if(a.length>1)for(s=0;s<a.length;s++){var h=a[s];h.getBendpoints().push(new p),this.createDummyNodesForBendpoints(h)}a.forEach((function(t){r.add(t)}))}}}if(r.size==t.length)break}},E.prototype.positionNodesRadially=function(t){for(var e=new l(0,0),r=Math.ceil(Math.sqrt(t.length)),i=0,o=0,n=0,a=new p(0,0),s=0;s<t.length;s++){s%r==0&&(n=0,o=i,0!=s&&(o+=h.DEFAULT_COMPONENT_SEPERATION),i=0);var d=t[s],u=c.findCenterOfTree(d);e.x=n,e.y=o,(a=E.radialLayout(d,u,e)).y>i&&(i=Math.floor(a.y)),n=Math.floor(a.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(g.WORLD_CENTER_X-a.x/2,g.WORLD_CENTER_Y-a.y/2))},E.radialLayout=function(t,e,r){var i=Math.max(this.maxDiagonalInTree(t),h.DEFAULT_RADIAL_SEPARATION);E.branchRadialLayout(e,null,0,359,0,i);var o=v.calculateBounds(t),n=new T;n.setDeviceOrgX(o.getMinX()),n.setDeviceOrgY(o.getMinY()),n.setWorldOrgX(r.x),n.setWorldOrgY(r.y);for(var a=0;a<t.length;a++)t[a].transform(n);var s=new p(o.getMaxX(),o.getMaxY());return n.inverseTransformPoint(s)},E.branchRadialLayout=function(t,e,r,i,o,n){var a=(i-r+1)/2;a<0&&(a+=180);var s=(a+r)%360*f.TWO_PI/360,h=o*Math.cos(s),d=o*Math.sin(s);t.setCenter(h,d);var g=[],l=(g=g.concat(t.getEdges())).length;null!=e&&l--;for(var p,c=0,u=g.length,v=t.getEdgesBetween(e);v.length>1;){var T=v[0];v.splice(0,1);var m=g.indexOf(T);m>=0&&g.splice(m,1),u--,l--}p=null!=e?(g.indexOf(v[0])+1)%u:0;for(var y=Math.abs(i-r)/l,N=p;c!=l;N=++N%u){var w=g[N].getOtherEnd(t);if(w!=e){var A=(r+c*y)%360,C=(A+y)%360;E.branchRadialLayout(w,t,A,C,o+n,n),c++}}},E.maxDiagonalInTree=function(t){for(var e=u.MIN_VALUE,r=0;r<t.length;r++){var i=t[r].getDiagonal();i>e&&(e=i)}return e},E.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},E.prototype.groupZeroDegreeMembers=function(){var t=this,e={};this.memberGroups={},this.idToDummyNode={};for(var r=[],i=this.graphManager.getAllNodes(),o=0;o<i.length;o++){var n=(s=i[o]).getParent();0!==this.getNodeDegreeWithChildren(s)||null!=n.id&&this.getToBeTiled(n)||r.push(s)}for(o=0;o<r.length;o++){var s,h=(s=r[o]).getParent().id;void 0===e[h]&&(e[h]=[]),e[h]=e[h].concat(s)}Object.keys(e).forEach((function(r){if(e[r].length>1){var i="DummyCompound_"+r;t.memberGroups[i]=e[r];var o=e[r][0].getParent(),n=new a(t.graphManager);n.id=i,n.paddingLeft=o.paddingLeft||0,n.paddingRight=o.paddingRight||0,n.paddingBottom=o.paddingBottom||0,n.paddingTop=o.paddingTop||0,t.idToDummyNode[i]=n;var s=t.getGraphManager().add(t.newGraph(),n),h=o.getChild();h.add(n);for(var d=0;d<e[r].length;d++){var g=e[r][d];h.remove(g),s.add(g)}}}))},E.prototype.clearCompounds=function(){var t={},e={};this.performDFSOnCompounds();for(var r=0;r<this.compoundOrder.length;r++)e[this.compoundOrder[r].id]=this.compoundOrder[r],t[this.compoundOrder[r].id]=[].concat(this.compoundOrder[r].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[r].getChild()),this.compoundOrder[r].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(t,e)},E.prototype.clearZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach((function(r){var i=t.idToDummyNode[r];e[r]=t.tileNodes(t.memberGroups[r],i.paddingLeft+i.paddingRight),i.rect.width=e[r].width,i.rect.height=e[r].height}))},E.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var e=this.compoundOrder[t],r=e.id,i=e.paddingLeft,o=e.paddingTop;this.adjustLocations(this.tiledMemberPack[r],e.rect.x,e.rect.y,i,o)}},E.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach((function(r){var i=t.idToDummyNode[r],o=i.paddingLeft,n=i.paddingTop;t.adjustLocations(e[r],i.rect.x,i.rect.y,o,n)}))},E.prototype.getToBeTiled=function(t){var e=t.id;if(null!=this.toBeTiled[e])return this.toBeTiled[e];var r=t.getChild();if(null==r)return this.toBeTiled[e]=!1,!1;for(var i=r.getNodes(),o=0;o<i.length;o++){var n=i[o];if(this.getNodeDegree(n)>0)return this.toBeTiled[e]=!1,!1;if(null!=n.getChild()){if(!this.getToBeTiled(n))return this.toBeTiled[e]=!1,!1}else this.toBeTiled[n.id]=!1}return this.toBeTiled[e]=!0,!0},E.prototype.getNodeDegree=function(t){t.id;for(var e=t.getEdges(),r=0,i=0;i<e.length;i++){var o=e[i];o.getSource().id!==o.getTarget().id&&(r+=1)}return r},E.prototype.getNodeDegreeWithChildren=function(t){var e=this.getNodeDegree(t);if(null==t.getChild())return e;for(var r=t.getChild().getNodes(),i=0;i<r.length;i++){var o=r[i];e+=this.getNodeDegreeWithChildren(o)}return e},E.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},E.prototype.fillCompexOrderByDFS=function(t){for(var e=0;e<t.length;e++){var r=t[e];null!=r.getChild()&&this.fillCompexOrderByDFS(r.getChild().getNodes()),this.getToBeTiled(r)&&this.compoundOrder.push(r)}},E.prototype.adjustLocations=function(t,e,r,i,o){r+=o;for(var n=e+=i,a=0;a<t.rows.length;a++){var s=t.rows[a];e=n;for(var h=0,d=0;d<s.length;d++){var g=s[d];g.rect.x=e,g.rect.y=r,e+=g.rect.width+t.horizontalPadding,g.rect.height>h&&(h=g.rect.height)}r+=h+t.verticalPadding}},E.prototype.tileCompoundMembers=function(t,e){var r=this;this.tiledMemberPack=[],Object.keys(t).forEach((function(i){var o=e[i];r.tiledMemberPack[i]=r.tileNodes(t[i],o.paddingLeft+o.paddingRight),o.rect.width=r.tiledMemberPack[i].width,o.rect.height=r.tiledMemberPack[i].height}))},E.prototype.tileNodes=function(t,e){var r={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:h.TILING_PADDING_VERTICAL,horizontalPadding:h.TILING_PADDING_HORIZONTAL};t.sort((function(t,e){return t.rect.width*t.rect.height>e.rect.width*e.rect.height?-1:t.rect.width*t.rect.height<e.rect.width*e.rect.height?1:0}));for(var i=0;i<t.length;i++){var o=t[i];0==r.rows.length?this.insertNodeToRow(r,o,0,e):this.canAddHorizontal(r,o.rect.width,o.rect.height)?this.insertNodeToRow(r,o,this.getShortestRowIndex(r),e):this.insertNodeToRow(r,o,r.rows.length,e),this.shiftToLastRow(r)}return r},E.prototype.insertNodeToRow=function(t,e,r,i){var o=i;r==t.rows.length&&(t.rows.push([]),t.rowWidth.push(o),t.rowHeight.push(0));var n=t.rowWidth[r]+e.rect.width;t.rows[r].length>0&&(n+=t.horizontalPadding),t.rowWidth[r]=n,t.width<n&&(t.width=n);var a=e.rect.height;r>0&&(a+=t.verticalPadding);var s=0;a>t.rowHeight[r]&&(s=t.rowHeight[r],t.rowHeight[r]=a,s=t.rowHeight[r]-s),t.height+=s,t.rows[r].push(e)},E.prototype.getShortestRowIndex=function(t){for(var e=-1,r=Number.MAX_VALUE,i=0;i<t.rows.length;i++)t.rowWidth[i]<r&&(e=i,r=t.rowWidth[i]);return e},E.prototype.getLongestRowIndex=function(t){for(var e=-1,r=Number.MIN_VALUE,i=0;i<t.rows.length;i++)t.rowWidth[i]>r&&(e=i,r=t.rowWidth[i]);return e},E.prototype.canAddHorizontal=function(t,e,r){var i=this.getShortestRowIndex(t);if(i<0)return!0;var o=t.rowWidth[i];if(o+t.horizontalPadding+e<=t.width)return!0;var n,a,s=0;return t.rowHeight[i]<r&&i>0&&(s=r+t.verticalPadding-t.rowHeight[i]),n=t.width-o>=e+t.horizontalPadding?(t.height+s)/(o+e+t.horizontalPadding):(t.height+s)/t.width,s=r+t.verticalPadding,(a=t.width<e?(t.height+s)/e:(t.height+s)/t.width)<1&&(a=1/a),n<1&&(n=1/n),n<a},E.prototype.shiftToLastRow=function(t){var e=this.getLongestRowIndex(t),r=t.rowWidth.length-1,i=t.rows[e],o=i[i.length-1],n=o.width+t.horizontalPadding;if(t.width-t.rowWidth[r]>n&&e!=r){i.splice(-1,1),t.rows[r].push(o),t.rowWidth[e]=t.rowWidth[e]-n,t.rowWidth[r]=t.rowWidth[r]+n,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var a=Number.MIN_VALUE,s=0;s<i.length;s++)i[s].height>a&&(a=i[s].height);e>0&&(a+=t.verticalPadding);var h=t.rowHeight[e]+t.rowHeight[r];t.rowHeight[e]=a,t.rowHeight[r]<o.height+t.verticalPadding&&(t.rowHeight[r]=o.height+t.verticalPadding);var d=t.rowHeight[e]+t.rowHeight[r];t.height+=d-h,this.shiftToLastRow(t)}},E.prototype.tilingPreLayout=function(){h.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},E.prototype.tilingPostLayout=function(){h.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},E.prototype.reduceTrees=function(){for(var t,e=[],r=!0;r;){var i=this.graphManager.getAllNodes(),o=[];r=!1;for(var n=0;n<i.length;n++)1!=(t=i[n]).getEdges().length||t.getEdges()[0].isInterGraph||null!=t.getChild()||(o.push([t,t.getEdges()[0],t.getOwner()]),r=!0);if(1==r){for(var a=[],s=0;s<o.length;s++)1==o[s][0].getEdges().length&&(a.push(o[s]),o[s][0].getOwner().remove(o[s][0]));e.push(a),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},E.prototype.growTree=function(t){for(var e,r=t[t.length-1],i=0;i<r.length;i++)e=r[i],this.findPlaceforPrunedNode(e),e[2].add(e[0]),e[2].add(e[1],e[1].source,e[1].target);t.splice(t.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},E.prototype.findPlaceforPrunedNode=function(t){var e,r,i=t[0],o=(r=i==t[1].source?t[1].target:t[1].source).startX,n=r.finishX,a=r.startY,s=r.finishY,h=[0,0,0,0];if(a>0)for(var g=o;g<=n;g++)h[0]+=this.grid[g][a-1].length+this.grid[g][a].length-1;if(n<this.grid.length-1)for(g=a;g<=s;g++)h[1]+=this.grid[n+1][g].length+this.grid[n][g].length-1;if(s<this.grid[0].length-1)for(g=o;g<=n;g++)h[2]+=this.grid[g][s+1].length+this.grid[g][s].length-1;if(o>0)for(g=a;g<=s;g++)h[3]+=this.grid[o-1][g].length+this.grid[o][g].length-1;for(var l,p,c=u.MAX_VALUE,f=0;f<h.length;f++)h[f]<c?(c=h[f],l=1,p=f):h[f]==c&&l++;if(3==l&&0==c)0==h[0]&&0==h[1]&&0==h[2]?e=1:0==h[0]&&0==h[1]&&0==h[3]?e=0:0==h[0]&&0==h[2]&&0==h[3]?e=3:0==h[1]&&0==h[2]&&0==h[3]&&(e=2);else if(2==l&&0==c){var v=Math.floor(2*Math.random());e=0==h[0]&&0==h[1]?0==v?0:1:0==h[0]&&0==h[2]?0==v?0:2:0==h[0]&&0==h[3]?0==v?0:3:0==h[1]&&0==h[2]?0==v?1:2:0==h[1]&&0==h[3]?0==v?1:3:0==v?2:3}else e=4==l&&0==c?v=Math.floor(4*Math.random()):p;0==e?i.setCenter(r.getCenterX(),r.getCenterY()-r.getHeight()/2-d.DEFAULT_EDGE_LENGTH-i.getHeight()/2):1==e?i.setCenter(r.getCenterX()+r.getWidth()/2+d.DEFAULT_EDGE_LENGTH+i.getWidth()/2,r.getCenterY()):2==e?i.setCenter(r.getCenterX(),r.getCenterY()+r.getHeight()/2+d.DEFAULT_EDGE_LENGTH+i.getHeight()/2):i.setCenter(r.getCenterX()-r.getWidth()/2-d.DEFAULT_EDGE_LENGTH-i.getWidth()/2,r.getCenterY())},t.exports=E},function(t,e,r){var i={};i.layoutBase=r(0),i.CoSEConstants=r(1),i.CoSEEdge=r(2),i.CoSEGraph=r(3),i.CoSEGraphManager=r(4),i.CoSELayout=r(6),i.CoSENode=r(5),t.exports=i}])},t.exports=o(r())),e.exports;var t,o}e.exports;export{o as __require};
|
|
1
|
+
import{commonjsGlobal as t}from"../../../../../_virtual/_commonjsHelpers.js";import{__module as e}from"../../../../../_virtual/cose-base.js";import{__require as r}from"../../../layout-base@1.0.2/node_modules/layout-base/layout-base.js";var i;function o(){return i||(i=1,t=e,e.exports,o=function(t){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.i=function(t){return t},r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=7)}([function(e,r){e.exports=t},function(t,e,r){var i=r(0).FDLayoutConstants;function o(){}for(var n in i)o[n]=i[n];o.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,o.DEFAULT_RADIAL_SEPARATION=i.DEFAULT_EDGE_LENGTH,o.DEFAULT_COMPONENT_SEPERATION=60,o.TILE=!0,o.TILING_PADDING_VERTICAL=10,o.TILING_PADDING_HORIZONTAL=10,o.TREE_REDUCTION_ON_INCREMENTAL=!1,t.exports=o},function(t,e,r){var i=r(0).FDLayoutEdge;function o(t,e,r){i.call(this,t,e,r)}for(var n in o.prototype=Object.create(i.prototype),i)o[n]=i[n];t.exports=o},function(t,e,r){var i=r(0).LGraph;function o(t,e,r){i.call(this,t,e,r)}for(var n in o.prototype=Object.create(i.prototype),i)o[n]=i[n];t.exports=o},function(t,e,r){var i=r(0).LGraphManager;function o(t){i.call(this,t)}for(var n in o.prototype=Object.create(i.prototype),i)o[n]=i[n];t.exports=o},function(t,e,r){var i=r(0).FDLayoutNode,o=r(0).IMath;function n(t,e,r,o){i.call(this,t,e,r,o)}for(var a in n.prototype=Object.create(i.prototype),i)n[a]=i[a];n.prototype.move=function(){var t=this.graphManager.getLayout();this.displacementX=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*o.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*o.sign(this.displacementY)),null==this.child||0==this.child.getNodes().length?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),t.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},n.prototype.propogateDisplacementToChildren=function(t,e){for(var r,i=this.getChild().getNodes(),o=0;o<i.length;o++)null==(r=i[o]).getChild()?(r.moveBy(t,e),r.displacementX+=t,r.displacementY+=e):r.propogateDisplacementToChildren(t,e)},n.prototype.setPred1=function(t){this.pred1=t},n.prototype.getPred1=function(){return pred1},n.prototype.getPred2=function(){return pred2},n.prototype.setNext=function(t){this.next=t},n.prototype.getNext=function(){return next},n.prototype.setProcessed=function(t){this.processed=t},n.prototype.isProcessed=function(){return processed},t.exports=n},function(t,e,r){var i=r(0).FDLayout,o=r(4),n=r(3),a=r(5),s=r(2),h=r(1),d=r(0).FDLayoutConstants,g=r(0).LayoutConstants,l=r(0).Point,p=r(0).PointD,c=r(0).Layout,u=r(0).Integer,f=r(0).IGeometry,v=r(0).LGraph,T=r(0).Transform;function E(){i.call(this),this.toBeTiled={}}for(var m in E.prototype=Object.create(i.prototype),i)E[m]=i[m];E.prototype.newGraphManager=function(){var t=new o(this);return this.graphManager=t,t},E.prototype.newGraph=function(t){return new n(null,this.graphManager,t)},E.prototype.newNode=function(t){return new a(this.graphManager,t)},E.prototype.newEdge=function(t){return new s(null,null,t)},E.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments),this.isSubLayout||(h.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=d.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=d.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=d.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=d.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=d.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},E.prototype.layout=function(){return g.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},E.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)h.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),e=new Set(this.getAllNodes()),r=this.nodesWithGravity.filter((function(t){return e.has(t)})),this.graphManager.setAllNodesToApplyGravitation(r));else{var t=this.getFlatForest();if(t.length>0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),r=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(r),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},E.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(e),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var r=!this.isTreeGrowing&&!this.isGrowthFinished,i=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(r,i),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},E.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},r=0;r<t.length;r++){var i=t[r].rect,o=t[r].id;e[o]={id:o,x:i.getCenterX(),y:i.getCenterY(),w:i.width,h:i.height}}return e},E.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var t=!1;if("during"===d.ANIMATE)this.emit("layoutstarted");else{for(;!t;)t=this.tick();this.graphManager.updateBounds()}},E.prototype.calculateNodesToApplyGravitationTo=function(){var t,e,r=[],i=this.graphManager.getGraphs(),o=i.length;for(e=0;e<o;e++)(t=i[e]).updateConnected(),t.isConnected||(r=r.concat(t.getNodes()));return r},E.prototype.createBendpoints=function(){var t=[];t=t.concat(this.graphManager.getAllEdges());var e,r=new Set;for(e=0;e<t.length;e++){var i=t[e];if(!r.has(i)){var o=i.getSource(),n=i.getTarget();if(o==n)i.getBendpoints().push(new p),i.getBendpoints().push(new p),this.createDummyNodesForBendpoints(i),r.add(i);else{var a=[];if(a=(a=a.concat(o.getEdgeListToNode(n))).concat(n.getEdgeListToNode(o)),!r.has(a[0])){var s;if(a.length>1)for(s=0;s<a.length;s++){var h=a[s];h.getBendpoints().push(new p),this.createDummyNodesForBendpoints(h)}a.forEach((function(t){r.add(t)}))}}}if(r.size==t.length)break}},E.prototype.positionNodesRadially=function(t){for(var e=new l(0,0),r=Math.ceil(Math.sqrt(t.length)),i=0,o=0,n=0,a=new p(0,0),s=0;s<t.length;s++){s%r==0&&(n=0,o=i,0!=s&&(o+=h.DEFAULT_COMPONENT_SEPERATION),i=0);var d=t[s],u=c.findCenterOfTree(d);e.x=n,e.y=o,(a=E.radialLayout(d,u,e)).y>i&&(i=Math.floor(a.y)),n=Math.floor(a.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(g.WORLD_CENTER_X-a.x/2,g.WORLD_CENTER_Y-a.y/2))},E.radialLayout=function(t,e,r){var i=Math.max(this.maxDiagonalInTree(t),h.DEFAULT_RADIAL_SEPARATION);E.branchRadialLayout(e,null,0,359,0,i);var o=v.calculateBounds(t),n=new T;n.setDeviceOrgX(o.getMinX()),n.setDeviceOrgY(o.getMinY()),n.setWorldOrgX(r.x),n.setWorldOrgY(r.y);for(var a=0;a<t.length;a++)t[a].transform(n);var s=new p(o.getMaxX(),o.getMaxY());return n.inverseTransformPoint(s)},E.branchRadialLayout=function(t,e,r,i,o,n){var a=(i-r+1)/2;a<0&&(a+=180);var s=(a+r)%360*f.TWO_PI/360,h=o*Math.cos(s),d=o*Math.sin(s);t.setCenter(h,d);var g=[],l=(g=g.concat(t.getEdges())).length;null!=e&&l--;for(var p,c=0,u=g.length,v=t.getEdgesBetween(e);v.length>1;){var T=v[0];v.splice(0,1);var m=g.indexOf(T);m>=0&&g.splice(m,1),u--,l--}p=null!=e?(g.indexOf(v[0])+1)%u:0;for(var y=Math.abs(i-r)/l,N=p;c!=l;N=++N%u){var w=g[N].getOtherEnd(t);if(w!=e){var A=(r+c*y)%360,C=(A+y)%360;E.branchRadialLayout(w,t,A,C,o+n,n),c++}}},E.maxDiagonalInTree=function(t){for(var e=u.MIN_VALUE,r=0;r<t.length;r++){var i=t[r].getDiagonal();i>e&&(e=i)}return e},E.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},E.prototype.groupZeroDegreeMembers=function(){var t=this,e={};this.memberGroups={},this.idToDummyNode={};for(var r=[],i=this.graphManager.getAllNodes(),o=0;o<i.length;o++){var n=(s=i[o]).getParent();0!==this.getNodeDegreeWithChildren(s)||null!=n.id&&this.getToBeTiled(n)||r.push(s)}for(o=0;o<r.length;o++){var s,h=(s=r[o]).getParent().id;void 0===e[h]&&(e[h]=[]),e[h]=e[h].concat(s)}Object.keys(e).forEach((function(r){if(e[r].length>1){var i="DummyCompound_"+r;t.memberGroups[i]=e[r];var o=e[r][0].getParent(),n=new a(t.graphManager);n.id=i,n.paddingLeft=o.paddingLeft||0,n.paddingRight=o.paddingRight||0,n.paddingBottom=o.paddingBottom||0,n.paddingTop=o.paddingTop||0,t.idToDummyNode[i]=n;var s=t.getGraphManager().add(t.newGraph(),n),h=o.getChild();h.add(n);for(var d=0;d<e[r].length;d++){var g=e[r][d];h.remove(g),s.add(g)}}}))},E.prototype.clearCompounds=function(){var t={},e={};this.performDFSOnCompounds();for(var r=0;r<this.compoundOrder.length;r++)e[this.compoundOrder[r].id]=this.compoundOrder[r],t[this.compoundOrder[r].id]=[].concat(this.compoundOrder[r].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[r].getChild()),this.compoundOrder[r].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(t,e)},E.prototype.clearZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach((function(r){var i=t.idToDummyNode[r];e[r]=t.tileNodes(t.memberGroups[r],i.paddingLeft+i.paddingRight),i.rect.width=e[r].width,i.rect.height=e[r].height}))},E.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var e=this.compoundOrder[t],r=e.id,i=e.paddingLeft,o=e.paddingTop;this.adjustLocations(this.tiledMemberPack[r],e.rect.x,e.rect.y,i,o)}},E.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach((function(r){var i=t.idToDummyNode[r],o=i.paddingLeft,n=i.paddingTop;t.adjustLocations(e[r],i.rect.x,i.rect.y,o,n)}))},E.prototype.getToBeTiled=function(t){var e=t.id;if(null!=this.toBeTiled[e])return this.toBeTiled[e];var r=t.getChild();if(null==r)return this.toBeTiled[e]=!1,!1;for(var i=r.getNodes(),o=0;o<i.length;o++){var n=i[o];if(this.getNodeDegree(n)>0)return this.toBeTiled[e]=!1,!1;if(null!=n.getChild()){if(!this.getToBeTiled(n))return this.toBeTiled[e]=!1,!1}else this.toBeTiled[n.id]=!1}return this.toBeTiled[e]=!0,!0},E.prototype.getNodeDegree=function(t){t.id;for(var e=t.getEdges(),r=0,i=0;i<e.length;i++){var o=e[i];o.getSource().id!==o.getTarget().id&&(r+=1)}return r},E.prototype.getNodeDegreeWithChildren=function(t){var e=this.getNodeDegree(t);if(null==t.getChild())return e;for(var r=t.getChild().getNodes(),i=0;i<r.length;i++){var o=r[i];e+=this.getNodeDegreeWithChildren(o)}return e},E.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},E.prototype.fillCompexOrderByDFS=function(t){for(var e=0;e<t.length;e++){var r=t[e];null!=r.getChild()&&this.fillCompexOrderByDFS(r.getChild().getNodes()),this.getToBeTiled(r)&&this.compoundOrder.push(r)}},E.prototype.adjustLocations=function(t,e,r,i,o){r+=o;for(var n=e+=i,a=0;a<t.rows.length;a++){var s=t.rows[a];e=n;for(var h=0,d=0;d<s.length;d++){var g=s[d];g.rect.x=e,g.rect.y=r,e+=g.rect.width+t.horizontalPadding,g.rect.height>h&&(h=g.rect.height)}r+=h+t.verticalPadding}},E.prototype.tileCompoundMembers=function(t,e){var r=this;this.tiledMemberPack=[],Object.keys(t).forEach((function(i){var o=e[i];r.tiledMemberPack[i]=r.tileNodes(t[i],o.paddingLeft+o.paddingRight),o.rect.width=r.tiledMemberPack[i].width,o.rect.height=r.tiledMemberPack[i].height}))},E.prototype.tileNodes=function(t,e){var r={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:h.TILING_PADDING_VERTICAL,horizontalPadding:h.TILING_PADDING_HORIZONTAL};t.sort((function(t,e){return t.rect.width*t.rect.height>e.rect.width*e.rect.height?-1:t.rect.width*t.rect.height<e.rect.width*e.rect.height?1:0}));for(var i=0;i<t.length;i++){var o=t[i];0==r.rows.length?this.insertNodeToRow(r,o,0,e):this.canAddHorizontal(r,o.rect.width,o.rect.height)?this.insertNodeToRow(r,o,this.getShortestRowIndex(r),e):this.insertNodeToRow(r,o,r.rows.length,e),this.shiftToLastRow(r)}return r},E.prototype.insertNodeToRow=function(t,e,r,i){var o=i;r==t.rows.length&&(t.rows.push([]),t.rowWidth.push(o),t.rowHeight.push(0));var n=t.rowWidth[r]+e.rect.width;t.rows[r].length>0&&(n+=t.horizontalPadding),t.rowWidth[r]=n,t.width<n&&(t.width=n);var a=e.rect.height;r>0&&(a+=t.verticalPadding);var s=0;a>t.rowHeight[r]&&(s=t.rowHeight[r],t.rowHeight[r]=a,s=t.rowHeight[r]-s),t.height+=s,t.rows[r].push(e)},E.prototype.getShortestRowIndex=function(t){for(var e=-1,r=Number.MAX_VALUE,i=0;i<t.rows.length;i++)t.rowWidth[i]<r&&(e=i,r=t.rowWidth[i]);return e},E.prototype.getLongestRowIndex=function(t){for(var e=-1,r=Number.MIN_VALUE,i=0;i<t.rows.length;i++)t.rowWidth[i]>r&&(e=i,r=t.rowWidth[i]);return e},E.prototype.canAddHorizontal=function(t,e,r){var i=this.getShortestRowIndex(t);if(i<0)return!0;var o=t.rowWidth[i];if(o+t.horizontalPadding+e<=t.width)return!0;var n,a,s=0;return t.rowHeight[i]<r&&i>0&&(s=r+t.verticalPadding-t.rowHeight[i]),n=t.width-o>=e+t.horizontalPadding?(t.height+s)/(o+e+t.horizontalPadding):(t.height+s)/t.width,s=r+t.verticalPadding,(a=t.width<e?(t.height+s)/e:(t.height+s)/t.width)<1&&(a=1/a),n<1&&(n=1/n),n<a},E.prototype.shiftToLastRow=function(t){var e=this.getLongestRowIndex(t),r=t.rowWidth.length-1,i=t.rows[e],o=i[i.length-1],n=o.width+t.horizontalPadding;if(t.width-t.rowWidth[r]>n&&e!=r){i.splice(-1,1),t.rows[r].push(o),t.rowWidth[e]=t.rowWidth[e]-n,t.rowWidth[r]=t.rowWidth[r]+n,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var a=Number.MIN_VALUE,s=0;s<i.length;s++)i[s].height>a&&(a=i[s].height);e>0&&(a+=t.verticalPadding);var h=t.rowHeight[e]+t.rowHeight[r];t.rowHeight[e]=a,t.rowHeight[r]<o.height+t.verticalPadding&&(t.rowHeight[r]=o.height+t.verticalPadding);var d=t.rowHeight[e]+t.rowHeight[r];t.height+=d-h,this.shiftToLastRow(t)}},E.prototype.tilingPreLayout=function(){h.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},E.prototype.tilingPostLayout=function(){h.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},E.prototype.reduceTrees=function(){for(var t,e=[],r=!0;r;){var i=this.graphManager.getAllNodes(),o=[];r=!1;for(var n=0;n<i.length;n++)1!=(t=i[n]).getEdges().length||t.getEdges()[0].isInterGraph||null!=t.getChild()||(o.push([t,t.getEdges()[0],t.getOwner()]),r=!0);if(1==r){for(var a=[],s=0;s<o.length;s++)1==o[s][0].getEdges().length&&(a.push(o[s]),o[s][0].getOwner().remove(o[s][0]));e.push(a),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},E.prototype.growTree=function(t){for(var e,r=t[t.length-1],i=0;i<r.length;i++)e=r[i],this.findPlaceforPrunedNode(e),e[2].add(e[0]),e[2].add(e[1],e[1].source,e[1].target);t.splice(t.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},E.prototype.findPlaceforPrunedNode=function(t){var e,r,i=t[0],o=(r=i==t[1].source?t[1].target:t[1].source).startX,n=r.finishX,a=r.startY,s=r.finishY,h=[0,0,0,0];if(a>0)for(var g=o;g<=n;g++)h[0]+=this.grid[g][a-1].length+this.grid[g][a].length-1;if(n<this.grid.length-1)for(g=a;g<=s;g++)h[1]+=this.grid[n+1][g].length+this.grid[n][g].length-1;if(s<this.grid[0].length-1)for(g=o;g<=n;g++)h[2]+=this.grid[g][s+1].length+this.grid[g][s].length-1;if(o>0)for(g=a;g<=s;g++)h[3]+=this.grid[o-1][g].length+this.grid[o][g].length-1;for(var l,p,c=u.MAX_VALUE,f=0;f<h.length;f++)h[f]<c?(c=h[f],l=1,p=f):h[f]==c&&l++;if(3==l&&0==c)0==h[0]&&0==h[1]&&0==h[2]?e=1:0==h[0]&&0==h[1]&&0==h[3]?e=0:0==h[0]&&0==h[2]&&0==h[3]?e=3:0==h[1]&&0==h[2]&&0==h[3]&&(e=2);else if(2==l&&0==c){var v=Math.floor(2*Math.random());e=0==h[0]&&0==h[1]?0==v?0:1:0==h[0]&&0==h[2]?0==v?0:2:0==h[0]&&0==h[3]?0==v?0:3:0==h[1]&&0==h[2]?0==v?1:2:0==h[1]&&0==h[3]?0==v?1:3:0==v?2:3}else e=4==l&&0==c?v=Math.floor(4*Math.random()):p;0==e?i.setCenter(r.getCenterX(),r.getCenterY()-r.getHeight()/2-d.DEFAULT_EDGE_LENGTH-i.getHeight()/2):1==e?i.setCenter(r.getCenterX()+r.getWidth()/2+d.DEFAULT_EDGE_LENGTH+i.getWidth()/2,r.getCenterY()):2==e?i.setCenter(r.getCenterX(),r.getCenterY()+r.getHeight()/2+d.DEFAULT_EDGE_LENGTH+i.getHeight()/2):i.setCenter(r.getCenterX()-r.getWidth()/2-d.DEFAULT_EDGE_LENGTH-i.getWidth()/2,r.getCenterY())},t.exports=E},function(t,e,r){var i={};i.layoutBase=r(0),i.CoSEConstants=r(1),i.CoSEEdge=r(2),i.CoSEGraph=r(3),i.CoSEGraphManager=r(4),i.CoSELayout=r(6),i.CoSENode=r(5),t.exports=i}])},t.exports=o(r())),e.exports;var t,o}e.exports;export{o as __require};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{commonjsGlobal as t}from"../../../../../_virtual/_commonjsHelpers.js";import{__module as e}from"../../../../../_virtual/cose-base.js";import{__require as i}from"../../../layout-base@2.0.1/node_modules/layout-base/layout-base.js";var o;function n(){return o||(o=1,t=e,e.exports,n=function(t){return e={45:(t,e,i)=>{var o={};o.layoutBase=i(551),o.CoSEConstants=i(806),o.CoSEEdge=i(767),o.CoSEGraph=i(880),o.CoSEGraphManager=i(578),o.CoSELayout=i(765),o.CoSENode=i(991),o.ConstraintHandler=i(902),t.exports=o},806:(t,e,i)=>{var o=i(551).FDLayoutConstants;function n(){}for(var r in o)n[r]=o[r];n.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,n.DEFAULT_RADIAL_SEPARATION=o.DEFAULT_EDGE_LENGTH,n.DEFAULT_COMPONENT_SEPERATION=60,n.TILE=!0,n.TILING_PADDING_VERTICAL=10,n.TILING_PADDING_HORIZONTAL=10,n.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,n.ENFORCE_CONSTRAINTS=!0,n.APPLY_LAYOUT=!0,n.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,n.TREE_REDUCTION_ON_INCREMENTAL=!0,n.PURE_INCREMENTAL=n.DEFAULT_INCREMENTAL,t.exports=n},767:(t,e,i)=>{var o=i(551).FDLayoutEdge;function n(t,e,i){o.call(this,t,e,i)}for(var r in n.prototype=Object.create(o.prototype),o)n[r]=o[r];t.exports=n},880:(t,e,i)=>{var o=i(551).LGraph;function n(t,e,i){o.call(this,t,e,i)}for(var r in n.prototype=Object.create(o.prototype),o)n[r]=o[r];t.exports=n},578:(t,e,i)=>{var o=i(551).LGraphManager;function n(t){o.call(this,t)}for(var r in n.prototype=Object.create(o.prototype),o)n[r]=o[r];t.exports=n},765:(t,e,i)=>{var o=i(551).FDLayout,n=i(578),r=i(880),a=i(991),s=i(767),h=i(806),l=i(902),d=i(551).FDLayoutConstants,g=i(551).LayoutConstants,c=i(551).Point,p=i(551).PointD,f=i(551).DimensionD,u=i(551).Layout,m=i(551).Integer,v=i(551).IGeometry,T=i(551).LGraph,N=i(551).Transform,E=i(551).LinkedList;function y(){o.call(this),this.toBeTiled={},this.constraints={}}for(var C in y.prototype=Object.create(o.prototype),o)y[C]=o[C];y.prototype.newGraphManager=function(){var t=new n(this);return this.graphManager=t,t},y.prototype.newGraph=function(t){return new r(null,this.graphManager,t)},y.prototype.newNode=function(t){return new a(this.graphManager,t)},y.prototype.newEdge=function(t){return new s(null,null,t)},y.prototype.initParameters=function(){o.prototype.initParameters.call(this,arguments),this.isSubLayout||(h.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=d.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=d.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},y.prototype.initSpringEmbedder=function(){o.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},y.prototype.layout=function(){return g.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},y.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)h.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),e=new Set(this.getAllNodes()),i=this.nodesWithGravity.filter((function(t){return e.has(t)})),this.graphManager.setAllNodesToApplyGravitation(i));else{var t=this.getFlatForest();if(t.length>0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),i=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(i),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(l.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),h.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(e),this.graphManager.updateBounds(),this.updateGrid(),h.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),h.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var i=!this.isTreeGrowing&&!this.isGrowthFinished,o=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(i,o),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},i=0;i<t.length;i++){var o=t[i].rect,n=t[i].id;e[n]={id:n,x:o.getCenterX(),y:o.getCenterY(),w:o.width,h:o.height}}return e},y.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var t=!1;if("during"===d.ANIMATE)this.emit("layoutstarted");else{for(;!t;)t=this.tick();this.graphManager.updateBounds()}},y.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].calculateDisplacement();for(Object.keys(this.constraints).length>0&&this.updateDisplacements(),e=0;e<t.length;e++)t[e].move()},y.prototype.initConstraintVariables=function(){var t=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var e=this.graphManager.getAllNodes(),i=0;i<e.length;i++){var o=e[i];this.idToNodeMap.set(o.id,o)}var n=function e(i){for(var o,n=i.getChild().getNodes(),r=0,a=0;a<n.length;a++)null==(o=n[a]).getChild()?t.fixedNodeSet.has(o.id)&&(r+=100):r+=e(o);return r};if(this.constraints.fixedNodeConstraint)for(this.constraints.fixedNodeConstraint.forEach((function(e){t.fixedNodeSet.add(e.nodeId)})),e=this.graphManager.getAllNodes(),i=0;i<e.length;i++)if(null!=(o=e[i]).getChild()){var r=n(o);r>0&&(o.fixedNodeWeight=r)}if(this.constraints.relativePlacementConstraint){var a=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach((function(e){t.fixedNodesOnHorizontal.add(e),t.fixedNodesOnVertical.add(e)})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var l=this.constraints.alignmentConstraint.vertical;for(i=0;i<l.length;i++)this.dummyToNodeForVerticalAlignment.set("dummy"+i,[]),l[i].forEach((function(e){a.set(e,"dummy"+i),t.dummyToNodeForVerticalAlignment.get("dummy"+i).push(e),t.fixedNodeSet.has(e)&&t.fixedNodesOnHorizontal.add("dummy"+i)}))}if(this.constraints.alignmentConstraint.horizontal){var d=this.constraints.alignmentConstraint.horizontal;for(i=0;i<d.length;i++)this.dummyToNodeForHorizontalAlignment.set("dummy"+i,[]),d[i].forEach((function(e){s.set(e,"dummy"+i),t.dummyToNodeForHorizontalAlignment.get("dummy"+i).push(e),t.fixedNodeSet.has(e)&&t.fixedNodesOnVertical.add("dummy"+i)}))}}if(h.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(t){var e,i,o;for(o=t.length-1;o>=2*t.length/3;o--)e=Math.floor(Math.random()*(o+1)),i=t[o],t[o]=t[e],t[e]=i;return t},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach((function(e){if(e.left){var i=a.has(e.left)?a.get(e.left):e.left,o=a.has(e.right)?a.get(e.right):e.right;t.nodesInRelativeHorizontal.includes(i)||(t.nodesInRelativeHorizontal.push(i),t.nodeToRelativeConstraintMapHorizontal.set(i,[]),t.dummyToNodeForVerticalAlignment.has(i)?t.nodeToTempPositionMapHorizontal.set(i,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(i)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(i,t.idToNodeMap.get(i).getCenterX())),t.nodesInRelativeHorizontal.includes(o)||(t.nodesInRelativeHorizontal.push(o),t.nodeToRelativeConstraintMapHorizontal.set(o,[]),t.dummyToNodeForVerticalAlignment.has(o)?t.nodeToTempPositionMapHorizontal.set(o,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(o)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(o,t.idToNodeMap.get(o).getCenterX())),t.nodeToRelativeConstraintMapHorizontal.get(i).push({right:o,gap:e.gap}),t.nodeToRelativeConstraintMapHorizontal.get(o).push({left:i,gap:e.gap})}else{var n=s.has(e.top)?s.get(e.top):e.top,r=s.has(e.bottom)?s.get(e.bottom):e.bottom;t.nodesInRelativeVertical.includes(n)||(t.nodesInRelativeVertical.push(n),t.nodeToRelativeConstraintMapVertical.set(n,[]),t.dummyToNodeForHorizontalAlignment.has(n)?t.nodeToTempPositionMapVertical.set(n,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(n)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(n,t.idToNodeMap.get(n).getCenterY())),t.nodesInRelativeVertical.includes(r)||(t.nodesInRelativeVertical.push(r),t.nodeToRelativeConstraintMapVertical.set(r,[]),t.dummyToNodeForHorizontalAlignment.has(r)?t.nodeToTempPositionMapVertical.set(r,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(r)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(r,t.idToNodeMap.get(r).getCenterY())),t.nodeToRelativeConstraintMapVertical.get(n).push({bottom:r,gap:e.gap}),t.nodeToRelativeConstraintMapVertical.get(r).push({top:n,gap:e.gap})}}));else{var g=new Map,c=new Map;this.constraints.relativePlacementConstraint.forEach((function(t){if(t.left){var e=a.has(t.left)?a.get(t.left):t.left,i=a.has(t.right)?a.get(t.right):t.right;g.has(e)?g.get(e).push(i):g.set(e,[i]),g.has(i)?g.get(i).push(e):g.set(i,[e])}else{var o=s.has(t.top)?s.get(t.top):t.top,n=s.has(t.bottom)?s.get(t.bottom):t.bottom;c.has(o)?c.get(o).push(n):c.set(o,[n]),c.has(n)?c.get(n).push(o):c.set(n,[o])}}));var p=function(t,e){var i=[],o=[],n=new E,r=new Set,a=0;return t.forEach((function(s,h){if(!r.has(h)){i[a]=[],o[a]=!1;var l=h;for(n.push(l),r.add(l),i[a].push(l);0!=n.length;)l=n.shift(),e.has(l)&&(o[a]=!0),t.get(l).forEach((function(t){r.has(t)||(n.push(t),r.add(t),i[a].push(t))}));a++}})),{components:i,isFixed:o}},f=p(g,t.fixedNodesOnHorizontal);this.componentsOnHorizontal=f.components,this.fixedComponentsOnHorizontal=f.isFixed;var u=p(c,t.fixedNodesOnVertical);this.componentsOnVertical=u.components,this.fixedComponentsOnVertical=u.isFixed}}},y.prototype.updateDisplacements=function(){var t=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach((function(e){var i=t.idToNodeMap.get(e.nodeId);i.displacementX=0,i.displacementY=0})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var e=this.constraints.alignmentConstraint.vertical,i=0;i<e.length;i++){for(var o=0,n=0;n<e[i].length;n++){if(this.fixedNodeSet.has(e[i][n])){o=0;break}o+=this.idToNodeMap.get(e[i][n]).displacementX}var r=o/e[i].length;for(n=0;n<e[i].length;n++)this.idToNodeMap.get(e[i][n]).displacementX=r}if(this.constraints.alignmentConstraint.horizontal){var a=this.constraints.alignmentConstraint.horizontal;for(i=0;i<a.length;i++){var s=0;for(n=0;n<a[i].length;n++){if(this.fixedNodeSet.has(a[i][n])){s=0;break}s+=this.idToNodeMap.get(a[i][n]).displacementY}var l=s/a[i].length;for(n=0;n<a[i].length;n++)this.idToNodeMap.get(a[i][n]).displacementY=l}}}if(this.constraints.relativePlacementConstraint)if(h.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach((function(e){if(!t.fixedNodesOnHorizontal.has(e)){var i=0;i=t.dummyToNodeForVerticalAlignment.has(e)?t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(e)[0]).displacementX:t.idToNodeMap.get(e).displacementX,t.nodeToRelativeConstraintMapHorizontal.get(e).forEach((function(o){var n;o.right?(n=t.nodeToTempPositionMapHorizontal.get(o.right)-t.nodeToTempPositionMapHorizontal.get(e)-i)<o.gap&&(i-=o.gap-n):(n=t.nodeToTempPositionMapHorizontal.get(e)-t.nodeToTempPositionMapHorizontal.get(o.left)+i)<o.gap&&(i+=o.gap-n)})),t.nodeToTempPositionMapHorizontal.set(e,t.nodeToTempPositionMapHorizontal.get(e)+i),t.dummyToNodeForVerticalAlignment.has(e)?t.dummyToNodeForVerticalAlignment.get(e).forEach((function(e){t.idToNodeMap.get(e).displacementX=i})):t.idToNodeMap.get(e).displacementX=i}})),this.nodesInRelativeVertical.forEach((function(e){if(!t.fixedNodesOnHorizontal.has(e)){var i=0;i=t.dummyToNodeForHorizontalAlignment.has(e)?t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(e)[0]).displacementY:t.idToNodeMap.get(e).displacementY,t.nodeToRelativeConstraintMapVertical.get(e).forEach((function(o){var n;o.bottom?(n=t.nodeToTempPositionMapVertical.get(o.bottom)-t.nodeToTempPositionMapVertical.get(e)-i)<o.gap&&(i-=o.gap-n):(n=t.nodeToTempPositionMapVertical.get(e)-t.nodeToTempPositionMapVertical.get(o.top)+i)<o.gap&&(i+=o.gap-n)})),t.nodeToTempPositionMapVertical.set(e,t.nodeToTempPositionMapVertical.get(e)+i),t.dummyToNodeForHorizontalAlignment.has(e)?t.dummyToNodeForHorizontalAlignment.get(e).forEach((function(e){t.idToNodeMap.get(e).displacementY=i})):t.idToNodeMap.get(e).displacementY=i}}));else{for(i=0;i<this.componentsOnHorizontal.length;i++){var d=this.componentsOnHorizontal[i];if(this.fixedComponentsOnHorizontal[i])for(n=0;n<d.length;n++)this.dummyToNodeForVerticalAlignment.has(d[n])?this.dummyToNodeForVerticalAlignment.get(d[n]).forEach((function(e){t.idToNodeMap.get(e).displacementX=0})):this.idToNodeMap.get(d[n]).displacementX=0;else{var g=0,c=0;for(n=0;n<d.length;n++)this.dummyToNodeForVerticalAlignment.has(d[n])?(g+=(f=this.dummyToNodeForVerticalAlignment.get(d[n])).length*this.idToNodeMap.get(f[0]).displacementX,c+=f.length):(g+=this.idToNodeMap.get(d[n]).displacementX,c++);var p=g/c;for(n=0;n<d.length;n++)this.dummyToNodeForVerticalAlignment.has(d[n])?this.dummyToNodeForVerticalAlignment.get(d[n]).forEach((function(e){t.idToNodeMap.get(e).displacementX=p})):this.idToNodeMap.get(d[n]).displacementX=p}}for(i=0;i<this.componentsOnVertical.length;i++)if(d=this.componentsOnVertical[i],this.fixedComponentsOnVertical[i])for(n=0;n<d.length;n++)this.dummyToNodeForHorizontalAlignment.has(d[n])?this.dummyToNodeForHorizontalAlignment.get(d[n]).forEach((function(e){t.idToNodeMap.get(e).displacementY=0})):this.idToNodeMap.get(d[n]).displacementY=0;else{for(g=0,c=0,n=0;n<d.length;n++){var f;this.dummyToNodeForHorizontalAlignment.has(d[n])?(g+=(f=this.dummyToNodeForHorizontalAlignment.get(d[n])).length*this.idToNodeMap.get(f[0]).displacementY,c+=f.length):(g+=this.idToNodeMap.get(d[n]).displacementY,c++)}for(p=g/c,n=0;n<d.length;n++)this.dummyToNodeForHorizontalAlignment.has(d[n])?this.dummyToNodeForHorizontalAlignment.get(d[n]).forEach((function(e){t.idToNodeMap.get(e).displacementY=p})):this.idToNodeMap.get(d[n]).displacementY=p}}},y.prototype.calculateNodesToApplyGravitationTo=function(){var t,e,i=[],o=this.graphManager.getGraphs(),n=o.length;for(e=0;e<n;e++)(t=o[e]).updateConnected(),t.isConnected||(i=i.concat(t.getNodes()));return i},y.prototype.createBendpoints=function(){var t=[];t=t.concat(this.graphManager.getAllEdges());var e,i=new Set;for(e=0;e<t.length;e++){var o=t[e];if(!i.has(o)){var n=o.getSource(),r=o.getTarget();if(n==r)o.getBendpoints().push(new p),o.getBendpoints().push(new p),this.createDummyNodesForBendpoints(o),i.add(o);else{var a=[];if(a=(a=a.concat(n.getEdgeListToNode(r))).concat(r.getEdgeListToNode(n)),!i.has(a[0])){var s;if(a.length>1)for(s=0;s<a.length;s++){var h=a[s];h.getBendpoints().push(new p),this.createDummyNodesForBendpoints(h)}a.forEach((function(t){i.add(t)}))}}}if(i.size==t.length)break}},y.prototype.positionNodesRadially=function(t){for(var e=new c(0,0),i=Math.ceil(Math.sqrt(t.length)),o=0,n=0,r=0,a=new p(0,0),s=0;s<t.length;s++){s%i==0&&(r=0,n=o,0!=s&&(n+=h.DEFAULT_COMPONENT_SEPERATION),o=0);var l=t[s],d=u.findCenterOfTree(l);e.x=r,e.y=n,(a=y.radialLayout(l,d,e)).y>o&&(o=Math.floor(a.y)),r=Math.floor(a.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(g.WORLD_CENTER_X-a.x/2,g.WORLD_CENTER_Y-a.y/2))},y.radialLayout=function(t,e,i){var o=Math.max(this.maxDiagonalInTree(t),h.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(e,null,0,359,0,o);var n=T.calculateBounds(t),r=new N;r.setDeviceOrgX(n.getMinX()),r.setDeviceOrgY(n.getMinY()),r.setWorldOrgX(i.x),r.setWorldOrgY(i.y);for(var a=0;a<t.length;a++)t[a].transform(r);var s=new p(n.getMaxX(),n.getMaxY());return r.inverseTransformPoint(s)},y.branchRadialLayout=function(t,e,i,o,n,r){var a=(o-i+1)/2;a<0&&(a+=180);var s=(a+i)%360*v.TWO_PI/360,h=n*Math.cos(s),l=n*Math.sin(s);t.setCenter(h,l);var d=[],g=(d=d.concat(t.getEdges())).length;null!=e&&g--;for(var c,p=0,f=d.length,u=t.getEdgesBetween(e);u.length>1;){var m=u[0];u.splice(0,1);var T=d.indexOf(m);T>=0&&d.splice(T,1),f--,g--}c=null!=e?(d.indexOf(u[0])+1)%f:0;for(var N=Math.abs(o-i)/g,E=c;p!=g;E=++E%f){var C=d[E].getOtherEnd(t);if(C!=e){var M=(i+p*N)%360,w=(M+N)%360;y.branchRadialLayout(C,t,M,w,n+r,r),p++}}},y.maxDiagonalInTree=function(t){for(var e=m.MIN_VALUE,i=0;i<t.length;i++){var o=t[i].getDiagonal();o>e&&(e=o)}return e},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var t=this,e={};this.memberGroups={},this.idToDummyNode={};for(var i=[],o=this.graphManager.getAllNodes(),n=0;n<o.length;n++){var r=(s=o[n]).getParent();0!==this.getNodeDegreeWithChildren(s)||null!=r.id&&this.getToBeTiled(r)||i.push(s)}for(n=0;n<i.length;n++){var s,h=(s=i[n]).getParent().id;void 0===e[h]&&(e[h]=[]),e[h]=e[h].concat(s)}Object.keys(e).forEach((function(i){if(e[i].length>1){var o="DummyCompound_"+i;t.memberGroups[o]=e[i];var n=e[i][0].getParent(),r=new a(t.graphManager);r.id=o,r.paddingLeft=n.paddingLeft||0,r.paddingRight=n.paddingRight||0,r.paddingBottom=n.paddingBottom||0,r.paddingTop=n.paddingTop||0,t.idToDummyNode[o]=r;var s=t.getGraphManager().add(t.newGraph(),r),h=n.getChild();h.add(r);for(var l=0;l<e[i].length;l++){var d=e[i][l];h.remove(d),s.add(d)}}}))},y.prototype.clearCompounds=function(){var t={},e={};this.performDFSOnCompounds();for(var i=0;i<this.compoundOrder.length;i++)e[this.compoundOrder[i].id]=this.compoundOrder[i],t[this.compoundOrder[i].id]=[].concat(this.compoundOrder[i].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[i].getChild()),this.compoundOrder[i].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(t,e)},y.prototype.clearZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach((function(i){var o=t.idToDummyNode[i];if(e[i]=t.tileNodes(t.memberGroups[i],o.paddingLeft+o.paddingRight),o.rect.width=e[i].width,o.rect.height=e[i].height,o.setCenter(e[i].centerX,e[i].centerY),o.labelMarginLeft=0,o.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var n=o.rect.width,r=o.rect.height;o.labelWidth&&("left"==o.labelPosHorizontal?(o.rect.x-=o.labelWidth,o.setWidth(n+o.labelWidth),o.labelMarginLeft=o.labelWidth):"center"==o.labelPosHorizontal&&o.labelWidth>n?(o.rect.x-=(o.labelWidth-n)/2,o.setWidth(o.labelWidth),o.labelMarginLeft=(o.labelWidth-n)/2):"right"==o.labelPosHorizontal&&o.setWidth(n+o.labelWidth)),o.labelHeight&&("top"==o.labelPosVertical?(o.rect.y-=o.labelHeight,o.setHeight(r+o.labelHeight),o.labelMarginTop=o.labelHeight):"center"==o.labelPosVertical&&o.labelHeight>r?(o.rect.y-=(o.labelHeight-r)/2,o.setHeight(o.labelHeight),o.labelMarginTop=(o.labelHeight-r)/2):"bottom"==o.labelPosVertical&&o.setHeight(r+o.labelHeight))}}))},y.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var e=this.compoundOrder[t],i=e.id,o=e.paddingLeft,n=e.paddingTop,r=e.labelMarginLeft,a=e.labelMarginTop;this.adjustLocations(this.tiledMemberPack[i],e.rect.x,e.rect.y,o,n,r,a)}},y.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach((function(i){var o=t.idToDummyNode[i],n=o.paddingLeft,r=o.paddingTop,a=o.labelMarginLeft,s=o.labelMarginTop;t.adjustLocations(e[i],o.rect.x,o.rect.y,n,r,a,s)}))},y.prototype.getToBeTiled=function(t){var e=t.id;if(null!=this.toBeTiled[e])return this.toBeTiled[e];var i=t.getChild();if(null==i)return this.toBeTiled[e]=!1,!1;for(var o=i.getNodes(),n=0;n<o.length;n++){var r=o[n];if(this.getNodeDegree(r)>0)return this.toBeTiled[e]=!1,!1;if(null!=r.getChild()){if(!this.getToBeTiled(r))return this.toBeTiled[e]=!1,!1}else this.toBeTiled[r.id]=!1}return this.toBeTiled[e]=!0,!0},y.prototype.getNodeDegree=function(t){t.id;for(var e=t.getEdges(),i=0,o=0;o<e.length;o++){var n=e[o];n.getSource().id!==n.getTarget().id&&(i+=1)}return i},y.prototype.getNodeDegreeWithChildren=function(t){var e=this.getNodeDegree(t);if(null==t.getChild())return e;for(var i=t.getChild().getNodes(),o=0;o<i.length;o++){var n=i[o];e+=this.getNodeDegreeWithChildren(n)}return e},y.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},y.prototype.fillCompexOrderByDFS=function(t){for(var e=0;e<t.length;e++){var i=t[e];null!=i.getChild()&&this.fillCompexOrderByDFS(i.getChild().getNodes()),this.getToBeTiled(i)&&this.compoundOrder.push(i)}},y.prototype.adjustLocations=function(t,e,i,o,n,r,a){i+=n+a;for(var s=e+=o+r,h=0;h<t.rows.length;h++){var l=t.rows[h];e=s;for(var d=0,g=0;g<l.length;g++){var c=l[g];c.rect.x=e,c.rect.y=i,e+=c.rect.width+t.horizontalPadding,c.rect.height>d&&(d=c.rect.height)}i+=d+t.verticalPadding}},y.prototype.tileCompoundMembers=function(t,e){var i=this;this.tiledMemberPack=[],Object.keys(t).forEach((function(o){var n=e[o];if(i.tiledMemberPack[o]=i.tileNodes(t[o],n.paddingLeft+n.paddingRight),n.rect.width=i.tiledMemberPack[o].width,n.rect.height=i.tiledMemberPack[o].height,n.setCenter(i.tiledMemberPack[o].centerX,i.tiledMemberPack[o].centerY),n.labelMarginLeft=0,n.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var r=n.rect.width,a=n.rect.height;n.labelWidth&&("left"==n.labelPosHorizontal?(n.rect.x-=n.labelWidth,n.setWidth(r+n.labelWidth),n.labelMarginLeft=n.labelWidth):"center"==n.labelPosHorizontal&&n.labelWidth>r?(n.rect.x-=(n.labelWidth-r)/2,n.setWidth(n.labelWidth),n.labelMarginLeft=(n.labelWidth-r)/2):"right"==n.labelPosHorizontal&&n.setWidth(r+n.labelWidth)),n.labelHeight&&("top"==n.labelPosVertical?(n.rect.y-=n.labelHeight,n.setHeight(a+n.labelHeight),n.labelMarginTop=n.labelHeight):"center"==n.labelPosVertical&&n.labelHeight>a?(n.rect.y-=(n.labelHeight-a)/2,n.setHeight(n.labelHeight),n.labelMarginTop=(n.labelHeight-a)/2):"bottom"==n.labelPosVertical&&n.setHeight(a+n.labelHeight))}}))},y.prototype.tileNodes=function(t,e){var i=this.tileNodesByFavoringDim(t,e,!0),o=this.tileNodesByFavoringDim(t,e,!1),n=this.getOrgRatio(i);return this.getOrgRatio(o)<n?o:i},y.prototype.getOrgRatio=function(t){var e=t.width/t.height;return e<1&&(e=1/e),e},y.prototype.calcIdealRowWidth=function(t,e){var i=h.TILING_PADDING_VERTICAL,o=h.TILING_PADDING_HORIZONTAL,n=t.length,r=0,a=0,s=0;t.forEach((function(t){r+=t.getWidth(),a+=t.getHeight(),t.getWidth()>s&&(s=t.getWidth())}));var l,d=r/n,g=a/n,c=Math.pow(i-o,2)+4*(d+o)*(g+i)*n,p=(o-i+Math.sqrt(c))/(2*(d+o));e?(l=Math.ceil(p))==p&&l++:l=Math.floor(p);var f=l*(d+o)-o;return s>f&&(f=s),f+=2*o},y.prototype.tileNodesByFavoringDim=function(t,e,i){var o=h.TILING_PADDING_VERTICAL,n=h.TILING_PADDING_HORIZONTAL,r=h.TILING_COMPARE_BY,a={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:o,horizontalPadding:n,centerX:0,centerY:0};r&&(a.idealRowWidth=this.calcIdealRowWidth(t,i));var s=function(t){return t.rect.width*t.rect.height},l=function(t,e){return s(e)-s(t)};t.sort((function(t,e){var i=l;return a.idealRowWidth?(i=r)(t.id,e.id):i(t,e)}));for(var d=0,g=0,c=0;c<t.length;c++)d+=(p=t[c]).getCenterX(),g+=p.getCenterY();for(a.centerX=d/t.length,a.centerY=g/t.length,c=0;c<t.length;c++){var p=t[c];if(0==a.rows.length)this.insertNodeToRow(a,p,0,e);else if(this.canAddHorizontal(a,p.rect.width,p.rect.height)){var f=a.rows.length-1;a.idealRowWidth||(f=this.getShortestRowIndex(a)),this.insertNodeToRow(a,p,f,e)}else this.insertNodeToRow(a,p,a.rows.length,e);this.shiftToLastRow(a)}return a},y.prototype.insertNodeToRow=function(t,e,i,o){var n=o;i==t.rows.length&&(t.rows.push([]),t.rowWidth.push(n),t.rowHeight.push(0));var r=t.rowWidth[i]+e.rect.width;t.rows[i].length>0&&(r+=t.horizontalPadding),t.rowWidth[i]=r,t.width<r&&(t.width=r);var a=e.rect.height;i>0&&(a+=t.verticalPadding);var s=0;a>t.rowHeight[i]&&(s=t.rowHeight[i],t.rowHeight[i]=a,s=t.rowHeight[i]-s),t.height+=s,t.rows[i].push(e)},y.prototype.getShortestRowIndex=function(t){for(var e=-1,i=Number.MAX_VALUE,o=0;o<t.rows.length;o++)t.rowWidth[o]<i&&(e=o,i=t.rowWidth[o]);return e},y.prototype.getLongestRowIndex=function(t){for(var e=-1,i=Number.MIN_VALUE,o=0;o<t.rows.length;o++)t.rowWidth[o]>i&&(e=o,i=t.rowWidth[o]);return e},y.prototype.canAddHorizontal=function(t,e,i){if(t.idealRowWidth){var o=t.rows.length-1;return t.rowWidth[o]+e+t.horizontalPadding<=t.idealRowWidth}var n=this.getShortestRowIndex(t);if(n<0)return!0;var r=t.rowWidth[n];if(r+t.horizontalPadding+e<=t.width)return!0;var a,s,h=0;return t.rowHeight[n]<i&&n>0&&(h=i+t.verticalPadding-t.rowHeight[n]),a=t.width-r>=e+t.horizontalPadding?(t.height+h)/(r+e+t.horizontalPadding):(t.height+h)/t.width,h=i+t.verticalPadding,(s=t.width<e?(t.height+h)/e:(t.height+h)/t.width)<1&&(s=1/s),a<1&&(a=1/a),a<s},y.prototype.shiftToLastRow=function(t){var e=this.getLongestRowIndex(t),i=t.rowWidth.length-1,o=t.rows[e],n=o[o.length-1],r=n.width+t.horizontalPadding;if(t.width-t.rowWidth[i]>r&&e!=i){o.splice(-1,1),t.rows[i].push(n),t.rowWidth[e]=t.rowWidth[e]-r,t.rowWidth[i]=t.rowWidth[i]+r,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var a=Number.MIN_VALUE,s=0;s<o.length;s++)o[s].height>a&&(a=o[s].height);e>0&&(a+=t.verticalPadding);var h=t.rowHeight[e]+t.rowHeight[i];t.rowHeight[e]=a,t.rowHeight[i]<n.height+t.verticalPadding&&(t.rowHeight[i]=n.height+t.verticalPadding);var l=t.rowHeight[e]+t.rowHeight[i];t.height+=l-h,this.shiftToLastRow(t)}},y.prototype.tilingPreLayout=function(){h.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},y.prototype.tilingPostLayout=function(){h.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},y.prototype.reduceTrees=function(){for(var t,e=[],i=!0;i;){var o=this.graphManager.getAllNodes(),n=[];i=!1;for(var r=0;r<o.length;r++)if(1==(t=o[r]).getEdges().length&&!t.getEdges()[0].isInterGraph&&null==t.getChild()){if(h.PURE_INCREMENTAL){var a=t.getEdges()[0].getOtherEnd(t),s=new f(t.getCenterX()-a.getCenterX(),t.getCenterY()-a.getCenterY());n.push([t,t.getEdges()[0],t.getOwner(),s])}else n.push([t,t.getEdges()[0],t.getOwner()]);i=!0}if(1==i){for(var l=[],d=0;d<n.length;d++)1==n[d][0].getEdges().length&&(l.push(n[d]),n[d][0].getOwner().remove(n[d][0]));e.push(l),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},y.prototype.growTree=function(t){for(var e,i=t[t.length-1],o=0;o<i.length;o++)e=i[o],this.findPlaceforPrunedNode(e),e[2].add(e[0]),e[2].add(e[1],e[1].source,e[1].target);t.splice(t.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},y.prototype.findPlaceforPrunedNode=function(t){var e,i,o=t[0];if(i=o==t[1].source?t[1].target:t[1].source,h.PURE_INCREMENTAL)o.setCenter(i.getCenterX()+t[3].getWidth(),i.getCenterY()+t[3].getHeight());else{var n=i.startX,r=i.finishX,a=i.startY,s=i.finishY,l=[0,0,0,0];if(a>0)for(var g=n;g<=r;g++)l[0]+=this.grid[g][a-1].length+this.grid[g][a].length-1;if(r<this.grid.length-1)for(g=a;g<=s;g++)l[1]+=this.grid[r+1][g].length+this.grid[r][g].length-1;if(s<this.grid[0].length-1)for(g=n;g<=r;g++)l[2]+=this.grid[g][s+1].length+this.grid[g][s].length-1;if(n>0)for(g=a;g<=s;g++)l[3]+=this.grid[n-1][g].length+this.grid[n][g].length-1;for(var c,p,f=m.MAX_VALUE,u=0;u<l.length;u++)l[u]<f?(f=l[u],c=1,p=u):l[u]==f&&c++;if(3==c&&0==f)0==l[0]&&0==l[1]&&0==l[2]?e=1:0==l[0]&&0==l[1]&&0==l[3]?e=0:0==l[0]&&0==l[2]&&0==l[3]?e=3:0==l[1]&&0==l[2]&&0==l[3]&&(e=2);else if(2==c&&0==f){var v=Math.floor(2*Math.random());e=0==l[0]&&0==l[1]?0==v?0:1:0==l[0]&&0==l[2]?0==v?0:2:0==l[0]&&0==l[3]?0==v?0:3:0==l[1]&&0==l[2]?0==v?1:2:0==l[1]&&0==l[3]?0==v?1:3:0==v?2:3}else e=4==c&&0==f?v=Math.floor(4*Math.random()):p;0==e?o.setCenter(i.getCenterX(),i.getCenterY()-i.getHeight()/2-d.DEFAULT_EDGE_LENGTH-o.getHeight()/2):1==e?o.setCenter(i.getCenterX()+i.getWidth()/2+d.DEFAULT_EDGE_LENGTH+o.getWidth()/2,i.getCenterY()):2==e?o.setCenter(i.getCenterX(),i.getCenterY()+i.getHeight()/2+d.DEFAULT_EDGE_LENGTH+o.getHeight()/2):o.setCenter(i.getCenterX()-i.getWidth()/2-d.DEFAULT_EDGE_LENGTH-o.getWidth()/2,i.getCenterY())}},t.exports=y},991:(t,e,i)=>{var o=i(551).FDLayoutNode,n=i(551).IMath;function r(t,e,i,n){o.call(this,t,e,i,n)}for(var a in r.prototype=Object.create(o.prototype),o)r[a]=o[a];r.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*n.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*n.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},r.prototype.propogateDisplacementToChildren=function(t,e){for(var i,o=this.getChild().getNodes(),n=0;n<o.length;n++)null==(i=o[n]).getChild()?(i.displacementX+=t,i.displacementY+=e):i.propogateDisplacementToChildren(t,e)},r.prototype.move=function(){var t=this.graphManager.getLayout();null!=this.child&&0!=this.child.getNodes().length||(this.moveBy(this.displacementX,this.displacementY),t.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},r.prototype.setPred1=function(t){this.pred1=t},r.prototype.getPred1=function(){return pred1},r.prototype.getPred2=function(){return pred2},r.prototype.setNext=function(t){this.next=t},r.prototype.getNext=function(){return next},r.prototype.setProcessed=function(t){this.processed=t},r.prototype.isProcessed=function(){return processed},t.exports=r},902:(t,e,i)=>{function o(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}var n=i(806),r=i(551).LinkedList,a=i(551).Matrix,s=i(551).SVD;function h(){}h.handleConstraints=function(t){var e={};e.fixedNodeConstraint=t.constraints.fixedNodeConstraint,e.alignmentConstraint=t.constraints.alignmentConstraint,e.relativePlacementConstraint=t.constraints.relativePlacementConstraint;for(var i=new Map,h=new Map,l=[],d=[],g=t.getAllNodes(),c=0,p=0;p<g.length;p++){var f=g[p];null==f.getChild()&&(h.set(f.id,c++),l.push(f.getCenterX()),d.push(f.getCenterY()),i.set(f.id,f))}e.relativePlacementConstraint&&e.relativePlacementConstraint.forEach((function(t){t.gap||0==t.gap||(t.left?t.gap=n.DEFAULT_EDGE_LENGTH+i.get(t.left).getWidth()/2+i.get(t.right).getWidth()/2:t.gap=n.DEFAULT_EDGE_LENGTH+i.get(t.top).getHeight()/2+i.get(t.bottom).getHeight()/2)}));var u=function(t){var e=0,i=0;return t.forEach((function(t){e+=l[h.get(t)],i+=d[h.get(t)]})),{x:e/t.size,y:i/t.size}},m=function(t,e,i,n,a){var s=new Map;t.forEach((function(t,e){s.set(e,0)})),t.forEach((function(t,e){t.forEach((function(t){s.set(t.id,s.get(t.id)+1)}))}));var g=new Map,c=new Map,p=new r;s.forEach((function(t,o){0==t?(p.push(o),i||("horizontal"==e?g.set(o,h.has(o)?l[h.get(o)]:n.get(o)):g.set(o,h.has(o)?d[h.get(o)]:n.get(o)))):g.set(o,Number.NEGATIVE_INFINITY),i&&c.set(o,new Set([o]))})),i&&a.forEach((function(t){var o=[];if(t.forEach((function(t){i.has(t)&&o.push(t)})),o.length>0){var r=0;o.forEach((function(t){"horizontal"==e?(g.set(t,h.has(t)?l[h.get(t)]:n.get(t)),r+=g.get(t)):(g.set(t,h.has(t)?d[h.get(t)]:n.get(t)),r+=g.get(t))})),r/=o.length,t.forEach((function(t){i.has(t)||g.set(t,r)}))}else{var a=0;t.forEach((function(t){a+="horizontal"==e?h.has(t)?l[h.get(t)]:n.get(t):h.has(t)?d[h.get(t)]:n.get(t)})),a/=t.length,t.forEach((function(t){g.set(t,a)}))}}));for(var f=function(){var o=p.shift();t.get(o).forEach((function(t){if(g.get(t.id)<g.get(o)+t.gap)if(i&&i.has(t.id)){var r=void 0;if(r="horizontal"==e?h.has(t.id)?l[h.get(t.id)]:n.get(t.id):h.has(t.id)?d[h.get(t.id)]:n.get(t.id),g.set(t.id,r),r<g.get(o)+t.gap){var a=g.get(o)+t.gap-r;c.get(o).forEach((function(t){g.set(t,g.get(t)-a)}))}}else g.set(t.id,g.get(o)+t.gap);s.set(t.id,s.get(t.id)-1),0==s.get(t.id)&&p.push(t.id),i&&c.set(t.id,function(t,e){var i=new Set(t),o=!0,n=!1,r=void 0;try{for(var a,s=e[Symbol.iterator]();!(o=(a=s.next()).done);o=!0){var h=a.value;i.add(h)}}catch(t){n=!0,r=t}finally{try{!o&&s.return&&s.return()}finally{if(n)throw r}}return i}(c.get(o),c.get(t.id)))}))};0!=p.length;)f();if(i){var u=new Set;t.forEach((function(t,e){0==t.length&&u.add(e)}));var m=[];c.forEach((function(t,e){if(u.has(e)){var n=!1,r=!0,a=!1,s=void 0;try{for(var h,l=t[Symbol.iterator]();!(r=(h=l.next()).done);r=!0){var d=h.value;i.has(d)&&(n=!0)}}catch(t){a=!0,s=t}finally{try{!r&&l.return&&l.return()}finally{if(a)throw s}}if(!n){var g=!1,c=void 0;m.forEach((function(e,i){e.has([].concat(o(t))[0])&&(g=!0,c=i)})),g?t.forEach((function(t){m[c].add(t)})):m.push(new Set(t))}}})),m.forEach((function(t,i){var o=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY,c=!0,p=!1,f=void 0;try{for(var u,m=t[Symbol.iterator]();!(c=(u=m.next()).done);c=!0){var v=u.value,T=void 0;T="horizontal"==e?h.has(v)?l[h.get(v)]:n.get(v):h.has(v)?d[h.get(v)]:n.get(v);var N=g.get(v);T<o&&(o=T),T>a&&(a=T),N<r&&(r=N),N>s&&(s=N)}}catch(t){p=!0,f=t}finally{try{!c&&m.return&&m.return()}finally{if(p)throw f}}var E=(o+a)/2-(r+s)/2,y=!0,C=!1,M=void 0;try{for(var w,A=t[Symbol.iterator]();!(y=(w=A.next()).done);y=!0){var I=w.value;g.set(I,g.get(I)+E)}}catch(t){C=!0,M=t}finally{try{!y&&A.return&&A.return()}finally{if(C)throw M}}}))}return g},v=function(t){var e=0,i=0,o=0,n=0;if(t.forEach((function(t){t.left?l[h.get(t.left)]-l[h.get(t.right)]>=0?e++:i++:d[h.get(t.top)]-d[h.get(t.bottom)]>=0?o++:n++})),e>i&&o>n)for(var r=0;r<h.size;r++)l[r]=-1*l[r],d[r]=-1*d[r];else if(e>i)for(var a=0;a<h.size;a++)l[a]=-1*l[a];else if(o>n)for(var s=0;s<h.size;s++)d[s]=-1*d[s]},T=function(t){var e=[],i=new r,o=new Set,n=0;return t.forEach((function(r,a){if(!o.has(a)){e[n]=[];var s=a;for(i.push(s),o.add(s),e[n].push(s);0!=i.length;)s=i.shift(),t.get(s).forEach((function(t){o.has(t.id)||(i.push(t.id),o.add(t.id),e[n].push(t.id))}));n++}})),e},N=function(t){var e=new Map;return t.forEach((function(t,i){e.set(i,[])})),t.forEach((function(t,i){t.forEach((function(t){e.get(i).push(t),e.get(t.id).push({id:i,gap:t.gap,direction:t.direction})}))})),e},E=function(t){var e=new Map;return t.forEach((function(t,i){e.set(i,[])})),t.forEach((function(t,i){t.forEach((function(t){e.get(t.id).push({id:i,gap:t.gap,direction:t.direction})}))})),e},y=[],C=[],M=!1,w=!1,A=new Set,I=new Map,L=new Map,b=[];if(e.fixedNodeConstraint&&e.fixedNodeConstraint.forEach((function(t){A.add(t.nodeId)})),e.relativePlacementConstraint&&(e.relativePlacementConstraint.forEach((function(t){t.left?(I.has(t.left)?I.get(t.left).push({id:t.right,gap:t.gap,direction:"horizontal"}):I.set(t.left,[{id:t.right,gap:t.gap,direction:"horizontal"}]),I.has(t.right)||I.set(t.right,[])):(I.has(t.top)?I.get(t.top).push({id:t.bottom,gap:t.gap,direction:"vertical"}):I.set(t.top,[{id:t.bottom,gap:t.gap,direction:"vertical"}]),I.has(t.bottom)||I.set(t.bottom,[]))})),L=N(I),b=T(L)),n.TRANSFORM_ON_CONSTRAINT_HANDLING){if(e.fixedNodeConstraint&&e.fixedNodeConstraint.length>1)e.fixedNodeConstraint.forEach((function(t,e){y[e]=[t.position.x,t.position.y],C[e]=[l[h.get(t.nodeId)],d[h.get(t.nodeId)]]})),M=!0;else if(e.alignmentConstraint)!function(){var t=0;if(e.alignmentConstraint.vertical){for(var i=e.alignmentConstraint.vertical,n=function(e){var n=new Set;i[e].forEach((function(t){n.add(t)}));var r=new Set([].concat(o(n)).filter((function(t){return A.has(t)}))),a=void 0;a=r.size>0?l[h.get(r.values().next().value)]:u(n).x,i[e].forEach((function(e){y[t]=[a,d[h.get(e)]],C[t]=[l[h.get(e)],d[h.get(e)]],t++}))},r=0;r<i.length;r++)n(r);M=!0}if(e.alignmentConstraint.horizontal){for(var a=e.alignmentConstraint.horizontal,s=function(e){var i=new Set;a[e].forEach((function(t){i.add(t)}));var n=new Set([].concat(o(i)).filter((function(t){return A.has(t)}))),r=void 0;r=n.size>0?l[h.get(n.values().next().value)]:u(i).y,a[e].forEach((function(e){y[t]=[l[h.get(e)],r],C[t]=[l[h.get(e)],d[h.get(e)]],t++}))},g=0;g<a.length;g++)s(g);M=!0}e.relativePlacementConstraint&&(w=!0)}();else if(e.relativePlacementConstraint){for(var _=0,F=0,R=0;R<b.length;R++)b[R].length>_&&(_=b[R].length,F=R);if(_<L.size/2)v(e.relativePlacementConstraint),M=!1,w=!1;else{var O=new Map,P=new Map,x=[];b[F].forEach((function(t){I.get(t).forEach((function(e){"horizontal"==e.direction?(O.has(t)?O.get(t).push(e):O.set(t,[e]),O.has(e.id)||O.set(e.id,[]),x.push({left:t,right:e.id})):(P.has(t)?P.get(t).push(e):P.set(t,[e]),P.has(e.id)||P.set(e.id,[]),x.push({top:t,bottom:e.id}))}))})),v(x),w=!1;var D=m(O,"horizontal"),H=m(P,"vertical");b[F].forEach((function(t,e){C[e]=[l[h.get(t)],d[h.get(t)]],y[e]=[],D.has(t)?y[e][0]=D.get(t):y[e][0]=l[h.get(t)],H.has(t)?y[e][1]=H.get(t):y[e][1]=d[h.get(t)]})),M=!0}}if(M){for(var G,z=a.transpose(y),S=a.transpose(C),V=0;V<z.length;V++)z[V]=a.multGamma(z[V]),S[V]=a.multGamma(S[V]);var W=a.multMat(z,a.transpose(S)),Y=s.svd(W);G=a.multMat(Y.V,a.transpose(Y.U));for(var X=0;X<h.size;X++){var U=[l[X],d[X]],B=[G[0][0],G[1][0]],k=[G[0][1],G[1][1]];l[X]=a.dotProduct(U,B),d[X]=a.dotProduct(U,k)}w&&v(e.relativePlacementConstraint)}}if(n.ENFORCE_CONSTRAINTS){if(e.fixedNodeConstraint&&e.fixedNodeConstraint.length>0){var j={x:0,y:0};e.fixedNodeConstraint.forEach((function(t,e){var i,o,n={x:l[h.get(t.nodeId)],y:d[h.get(t.nodeId)]},r=t.position,a=(o=n,{x:(i=r).x-o.x,y:i.y-o.y});j.x+=a.x,j.y+=a.y})),j.x/=e.fixedNodeConstraint.length,j.y/=e.fixedNodeConstraint.length,l.forEach((function(t,e){l[e]+=j.x})),d.forEach((function(t,e){d[e]+=j.y})),e.fixedNodeConstraint.forEach((function(t){l[h.get(t.nodeId)]=t.position.x,d[h.get(t.nodeId)]=t.position.y}))}if(e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var Z=e.alignmentConstraint.vertical,q=function(t){var e=new Set;Z[t].forEach((function(t){e.add(t)}));var i=new Set([].concat(o(e)).filter((function(t){return A.has(t)}))),n=void 0;n=i.size>0?l[h.get(i.values().next().value)]:u(e).x,e.forEach((function(t){A.has(t)||(l[h.get(t)]=n)}))},K=0;K<Z.length;K++)q(K);if(e.alignmentConstraint.horizontal)for(var Q=e.alignmentConstraint.horizontal,J=function(t){var e=new Set;Q[t].forEach((function(t){e.add(t)}));var i=new Set([].concat(o(e)).filter((function(t){return A.has(t)}))),n=void 0;n=i.size>0?d[h.get(i.values().next().value)]:u(e).y,e.forEach((function(t){A.has(t)||(d[h.get(t)]=n)}))},$=0;$<Q.length;$++)J($)}e.relativePlacementConstraint&&function(){var t=new Map,i=new Map,o=new Map,n=new Map,r=new Map,a=new Map,s=new Set,g=new Set;if(A.forEach((function(t){s.add(t),g.add(t)})),e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var c=e.alignmentConstraint.vertical,p=function(e){o.set("dummy"+e,[]),c[e].forEach((function(i){t.set(i,"dummy"+e),o.get("dummy"+e).push(i),A.has(i)&&s.add("dummy"+e)})),r.set("dummy"+e,l[h.get(c[e][0])])},f=0;f<c.length;f++)p(f);if(e.alignmentConstraint.horizontal)for(var u=e.alignmentConstraint.horizontal,v=function(t){n.set("dummy"+t,[]),u[t].forEach((function(e){i.set(e,"dummy"+t),n.get("dummy"+t).push(e),A.has(e)&&g.add("dummy"+t)})),a.set("dummy"+t,d[h.get(u[t][0])])},y=0;y<u.length;y++)v(y)}var C=new Map,M=new Map,w=function(e){I.get(e).forEach((function(o){var n=void 0,r=void 0;"horizontal"==o.direction?(n=t.get(e)?t.get(e):e,r=t.get(o.id)?{id:t.get(o.id),gap:o.gap,direction:o.direction}:o,C.has(n)?C.get(n).push(r):C.set(n,[r]),C.has(r.id)||C.set(r.id,[])):(n=i.get(e)?i.get(e):e,r=i.get(o.id)?{id:i.get(o.id),gap:o.gap,direction:o.direction}:o,M.has(n)?M.get(n).push(r):M.set(n,[r]),M.has(r.id)||M.set(r.id,[]))}))},L=!0,b=!1,_=void 0;try{for(var F,R=I.keys()[Symbol.iterator]();!(L=(F=R.next()).done);L=!0)w(F.value)}catch(t){b=!0,_=t}finally{try{!L&&R.return&&R.return()}finally{if(b)throw _}}var O=N(C),P=N(M),x=T(O),D=T(P),H=E(C),G=E(M),z=[],S=[];x.forEach((function(t,e){z[e]=[],t.forEach((function(t){0==H.get(t).length&&z[e].push(t)}))})),D.forEach((function(t,e){S[e]=[],t.forEach((function(t){0==G.get(t).length&&S[e].push(t)}))}));var V=m(C,"horizontal",s,r,z),W=m(M,"vertical",g,a,S),Y=function(t){o.get(t)?o.get(t).forEach((function(e){l[h.get(e)]=V.get(t)})):l[h.get(t)]=V.get(t)},X=!0,U=!1,B=void 0;try{for(var k,j=V.keys()[Symbol.iterator]();!(X=(k=j.next()).done);X=!0)Y(k.value)}catch(t){U=!0,B=t}finally{try{!X&&j.return&&j.return()}finally{if(U)throw B}}var Z=function(t){n.get(t)?n.get(t).forEach((function(e){d[h.get(e)]=W.get(t)})):d[h.get(t)]=W.get(t)},q=!0,K=!1,Q=void 0;try{for(var J,$=W.keys()[Symbol.iterator]();!(q=(J=$.next()).done);q=!0)Z(J.value)}catch(t){K=!0,Q=t}finally{try{!q&&$.return&&$.return()}finally{if(K)throw Q}}}()}for(var tt=0;tt<g.length;tt++){var et=g[tt];null==et.getChild()&&et.setCenter(l[h.get(et.id)],d[h.get(et.id)])}},t.exports=h},551:e=>{e.exports=t}},i={},o=function t(o){var n=i[o];if(void 0!==n)return n.exports;var r=i[o]={exports:{}};return e[o](r,r.exports,t),r.exports}(45),o;var e,i,o},t.exports=n(i())),e.exports;var t,n}e.exports;export{n as __require};
|
|
1
|
+
import{commonjsGlobal as t}from"../../../../../_virtual/_commonjsHelpers.js";import{__module as e}from"../../../../../_virtual/cose-base2.js";import{__require as i}from"../../../layout-base@2.0.1/node_modules/layout-base/layout-base.js";var o;function n(){return o||(o=1,t=e,e.exports,n=function(t){return e={45:(t,e,i)=>{var o={};o.layoutBase=i(551),o.CoSEConstants=i(806),o.CoSEEdge=i(767),o.CoSEGraph=i(880),o.CoSEGraphManager=i(578),o.CoSELayout=i(765),o.CoSENode=i(991),o.ConstraintHandler=i(902),t.exports=o},806:(t,e,i)=>{var o=i(551).FDLayoutConstants;function n(){}for(var r in o)n[r]=o[r];n.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,n.DEFAULT_RADIAL_SEPARATION=o.DEFAULT_EDGE_LENGTH,n.DEFAULT_COMPONENT_SEPERATION=60,n.TILE=!0,n.TILING_PADDING_VERTICAL=10,n.TILING_PADDING_HORIZONTAL=10,n.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,n.ENFORCE_CONSTRAINTS=!0,n.APPLY_LAYOUT=!0,n.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,n.TREE_REDUCTION_ON_INCREMENTAL=!0,n.PURE_INCREMENTAL=n.DEFAULT_INCREMENTAL,t.exports=n},767:(t,e,i)=>{var o=i(551).FDLayoutEdge;function n(t,e,i){o.call(this,t,e,i)}for(var r in n.prototype=Object.create(o.prototype),o)n[r]=o[r];t.exports=n},880:(t,e,i)=>{var o=i(551).LGraph;function n(t,e,i){o.call(this,t,e,i)}for(var r in n.prototype=Object.create(o.prototype),o)n[r]=o[r];t.exports=n},578:(t,e,i)=>{var o=i(551).LGraphManager;function n(t){o.call(this,t)}for(var r in n.prototype=Object.create(o.prototype),o)n[r]=o[r];t.exports=n},765:(t,e,i)=>{var o=i(551).FDLayout,n=i(578),r=i(880),a=i(991),s=i(767),h=i(806),l=i(902),d=i(551).FDLayoutConstants,g=i(551).LayoutConstants,c=i(551).Point,p=i(551).PointD,f=i(551).DimensionD,u=i(551).Layout,m=i(551).Integer,v=i(551).IGeometry,T=i(551).LGraph,N=i(551).Transform,E=i(551).LinkedList;function y(){o.call(this),this.toBeTiled={},this.constraints={}}for(var C in y.prototype=Object.create(o.prototype),o)y[C]=o[C];y.prototype.newGraphManager=function(){var t=new n(this);return this.graphManager=t,t},y.prototype.newGraph=function(t){return new r(null,this.graphManager,t)},y.prototype.newNode=function(t){return new a(this.graphManager,t)},y.prototype.newEdge=function(t){return new s(null,null,t)},y.prototype.initParameters=function(){o.prototype.initParameters.call(this,arguments),this.isSubLayout||(h.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=d.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=d.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},y.prototype.initSpringEmbedder=function(){o.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},y.prototype.layout=function(){return g.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},y.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)h.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),e=new Set(this.getAllNodes()),i=this.nodesWithGravity.filter((function(t){return e.has(t)})),this.graphManager.setAllNodesToApplyGravitation(i));else{var t=this.getFlatForest();if(t.length>0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),i=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(i),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(l.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),h.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),e=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(e),this.graphManager.updateBounds(),this.updateGrid(),h.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),h.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var i=!this.isTreeGrowing&&!this.isGrowthFinished,o=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(i,o),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),e={},i=0;i<t.length;i++){var o=t[i].rect,n=t[i].id;e[n]={id:n,x:o.getCenterX(),y:o.getCenterY(),w:o.width,h:o.height}}return e},y.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var t=!1;if("during"===d.ANIMATE)this.emit("layoutstarted");else{for(;!t;)t=this.tick();this.graphManager.updateBounds()}},y.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].calculateDisplacement();for(Object.keys(this.constraints).length>0&&this.updateDisplacements(),e=0;e<t.length;e++)t[e].move()},y.prototype.initConstraintVariables=function(){var t=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var e=this.graphManager.getAllNodes(),i=0;i<e.length;i++){var o=e[i];this.idToNodeMap.set(o.id,o)}var n=function e(i){for(var o,n=i.getChild().getNodes(),r=0,a=0;a<n.length;a++)null==(o=n[a]).getChild()?t.fixedNodeSet.has(o.id)&&(r+=100):r+=e(o);return r};if(this.constraints.fixedNodeConstraint)for(this.constraints.fixedNodeConstraint.forEach((function(e){t.fixedNodeSet.add(e.nodeId)})),e=this.graphManager.getAllNodes(),i=0;i<e.length;i++)if(null!=(o=e[i]).getChild()){var r=n(o);r>0&&(o.fixedNodeWeight=r)}if(this.constraints.relativePlacementConstraint){var a=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach((function(e){t.fixedNodesOnHorizontal.add(e),t.fixedNodesOnVertical.add(e)})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var l=this.constraints.alignmentConstraint.vertical;for(i=0;i<l.length;i++)this.dummyToNodeForVerticalAlignment.set("dummy"+i,[]),l[i].forEach((function(e){a.set(e,"dummy"+i),t.dummyToNodeForVerticalAlignment.get("dummy"+i).push(e),t.fixedNodeSet.has(e)&&t.fixedNodesOnHorizontal.add("dummy"+i)}))}if(this.constraints.alignmentConstraint.horizontal){var d=this.constraints.alignmentConstraint.horizontal;for(i=0;i<d.length;i++)this.dummyToNodeForHorizontalAlignment.set("dummy"+i,[]),d[i].forEach((function(e){s.set(e,"dummy"+i),t.dummyToNodeForHorizontalAlignment.get("dummy"+i).push(e),t.fixedNodeSet.has(e)&&t.fixedNodesOnVertical.add("dummy"+i)}))}}if(h.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(t){var e,i,o;for(o=t.length-1;o>=2*t.length/3;o--)e=Math.floor(Math.random()*(o+1)),i=t[o],t[o]=t[e],t[e]=i;return t},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach((function(e){if(e.left){var i=a.has(e.left)?a.get(e.left):e.left,o=a.has(e.right)?a.get(e.right):e.right;t.nodesInRelativeHorizontal.includes(i)||(t.nodesInRelativeHorizontal.push(i),t.nodeToRelativeConstraintMapHorizontal.set(i,[]),t.dummyToNodeForVerticalAlignment.has(i)?t.nodeToTempPositionMapHorizontal.set(i,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(i)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(i,t.idToNodeMap.get(i).getCenterX())),t.nodesInRelativeHorizontal.includes(o)||(t.nodesInRelativeHorizontal.push(o),t.nodeToRelativeConstraintMapHorizontal.set(o,[]),t.dummyToNodeForVerticalAlignment.has(o)?t.nodeToTempPositionMapHorizontal.set(o,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(o)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(o,t.idToNodeMap.get(o).getCenterX())),t.nodeToRelativeConstraintMapHorizontal.get(i).push({right:o,gap:e.gap}),t.nodeToRelativeConstraintMapHorizontal.get(o).push({left:i,gap:e.gap})}else{var n=s.has(e.top)?s.get(e.top):e.top,r=s.has(e.bottom)?s.get(e.bottom):e.bottom;t.nodesInRelativeVertical.includes(n)||(t.nodesInRelativeVertical.push(n),t.nodeToRelativeConstraintMapVertical.set(n,[]),t.dummyToNodeForHorizontalAlignment.has(n)?t.nodeToTempPositionMapVertical.set(n,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(n)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(n,t.idToNodeMap.get(n).getCenterY())),t.nodesInRelativeVertical.includes(r)||(t.nodesInRelativeVertical.push(r),t.nodeToRelativeConstraintMapVertical.set(r,[]),t.dummyToNodeForHorizontalAlignment.has(r)?t.nodeToTempPositionMapVertical.set(r,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(r)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(r,t.idToNodeMap.get(r).getCenterY())),t.nodeToRelativeConstraintMapVertical.get(n).push({bottom:r,gap:e.gap}),t.nodeToRelativeConstraintMapVertical.get(r).push({top:n,gap:e.gap})}}));else{var g=new Map,c=new Map;this.constraints.relativePlacementConstraint.forEach((function(t){if(t.left){var e=a.has(t.left)?a.get(t.left):t.left,i=a.has(t.right)?a.get(t.right):t.right;g.has(e)?g.get(e).push(i):g.set(e,[i]),g.has(i)?g.get(i).push(e):g.set(i,[e])}else{var o=s.has(t.top)?s.get(t.top):t.top,n=s.has(t.bottom)?s.get(t.bottom):t.bottom;c.has(o)?c.get(o).push(n):c.set(o,[n]),c.has(n)?c.get(n).push(o):c.set(n,[o])}}));var p=function(t,e){var i=[],o=[],n=new E,r=new Set,a=0;return t.forEach((function(s,h){if(!r.has(h)){i[a]=[],o[a]=!1;var l=h;for(n.push(l),r.add(l),i[a].push(l);0!=n.length;)l=n.shift(),e.has(l)&&(o[a]=!0),t.get(l).forEach((function(t){r.has(t)||(n.push(t),r.add(t),i[a].push(t))}));a++}})),{components:i,isFixed:o}},f=p(g,t.fixedNodesOnHorizontal);this.componentsOnHorizontal=f.components,this.fixedComponentsOnHorizontal=f.isFixed;var u=p(c,t.fixedNodesOnVertical);this.componentsOnVertical=u.components,this.fixedComponentsOnVertical=u.isFixed}}},y.prototype.updateDisplacements=function(){var t=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach((function(e){var i=t.idToNodeMap.get(e.nodeId);i.displacementX=0,i.displacementY=0})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var e=this.constraints.alignmentConstraint.vertical,i=0;i<e.length;i++){for(var o=0,n=0;n<e[i].length;n++){if(this.fixedNodeSet.has(e[i][n])){o=0;break}o+=this.idToNodeMap.get(e[i][n]).displacementX}var r=o/e[i].length;for(n=0;n<e[i].length;n++)this.idToNodeMap.get(e[i][n]).displacementX=r}if(this.constraints.alignmentConstraint.horizontal){var a=this.constraints.alignmentConstraint.horizontal;for(i=0;i<a.length;i++){var s=0;for(n=0;n<a[i].length;n++){if(this.fixedNodeSet.has(a[i][n])){s=0;break}s+=this.idToNodeMap.get(a[i][n]).displacementY}var l=s/a[i].length;for(n=0;n<a[i].length;n++)this.idToNodeMap.get(a[i][n]).displacementY=l}}}if(this.constraints.relativePlacementConstraint)if(h.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach((function(e){if(!t.fixedNodesOnHorizontal.has(e)){var i=0;i=t.dummyToNodeForVerticalAlignment.has(e)?t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(e)[0]).displacementX:t.idToNodeMap.get(e).displacementX,t.nodeToRelativeConstraintMapHorizontal.get(e).forEach((function(o){var n;o.right?(n=t.nodeToTempPositionMapHorizontal.get(o.right)-t.nodeToTempPositionMapHorizontal.get(e)-i)<o.gap&&(i-=o.gap-n):(n=t.nodeToTempPositionMapHorizontal.get(e)-t.nodeToTempPositionMapHorizontal.get(o.left)+i)<o.gap&&(i+=o.gap-n)})),t.nodeToTempPositionMapHorizontal.set(e,t.nodeToTempPositionMapHorizontal.get(e)+i),t.dummyToNodeForVerticalAlignment.has(e)?t.dummyToNodeForVerticalAlignment.get(e).forEach((function(e){t.idToNodeMap.get(e).displacementX=i})):t.idToNodeMap.get(e).displacementX=i}})),this.nodesInRelativeVertical.forEach((function(e){if(!t.fixedNodesOnHorizontal.has(e)){var i=0;i=t.dummyToNodeForHorizontalAlignment.has(e)?t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(e)[0]).displacementY:t.idToNodeMap.get(e).displacementY,t.nodeToRelativeConstraintMapVertical.get(e).forEach((function(o){var n;o.bottom?(n=t.nodeToTempPositionMapVertical.get(o.bottom)-t.nodeToTempPositionMapVertical.get(e)-i)<o.gap&&(i-=o.gap-n):(n=t.nodeToTempPositionMapVertical.get(e)-t.nodeToTempPositionMapVertical.get(o.top)+i)<o.gap&&(i+=o.gap-n)})),t.nodeToTempPositionMapVertical.set(e,t.nodeToTempPositionMapVertical.get(e)+i),t.dummyToNodeForHorizontalAlignment.has(e)?t.dummyToNodeForHorizontalAlignment.get(e).forEach((function(e){t.idToNodeMap.get(e).displacementY=i})):t.idToNodeMap.get(e).displacementY=i}}));else{for(i=0;i<this.componentsOnHorizontal.length;i++){var d=this.componentsOnHorizontal[i];if(this.fixedComponentsOnHorizontal[i])for(n=0;n<d.length;n++)this.dummyToNodeForVerticalAlignment.has(d[n])?this.dummyToNodeForVerticalAlignment.get(d[n]).forEach((function(e){t.idToNodeMap.get(e).displacementX=0})):this.idToNodeMap.get(d[n]).displacementX=0;else{var g=0,c=0;for(n=0;n<d.length;n++)this.dummyToNodeForVerticalAlignment.has(d[n])?(g+=(f=this.dummyToNodeForVerticalAlignment.get(d[n])).length*this.idToNodeMap.get(f[0]).displacementX,c+=f.length):(g+=this.idToNodeMap.get(d[n]).displacementX,c++);var p=g/c;for(n=0;n<d.length;n++)this.dummyToNodeForVerticalAlignment.has(d[n])?this.dummyToNodeForVerticalAlignment.get(d[n]).forEach((function(e){t.idToNodeMap.get(e).displacementX=p})):this.idToNodeMap.get(d[n]).displacementX=p}}for(i=0;i<this.componentsOnVertical.length;i++)if(d=this.componentsOnVertical[i],this.fixedComponentsOnVertical[i])for(n=0;n<d.length;n++)this.dummyToNodeForHorizontalAlignment.has(d[n])?this.dummyToNodeForHorizontalAlignment.get(d[n]).forEach((function(e){t.idToNodeMap.get(e).displacementY=0})):this.idToNodeMap.get(d[n]).displacementY=0;else{for(g=0,c=0,n=0;n<d.length;n++){var f;this.dummyToNodeForHorizontalAlignment.has(d[n])?(g+=(f=this.dummyToNodeForHorizontalAlignment.get(d[n])).length*this.idToNodeMap.get(f[0]).displacementY,c+=f.length):(g+=this.idToNodeMap.get(d[n]).displacementY,c++)}for(p=g/c,n=0;n<d.length;n++)this.dummyToNodeForHorizontalAlignment.has(d[n])?this.dummyToNodeForHorizontalAlignment.get(d[n]).forEach((function(e){t.idToNodeMap.get(e).displacementY=p})):this.idToNodeMap.get(d[n]).displacementY=p}}},y.prototype.calculateNodesToApplyGravitationTo=function(){var t,e,i=[],o=this.graphManager.getGraphs(),n=o.length;for(e=0;e<n;e++)(t=o[e]).updateConnected(),t.isConnected||(i=i.concat(t.getNodes()));return i},y.prototype.createBendpoints=function(){var t=[];t=t.concat(this.graphManager.getAllEdges());var e,i=new Set;for(e=0;e<t.length;e++){var o=t[e];if(!i.has(o)){var n=o.getSource(),r=o.getTarget();if(n==r)o.getBendpoints().push(new p),o.getBendpoints().push(new p),this.createDummyNodesForBendpoints(o),i.add(o);else{var a=[];if(a=(a=a.concat(n.getEdgeListToNode(r))).concat(r.getEdgeListToNode(n)),!i.has(a[0])){var s;if(a.length>1)for(s=0;s<a.length;s++){var h=a[s];h.getBendpoints().push(new p),this.createDummyNodesForBendpoints(h)}a.forEach((function(t){i.add(t)}))}}}if(i.size==t.length)break}},y.prototype.positionNodesRadially=function(t){for(var e=new c(0,0),i=Math.ceil(Math.sqrt(t.length)),o=0,n=0,r=0,a=new p(0,0),s=0;s<t.length;s++){s%i==0&&(r=0,n=o,0!=s&&(n+=h.DEFAULT_COMPONENT_SEPERATION),o=0);var l=t[s],d=u.findCenterOfTree(l);e.x=r,e.y=n,(a=y.radialLayout(l,d,e)).y>o&&(o=Math.floor(a.y)),r=Math.floor(a.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(g.WORLD_CENTER_X-a.x/2,g.WORLD_CENTER_Y-a.y/2))},y.radialLayout=function(t,e,i){var o=Math.max(this.maxDiagonalInTree(t),h.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(e,null,0,359,0,o);var n=T.calculateBounds(t),r=new N;r.setDeviceOrgX(n.getMinX()),r.setDeviceOrgY(n.getMinY()),r.setWorldOrgX(i.x),r.setWorldOrgY(i.y);for(var a=0;a<t.length;a++)t[a].transform(r);var s=new p(n.getMaxX(),n.getMaxY());return r.inverseTransformPoint(s)},y.branchRadialLayout=function(t,e,i,o,n,r){var a=(o-i+1)/2;a<0&&(a+=180);var s=(a+i)%360*v.TWO_PI/360,h=n*Math.cos(s),l=n*Math.sin(s);t.setCenter(h,l);var d=[],g=(d=d.concat(t.getEdges())).length;null!=e&&g--;for(var c,p=0,f=d.length,u=t.getEdgesBetween(e);u.length>1;){var m=u[0];u.splice(0,1);var T=d.indexOf(m);T>=0&&d.splice(T,1),f--,g--}c=null!=e?(d.indexOf(u[0])+1)%f:0;for(var N=Math.abs(o-i)/g,E=c;p!=g;E=++E%f){var C=d[E].getOtherEnd(t);if(C!=e){var M=(i+p*N)%360,w=(M+N)%360;y.branchRadialLayout(C,t,M,w,n+r,r),p++}}},y.maxDiagonalInTree=function(t){for(var e=m.MIN_VALUE,i=0;i<t.length;i++){var o=t[i].getDiagonal();o>e&&(e=o)}return e},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var t=this,e={};this.memberGroups={},this.idToDummyNode={};for(var i=[],o=this.graphManager.getAllNodes(),n=0;n<o.length;n++){var r=(s=o[n]).getParent();0!==this.getNodeDegreeWithChildren(s)||null!=r.id&&this.getToBeTiled(r)||i.push(s)}for(n=0;n<i.length;n++){var s,h=(s=i[n]).getParent().id;void 0===e[h]&&(e[h]=[]),e[h]=e[h].concat(s)}Object.keys(e).forEach((function(i){if(e[i].length>1){var o="DummyCompound_"+i;t.memberGroups[o]=e[i];var n=e[i][0].getParent(),r=new a(t.graphManager);r.id=o,r.paddingLeft=n.paddingLeft||0,r.paddingRight=n.paddingRight||0,r.paddingBottom=n.paddingBottom||0,r.paddingTop=n.paddingTop||0,t.idToDummyNode[o]=r;var s=t.getGraphManager().add(t.newGraph(),r),h=n.getChild();h.add(r);for(var l=0;l<e[i].length;l++){var d=e[i][l];h.remove(d),s.add(d)}}}))},y.prototype.clearCompounds=function(){var t={},e={};this.performDFSOnCompounds();for(var i=0;i<this.compoundOrder.length;i++)e[this.compoundOrder[i].id]=this.compoundOrder[i],t[this.compoundOrder[i].id]=[].concat(this.compoundOrder[i].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[i].getChild()),this.compoundOrder[i].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(t,e)},y.prototype.clearZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach((function(i){var o=t.idToDummyNode[i];if(e[i]=t.tileNodes(t.memberGroups[i],o.paddingLeft+o.paddingRight),o.rect.width=e[i].width,o.rect.height=e[i].height,o.setCenter(e[i].centerX,e[i].centerY),o.labelMarginLeft=0,o.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var n=o.rect.width,r=o.rect.height;o.labelWidth&&("left"==o.labelPosHorizontal?(o.rect.x-=o.labelWidth,o.setWidth(n+o.labelWidth),o.labelMarginLeft=o.labelWidth):"center"==o.labelPosHorizontal&&o.labelWidth>n?(o.rect.x-=(o.labelWidth-n)/2,o.setWidth(o.labelWidth),o.labelMarginLeft=(o.labelWidth-n)/2):"right"==o.labelPosHorizontal&&o.setWidth(n+o.labelWidth)),o.labelHeight&&("top"==o.labelPosVertical?(o.rect.y-=o.labelHeight,o.setHeight(r+o.labelHeight),o.labelMarginTop=o.labelHeight):"center"==o.labelPosVertical&&o.labelHeight>r?(o.rect.y-=(o.labelHeight-r)/2,o.setHeight(o.labelHeight),o.labelMarginTop=(o.labelHeight-r)/2):"bottom"==o.labelPosVertical&&o.setHeight(r+o.labelHeight))}}))},y.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var e=this.compoundOrder[t],i=e.id,o=e.paddingLeft,n=e.paddingTop,r=e.labelMarginLeft,a=e.labelMarginTop;this.adjustLocations(this.tiledMemberPack[i],e.rect.x,e.rect.y,o,n,r,a)}},y.prototype.repopulateZeroDegreeMembers=function(){var t=this,e=this.tiledZeroDegreePack;Object.keys(e).forEach((function(i){var o=t.idToDummyNode[i],n=o.paddingLeft,r=o.paddingTop,a=o.labelMarginLeft,s=o.labelMarginTop;t.adjustLocations(e[i],o.rect.x,o.rect.y,n,r,a,s)}))},y.prototype.getToBeTiled=function(t){var e=t.id;if(null!=this.toBeTiled[e])return this.toBeTiled[e];var i=t.getChild();if(null==i)return this.toBeTiled[e]=!1,!1;for(var o=i.getNodes(),n=0;n<o.length;n++){var r=o[n];if(this.getNodeDegree(r)>0)return this.toBeTiled[e]=!1,!1;if(null!=r.getChild()){if(!this.getToBeTiled(r))return this.toBeTiled[e]=!1,!1}else this.toBeTiled[r.id]=!1}return this.toBeTiled[e]=!0,!0},y.prototype.getNodeDegree=function(t){t.id;for(var e=t.getEdges(),i=0,o=0;o<e.length;o++){var n=e[o];n.getSource().id!==n.getTarget().id&&(i+=1)}return i},y.prototype.getNodeDegreeWithChildren=function(t){var e=this.getNodeDegree(t);if(null==t.getChild())return e;for(var i=t.getChild().getNodes(),o=0;o<i.length;o++){var n=i[o];e+=this.getNodeDegreeWithChildren(n)}return e},y.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},y.prototype.fillCompexOrderByDFS=function(t){for(var e=0;e<t.length;e++){var i=t[e];null!=i.getChild()&&this.fillCompexOrderByDFS(i.getChild().getNodes()),this.getToBeTiled(i)&&this.compoundOrder.push(i)}},y.prototype.adjustLocations=function(t,e,i,o,n,r,a){i+=n+a;for(var s=e+=o+r,h=0;h<t.rows.length;h++){var l=t.rows[h];e=s;for(var d=0,g=0;g<l.length;g++){var c=l[g];c.rect.x=e,c.rect.y=i,e+=c.rect.width+t.horizontalPadding,c.rect.height>d&&(d=c.rect.height)}i+=d+t.verticalPadding}},y.prototype.tileCompoundMembers=function(t,e){var i=this;this.tiledMemberPack=[],Object.keys(t).forEach((function(o){var n=e[o];if(i.tiledMemberPack[o]=i.tileNodes(t[o],n.paddingLeft+n.paddingRight),n.rect.width=i.tiledMemberPack[o].width,n.rect.height=i.tiledMemberPack[o].height,n.setCenter(i.tiledMemberPack[o].centerX,i.tiledMemberPack[o].centerY),n.labelMarginLeft=0,n.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var r=n.rect.width,a=n.rect.height;n.labelWidth&&("left"==n.labelPosHorizontal?(n.rect.x-=n.labelWidth,n.setWidth(r+n.labelWidth),n.labelMarginLeft=n.labelWidth):"center"==n.labelPosHorizontal&&n.labelWidth>r?(n.rect.x-=(n.labelWidth-r)/2,n.setWidth(n.labelWidth),n.labelMarginLeft=(n.labelWidth-r)/2):"right"==n.labelPosHorizontal&&n.setWidth(r+n.labelWidth)),n.labelHeight&&("top"==n.labelPosVertical?(n.rect.y-=n.labelHeight,n.setHeight(a+n.labelHeight),n.labelMarginTop=n.labelHeight):"center"==n.labelPosVertical&&n.labelHeight>a?(n.rect.y-=(n.labelHeight-a)/2,n.setHeight(n.labelHeight),n.labelMarginTop=(n.labelHeight-a)/2):"bottom"==n.labelPosVertical&&n.setHeight(a+n.labelHeight))}}))},y.prototype.tileNodes=function(t,e){var i=this.tileNodesByFavoringDim(t,e,!0),o=this.tileNodesByFavoringDim(t,e,!1),n=this.getOrgRatio(i);return this.getOrgRatio(o)<n?o:i},y.prototype.getOrgRatio=function(t){var e=t.width/t.height;return e<1&&(e=1/e),e},y.prototype.calcIdealRowWidth=function(t,e){var i=h.TILING_PADDING_VERTICAL,o=h.TILING_PADDING_HORIZONTAL,n=t.length,r=0,a=0,s=0;t.forEach((function(t){r+=t.getWidth(),a+=t.getHeight(),t.getWidth()>s&&(s=t.getWidth())}));var l,d=r/n,g=a/n,c=Math.pow(i-o,2)+4*(d+o)*(g+i)*n,p=(o-i+Math.sqrt(c))/(2*(d+o));e?(l=Math.ceil(p))==p&&l++:l=Math.floor(p);var f=l*(d+o)-o;return s>f&&(f=s),f+=2*o},y.prototype.tileNodesByFavoringDim=function(t,e,i){var o=h.TILING_PADDING_VERTICAL,n=h.TILING_PADDING_HORIZONTAL,r=h.TILING_COMPARE_BY,a={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:o,horizontalPadding:n,centerX:0,centerY:0};r&&(a.idealRowWidth=this.calcIdealRowWidth(t,i));var s=function(t){return t.rect.width*t.rect.height},l=function(t,e){return s(e)-s(t)};t.sort((function(t,e){var i=l;return a.idealRowWidth?(i=r)(t.id,e.id):i(t,e)}));for(var d=0,g=0,c=0;c<t.length;c++)d+=(p=t[c]).getCenterX(),g+=p.getCenterY();for(a.centerX=d/t.length,a.centerY=g/t.length,c=0;c<t.length;c++){var p=t[c];if(0==a.rows.length)this.insertNodeToRow(a,p,0,e);else if(this.canAddHorizontal(a,p.rect.width,p.rect.height)){var f=a.rows.length-1;a.idealRowWidth||(f=this.getShortestRowIndex(a)),this.insertNodeToRow(a,p,f,e)}else this.insertNodeToRow(a,p,a.rows.length,e);this.shiftToLastRow(a)}return a},y.prototype.insertNodeToRow=function(t,e,i,o){var n=o;i==t.rows.length&&(t.rows.push([]),t.rowWidth.push(n),t.rowHeight.push(0));var r=t.rowWidth[i]+e.rect.width;t.rows[i].length>0&&(r+=t.horizontalPadding),t.rowWidth[i]=r,t.width<r&&(t.width=r);var a=e.rect.height;i>0&&(a+=t.verticalPadding);var s=0;a>t.rowHeight[i]&&(s=t.rowHeight[i],t.rowHeight[i]=a,s=t.rowHeight[i]-s),t.height+=s,t.rows[i].push(e)},y.prototype.getShortestRowIndex=function(t){for(var e=-1,i=Number.MAX_VALUE,o=0;o<t.rows.length;o++)t.rowWidth[o]<i&&(e=o,i=t.rowWidth[o]);return e},y.prototype.getLongestRowIndex=function(t){for(var e=-1,i=Number.MIN_VALUE,o=0;o<t.rows.length;o++)t.rowWidth[o]>i&&(e=o,i=t.rowWidth[o]);return e},y.prototype.canAddHorizontal=function(t,e,i){if(t.idealRowWidth){var o=t.rows.length-1;return t.rowWidth[o]+e+t.horizontalPadding<=t.idealRowWidth}var n=this.getShortestRowIndex(t);if(n<0)return!0;var r=t.rowWidth[n];if(r+t.horizontalPadding+e<=t.width)return!0;var a,s,h=0;return t.rowHeight[n]<i&&n>0&&(h=i+t.verticalPadding-t.rowHeight[n]),a=t.width-r>=e+t.horizontalPadding?(t.height+h)/(r+e+t.horizontalPadding):(t.height+h)/t.width,h=i+t.verticalPadding,(s=t.width<e?(t.height+h)/e:(t.height+h)/t.width)<1&&(s=1/s),a<1&&(a=1/a),a<s},y.prototype.shiftToLastRow=function(t){var e=this.getLongestRowIndex(t),i=t.rowWidth.length-1,o=t.rows[e],n=o[o.length-1],r=n.width+t.horizontalPadding;if(t.width-t.rowWidth[i]>r&&e!=i){o.splice(-1,1),t.rows[i].push(n),t.rowWidth[e]=t.rowWidth[e]-r,t.rowWidth[i]=t.rowWidth[i]+r,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var a=Number.MIN_VALUE,s=0;s<o.length;s++)o[s].height>a&&(a=o[s].height);e>0&&(a+=t.verticalPadding);var h=t.rowHeight[e]+t.rowHeight[i];t.rowHeight[e]=a,t.rowHeight[i]<n.height+t.verticalPadding&&(t.rowHeight[i]=n.height+t.verticalPadding);var l=t.rowHeight[e]+t.rowHeight[i];t.height+=l-h,this.shiftToLastRow(t)}},y.prototype.tilingPreLayout=function(){h.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},y.prototype.tilingPostLayout=function(){h.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},y.prototype.reduceTrees=function(){for(var t,e=[],i=!0;i;){var o=this.graphManager.getAllNodes(),n=[];i=!1;for(var r=0;r<o.length;r++)if(1==(t=o[r]).getEdges().length&&!t.getEdges()[0].isInterGraph&&null==t.getChild()){if(h.PURE_INCREMENTAL){var a=t.getEdges()[0].getOtherEnd(t),s=new f(t.getCenterX()-a.getCenterX(),t.getCenterY()-a.getCenterY());n.push([t,t.getEdges()[0],t.getOwner(),s])}else n.push([t,t.getEdges()[0],t.getOwner()]);i=!0}if(1==i){for(var l=[],d=0;d<n.length;d++)1==n[d][0].getEdges().length&&(l.push(n[d]),n[d][0].getOwner().remove(n[d][0]));e.push(l),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},y.prototype.growTree=function(t){for(var e,i=t[t.length-1],o=0;o<i.length;o++)e=i[o],this.findPlaceforPrunedNode(e),e[2].add(e[0]),e[2].add(e[1],e[1].source,e[1].target);t.splice(t.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},y.prototype.findPlaceforPrunedNode=function(t){var e,i,o=t[0];if(i=o==t[1].source?t[1].target:t[1].source,h.PURE_INCREMENTAL)o.setCenter(i.getCenterX()+t[3].getWidth(),i.getCenterY()+t[3].getHeight());else{var n=i.startX,r=i.finishX,a=i.startY,s=i.finishY,l=[0,0,0,0];if(a>0)for(var g=n;g<=r;g++)l[0]+=this.grid[g][a-1].length+this.grid[g][a].length-1;if(r<this.grid.length-1)for(g=a;g<=s;g++)l[1]+=this.grid[r+1][g].length+this.grid[r][g].length-1;if(s<this.grid[0].length-1)for(g=n;g<=r;g++)l[2]+=this.grid[g][s+1].length+this.grid[g][s].length-1;if(n>0)for(g=a;g<=s;g++)l[3]+=this.grid[n-1][g].length+this.grid[n][g].length-1;for(var c,p,f=m.MAX_VALUE,u=0;u<l.length;u++)l[u]<f?(f=l[u],c=1,p=u):l[u]==f&&c++;if(3==c&&0==f)0==l[0]&&0==l[1]&&0==l[2]?e=1:0==l[0]&&0==l[1]&&0==l[3]?e=0:0==l[0]&&0==l[2]&&0==l[3]?e=3:0==l[1]&&0==l[2]&&0==l[3]&&(e=2);else if(2==c&&0==f){var v=Math.floor(2*Math.random());e=0==l[0]&&0==l[1]?0==v?0:1:0==l[0]&&0==l[2]?0==v?0:2:0==l[0]&&0==l[3]?0==v?0:3:0==l[1]&&0==l[2]?0==v?1:2:0==l[1]&&0==l[3]?0==v?1:3:0==v?2:3}else e=4==c&&0==f?v=Math.floor(4*Math.random()):p;0==e?o.setCenter(i.getCenterX(),i.getCenterY()-i.getHeight()/2-d.DEFAULT_EDGE_LENGTH-o.getHeight()/2):1==e?o.setCenter(i.getCenterX()+i.getWidth()/2+d.DEFAULT_EDGE_LENGTH+o.getWidth()/2,i.getCenterY()):2==e?o.setCenter(i.getCenterX(),i.getCenterY()+i.getHeight()/2+d.DEFAULT_EDGE_LENGTH+o.getHeight()/2):o.setCenter(i.getCenterX()-i.getWidth()/2-d.DEFAULT_EDGE_LENGTH-o.getWidth()/2,i.getCenterY())}},t.exports=y},991:(t,e,i)=>{var o=i(551).FDLayoutNode,n=i(551).IMath;function r(t,e,i,n){o.call(this,t,e,i,n)}for(var a in r.prototype=Object.create(o.prototype),o)r[a]=o[a];r.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*n.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*n.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},r.prototype.propogateDisplacementToChildren=function(t,e){for(var i,o=this.getChild().getNodes(),n=0;n<o.length;n++)null==(i=o[n]).getChild()?(i.displacementX+=t,i.displacementY+=e):i.propogateDisplacementToChildren(t,e)},r.prototype.move=function(){var t=this.graphManager.getLayout();null!=this.child&&0!=this.child.getNodes().length||(this.moveBy(this.displacementX,this.displacementY),t.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},r.prototype.setPred1=function(t){this.pred1=t},r.prototype.getPred1=function(){return pred1},r.prototype.getPred2=function(){return pred2},r.prototype.setNext=function(t){this.next=t},r.prototype.getNext=function(){return next},r.prototype.setProcessed=function(t){this.processed=t},r.prototype.isProcessed=function(){return processed},t.exports=r},902:(t,e,i)=>{function o(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}var n=i(806),r=i(551).LinkedList,a=i(551).Matrix,s=i(551).SVD;function h(){}h.handleConstraints=function(t){var e={};e.fixedNodeConstraint=t.constraints.fixedNodeConstraint,e.alignmentConstraint=t.constraints.alignmentConstraint,e.relativePlacementConstraint=t.constraints.relativePlacementConstraint;for(var i=new Map,h=new Map,l=[],d=[],g=t.getAllNodes(),c=0,p=0;p<g.length;p++){var f=g[p];null==f.getChild()&&(h.set(f.id,c++),l.push(f.getCenterX()),d.push(f.getCenterY()),i.set(f.id,f))}e.relativePlacementConstraint&&e.relativePlacementConstraint.forEach((function(t){t.gap||0==t.gap||(t.left?t.gap=n.DEFAULT_EDGE_LENGTH+i.get(t.left).getWidth()/2+i.get(t.right).getWidth()/2:t.gap=n.DEFAULT_EDGE_LENGTH+i.get(t.top).getHeight()/2+i.get(t.bottom).getHeight()/2)}));var u=function(t){var e=0,i=0;return t.forEach((function(t){e+=l[h.get(t)],i+=d[h.get(t)]})),{x:e/t.size,y:i/t.size}},m=function(t,e,i,n,a){var s=new Map;t.forEach((function(t,e){s.set(e,0)})),t.forEach((function(t,e){t.forEach((function(t){s.set(t.id,s.get(t.id)+1)}))}));var g=new Map,c=new Map,p=new r;s.forEach((function(t,o){0==t?(p.push(o),i||("horizontal"==e?g.set(o,h.has(o)?l[h.get(o)]:n.get(o)):g.set(o,h.has(o)?d[h.get(o)]:n.get(o)))):g.set(o,Number.NEGATIVE_INFINITY),i&&c.set(o,new Set([o]))})),i&&a.forEach((function(t){var o=[];if(t.forEach((function(t){i.has(t)&&o.push(t)})),o.length>0){var r=0;o.forEach((function(t){"horizontal"==e?(g.set(t,h.has(t)?l[h.get(t)]:n.get(t)),r+=g.get(t)):(g.set(t,h.has(t)?d[h.get(t)]:n.get(t)),r+=g.get(t))})),r/=o.length,t.forEach((function(t){i.has(t)||g.set(t,r)}))}else{var a=0;t.forEach((function(t){a+="horizontal"==e?h.has(t)?l[h.get(t)]:n.get(t):h.has(t)?d[h.get(t)]:n.get(t)})),a/=t.length,t.forEach((function(t){g.set(t,a)}))}}));for(var f=function(){var o=p.shift();t.get(o).forEach((function(t){if(g.get(t.id)<g.get(o)+t.gap)if(i&&i.has(t.id)){var r=void 0;if(r="horizontal"==e?h.has(t.id)?l[h.get(t.id)]:n.get(t.id):h.has(t.id)?d[h.get(t.id)]:n.get(t.id),g.set(t.id,r),r<g.get(o)+t.gap){var a=g.get(o)+t.gap-r;c.get(o).forEach((function(t){g.set(t,g.get(t)-a)}))}}else g.set(t.id,g.get(o)+t.gap);s.set(t.id,s.get(t.id)-1),0==s.get(t.id)&&p.push(t.id),i&&c.set(t.id,function(t,e){var i=new Set(t),o=!0,n=!1,r=void 0;try{for(var a,s=e[Symbol.iterator]();!(o=(a=s.next()).done);o=!0){var h=a.value;i.add(h)}}catch(t){n=!0,r=t}finally{try{!o&&s.return&&s.return()}finally{if(n)throw r}}return i}(c.get(o),c.get(t.id)))}))};0!=p.length;)f();if(i){var u=new Set;t.forEach((function(t,e){0==t.length&&u.add(e)}));var m=[];c.forEach((function(t,e){if(u.has(e)){var n=!1,r=!0,a=!1,s=void 0;try{for(var h,l=t[Symbol.iterator]();!(r=(h=l.next()).done);r=!0){var d=h.value;i.has(d)&&(n=!0)}}catch(t){a=!0,s=t}finally{try{!r&&l.return&&l.return()}finally{if(a)throw s}}if(!n){var g=!1,c=void 0;m.forEach((function(e,i){e.has([].concat(o(t))[0])&&(g=!0,c=i)})),g?t.forEach((function(t){m[c].add(t)})):m.push(new Set(t))}}})),m.forEach((function(t,i){var o=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY,c=!0,p=!1,f=void 0;try{for(var u,m=t[Symbol.iterator]();!(c=(u=m.next()).done);c=!0){var v=u.value,T=void 0;T="horizontal"==e?h.has(v)?l[h.get(v)]:n.get(v):h.has(v)?d[h.get(v)]:n.get(v);var N=g.get(v);T<o&&(o=T),T>a&&(a=T),N<r&&(r=N),N>s&&(s=N)}}catch(t){p=!0,f=t}finally{try{!c&&m.return&&m.return()}finally{if(p)throw f}}var E=(o+a)/2-(r+s)/2,y=!0,C=!1,M=void 0;try{for(var w,A=t[Symbol.iterator]();!(y=(w=A.next()).done);y=!0){var I=w.value;g.set(I,g.get(I)+E)}}catch(t){C=!0,M=t}finally{try{!y&&A.return&&A.return()}finally{if(C)throw M}}}))}return g},v=function(t){var e=0,i=0,o=0,n=0;if(t.forEach((function(t){t.left?l[h.get(t.left)]-l[h.get(t.right)]>=0?e++:i++:d[h.get(t.top)]-d[h.get(t.bottom)]>=0?o++:n++})),e>i&&o>n)for(var r=0;r<h.size;r++)l[r]=-1*l[r],d[r]=-1*d[r];else if(e>i)for(var a=0;a<h.size;a++)l[a]=-1*l[a];else if(o>n)for(var s=0;s<h.size;s++)d[s]=-1*d[s]},T=function(t){var e=[],i=new r,o=new Set,n=0;return t.forEach((function(r,a){if(!o.has(a)){e[n]=[];var s=a;for(i.push(s),o.add(s),e[n].push(s);0!=i.length;)s=i.shift(),t.get(s).forEach((function(t){o.has(t.id)||(i.push(t.id),o.add(t.id),e[n].push(t.id))}));n++}})),e},N=function(t){var e=new Map;return t.forEach((function(t,i){e.set(i,[])})),t.forEach((function(t,i){t.forEach((function(t){e.get(i).push(t),e.get(t.id).push({id:i,gap:t.gap,direction:t.direction})}))})),e},E=function(t){var e=new Map;return t.forEach((function(t,i){e.set(i,[])})),t.forEach((function(t,i){t.forEach((function(t){e.get(t.id).push({id:i,gap:t.gap,direction:t.direction})}))})),e},y=[],C=[],M=!1,w=!1,A=new Set,I=new Map,L=new Map,b=[];if(e.fixedNodeConstraint&&e.fixedNodeConstraint.forEach((function(t){A.add(t.nodeId)})),e.relativePlacementConstraint&&(e.relativePlacementConstraint.forEach((function(t){t.left?(I.has(t.left)?I.get(t.left).push({id:t.right,gap:t.gap,direction:"horizontal"}):I.set(t.left,[{id:t.right,gap:t.gap,direction:"horizontal"}]),I.has(t.right)||I.set(t.right,[])):(I.has(t.top)?I.get(t.top).push({id:t.bottom,gap:t.gap,direction:"vertical"}):I.set(t.top,[{id:t.bottom,gap:t.gap,direction:"vertical"}]),I.has(t.bottom)||I.set(t.bottom,[]))})),L=N(I),b=T(L)),n.TRANSFORM_ON_CONSTRAINT_HANDLING){if(e.fixedNodeConstraint&&e.fixedNodeConstraint.length>1)e.fixedNodeConstraint.forEach((function(t,e){y[e]=[t.position.x,t.position.y],C[e]=[l[h.get(t.nodeId)],d[h.get(t.nodeId)]]})),M=!0;else if(e.alignmentConstraint)!function(){var t=0;if(e.alignmentConstraint.vertical){for(var i=e.alignmentConstraint.vertical,n=function(e){var n=new Set;i[e].forEach((function(t){n.add(t)}));var r=new Set([].concat(o(n)).filter((function(t){return A.has(t)}))),a=void 0;a=r.size>0?l[h.get(r.values().next().value)]:u(n).x,i[e].forEach((function(e){y[t]=[a,d[h.get(e)]],C[t]=[l[h.get(e)],d[h.get(e)]],t++}))},r=0;r<i.length;r++)n(r);M=!0}if(e.alignmentConstraint.horizontal){for(var a=e.alignmentConstraint.horizontal,s=function(e){var i=new Set;a[e].forEach((function(t){i.add(t)}));var n=new Set([].concat(o(i)).filter((function(t){return A.has(t)}))),r=void 0;r=n.size>0?l[h.get(n.values().next().value)]:u(i).y,a[e].forEach((function(e){y[t]=[l[h.get(e)],r],C[t]=[l[h.get(e)],d[h.get(e)]],t++}))},g=0;g<a.length;g++)s(g);M=!0}e.relativePlacementConstraint&&(w=!0)}();else if(e.relativePlacementConstraint){for(var _=0,F=0,R=0;R<b.length;R++)b[R].length>_&&(_=b[R].length,F=R);if(_<L.size/2)v(e.relativePlacementConstraint),M=!1,w=!1;else{var O=new Map,P=new Map,x=[];b[F].forEach((function(t){I.get(t).forEach((function(e){"horizontal"==e.direction?(O.has(t)?O.get(t).push(e):O.set(t,[e]),O.has(e.id)||O.set(e.id,[]),x.push({left:t,right:e.id})):(P.has(t)?P.get(t).push(e):P.set(t,[e]),P.has(e.id)||P.set(e.id,[]),x.push({top:t,bottom:e.id}))}))})),v(x),w=!1;var D=m(O,"horizontal"),H=m(P,"vertical");b[F].forEach((function(t,e){C[e]=[l[h.get(t)],d[h.get(t)]],y[e]=[],D.has(t)?y[e][0]=D.get(t):y[e][0]=l[h.get(t)],H.has(t)?y[e][1]=H.get(t):y[e][1]=d[h.get(t)]})),M=!0}}if(M){for(var G,z=a.transpose(y),S=a.transpose(C),V=0;V<z.length;V++)z[V]=a.multGamma(z[V]),S[V]=a.multGamma(S[V]);var W=a.multMat(z,a.transpose(S)),Y=s.svd(W);G=a.multMat(Y.V,a.transpose(Y.U));for(var X=0;X<h.size;X++){var U=[l[X],d[X]],B=[G[0][0],G[1][0]],k=[G[0][1],G[1][1]];l[X]=a.dotProduct(U,B),d[X]=a.dotProduct(U,k)}w&&v(e.relativePlacementConstraint)}}if(n.ENFORCE_CONSTRAINTS){if(e.fixedNodeConstraint&&e.fixedNodeConstraint.length>0){var j={x:0,y:0};e.fixedNodeConstraint.forEach((function(t,e){var i,o,n={x:l[h.get(t.nodeId)],y:d[h.get(t.nodeId)]},r=t.position,a=(o=n,{x:(i=r).x-o.x,y:i.y-o.y});j.x+=a.x,j.y+=a.y})),j.x/=e.fixedNodeConstraint.length,j.y/=e.fixedNodeConstraint.length,l.forEach((function(t,e){l[e]+=j.x})),d.forEach((function(t,e){d[e]+=j.y})),e.fixedNodeConstraint.forEach((function(t){l[h.get(t.nodeId)]=t.position.x,d[h.get(t.nodeId)]=t.position.y}))}if(e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var Z=e.alignmentConstraint.vertical,q=function(t){var e=new Set;Z[t].forEach((function(t){e.add(t)}));var i=new Set([].concat(o(e)).filter((function(t){return A.has(t)}))),n=void 0;n=i.size>0?l[h.get(i.values().next().value)]:u(e).x,e.forEach((function(t){A.has(t)||(l[h.get(t)]=n)}))},K=0;K<Z.length;K++)q(K);if(e.alignmentConstraint.horizontal)for(var Q=e.alignmentConstraint.horizontal,J=function(t){var e=new Set;Q[t].forEach((function(t){e.add(t)}));var i=new Set([].concat(o(e)).filter((function(t){return A.has(t)}))),n=void 0;n=i.size>0?d[h.get(i.values().next().value)]:u(e).y,e.forEach((function(t){A.has(t)||(d[h.get(t)]=n)}))},$=0;$<Q.length;$++)J($)}e.relativePlacementConstraint&&function(){var t=new Map,i=new Map,o=new Map,n=new Map,r=new Map,a=new Map,s=new Set,g=new Set;if(A.forEach((function(t){s.add(t),g.add(t)})),e.alignmentConstraint){if(e.alignmentConstraint.vertical)for(var c=e.alignmentConstraint.vertical,p=function(e){o.set("dummy"+e,[]),c[e].forEach((function(i){t.set(i,"dummy"+e),o.get("dummy"+e).push(i),A.has(i)&&s.add("dummy"+e)})),r.set("dummy"+e,l[h.get(c[e][0])])},f=0;f<c.length;f++)p(f);if(e.alignmentConstraint.horizontal)for(var u=e.alignmentConstraint.horizontal,v=function(t){n.set("dummy"+t,[]),u[t].forEach((function(e){i.set(e,"dummy"+t),n.get("dummy"+t).push(e),A.has(e)&&g.add("dummy"+t)})),a.set("dummy"+t,d[h.get(u[t][0])])},y=0;y<u.length;y++)v(y)}var C=new Map,M=new Map,w=function(e){I.get(e).forEach((function(o){var n=void 0,r=void 0;"horizontal"==o.direction?(n=t.get(e)?t.get(e):e,r=t.get(o.id)?{id:t.get(o.id),gap:o.gap,direction:o.direction}:o,C.has(n)?C.get(n).push(r):C.set(n,[r]),C.has(r.id)||C.set(r.id,[])):(n=i.get(e)?i.get(e):e,r=i.get(o.id)?{id:i.get(o.id),gap:o.gap,direction:o.direction}:o,M.has(n)?M.get(n).push(r):M.set(n,[r]),M.has(r.id)||M.set(r.id,[]))}))},L=!0,b=!1,_=void 0;try{for(var F,R=I.keys()[Symbol.iterator]();!(L=(F=R.next()).done);L=!0)w(F.value)}catch(t){b=!0,_=t}finally{try{!L&&R.return&&R.return()}finally{if(b)throw _}}var O=N(C),P=N(M),x=T(O),D=T(P),H=E(C),G=E(M),z=[],S=[];x.forEach((function(t,e){z[e]=[],t.forEach((function(t){0==H.get(t).length&&z[e].push(t)}))})),D.forEach((function(t,e){S[e]=[],t.forEach((function(t){0==G.get(t).length&&S[e].push(t)}))}));var V=m(C,"horizontal",s,r,z),W=m(M,"vertical",g,a,S),Y=function(t){o.get(t)?o.get(t).forEach((function(e){l[h.get(e)]=V.get(t)})):l[h.get(t)]=V.get(t)},X=!0,U=!1,B=void 0;try{for(var k,j=V.keys()[Symbol.iterator]();!(X=(k=j.next()).done);X=!0)Y(k.value)}catch(t){U=!0,B=t}finally{try{!X&&j.return&&j.return()}finally{if(U)throw B}}var Z=function(t){n.get(t)?n.get(t).forEach((function(e){d[h.get(e)]=W.get(t)})):d[h.get(t)]=W.get(t)},q=!0,K=!1,Q=void 0;try{for(var J,$=W.keys()[Symbol.iterator]();!(q=(J=$.next()).done);q=!0)Z(J.value)}catch(t){K=!0,Q=t}finally{try{!q&&$.return&&$.return()}finally{if(K)throw Q}}}()}for(var tt=0;tt<g.length;tt++){var et=g[tt];null==et.getChild()&&et.setCenter(l[h.get(et.id)],d[h.get(et.id)])}},t.exports=h},551:e=>{e.exports=t}},i={},o=function t(o){var n=i[o];if(void 0!==n)return n.exports;var r=i[o]={exports:{}};return e[o](r,r.exports,t),r.exports}(45),o;var e,i,o},t.exports=n(i())),e.exports;var t,n}e.exports;export{n as __require};
|
package/dist/esm/node_modules/.pnpm/layout-base@1.0.2/node_modules/layout-base/layout-base.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{commonjsGlobal as t}from"../../../../../_virtual/_commonjsHelpers.js";import{__module as e}from"../../../../../_virtual/layout-base2.js";var r;function n(){return r||(r=1,t=e,e.exports,n=function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.i=function(t){return t},r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=26)}([function(t,e,r){function n(){}n.QUALITY=1,n.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,n.DEFAULT_INCREMENTAL=!1,n.DEFAULT_ANIMATION_ON_LAYOUT=!0,n.DEFAULT_ANIMATION_DURING_LAYOUT=!1,n.DEFAULT_ANIMATION_PERIOD=50,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,n.DEFAULT_GRAPH_MARGIN=15,n.NODE_DIMENSIONS_INCLUDE_LABELS=!1,n.SIMPLE_NODE_SIZE=40,n.SIMPLE_NODE_HALF_SIZE=n.SIMPLE_NODE_SIZE/2,n.EMPTY_COMPOUND_NODE_SIZE=40,n.MIN_EDGE_LENGTH=1,n.WORLD_BOUNDARY=1e6,n.INITIAL_WORLD_BOUNDARY=n.WORLD_BOUNDARY/1e3,n.WORLD_CENTER_X=1200,n.WORLD_CENTER_Y=900,t.exports=n},function(t,e,r){var n=r(2),i=r(8),o=r(9);function s(t,e,r){n.call(this,r),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=r,this.bendpoints=[],this.source=t,this.target=e}for(var a in s.prototype=Object.create(n.prototype),n)s[a]=n[a];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(t){if(this.source===t)return this.target;if(this.target===t)return this.source;throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(t,e){for(var r=this.getOtherEnd(t),n=e.getGraphManager().getRoot();;){if(r.getOwner()==e)return r;if(r.getOwner()==n)break;r=r.getOwner().getParent()}return null},s.prototype.updateLength=function(){var t=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),t),this.isOverlapingSourceAndTarget||(this.lengthX=t[0]-t[2],this.lengthY=t[1]-t[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},s.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=s},function(t,e,r){t.exports=function(t){this.vGraphObject=t}},function(t,e,r){var n=r(2),i=r(10),o=r(13),s=r(0),a=r(16),h=r(4);function u(t,e,r,s){null==r&&null==s&&(s=e),n.call(this,s),null!=t.graphManager&&(t=t.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=s,this.edges=[],this.graphManager=t,this.rect=null!=r&&null!=e?new o(e.x,e.y,r.width,r.height):new o}for(var l in u.prototype=Object.create(n.prototype),n)u[l]=n[l];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(t){this.rect.width=t},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(t){this.rect.height=t},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(t,e){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=e.width,this.rect.height=e.height},u.prototype.setCenter=function(t,e){this.rect.x=t-this.rect.width/2,this.rect.y=e-this.rect.height/2},u.prototype.setLocation=function(t,e){this.rect.x=t,this.rect.y=e},u.prototype.moveBy=function(t,e){this.rect.x+=t,this.rect.y+=e},u.prototype.getEdgeListToNode=function(t){var e=[],r=this;return r.edges.forEach((function(n){if(n.target==t){if(n.source!=r)throw"Incorrect edge source!";e.push(n)}})),e},u.prototype.getEdgesBetween=function(t){var e=[],r=this;return r.edges.forEach((function(n){if(n.source!=r&&n.target!=r)throw"Incorrect edge source and/or target";n.target!=t&&n.source!=t||e.push(n)})),e},u.prototype.getNeighborsList=function(){var t=new Set,e=this;return e.edges.forEach((function(r){if(r.source==e)t.add(r.target);else{if(r.target!=e)throw"Incorrect incidency!";t.add(r.source)}})),t},u.prototype.withChildren=function(){var t=new Set;if(t.add(this),null!=this.child)for(var e=this.child.getNodes(),r=0;r<e.length;r++)e[r].withChildren().forEach((function(e){t.add(e)}));return t},u.prototype.getNoOfChildren=function(){var t=0;if(null==this.child)t=1;else for(var e=this.child.getNodes(),r=0;r<e.length;r++)t+=e[r].getNoOfChildren();return 0==t&&(t=1),t},u.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},u.prototype.calcEstimatedSize=function(){return null==this.child?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},u.prototype.scatter=function(){var t,e,r=-s.INITIAL_WORLD_BOUNDARY,n=s.INITIAL_WORLD_BOUNDARY;t=s.WORLD_CENTER_X+a.nextDouble()*(n-r)+r;var i=-s.INITIAL_WORLD_BOUNDARY,o=s.INITIAL_WORLD_BOUNDARY;e=s.WORLD_CENTER_Y+a.nextDouble()*(o-i)+i,this.rect.x=t,this.rect.y=e},u.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var e=t.getRight()-t.getLeft(),r=t.getBottom()-t.getTop();this.labelWidth>e&&(this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth)),this.labelHeight>r&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-r)/2:"top"==this.labelPos&&(this.rect.y-=this.labelHeight-r),this.setHeight(this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(t){var e=this.rect.x;e>s.WORLD_BOUNDARY?e=s.WORLD_BOUNDARY:e<-s.WORLD_BOUNDARY&&(e=-s.WORLD_BOUNDARY);var r=this.rect.y;r>s.WORLD_BOUNDARY?r=s.WORLD_BOUNDARY:r<-s.WORLD_BOUNDARY&&(r=-s.WORLD_BOUNDARY);var n=new h(e,r),i=t.inverseTransformPoint(n);this.setLocation(i.x,i.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=u},function(t,e,r){function n(t,e){null==t&&null==e?(this.x=0,this.y=0):(this.x=t,this.y=e)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(t){this.x=t},n.prototype.setY=function(t){this.y=t},n.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=n},function(t,e,r){var n=r(2),i=r(10),o=r(0),s=r(6),a=r(3),h=r(1),u=r(13),l=r(12),g=r(11);function c(t,e,r){n.call(this,r),this.estimatedSize=i.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=e&&e instanceof s?this.graphManager=e:null!=e&&e instanceof Layout&&(this.graphManager=e.graphManager)}for(var p in c.prototype=Object.create(n.prototype),n)c[p]=n[p];c.prototype.getNodes=function(){return this.nodes},c.prototype.getEdges=function(){return this.edges},c.prototype.getGraphManager=function(){return this.graphManager},c.prototype.getParent=function(){return this.parent},c.prototype.getLeft=function(){return this.left},c.prototype.getRight=function(){return this.right},c.prototype.getTop=function(){return this.top},c.prototype.getBottom=function(){return this.bottom},c.prototype.isConnected=function(){return this.isConnected},c.prototype.add=function(t,e,r){if(null==e&&null==r){var n=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(n)>-1)throw"Node already in graph!";return n.owner=this,this.getNodes().push(n),n}var i=t;if(!(this.getNodes().indexOf(e)>-1&&this.getNodes().indexOf(r)>-1))throw"Source or target not in graph!";if(e.owner!=r.owner||e.owner!=this)throw"Both owners must be this graph!";return e.owner!=r.owner?null:(i.source=e,i.target=r,i.isInterGraph=!1,this.getEdges().push(i),e.edges.push(i),r!=e&&r.edges.push(i),i)},c.prototype.remove=function(t){var e=t;if(t instanceof a){if(null==e)throw"Node is null!";if(null==e.owner||e.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var r=e.edges.slice(),n=r.length,i=0;i<n;i++)(o=r[i]).isInterGraph?this.graphManager.remove(o):o.source.owner.remove(o);if(-1==(s=this.nodes.indexOf(e)))throw"Node not in owner node list!";this.nodes.splice(s,1)}else if(t instanceof h){var o;if(null==(o=t))throw"Edge is null!";if(null==o.source||null==o.target)throw"Source and/or target is null!";if(null==o.source.owner||null==o.target.owner||o.source.owner!=this||o.target.owner!=this)throw"Source and/or target owner is invalid!";var s,u=o.source.edges.indexOf(o),l=o.target.edges.indexOf(o);if(!(u>-1&&l>-1))throw"Source and/or target doesn't know this edge!";if(o.source.edges.splice(u,1),o.target!=o.source&&o.target.edges.splice(l,1),-1==(s=o.source.owner.getEdges().indexOf(o)))throw"Not in owner's edge list!";o.source.owner.getEdges().splice(s,1)}},c.prototype.updateLeftTop=function(){for(var t,e,r,n=i.MAX_VALUE,o=i.MAX_VALUE,s=this.getNodes(),a=s.length,h=0;h<a;h++){var u=s[h];n>(t=u.getTop())&&(n=t),o>(e=u.getLeft())&&(o=e)}return n==i.MAX_VALUE?null:(r=null!=s[0].getParent().paddingLeft?s[0].getParent().paddingLeft:this.margin,this.left=o-r,this.top=n-r,new l(this.left,this.top))},c.prototype.updateBounds=function(t){for(var e,r,n,o,s,a=i.MAX_VALUE,h=-i.MAX_VALUE,l=i.MAX_VALUE,g=-i.MAX_VALUE,c=this.nodes,p=c.length,f=0;f<p;f++){var d=c[f];t&&null!=d.child&&d.updateBounds(),a>(e=d.getLeft())&&(a=e),h<(r=d.getRight())&&(h=r),l>(n=d.getTop())&&(l=n),g<(o=d.getBottom())&&(g=o)}var y=new u(a,l,h-a,g-l);a==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),s=null!=c[0].getParent().paddingLeft?c[0].getParent().paddingLeft:this.margin,this.left=y.x-s,this.right=y.x+y.width+s,this.top=y.y-s,this.bottom=y.y+y.height+s},c.calculateBounds=function(t){for(var e,r,n,o,s=i.MAX_VALUE,a=-i.MAX_VALUE,h=i.MAX_VALUE,l=-i.MAX_VALUE,g=t.length,c=0;c<g;c++){var p=t[c];s>(e=p.getLeft())&&(s=e),a<(r=p.getRight())&&(a=r),h>(n=p.getTop())&&(h=n),l<(o=p.getBottom())&&(l=o)}return new u(s,h,a-s,l-h)},c.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},c.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},c.prototype.calcEstimatedSize=function(){for(var t=0,e=this.nodes,r=e.length,n=0;n<r;n++)t+=e[n].calcEstimatedSize();return this.estimatedSize=0==t?o.EMPTY_COMPOUND_NODE_SIZE:t/Math.sqrt(this.nodes.length),this.estimatedSize},c.prototype.updateConnected=function(){var t=this;if(0!=this.nodes.length){var e,r,n=new g,i=new Set,o=this.nodes[0];for(o.withChildren().forEach((function(t){n.push(t),i.add(t)}));0!==n.length;)for(var s=(e=(o=n.shift()).getEdges()).length,a=0;a<s;a++)null==(r=e[a].getOtherEndInGraph(o,this))||i.has(r)||r.withChildren().forEach((function(t){n.push(t),i.add(t)}));if(this.isConnected=!1,i.size>=this.nodes.length){var h=0;i.forEach((function(e){e.owner==t&&h++})),h==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},t.exports=c},function(t,e,r){var n,i=r(1);function o(t){n=r(5),this.layout=t,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var t=this.layout.newGraph(),e=this.layout.newNode(null),r=this.add(t,e);return this.setRootGraph(r),this.rootGraph},o.prototype.add=function(t,e,r,n,i){if(null==r&&null==n&&null==i){if(null==t)throw"Graph is null!";if(null==e)throw"Parent node is null!";if(this.graphs.indexOf(t)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(t),null!=t.parent)throw"Already has a parent!";if(null!=e.child)throw"Already has a child!";return t.parent=e,e.child=t,t}i=r,r=t;var o=(n=e).getOwner(),s=i.getOwner();if(null==o||o.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==s||s.getGraphManager()!=this)throw"Target not in this graph mgr!";if(o==s)return r.isInterGraph=!1,o.add(r,n,i);if(r.isInterGraph=!0,r.source=n,r.target=i,this.edges.indexOf(r)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(r),null==r.source||null==r.target)throw"Edge source and/or target is null!";if(-1!=r.source.edges.indexOf(r)||-1!=r.target.edges.indexOf(r))throw"Edge already in source and/or target incidency list!";return r.source.edges.push(r),r.target.edges.push(r),r},o.prototype.remove=function(t){if(t instanceof n){var e=t;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(e!=this.rootGraph&&(null==e.parent||e.parent.graphManager!=this))throw"Invalid parent node!";for(var r,o=[],s=(o=o.concat(e.getEdges())).length,a=0;a<s;a++)r=o[a],e.remove(r);var h,u=[];for(s=(u=u.concat(e.getNodes())).length,a=0;a<s;a++)h=u[a],e.remove(h);e==this.rootGraph&&this.setRootGraph(null);var l=this.graphs.indexOf(e);this.graphs.splice(l,1),e.parent=null}else if(t instanceof i){if(null==(r=t))throw"Edge is null!";if(!r.isInterGraph)throw"Not an inter-graph edge!";if(null==r.source||null==r.target)throw"Source and/or target is null!";if(-1==r.source.edges.indexOf(r)||-1==r.target.edges.indexOf(r))throw"Source and/or target doesn't know this edge!";if(l=r.source.edges.indexOf(r),r.source.edges.splice(l,1),l=r.target.edges.indexOf(r),r.target.edges.splice(l,1),null==r.source.owner||null==r.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==r.source.owner.getGraphManager().edges.indexOf(r))throw"Not in owner graph manager's edge list!";l=r.source.owner.getGraphManager().edges.indexOf(r),r.source.owner.getGraphManager().edges.splice(l,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(null==this.allNodes){for(var t=[],e=this.getGraphs(),r=e.length,n=0;n<r;n++)t=t.concat(e[n].getNodes());this.allNodes=t}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(null==this.allEdges){var t=[],e=this.getGraphs();e.length;for(var r=0;r<e.length;r++)t=t.concat(e[r].getEdges());t=t.concat(this.edges),this.allEdges=t}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(t){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=t},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(t){if(t.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=t,null==t.parent&&(t.parent=this.layout.newNode("Root node"))},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(t,e){if(null==t||null==e)throw"assert failed";if(t==e)return!0;for(var r,n=t.getOwner();null!=(r=n.getParent());){if(r==e)return!0;if(null==(n=r.getOwner()))break}for(n=e.getOwner();null!=(r=n.getParent());){if(r==t)return!0;if(null==(n=r.getOwner()))break}return!1},o.prototype.calcLowestCommonAncestors=function(){for(var t,e,r,n,i,o=this.getAllEdges(),s=o.length,a=0;a<s;a++)if(e=(t=o[a]).source,r=t.target,t.lca=null,t.sourceInLca=e,t.targetInLca=r,e!=r){for(n=e.getOwner();null==t.lca;){for(t.targetInLca=r,i=r.getOwner();null==t.lca;){if(i==n){t.lca=i;break}if(i==this.rootGraph)break;if(null!=t.lca)throw"assert failed";t.targetInLca=i.getParent(),i=t.targetInLca.getOwner()}if(n==this.rootGraph)break;null==t.lca&&(t.sourceInLca=n.getParent(),n=t.sourceInLca.getOwner())}if(null==t.lca)throw"assert failed"}else t.lca=e.getOwner()},o.prototype.calcLowestCommonAncestor=function(t,e){if(t==e)return t.getOwner();for(var r=t.getOwner();null!=r;){for(var n=e.getOwner();null!=n;){if(n==r)return n;n=n.getParent().getOwner()}r=r.getParent().getOwner()}return r},o.prototype.calcInclusionTreeDepths=function(t,e){var r;null==t&&null==e&&(t=this.rootGraph,e=1);for(var n=t.getNodes(),i=n.length,o=0;o<i;o++)(r=n[o]).inclusionTreeDepth=e,null!=r.child&&this.calcInclusionTreeDepths(r.child,e+1)},o.prototype.includesInvalidEdge=function(){for(var t,e=this.edges.length,r=0;r<e;r++)if(t=this.edges[r],this.isOneAncestorOfOther(t.source,t.target))return!0;return!1},t.exports=o},function(t,e,r){var n=r(0);function i(){}for(var o in n)i[o]=n[o];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=3*i.MAX_NODE_DISPLACEMENT_INCREMENTAL,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=i},function(t,e,r){var n=r(12);function i(){}i.calcSeparationAmount=function(t,e,r,n){if(!t.intersects(e))throw"assert failed";var i=new Array(2);this.decideDirectionsForOverlappingNodes(t,e,i),r[0]=Math.min(t.getRight(),e.getRight())-Math.max(t.x,e.x),r[1]=Math.min(t.getBottom(),e.getBottom())-Math.max(t.y,e.y),t.getX()<=e.getX()&&t.getRight()>=e.getRight()?r[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight()):e.getX()<=t.getX()&&e.getRight()>=t.getRight()&&(r[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())),t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()?r[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()):e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()&&(r[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()));var o=Math.abs((e.getCenterY()-t.getCenterY())/(e.getCenterX()-t.getCenterX()));e.getCenterY()===t.getCenterY()&&e.getCenterX()===t.getCenterX()&&(o=1);var s=o*r[0],a=r[1]/o;r[0]<a?a=r[0]:s=r[1],r[0]=-1*i[0]*(a/2+n),r[1]=-1*i[1]*(s/2+n)},i.decideDirectionsForOverlappingNodes=function(t,e,r){t.getCenterX()<e.getCenterX()?r[0]=-1:r[0]=1,t.getCenterY()<e.getCenterY()?r[1]=-1:r[1]=1},i.getIntersection2=function(t,e,r){var n=t.getCenterX(),i=t.getCenterY(),o=e.getCenterX(),s=e.getCenterY();if(t.intersects(e))return r[0]=n,r[1]=i,r[2]=o,r[3]=s,!0;var a=t.getX(),h=t.getY(),u=t.getRight(),l=t.getX(),g=t.getBottom(),c=t.getRight(),p=t.getWidthHalf(),f=t.getHeightHalf(),d=e.getX(),y=e.getY(),E=e.getRight(),v=e.getX(),A=e.getBottom(),_=e.getRight(),O=e.getWidthHalf(),N=e.getHeightHalf(),L=!1,T=!1;if(n===o){if(i>s)return r[0]=n,r[1]=h,r[2]=o,r[3]=A,!1;if(i<s)return r[0]=n,r[1]=g,r[2]=o,r[3]=y,!1}else if(i===s){if(n>o)return r[0]=a,r[1]=i,r[2]=E,r[3]=s,!1;if(n<o)return r[0]=u,r[1]=i,r[2]=d,r[3]=s,!1}else{var I=t.height/t.width,D=e.height/e.width,m=(s-i)/(o-n),w=void 0,R=void 0,M=void 0,x=void 0,C=void 0,G=void 0;if(-I===m?n>o?(r[0]=l,r[1]=g,L=!0):(r[0]=u,r[1]=h,L=!0):I===m&&(n>o?(r[0]=a,r[1]=h,L=!0):(r[0]=c,r[1]=g,L=!0)),-D===m?o>n?(r[2]=v,r[3]=A,T=!0):(r[2]=E,r[3]=y,T=!0):D===m&&(o>n?(r[2]=d,r[3]=y,T=!0):(r[2]=_,r[3]=A,T=!0)),L&&T)return!1;if(n>o?i>s?(w=this.getCardinalDirection(I,m,4),R=this.getCardinalDirection(D,m,2)):(w=this.getCardinalDirection(-I,m,3),R=this.getCardinalDirection(-D,m,1)):i>s?(w=this.getCardinalDirection(-I,m,1),R=this.getCardinalDirection(-D,m,3)):(w=this.getCardinalDirection(I,m,2),R=this.getCardinalDirection(D,m,4)),!L)switch(w){case 1:x=h,M=n+-f/m,r[0]=M,r[1]=x;break;case 2:M=c,x=i+p*m,r[0]=M,r[1]=x;break;case 3:x=g,M=n+f/m,r[0]=M,r[1]=x;break;case 4:M=l,x=i+-p*m,r[0]=M,r[1]=x}if(!T)switch(R){case 1:G=y,C=o+-N/m,r[2]=C,r[3]=G;break;case 2:C=_,G=s+O*m,r[2]=C,r[3]=G;break;case 3:G=A,C=o+N/m,r[2]=C,r[3]=G;break;case 4:C=v,G=s+-O*m,r[2]=C,r[3]=G}}return!1},i.getCardinalDirection=function(t,e,r){return t>e?r:1+r%4},i.getIntersection=function(t,e,r,i){if(null==i)return this.getIntersection2(t,e,r);var o,s,a,h,u,l,g,c=t.x,p=t.y,f=e.x,d=e.y,y=r.x,E=r.y,v=i.x,A=i.y;return 0==(g=(o=d-p)*(h=y-v)-(s=A-E)*(a=c-f))?null:new n((a*(l=v*E-y*A)-h*(u=f*p-c*d))/g,(s*u-o*l)/g)},i.angleOfVector=function(t,e,r,n){var i=void 0;return t!==r?(i=Math.atan((n-e)/(r-t)),r<t?i+=Math.PI:n<e&&(i+=this.TWO_PI)):i=n<e?this.ONE_AND_HALF_PI:this.HALF_PI,i},i.doIntersect=function(t,e,r,n){var i=t.x,o=t.y,s=e.x,a=e.y,h=r.x,u=r.y,l=n.x,g=n.y,c=(s-i)*(g-u)-(l-h)*(a-o);if(0===c)return!1;var p=((g-u)*(l-i)+(h-l)*(g-o))/c,f=((o-a)*(l-i)+(s-i)*(g-o))/c;return 0<p&&p<1&&0<f&&f<1},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,t.exports=i},function(t,e,r){function n(){}n.sign=function(t){return t>0?1:t<0?-1:0},n.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},n.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=n},function(t,e,r){function n(){}n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,t.exports=n},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=function(t){return{value:t,next:null,prev:null}},o=function(t,e,r,n){return null!==t?t.next=e:n.head=e,null!==r?r.prev=e:n.tail=e,e.prev=t,e.next=r,n.length++,e},s=function(t,e){var r=t.prev,n=t.next;return null!==r?r.next=n:e.head=n,null!==n?n.prev=r:e.tail=r,t.prev=t.next=null,e.length--,t},a=function(){function t(e){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.length=0,this.head=null,this.tail=null,null!=e&&e.forEach((function(t){return r.push(t)}))}return n(t,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(t,e){return o(e.prev,i(t),e,this)}},{key:"insertAfter",value:function(t,e){return o(e,i(t),e.next,this)}},{key:"insertNodeBefore",value:function(t,e){return o(e.prev,t,e,this)}},{key:"insertNodeAfter",value:function(t,e){return o(e,t,e.next,this)}},{key:"push",value:function(t){return o(this.tail,i(t),null,this)}},{key:"unshift",value:function(t){return o(null,i(t),this.head,this)}},{key:"remove",value:function(t){return s(t,this)}},{key:"pop",value:function(){return s(this.tail,this).value}},{key:"popNode",value:function(){return s(this.tail,this)}},{key:"shift",value:function(){return s(this.head,this).value}},{key:"shiftNode",value:function(){return s(this.head,this)}},{key:"get_object_at",value:function(t){if(t<=this.length()){for(var e=1,r=this.head;e<t;)r=r.next,e++;return r.value}}},{key:"set_object_at",value:function(t,e){if(t<=this.length()){for(var r=1,n=this.head;r<t;)n=n.next,r++;n.value=e}}}]),t}();t.exports=a},function(t,e,r){function n(t,e,r){this.x=null,this.y=null,null==t&&null==e&&null==r?(this.x=0,this.y=0):"number"==typeof t&&"number"==typeof e&&null==r?(this.x=t,this.y=e):"Point"==t.constructor.name&&null==e&&null==r&&(r=t,this.x=r.x,this.y=r.y)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.getLocation=function(){return new n(this.x,this.y)},n.prototype.setLocation=function(t,e,r){"Point"==t.constructor.name&&null==e&&null==r?(r=t,this.setLocation(r.x,r.y)):"number"==typeof t&&"number"==typeof e&&null==r&&(parseInt(t)==t&&parseInt(e)==e?this.move(t,e):(this.x=Math.floor(t+.5),this.y=Math.floor(e+.5)))},n.prototype.move=function(t,e){this.x=t,this.y=e},n.prototype.translate=function(t,e){this.x+=t,this.y+=e},n.prototype.equals=function(t){if("Point"==t.constructor.name){var e=t;return this.x==e.x&&this.y==e.y}return this==t},n.prototype.toString=function(){return(new n).constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=n},function(t,e,r){function n(t,e,r,n){this.x=0,this.y=0,this.width=0,this.height=0,null!=t&&null!=e&&null!=r&&null!=n&&(this.x=t,this.y=e,this.width=r,this.height=n)}n.prototype.getX=function(){return this.x},n.prototype.setX=function(t){this.x=t},n.prototype.getY=function(){return this.y},n.prototype.setY=function(t){this.y=t},n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(t){this.width=t},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(t){this.height=t},n.prototype.getRight=function(){return this.x+this.width},n.prototype.getBottom=function(){return this.y+this.height},n.prototype.intersects=function(t){return!(this.getRight()<t.x||this.getBottom()<t.y||t.getRight()<this.x||t.getBottom()<this.y)},n.prototype.getCenterX=function(){return this.x+this.width/2},n.prototype.getMinX=function(){return this.getX()},n.prototype.getMaxX=function(){return this.getX()+this.width},n.prototype.getCenterY=function(){return this.y+this.height/2},n.prototype.getMinY=function(){return this.getY()},n.prototype.getMaxY=function(){return this.getY()+this.height},n.prototype.getWidthHalf=function(){return this.width/2},n.prototype.getHeightHalf=function(){return this.height/2},t.exports=n},function(t,e,r){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function i(){}i.lastID=0,i.createID=function(t){return i.isPrimitive(t)?t:(null!=t.uniqueID||(t.uniqueID=i.getString(),i.lastID++),t.uniqueID)},i.getString=function(t){return null==t&&(t=i.lastID),"Object#"+t},i.isPrimitive=function(t){var e=void 0===t?"undefined":n(t);return null==t||"object"!=e&&"function"!=e},t.exports=i},function(t,e,r){function n(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}var i=r(0),o=r(6),s=r(3),a=r(1),h=r(5),u=r(4),l=r(17),g=r(27);function c(t){g.call(this),this.layoutQuality=i.QUALITY,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=i.DEFAULT_INCREMENTAL,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=t&&(this.isRemoteUse=t)}c.RANDOM_SEED=1,c.prototype=Object.create(g.prototype),c.prototype.getGraphManager=function(){return this.graphManager},c.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},c.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},c.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},c.prototype.newGraphManager=function(){var t=new o(this);return this.graphManager=t,t},c.prototype.newGraph=function(t){return new h(null,this.graphManager,t)},c.prototype.newNode=function(t){return new s(this.graphManager,t)},c.prototype.newEdge=function(t){return new a(null,null,t)},c.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},c.prototype.runLayout=function(){var t;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),t=!this.checkLayoutSuccess()&&this.layout(),"during"!==i.ANIMATE&&(t&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,t)},c.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},c.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var t=this.graphManager.getAllEdges(),e=0;e<t.length;e++)t[e];var r=this.graphManager.getRoot().getNodes();for(e=0;e<r.length;e++)r[e];this.update(this.graphManager.getRoot())}},c.prototype.update=function(t){if(null==t)this.update2();else if(t instanceof s){var e=t;if(null!=e.getChild())for(var r=e.getChild().getNodes(),n=0;n<r.length;n++)update(r[n]);null!=e.vGraphObject&&e.vGraphObject.update(e)}else if(t instanceof a){var i=t;null!=i.vGraphObject&&i.vGraphObject.update(i)}else if(t instanceof h){var o=t;null!=o.vGraphObject&&o.vGraphObject.update(o)}},c.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=i.QUALITY,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=i.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},c.prototype.transform=function(t){if(null==t)this.transform(new u(0,0));else{var e=new l,r=this.graphManager.getRoot().updateLeftTop();if(null!=r){e.setWorldOrgX(t.x),e.setWorldOrgY(t.y),e.setDeviceOrgX(r.x),e.setDeviceOrgY(r.y);for(var n=this.getAllNodes(),i=0;i<n.length;i++)n[i].transform(e)}}},c.prototype.positionNodesRandomly=function(t){if(null==t)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var e,r,n=t.getNodes(),i=0;i<n.length;i++)null==(r=(e=n[i]).getChild())||0==r.getNodes().length?e.scatter():(this.positionNodesRandomly(r),e.updateBounds())},c.prototype.getFlatForest=function(){for(var t=[],e=!0,r=this.graphManager.getRoot().getNodes(),i=!0,o=0;o<r.length;o++)null!=r[o].getChild()&&(i=!1);if(!i)return t;var s=new Set,a=[],h=new Map,u=[];for(u=u.concat(r);u.length>0&&e;){for(a.push(u[0]);a.length>0&&e;){var l=a[0];a.splice(0,1),s.add(l);var g=l.getEdges();for(o=0;o<g.length;o++){var c=g[o].getOtherEnd(l);if(h.get(l)!=c){if(s.has(c)){e=!1;break}a.push(c),h.set(c,l)}}}if(e){var p=[].concat(n(s));for(t.push(p),o=0;o<p.length;o++){var f=p[o],d=u.indexOf(f);d>-1&&u.splice(d,1)}s=new Set,h=new Map}else t=[]}return t},c.prototype.createDummyNodesForBendpoints=function(t){for(var e=[],r=t.source,n=this.graphManager.calcLowestCommonAncestor(t.source,t.target),i=0;i<t.bendpoints.length;i++){var o=this.newNode(null);o.setRect(new Point(0,0),new Dimension(1,1)),n.add(o);var s=this.newEdge(null);this.graphManager.add(s,r,o),e.add(o),r=o}return s=this.newEdge(null),this.graphManager.add(s,r,t.target),this.edgeToDummyNodes.set(t,e),t.isInterGraph()?this.graphManager.remove(t):n.remove(t),e},c.prototype.createBendpointsFromDummyNodes=function(){var t=[];t=t.concat(this.graphManager.getAllEdges()),t=[].concat(n(this.edgeToDummyNodes.keys())).concat(t);for(var e=0;e<t.length;e++){var r=t[e];if(r.bendpoints.length>0){for(var i=this.edgeToDummyNodes.get(r),o=0;o<i.length;o++){var s=i[o],a=new u(s.getCenterX(),s.getCenterY()),h=r.bendpoints.get(o);h.x=a.x,h.y=a.y,s.getOwner().remove(s)}this.graphManager.add(r,r.source,r.target)}}},c.transform=function(t,e,r,n){if(null!=r&&null!=n){var i=e;return t<=50?i-=(e-e/r)/50*(50-t):i+=(e*n-e)/50*(t-50),i}var o,s;return t<=50?(o=9*e/500,s=e/10):(o=9*e/50,s=-8*e),o*t+s},c.findCenterOfTree=function(t){var e=[];e=e.concat(t);var r=[],n=new Map,i=!1,o=null;1!=e.length&&2!=e.length||(i=!0,o=e[0]);for(var s=0;s<e.length;s++){var a=(l=e[s]).getNeighborsList().size;n.set(l,l.getNeighborsList().size),1==a&&r.push(l)}var h=[];for(h=h.concat(r);!i;){var u=[];for(u=u.concat(h),h=[],s=0;s<e.length;s++){var l=e[s],g=e.indexOf(l);g>=0&&e.splice(g,1),l.getNeighborsList().forEach((function(t){if(r.indexOf(t)<0){var e=n.get(t)-1;1==e&&h.push(t),n.set(t,e)}}))}r=r.concat(h),1!=e.length&&2!=e.length||(i=!0,o=e[0])}return o},c.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=c},function(t,e,r){function n(){}n.seed=1,n.x=0,n.nextDouble=function(){return n.x=1e4*Math.sin(n.seed++),n.x-Math.floor(n.x)},t.exports=n},function(t,e,r){var n=r(4);function i(t,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(t){this.lworldExtX=t},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(t){this.lworldExtY=t},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},i.prototype.transformX=function(t){var e=0,r=this.lworldExtX;return 0!=r&&(e=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/r),e},i.prototype.transformY=function(t){var e=0,r=this.lworldExtY;return 0!=r&&(e=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/r),e},i.prototype.inverseTransformX=function(t){var e=0,r=this.ldeviceExtX;return 0!=r&&(e=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/r),e},i.prototype.inverseTransformY=function(t){var e=0,r=this.ldeviceExtY;return 0!=r&&(e=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/r),e},i.prototype.inverseTransformPoint=function(t){return new n(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=i},function(t,e,r){var n=r(15),i=r(7),o=r(0),s=r(8),a=r(9);function h(){n.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=i.DEFAULT_EDGE_LENGTH,this.springConstant=i.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=i.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}for(var u in h.prototype=Object.create(n.prototype),n)h[u]=n[u];h.prototype.initParameters=function(){n.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},h.prototype.calcIdealEdgeLengths=function(){for(var t,e,r,n,s,a,h=this.getGraphManager().getAllEdges(),u=0;u<h.length;u++)(t=h[u]).idealLength=this.idealEdgeLength,t.isInterGraph&&(r=t.getSource(),n=t.getTarget(),s=t.getSourceInLca().getEstimatedSize(),a=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=s+a-2*o.SIMPLE_NODE_SIZE),e=t.getLca().getInclusionTreeDepth(),t.idealLength+=i.DEFAULT_EDGE_LENGTH*i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(r.getInclusionTreeDepth()+n.getInclusionTreeDepth()-2*e))},h.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>i.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var t,e=this.getAllEdges(),r=0;r<e.length;r++)t=e[r],this.calcSpringForce(t,t.idealLength)},h.prototype.calcRepulsionForces=function(){var t,e,r,n,o,s=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],h=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&s&&this.updateGrid(),o=new Set,t=0;t<h.length;t++)r=h[t],this.calculateRepulsionForceOfANode(r,o,s,a),o.add(r);else for(t=0;t<h.length;t++)for(r=h[t],e=t+1;e<h.length;e++)n=h[e],r.getOwner()==n.getOwner()&&this.calcRepulsionForce(r,n)},h.prototype.calcGravitationalForces=function(){for(var t,e=this.getAllNodesToApplyGravitation(),r=0;r<e.length;r++)t=e[r],this.calcGravitationalForce(t)},h.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].move()},h.prototype.calcSpringForce=function(t,e){var r,n,i,o,s=t.getSource(),a=t.getTarget();if(this.uniformLeafNodeSizes&&null==s.getChild()&&null==a.getChild())t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;0!=(r=t.getLength())&&(i=(n=this.springConstant*(r-e))*(t.lengthX/r),o=n*(t.lengthY/r),s.springForceX+=i,s.springForceY+=o,a.springForceX-=i,a.springForceY-=o)},h.prototype.calcRepulsionForce=function(t,e){var r,n,o,h,u,l,g,c=t.getRect(),p=e.getRect(),f=new Array(2),d=new Array(4);if(c.intersects(p)){s.calcSeparationAmount(c,p,f,i.DEFAULT_EDGE_LENGTH/2),l=2*f[0],g=2*f[1];var y=t.noOfChildren*e.noOfChildren/(t.noOfChildren+e.noOfChildren);t.repulsionForceX-=y*l,t.repulsionForceY-=y*g,e.repulsionForceX+=y*l,e.repulsionForceY+=y*g}else this.uniformLeafNodeSizes&&null==t.getChild()&&null==e.getChild()?(r=p.getCenterX()-c.getCenterX(),n=p.getCenterY()-c.getCenterY()):(s.getIntersection(c,p,d),r=d[2]-d[0],n=d[3]-d[1]),Math.abs(r)<i.MIN_REPULSION_DIST&&(r=a.sign(r)*i.MIN_REPULSION_DIST),Math.abs(n)<i.MIN_REPULSION_DIST&&(n=a.sign(n)*i.MIN_REPULSION_DIST),o=r*r+n*n,h=Math.sqrt(o),l=(u=this.repulsionConstant*t.noOfChildren*e.noOfChildren/o)*r/h,g=u*n/h,t.repulsionForceX-=l,t.repulsionForceY-=g,e.repulsionForceX+=l,e.repulsionForceY+=g},h.prototype.calcGravitationalForce=function(t){var e,r,n,i,o,s,a,h;r=((e=t.getOwner()).getRight()+e.getLeft())/2,n=(e.getTop()+e.getBottom())/2,i=t.getCenterX()-r,o=t.getCenterY()-n,s=Math.abs(i)+t.getWidth()/2,a=Math.abs(o)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(s>(h=e.getEstimatedSize()*this.gravityRangeFactor)||a>h)&&(t.gravitationForceX=-this.gravityConstant*i,t.gravitationForceY=-this.gravityConstant*o):(s>(h=e.getEstimatedSize()*this.compoundGravityRangeFactor)||a>h)&&(t.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*o*this.compoundGravityConstant)},h.prototype.isConverged=function(){var t,e=!1;return this.totalIterations>this.maxIterations/3&&(e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||e},h.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},h.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,e=this.graphManager.getAllNodes(),r=0;r<e.length;r++)(t=e[r]).noOfChildren=t.getNoOfChildren()},h.prototype.calcGrid=function(t){var e,r;e=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),r=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var n=new Array(e),i=0;i<e;i++)n[i]=new Array(r);for(i=0;i<e;i++)for(var o=0;o<r;o++)n[i][o]=new Array;return n},h.prototype.addNodeToGrid=function(t,e,r){var n,i,o,s;n=parseInt(Math.floor((t.getRect().x-e)/this.repulsionRange)),i=parseInt(Math.floor((t.getRect().width+t.getRect().x-e)/this.repulsionRange)),o=parseInt(Math.floor((t.getRect().y-r)/this.repulsionRange)),s=parseInt(Math.floor((t.getRect().height+t.getRect().y-r)/this.repulsionRange));for(var a=n;a<=i;a++)for(var h=o;h<=s;h++)this.grid[a][h].push(t),t.setGridCoordinates(n,i,o,s)},h.prototype.updateGrid=function(){var t,e,r=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<r.length;t++)e=r[t],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},h.prototype.calculateRepulsionForceOfANode=function(t,e,r,n){if(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&r||n){var o,s=new Set;t.surrounding=new Array;for(var a=this.grid,h=t.startX-1;h<t.finishX+2;h++)for(var u=t.startY-1;u<t.finishY+2;u++)if(!(h<0||u<0||h>=a.length||u>=a[0].length))for(var l=0;l<a[h][u].length;l++)if(o=a[h][u][l],t.getOwner()==o.getOwner()&&t!=o&&!e.has(o)&&!s.has(o)){var g=Math.abs(t.getCenterX()-o.getCenterX())-(t.getWidth()/2+o.getWidth()/2),c=Math.abs(t.getCenterY()-o.getCenterY())-(t.getHeight()/2+o.getHeight()/2);g<=this.repulsionRange&&c<=this.repulsionRange&&s.add(o)}t.surrounding=[].concat(function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}(s))}for(h=0;h<t.surrounding.length;h++)this.calcRepulsionForce(t,t.surrounding[h])},h.prototype.calcRepulsionRange=function(){return 0},t.exports=h},function(t,e,r){var n=r(1),i=r(7);function o(t,e,r){n.call(this,t,e,r),this.idealLength=i.DEFAULT_EDGE_LENGTH}for(var s in o.prototype=Object.create(n.prototype),n)o[s]=n[s];t.exports=o},function(t,e,r){var n=r(3);function i(t,e,r,i){n.call(this,t,e,r,i),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var o in i.prototype=Object.create(n.prototype),n)i[o]=n[o];i.prototype.setGridCoordinates=function(t,e,r,n){this.startX=t,this.finishX=e,this.startY=r,this.finishY=n},t.exports=i},function(t,e,r){function n(t,e){this.width=0,this.height=0,null!==t&&null!==e&&(this.height=e,this.width=t)}n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(t){this.width=t},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(t){this.height=t},t.exports=n},function(t,e,r){var n=r(14);function i(){this.map={},this.keys=[]}i.prototype.put=function(t,e){var r=n.createID(t);this.contains(r)||(this.map[r]=e,this.keys.push(t))},i.prototype.contains=function(t){return n.createID(t),null!=this.map[t]},i.prototype.get=function(t){var e=n.createID(t);return this.map[e]},i.prototype.keySet=function(){return this.keys},t.exports=i},function(t,e,r){var n=r(14);function i(){this.set={}}i.prototype.add=function(t){var e=n.createID(t);this.contains(e)||(this.set[e]=t)},i.prototype.remove=function(t){delete this.set[n.createID(t)]},i.prototype.clear=function(){this.set={}},i.prototype.contains=function(t){return this.set[n.createID(t)]==t},i.prototype.isEmpty=function(){return 0===this.size()},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAllTo=function(t){for(var e=Object.keys(this.set),r=e.length,n=0;n<r;n++)t.push(this.set[e[n]])},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAll=function(t){for(var e=t.length,r=0;r<e;r++){var n=t[r];this.add(n)}},t.exports=i},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=r(11),o=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),null===r&&void 0===r||(this.compareFunction=this._defaultCompareFunction);var n=void 0;n=e instanceof i?e.size():e.length,this._quicksort(e,0,n-1)}return n(t,[{key:"_quicksort",value:function(t,e,r){if(e<r){var n=this._partition(t,e,r);this._quicksort(t,e,n),this._quicksort(t,n+1,r)}}},{key:"_partition",value:function(t,e,r){for(var n=this._get(t,e),i=e,o=r;;){for(;this.compareFunction(n,this._get(t,o));)o--;for(;this.compareFunction(this._get(t,i),n);)i++;if(!(i<o))return o;this._swap(t,i,o),i++,o--}}},{key:"_get",value:function(t,e){return t instanceof i?t.get_object_at(e):t[e]}},{key:"_set",value:function(t,e,r){t instanceof i?t.set_object_at(e,r):t[e]=r}},{key:"_swap",value:function(t,e,r){var n=this._get(t,e);this._set(t,e,this._get(t,r)),this._set(t,r,n)}},{key:"_defaultCompareFunction",value:function(t,e){return e>t}}]),t}();t.exports=o},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=function(){function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.sequence1=e,this.sequence2=r,this.match_score=n,this.mismatch_penalty=i,this.gap_penalty=o,this.iMax=e.length+1,this.jMax=r.length+1,this.grid=new Array(this.iMax);for(var s=0;s<this.iMax;s++){this.grid[s]=new Array(this.jMax);for(var a=0;a<this.jMax;a++)this.grid[s][a]=0}this.tracebackGrid=new Array(this.iMax);for(var h=0;h<this.iMax;h++){this.tracebackGrid[h]=new Array(this.jMax);for(var u=0;u<this.jMax;u++)this.tracebackGrid[h][u]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return n(t,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var t=1;t<this.jMax;t++)this.grid[0][t]=this.grid[0][t-1]+this.gap_penalty,this.tracebackGrid[0][t]=[!1,!1,!0];for(var e=1;e<this.iMax;e++)this.grid[e][0]=this.grid[e-1][0]+this.gap_penalty,this.tracebackGrid[e][0]=[!1,!0,!1];for(var r=1;r<this.iMax;r++)for(var n=1;n<this.jMax;n++){var i=[this.sequence1[r-1]===this.sequence2[n-1]?this.grid[r-1][n-1]+this.match_score:this.grid[r-1][n-1]+this.mismatch_penalty,this.grid[r-1][n]+this.gap_penalty,this.grid[r][n-1]+this.gap_penalty],o=this.arrayAllMaxIndexes(i);this.grid[r][n]=i[o[0]],this.tracebackGrid[r][n]=[o.includes(0),o.includes(1),o.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var t=[];for(t.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});t[0];){var e=t[0],r=this.tracebackGrid[e.pos[0]][e.pos[1]];r[0]&&t.push({pos:[e.pos[0]-1,e.pos[1]-1],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),r[1]&&t.push({pos:[e.pos[0]-1,e.pos[1]],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:"-"+e.seq2}),r[2]&&t.push({pos:[e.pos[0],e.pos[1]-1],seq1:"-"+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),0===e.pos[0]&&0===e.pos[1]&&this.alignments.push({sequence1:e.seq1,sequence2:e.seq2}),t.shift()}return this.alignments}},{key:"getAllIndexes",value:function(t,e){for(var r=[],n=-1;-1!==(n=t.indexOf(e,n+1));)r.push(n);return r}},{key:"arrayAllMaxIndexes",value:function(t){return this.getAllIndexes(t,Math.max.apply(null,t))}}]),t}();t.exports=i},function(t,e,r){var n=function(){};n.FDLayout=r(18),n.FDLayoutConstants=r(7),n.FDLayoutEdge=r(19),n.FDLayoutNode=r(20),n.DimensionD=r(21),n.HashMap=r(22),n.HashSet=r(23),n.IGeometry=r(8),n.IMath=r(9),n.Integer=r(10),n.Point=r(12),n.PointD=r(4),n.RandomSeed=r(16),n.RectangleD=r(13),n.Transform=r(17),n.UniqueIDGeneretor=r(14),n.Quicksort=r(24),n.LinkedList=r(11),n.LGraphObject=r(2),n.LGraph=r(5),n.LEdge=r(1),n.LGraphManager=r(6),n.LNode=r(3),n.Layout=r(15),n.LayoutConstants=r(0),n.NeedlemanWunsch=r(25),t.exports=n},function(t,e,r){function n(){this.listeners=[]}var i=n.prototype;i.addListener=function(t,e){this.listeners.push({event:t,callback:e})},i.removeListener=function(t,e){for(var r=this.listeners.length;r>=0;r--){var n=this.listeners[r];n.event===t&&n.callback===e&&this.listeners.splice(r,1)}},i.emit=function(t,e){for(var r=0;r<this.listeners.length;r++){var n=this.listeners[r];t===n.event&&n.callback(e)}},t.exports=n}])},t.exports=n()),e.exports;var t,n}e.exports;export{n as __require};
|
|
1
|
+
import{commonjsGlobal as t}from"../../../../../_virtual/_commonjsHelpers.js";import{__module as e}from"../../../../../_virtual/layout-base.js";var r;function n(){return r||(r=1,t=e,e.exports,n=function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.i=function(t){return t},r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=26)}([function(t,e,r){function n(){}n.QUALITY=1,n.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,n.DEFAULT_INCREMENTAL=!1,n.DEFAULT_ANIMATION_ON_LAYOUT=!0,n.DEFAULT_ANIMATION_DURING_LAYOUT=!1,n.DEFAULT_ANIMATION_PERIOD=50,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,n.DEFAULT_GRAPH_MARGIN=15,n.NODE_DIMENSIONS_INCLUDE_LABELS=!1,n.SIMPLE_NODE_SIZE=40,n.SIMPLE_NODE_HALF_SIZE=n.SIMPLE_NODE_SIZE/2,n.EMPTY_COMPOUND_NODE_SIZE=40,n.MIN_EDGE_LENGTH=1,n.WORLD_BOUNDARY=1e6,n.INITIAL_WORLD_BOUNDARY=n.WORLD_BOUNDARY/1e3,n.WORLD_CENTER_X=1200,n.WORLD_CENTER_Y=900,t.exports=n},function(t,e,r){var n=r(2),i=r(8),o=r(9);function s(t,e,r){n.call(this,r),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=r,this.bendpoints=[],this.source=t,this.target=e}for(var a in s.prototype=Object.create(n.prototype),n)s[a]=n[a];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(t){if(this.source===t)return this.target;if(this.target===t)return this.source;throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(t,e){for(var r=this.getOtherEnd(t),n=e.getGraphManager().getRoot();;){if(r.getOwner()==e)return r;if(r.getOwner()==n)break;r=r.getOwner().getParent()}return null},s.prototype.updateLength=function(){var t=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),t),this.isOverlapingSourceAndTarget||(this.lengthX=t[0]-t[2],this.lengthY=t[1]-t[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},s.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=s},function(t,e,r){t.exports=function(t){this.vGraphObject=t}},function(t,e,r){var n=r(2),i=r(10),o=r(13),s=r(0),a=r(16),h=r(4);function u(t,e,r,s){null==r&&null==s&&(s=e),n.call(this,s),null!=t.graphManager&&(t=t.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=s,this.edges=[],this.graphManager=t,this.rect=null!=r&&null!=e?new o(e.x,e.y,r.width,r.height):new o}for(var l in u.prototype=Object.create(n.prototype),n)u[l]=n[l];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(t){this.rect.width=t},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(t){this.rect.height=t},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(t,e){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=e.width,this.rect.height=e.height},u.prototype.setCenter=function(t,e){this.rect.x=t-this.rect.width/2,this.rect.y=e-this.rect.height/2},u.prototype.setLocation=function(t,e){this.rect.x=t,this.rect.y=e},u.prototype.moveBy=function(t,e){this.rect.x+=t,this.rect.y+=e},u.prototype.getEdgeListToNode=function(t){var e=[],r=this;return r.edges.forEach((function(n){if(n.target==t){if(n.source!=r)throw"Incorrect edge source!";e.push(n)}})),e},u.prototype.getEdgesBetween=function(t){var e=[],r=this;return r.edges.forEach((function(n){if(n.source!=r&&n.target!=r)throw"Incorrect edge source and/or target";n.target!=t&&n.source!=t||e.push(n)})),e},u.prototype.getNeighborsList=function(){var t=new Set,e=this;return e.edges.forEach((function(r){if(r.source==e)t.add(r.target);else{if(r.target!=e)throw"Incorrect incidency!";t.add(r.source)}})),t},u.prototype.withChildren=function(){var t=new Set;if(t.add(this),null!=this.child)for(var e=this.child.getNodes(),r=0;r<e.length;r++)e[r].withChildren().forEach((function(e){t.add(e)}));return t},u.prototype.getNoOfChildren=function(){var t=0;if(null==this.child)t=1;else for(var e=this.child.getNodes(),r=0;r<e.length;r++)t+=e[r].getNoOfChildren();return 0==t&&(t=1),t},u.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},u.prototype.calcEstimatedSize=function(){return null==this.child?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},u.prototype.scatter=function(){var t,e,r=-s.INITIAL_WORLD_BOUNDARY,n=s.INITIAL_WORLD_BOUNDARY;t=s.WORLD_CENTER_X+a.nextDouble()*(n-r)+r;var i=-s.INITIAL_WORLD_BOUNDARY,o=s.INITIAL_WORLD_BOUNDARY;e=s.WORLD_CENTER_Y+a.nextDouble()*(o-i)+i,this.rect.x=t,this.rect.y=e},u.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var e=t.getRight()-t.getLeft(),r=t.getBottom()-t.getTop();this.labelWidth>e&&(this.rect.x-=(this.labelWidth-e)/2,this.setWidth(this.labelWidth)),this.labelHeight>r&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-r)/2:"top"==this.labelPos&&(this.rect.y-=this.labelHeight-r),this.setHeight(this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(t){var e=this.rect.x;e>s.WORLD_BOUNDARY?e=s.WORLD_BOUNDARY:e<-s.WORLD_BOUNDARY&&(e=-s.WORLD_BOUNDARY);var r=this.rect.y;r>s.WORLD_BOUNDARY?r=s.WORLD_BOUNDARY:r<-s.WORLD_BOUNDARY&&(r=-s.WORLD_BOUNDARY);var n=new h(e,r),i=t.inverseTransformPoint(n);this.setLocation(i.x,i.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=u},function(t,e,r){function n(t,e){null==t&&null==e?(this.x=0,this.y=0):(this.x=t,this.y=e)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(t){this.x=t},n.prototype.setY=function(t){this.y=t},n.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},t.exports=n},function(t,e,r){var n=r(2),i=r(10),o=r(0),s=r(6),a=r(3),h=r(1),u=r(13),l=r(12),g=r(11);function c(t,e,r){n.call(this,r),this.estimatedSize=i.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=e&&e instanceof s?this.graphManager=e:null!=e&&e instanceof Layout&&(this.graphManager=e.graphManager)}for(var p in c.prototype=Object.create(n.prototype),n)c[p]=n[p];c.prototype.getNodes=function(){return this.nodes},c.prototype.getEdges=function(){return this.edges},c.prototype.getGraphManager=function(){return this.graphManager},c.prototype.getParent=function(){return this.parent},c.prototype.getLeft=function(){return this.left},c.prototype.getRight=function(){return this.right},c.prototype.getTop=function(){return this.top},c.prototype.getBottom=function(){return this.bottom},c.prototype.isConnected=function(){return this.isConnected},c.prototype.add=function(t,e,r){if(null==e&&null==r){var n=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(n)>-1)throw"Node already in graph!";return n.owner=this,this.getNodes().push(n),n}var i=t;if(!(this.getNodes().indexOf(e)>-1&&this.getNodes().indexOf(r)>-1))throw"Source or target not in graph!";if(e.owner!=r.owner||e.owner!=this)throw"Both owners must be this graph!";return e.owner!=r.owner?null:(i.source=e,i.target=r,i.isInterGraph=!1,this.getEdges().push(i),e.edges.push(i),r!=e&&r.edges.push(i),i)},c.prototype.remove=function(t){var e=t;if(t instanceof a){if(null==e)throw"Node is null!";if(null==e.owner||e.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var r=e.edges.slice(),n=r.length,i=0;i<n;i++)(o=r[i]).isInterGraph?this.graphManager.remove(o):o.source.owner.remove(o);if(-1==(s=this.nodes.indexOf(e)))throw"Node not in owner node list!";this.nodes.splice(s,1)}else if(t instanceof h){var o;if(null==(o=t))throw"Edge is null!";if(null==o.source||null==o.target)throw"Source and/or target is null!";if(null==o.source.owner||null==o.target.owner||o.source.owner!=this||o.target.owner!=this)throw"Source and/or target owner is invalid!";var s,u=o.source.edges.indexOf(o),l=o.target.edges.indexOf(o);if(!(u>-1&&l>-1))throw"Source and/or target doesn't know this edge!";if(o.source.edges.splice(u,1),o.target!=o.source&&o.target.edges.splice(l,1),-1==(s=o.source.owner.getEdges().indexOf(o)))throw"Not in owner's edge list!";o.source.owner.getEdges().splice(s,1)}},c.prototype.updateLeftTop=function(){for(var t,e,r,n=i.MAX_VALUE,o=i.MAX_VALUE,s=this.getNodes(),a=s.length,h=0;h<a;h++){var u=s[h];n>(t=u.getTop())&&(n=t),o>(e=u.getLeft())&&(o=e)}return n==i.MAX_VALUE?null:(r=null!=s[0].getParent().paddingLeft?s[0].getParent().paddingLeft:this.margin,this.left=o-r,this.top=n-r,new l(this.left,this.top))},c.prototype.updateBounds=function(t){for(var e,r,n,o,s,a=i.MAX_VALUE,h=-i.MAX_VALUE,l=i.MAX_VALUE,g=-i.MAX_VALUE,c=this.nodes,p=c.length,f=0;f<p;f++){var d=c[f];t&&null!=d.child&&d.updateBounds(),a>(e=d.getLeft())&&(a=e),h<(r=d.getRight())&&(h=r),l>(n=d.getTop())&&(l=n),g<(o=d.getBottom())&&(g=o)}var y=new u(a,l,h-a,g-l);a==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),s=null!=c[0].getParent().paddingLeft?c[0].getParent().paddingLeft:this.margin,this.left=y.x-s,this.right=y.x+y.width+s,this.top=y.y-s,this.bottom=y.y+y.height+s},c.calculateBounds=function(t){for(var e,r,n,o,s=i.MAX_VALUE,a=-i.MAX_VALUE,h=i.MAX_VALUE,l=-i.MAX_VALUE,g=t.length,c=0;c<g;c++){var p=t[c];s>(e=p.getLeft())&&(s=e),a<(r=p.getRight())&&(a=r),h>(n=p.getTop())&&(h=n),l<(o=p.getBottom())&&(l=o)}return new u(s,h,a-s,l-h)},c.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},c.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},c.prototype.calcEstimatedSize=function(){for(var t=0,e=this.nodes,r=e.length,n=0;n<r;n++)t+=e[n].calcEstimatedSize();return this.estimatedSize=0==t?o.EMPTY_COMPOUND_NODE_SIZE:t/Math.sqrt(this.nodes.length),this.estimatedSize},c.prototype.updateConnected=function(){var t=this;if(0!=this.nodes.length){var e,r,n=new g,i=new Set,o=this.nodes[0];for(o.withChildren().forEach((function(t){n.push(t),i.add(t)}));0!==n.length;)for(var s=(e=(o=n.shift()).getEdges()).length,a=0;a<s;a++)null==(r=e[a].getOtherEndInGraph(o,this))||i.has(r)||r.withChildren().forEach((function(t){n.push(t),i.add(t)}));if(this.isConnected=!1,i.size>=this.nodes.length){var h=0;i.forEach((function(e){e.owner==t&&h++})),h==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},t.exports=c},function(t,e,r){var n,i=r(1);function o(t){n=r(5),this.layout=t,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var t=this.layout.newGraph(),e=this.layout.newNode(null),r=this.add(t,e);return this.setRootGraph(r),this.rootGraph},o.prototype.add=function(t,e,r,n,i){if(null==r&&null==n&&null==i){if(null==t)throw"Graph is null!";if(null==e)throw"Parent node is null!";if(this.graphs.indexOf(t)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(t),null!=t.parent)throw"Already has a parent!";if(null!=e.child)throw"Already has a child!";return t.parent=e,e.child=t,t}i=r,r=t;var o=(n=e).getOwner(),s=i.getOwner();if(null==o||o.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==s||s.getGraphManager()!=this)throw"Target not in this graph mgr!";if(o==s)return r.isInterGraph=!1,o.add(r,n,i);if(r.isInterGraph=!0,r.source=n,r.target=i,this.edges.indexOf(r)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(r),null==r.source||null==r.target)throw"Edge source and/or target is null!";if(-1!=r.source.edges.indexOf(r)||-1!=r.target.edges.indexOf(r))throw"Edge already in source and/or target incidency list!";return r.source.edges.push(r),r.target.edges.push(r),r},o.prototype.remove=function(t){if(t instanceof n){var e=t;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(e!=this.rootGraph&&(null==e.parent||e.parent.graphManager!=this))throw"Invalid parent node!";for(var r,o=[],s=(o=o.concat(e.getEdges())).length,a=0;a<s;a++)r=o[a],e.remove(r);var h,u=[];for(s=(u=u.concat(e.getNodes())).length,a=0;a<s;a++)h=u[a],e.remove(h);e==this.rootGraph&&this.setRootGraph(null);var l=this.graphs.indexOf(e);this.graphs.splice(l,1),e.parent=null}else if(t instanceof i){if(null==(r=t))throw"Edge is null!";if(!r.isInterGraph)throw"Not an inter-graph edge!";if(null==r.source||null==r.target)throw"Source and/or target is null!";if(-1==r.source.edges.indexOf(r)||-1==r.target.edges.indexOf(r))throw"Source and/or target doesn't know this edge!";if(l=r.source.edges.indexOf(r),r.source.edges.splice(l,1),l=r.target.edges.indexOf(r),r.target.edges.splice(l,1),null==r.source.owner||null==r.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==r.source.owner.getGraphManager().edges.indexOf(r))throw"Not in owner graph manager's edge list!";l=r.source.owner.getGraphManager().edges.indexOf(r),r.source.owner.getGraphManager().edges.splice(l,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(null==this.allNodes){for(var t=[],e=this.getGraphs(),r=e.length,n=0;n<r;n++)t=t.concat(e[n].getNodes());this.allNodes=t}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(null==this.allEdges){var t=[],e=this.getGraphs();e.length;for(var r=0;r<e.length;r++)t=t.concat(e[r].getEdges());t=t.concat(this.edges),this.allEdges=t}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(t){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=t},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(t){if(t.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=t,null==t.parent&&(t.parent=this.layout.newNode("Root node"))},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(t,e){if(null==t||null==e)throw"assert failed";if(t==e)return!0;for(var r,n=t.getOwner();null!=(r=n.getParent());){if(r==e)return!0;if(null==(n=r.getOwner()))break}for(n=e.getOwner();null!=(r=n.getParent());){if(r==t)return!0;if(null==(n=r.getOwner()))break}return!1},o.prototype.calcLowestCommonAncestors=function(){for(var t,e,r,n,i,o=this.getAllEdges(),s=o.length,a=0;a<s;a++)if(e=(t=o[a]).source,r=t.target,t.lca=null,t.sourceInLca=e,t.targetInLca=r,e!=r){for(n=e.getOwner();null==t.lca;){for(t.targetInLca=r,i=r.getOwner();null==t.lca;){if(i==n){t.lca=i;break}if(i==this.rootGraph)break;if(null!=t.lca)throw"assert failed";t.targetInLca=i.getParent(),i=t.targetInLca.getOwner()}if(n==this.rootGraph)break;null==t.lca&&(t.sourceInLca=n.getParent(),n=t.sourceInLca.getOwner())}if(null==t.lca)throw"assert failed"}else t.lca=e.getOwner()},o.prototype.calcLowestCommonAncestor=function(t,e){if(t==e)return t.getOwner();for(var r=t.getOwner();null!=r;){for(var n=e.getOwner();null!=n;){if(n==r)return n;n=n.getParent().getOwner()}r=r.getParent().getOwner()}return r},o.prototype.calcInclusionTreeDepths=function(t,e){var r;null==t&&null==e&&(t=this.rootGraph,e=1);for(var n=t.getNodes(),i=n.length,o=0;o<i;o++)(r=n[o]).inclusionTreeDepth=e,null!=r.child&&this.calcInclusionTreeDepths(r.child,e+1)},o.prototype.includesInvalidEdge=function(){for(var t,e=this.edges.length,r=0;r<e;r++)if(t=this.edges[r],this.isOneAncestorOfOther(t.source,t.target))return!0;return!1},t.exports=o},function(t,e,r){var n=r(0);function i(){}for(var o in n)i[o]=n[o];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=3*i.MAX_NODE_DISPLACEMENT_INCREMENTAL,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=i},function(t,e,r){var n=r(12);function i(){}i.calcSeparationAmount=function(t,e,r,n){if(!t.intersects(e))throw"assert failed";var i=new Array(2);this.decideDirectionsForOverlappingNodes(t,e,i),r[0]=Math.min(t.getRight(),e.getRight())-Math.max(t.x,e.x),r[1]=Math.min(t.getBottom(),e.getBottom())-Math.max(t.y,e.y),t.getX()<=e.getX()&&t.getRight()>=e.getRight()?r[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight()):e.getX()<=t.getX()&&e.getRight()>=t.getRight()&&(r[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())),t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()?r[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()):e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()&&(r[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()));var o=Math.abs((e.getCenterY()-t.getCenterY())/(e.getCenterX()-t.getCenterX()));e.getCenterY()===t.getCenterY()&&e.getCenterX()===t.getCenterX()&&(o=1);var s=o*r[0],a=r[1]/o;r[0]<a?a=r[0]:s=r[1],r[0]=-1*i[0]*(a/2+n),r[1]=-1*i[1]*(s/2+n)},i.decideDirectionsForOverlappingNodes=function(t,e,r){t.getCenterX()<e.getCenterX()?r[0]=-1:r[0]=1,t.getCenterY()<e.getCenterY()?r[1]=-1:r[1]=1},i.getIntersection2=function(t,e,r){var n=t.getCenterX(),i=t.getCenterY(),o=e.getCenterX(),s=e.getCenterY();if(t.intersects(e))return r[0]=n,r[1]=i,r[2]=o,r[3]=s,!0;var a=t.getX(),h=t.getY(),u=t.getRight(),l=t.getX(),g=t.getBottom(),c=t.getRight(),p=t.getWidthHalf(),f=t.getHeightHalf(),d=e.getX(),y=e.getY(),E=e.getRight(),v=e.getX(),A=e.getBottom(),_=e.getRight(),O=e.getWidthHalf(),N=e.getHeightHalf(),L=!1,T=!1;if(n===o){if(i>s)return r[0]=n,r[1]=h,r[2]=o,r[3]=A,!1;if(i<s)return r[0]=n,r[1]=g,r[2]=o,r[3]=y,!1}else if(i===s){if(n>o)return r[0]=a,r[1]=i,r[2]=E,r[3]=s,!1;if(n<o)return r[0]=u,r[1]=i,r[2]=d,r[3]=s,!1}else{var I=t.height/t.width,D=e.height/e.width,m=(s-i)/(o-n),w=void 0,R=void 0,M=void 0,x=void 0,C=void 0,G=void 0;if(-I===m?n>o?(r[0]=l,r[1]=g,L=!0):(r[0]=u,r[1]=h,L=!0):I===m&&(n>o?(r[0]=a,r[1]=h,L=!0):(r[0]=c,r[1]=g,L=!0)),-D===m?o>n?(r[2]=v,r[3]=A,T=!0):(r[2]=E,r[3]=y,T=!0):D===m&&(o>n?(r[2]=d,r[3]=y,T=!0):(r[2]=_,r[3]=A,T=!0)),L&&T)return!1;if(n>o?i>s?(w=this.getCardinalDirection(I,m,4),R=this.getCardinalDirection(D,m,2)):(w=this.getCardinalDirection(-I,m,3),R=this.getCardinalDirection(-D,m,1)):i>s?(w=this.getCardinalDirection(-I,m,1),R=this.getCardinalDirection(-D,m,3)):(w=this.getCardinalDirection(I,m,2),R=this.getCardinalDirection(D,m,4)),!L)switch(w){case 1:x=h,M=n+-f/m,r[0]=M,r[1]=x;break;case 2:M=c,x=i+p*m,r[0]=M,r[1]=x;break;case 3:x=g,M=n+f/m,r[0]=M,r[1]=x;break;case 4:M=l,x=i+-p*m,r[0]=M,r[1]=x}if(!T)switch(R){case 1:G=y,C=o+-N/m,r[2]=C,r[3]=G;break;case 2:C=_,G=s+O*m,r[2]=C,r[3]=G;break;case 3:G=A,C=o+N/m,r[2]=C,r[3]=G;break;case 4:C=v,G=s+-O*m,r[2]=C,r[3]=G}}return!1},i.getCardinalDirection=function(t,e,r){return t>e?r:1+r%4},i.getIntersection=function(t,e,r,i){if(null==i)return this.getIntersection2(t,e,r);var o,s,a,h,u,l,g,c=t.x,p=t.y,f=e.x,d=e.y,y=r.x,E=r.y,v=i.x,A=i.y;return 0==(g=(o=d-p)*(h=y-v)-(s=A-E)*(a=c-f))?null:new n((a*(l=v*E-y*A)-h*(u=f*p-c*d))/g,(s*u-o*l)/g)},i.angleOfVector=function(t,e,r,n){var i=void 0;return t!==r?(i=Math.atan((n-e)/(r-t)),r<t?i+=Math.PI:n<e&&(i+=this.TWO_PI)):i=n<e?this.ONE_AND_HALF_PI:this.HALF_PI,i},i.doIntersect=function(t,e,r,n){var i=t.x,o=t.y,s=e.x,a=e.y,h=r.x,u=r.y,l=n.x,g=n.y,c=(s-i)*(g-u)-(l-h)*(a-o);if(0===c)return!1;var p=((g-u)*(l-i)+(h-l)*(g-o))/c,f=((o-a)*(l-i)+(s-i)*(g-o))/c;return 0<p&&p<1&&0<f&&f<1},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,t.exports=i},function(t,e,r){function n(){}n.sign=function(t){return t>0?1:t<0?-1:0},n.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},n.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},t.exports=n},function(t,e,r){function n(){}n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,t.exports=n},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=function(t){return{value:t,next:null,prev:null}},o=function(t,e,r,n){return null!==t?t.next=e:n.head=e,null!==r?r.prev=e:n.tail=e,e.prev=t,e.next=r,n.length++,e},s=function(t,e){var r=t.prev,n=t.next;return null!==r?r.next=n:e.head=n,null!==n?n.prev=r:e.tail=r,t.prev=t.next=null,e.length--,t},a=function(){function t(e){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.length=0,this.head=null,this.tail=null,null!=e&&e.forEach((function(t){return r.push(t)}))}return n(t,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(t,e){return o(e.prev,i(t),e,this)}},{key:"insertAfter",value:function(t,e){return o(e,i(t),e.next,this)}},{key:"insertNodeBefore",value:function(t,e){return o(e.prev,t,e,this)}},{key:"insertNodeAfter",value:function(t,e){return o(e,t,e.next,this)}},{key:"push",value:function(t){return o(this.tail,i(t),null,this)}},{key:"unshift",value:function(t){return o(null,i(t),this.head,this)}},{key:"remove",value:function(t){return s(t,this)}},{key:"pop",value:function(){return s(this.tail,this).value}},{key:"popNode",value:function(){return s(this.tail,this)}},{key:"shift",value:function(){return s(this.head,this).value}},{key:"shiftNode",value:function(){return s(this.head,this)}},{key:"get_object_at",value:function(t){if(t<=this.length()){for(var e=1,r=this.head;e<t;)r=r.next,e++;return r.value}}},{key:"set_object_at",value:function(t,e){if(t<=this.length()){for(var r=1,n=this.head;r<t;)n=n.next,r++;n.value=e}}}]),t}();t.exports=a},function(t,e,r){function n(t,e,r){this.x=null,this.y=null,null==t&&null==e&&null==r?(this.x=0,this.y=0):"number"==typeof t&&"number"==typeof e&&null==r?(this.x=t,this.y=e):"Point"==t.constructor.name&&null==e&&null==r&&(r=t,this.x=r.x,this.y=r.y)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.getLocation=function(){return new n(this.x,this.y)},n.prototype.setLocation=function(t,e,r){"Point"==t.constructor.name&&null==e&&null==r?(r=t,this.setLocation(r.x,r.y)):"number"==typeof t&&"number"==typeof e&&null==r&&(parseInt(t)==t&&parseInt(e)==e?this.move(t,e):(this.x=Math.floor(t+.5),this.y=Math.floor(e+.5)))},n.prototype.move=function(t,e){this.x=t,this.y=e},n.prototype.translate=function(t,e){this.x+=t,this.y+=e},n.prototype.equals=function(t){if("Point"==t.constructor.name){var e=t;return this.x==e.x&&this.y==e.y}return this==t},n.prototype.toString=function(){return(new n).constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=n},function(t,e,r){function n(t,e,r,n){this.x=0,this.y=0,this.width=0,this.height=0,null!=t&&null!=e&&null!=r&&null!=n&&(this.x=t,this.y=e,this.width=r,this.height=n)}n.prototype.getX=function(){return this.x},n.prototype.setX=function(t){this.x=t},n.prototype.getY=function(){return this.y},n.prototype.setY=function(t){this.y=t},n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(t){this.width=t},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(t){this.height=t},n.prototype.getRight=function(){return this.x+this.width},n.prototype.getBottom=function(){return this.y+this.height},n.prototype.intersects=function(t){return!(this.getRight()<t.x||this.getBottom()<t.y||t.getRight()<this.x||t.getBottom()<this.y)},n.prototype.getCenterX=function(){return this.x+this.width/2},n.prototype.getMinX=function(){return this.getX()},n.prototype.getMaxX=function(){return this.getX()+this.width},n.prototype.getCenterY=function(){return this.y+this.height/2},n.prototype.getMinY=function(){return this.getY()},n.prototype.getMaxY=function(){return this.getY()+this.height},n.prototype.getWidthHalf=function(){return this.width/2},n.prototype.getHeightHalf=function(){return this.height/2},t.exports=n},function(t,e,r){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function i(){}i.lastID=0,i.createID=function(t){return i.isPrimitive(t)?t:(null!=t.uniqueID||(t.uniqueID=i.getString(),i.lastID++),t.uniqueID)},i.getString=function(t){return null==t&&(t=i.lastID),"Object#"+t},i.isPrimitive=function(t){var e=void 0===t?"undefined":n(t);return null==t||"object"!=e&&"function"!=e},t.exports=i},function(t,e,r){function n(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}var i=r(0),o=r(6),s=r(3),a=r(1),h=r(5),u=r(4),l=r(17),g=r(27);function c(t){g.call(this),this.layoutQuality=i.QUALITY,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=i.DEFAULT_INCREMENTAL,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=t&&(this.isRemoteUse=t)}c.RANDOM_SEED=1,c.prototype=Object.create(g.prototype),c.prototype.getGraphManager=function(){return this.graphManager},c.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},c.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},c.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},c.prototype.newGraphManager=function(){var t=new o(this);return this.graphManager=t,t},c.prototype.newGraph=function(t){return new h(null,this.graphManager,t)},c.prototype.newNode=function(t){return new s(this.graphManager,t)},c.prototype.newEdge=function(t){return new a(null,null,t)},c.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},c.prototype.runLayout=function(){var t;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),t=!this.checkLayoutSuccess()&&this.layout(),"during"!==i.ANIMATE&&(t&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,t)},c.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},c.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var t=this.graphManager.getAllEdges(),e=0;e<t.length;e++)t[e];var r=this.graphManager.getRoot().getNodes();for(e=0;e<r.length;e++)r[e];this.update(this.graphManager.getRoot())}},c.prototype.update=function(t){if(null==t)this.update2();else if(t instanceof s){var e=t;if(null!=e.getChild())for(var r=e.getChild().getNodes(),n=0;n<r.length;n++)update(r[n]);null!=e.vGraphObject&&e.vGraphObject.update(e)}else if(t instanceof a){var i=t;null!=i.vGraphObject&&i.vGraphObject.update(i)}else if(t instanceof h){var o=t;null!=o.vGraphObject&&o.vGraphObject.update(o)}},c.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=i.QUALITY,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=i.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},c.prototype.transform=function(t){if(null==t)this.transform(new u(0,0));else{var e=new l,r=this.graphManager.getRoot().updateLeftTop();if(null!=r){e.setWorldOrgX(t.x),e.setWorldOrgY(t.y),e.setDeviceOrgX(r.x),e.setDeviceOrgY(r.y);for(var n=this.getAllNodes(),i=0;i<n.length;i++)n[i].transform(e)}}},c.prototype.positionNodesRandomly=function(t){if(null==t)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var e,r,n=t.getNodes(),i=0;i<n.length;i++)null==(r=(e=n[i]).getChild())||0==r.getNodes().length?e.scatter():(this.positionNodesRandomly(r),e.updateBounds())},c.prototype.getFlatForest=function(){for(var t=[],e=!0,r=this.graphManager.getRoot().getNodes(),i=!0,o=0;o<r.length;o++)null!=r[o].getChild()&&(i=!1);if(!i)return t;var s=new Set,a=[],h=new Map,u=[];for(u=u.concat(r);u.length>0&&e;){for(a.push(u[0]);a.length>0&&e;){var l=a[0];a.splice(0,1),s.add(l);var g=l.getEdges();for(o=0;o<g.length;o++){var c=g[o].getOtherEnd(l);if(h.get(l)!=c){if(s.has(c)){e=!1;break}a.push(c),h.set(c,l)}}}if(e){var p=[].concat(n(s));for(t.push(p),o=0;o<p.length;o++){var f=p[o],d=u.indexOf(f);d>-1&&u.splice(d,1)}s=new Set,h=new Map}else t=[]}return t},c.prototype.createDummyNodesForBendpoints=function(t){for(var e=[],r=t.source,n=this.graphManager.calcLowestCommonAncestor(t.source,t.target),i=0;i<t.bendpoints.length;i++){var o=this.newNode(null);o.setRect(new Point(0,0),new Dimension(1,1)),n.add(o);var s=this.newEdge(null);this.graphManager.add(s,r,o),e.add(o),r=o}return s=this.newEdge(null),this.graphManager.add(s,r,t.target),this.edgeToDummyNodes.set(t,e),t.isInterGraph()?this.graphManager.remove(t):n.remove(t),e},c.prototype.createBendpointsFromDummyNodes=function(){var t=[];t=t.concat(this.graphManager.getAllEdges()),t=[].concat(n(this.edgeToDummyNodes.keys())).concat(t);for(var e=0;e<t.length;e++){var r=t[e];if(r.bendpoints.length>0){for(var i=this.edgeToDummyNodes.get(r),o=0;o<i.length;o++){var s=i[o],a=new u(s.getCenterX(),s.getCenterY()),h=r.bendpoints.get(o);h.x=a.x,h.y=a.y,s.getOwner().remove(s)}this.graphManager.add(r,r.source,r.target)}}},c.transform=function(t,e,r,n){if(null!=r&&null!=n){var i=e;return t<=50?i-=(e-e/r)/50*(50-t):i+=(e*n-e)/50*(t-50),i}var o,s;return t<=50?(o=9*e/500,s=e/10):(o=9*e/50,s=-8*e),o*t+s},c.findCenterOfTree=function(t){var e=[];e=e.concat(t);var r=[],n=new Map,i=!1,o=null;1!=e.length&&2!=e.length||(i=!0,o=e[0]);for(var s=0;s<e.length;s++){var a=(l=e[s]).getNeighborsList().size;n.set(l,l.getNeighborsList().size),1==a&&r.push(l)}var h=[];for(h=h.concat(r);!i;){var u=[];for(u=u.concat(h),h=[],s=0;s<e.length;s++){var l=e[s],g=e.indexOf(l);g>=0&&e.splice(g,1),l.getNeighborsList().forEach((function(t){if(r.indexOf(t)<0){var e=n.get(t)-1;1==e&&h.push(t),n.set(t,e)}}))}r=r.concat(h),1!=e.length&&2!=e.length||(i=!0,o=e[0])}return o},c.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=c},function(t,e,r){function n(){}n.seed=1,n.x=0,n.nextDouble=function(){return n.x=1e4*Math.sin(n.seed++),n.x-Math.floor(n.x)},t.exports=n},function(t,e,r){var n=r(4);function i(t,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(t){this.lworldExtX=t},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(t){this.lworldExtY=t},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},i.prototype.transformX=function(t){var e=0,r=this.lworldExtX;return 0!=r&&(e=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/r),e},i.prototype.transformY=function(t){var e=0,r=this.lworldExtY;return 0!=r&&(e=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/r),e},i.prototype.inverseTransformX=function(t){var e=0,r=this.ldeviceExtX;return 0!=r&&(e=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/r),e},i.prototype.inverseTransformY=function(t){var e=0,r=this.ldeviceExtY;return 0!=r&&(e=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/r),e},i.prototype.inverseTransformPoint=function(t){return new n(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=i},function(t,e,r){var n=r(15),i=r(7),o=r(0),s=r(8),a=r(9);function h(){n.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=i.DEFAULT_EDGE_LENGTH,this.springConstant=i.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=i.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}for(var u in h.prototype=Object.create(n.prototype),n)h[u]=n[u];h.prototype.initParameters=function(){n.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},h.prototype.calcIdealEdgeLengths=function(){for(var t,e,r,n,s,a,h=this.getGraphManager().getAllEdges(),u=0;u<h.length;u++)(t=h[u]).idealLength=this.idealEdgeLength,t.isInterGraph&&(r=t.getSource(),n=t.getTarget(),s=t.getSourceInLca().getEstimatedSize(),a=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=s+a-2*o.SIMPLE_NODE_SIZE),e=t.getLca().getInclusionTreeDepth(),t.idealLength+=i.DEFAULT_EDGE_LENGTH*i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(r.getInclusionTreeDepth()+n.getInclusionTreeDepth()-2*e))},h.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>i.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},h.prototype.calcSpringForces=function(){for(var t,e=this.getAllEdges(),r=0;r<e.length;r++)t=e[r],this.calcSpringForce(t,t.idealLength)},h.prototype.calcRepulsionForces=function(){var t,e,r,n,o,s=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],h=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&s&&this.updateGrid(),o=new Set,t=0;t<h.length;t++)r=h[t],this.calculateRepulsionForceOfANode(r,o,s,a),o.add(r);else for(t=0;t<h.length;t++)for(r=h[t],e=t+1;e<h.length;e++)n=h[e],r.getOwner()==n.getOwner()&&this.calcRepulsionForce(r,n)},h.prototype.calcGravitationalForces=function(){for(var t,e=this.getAllNodesToApplyGravitation(),r=0;r<e.length;r++)t=e[r],this.calcGravitationalForce(t)},h.prototype.moveNodes=function(){for(var t=this.getAllNodes(),e=0;e<t.length;e++)t[e].move()},h.prototype.calcSpringForce=function(t,e){var r,n,i,o,s=t.getSource(),a=t.getTarget();if(this.uniformLeafNodeSizes&&null==s.getChild()&&null==a.getChild())t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;0!=(r=t.getLength())&&(i=(n=this.springConstant*(r-e))*(t.lengthX/r),o=n*(t.lengthY/r),s.springForceX+=i,s.springForceY+=o,a.springForceX-=i,a.springForceY-=o)},h.prototype.calcRepulsionForce=function(t,e){var r,n,o,h,u,l,g,c=t.getRect(),p=e.getRect(),f=new Array(2),d=new Array(4);if(c.intersects(p)){s.calcSeparationAmount(c,p,f,i.DEFAULT_EDGE_LENGTH/2),l=2*f[0],g=2*f[1];var y=t.noOfChildren*e.noOfChildren/(t.noOfChildren+e.noOfChildren);t.repulsionForceX-=y*l,t.repulsionForceY-=y*g,e.repulsionForceX+=y*l,e.repulsionForceY+=y*g}else this.uniformLeafNodeSizes&&null==t.getChild()&&null==e.getChild()?(r=p.getCenterX()-c.getCenterX(),n=p.getCenterY()-c.getCenterY()):(s.getIntersection(c,p,d),r=d[2]-d[0],n=d[3]-d[1]),Math.abs(r)<i.MIN_REPULSION_DIST&&(r=a.sign(r)*i.MIN_REPULSION_DIST),Math.abs(n)<i.MIN_REPULSION_DIST&&(n=a.sign(n)*i.MIN_REPULSION_DIST),o=r*r+n*n,h=Math.sqrt(o),l=(u=this.repulsionConstant*t.noOfChildren*e.noOfChildren/o)*r/h,g=u*n/h,t.repulsionForceX-=l,t.repulsionForceY-=g,e.repulsionForceX+=l,e.repulsionForceY+=g},h.prototype.calcGravitationalForce=function(t){var e,r,n,i,o,s,a,h;r=((e=t.getOwner()).getRight()+e.getLeft())/2,n=(e.getTop()+e.getBottom())/2,i=t.getCenterX()-r,o=t.getCenterY()-n,s=Math.abs(i)+t.getWidth()/2,a=Math.abs(o)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(s>(h=e.getEstimatedSize()*this.gravityRangeFactor)||a>h)&&(t.gravitationForceX=-this.gravityConstant*i,t.gravitationForceY=-this.gravityConstant*o):(s>(h=e.getEstimatedSize()*this.compoundGravityRangeFactor)||a>h)&&(t.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*o*this.compoundGravityConstant)},h.prototype.isConverged=function(){var t,e=!1;return this.totalIterations>this.maxIterations/3&&(e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||e},h.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},h.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,e=this.graphManager.getAllNodes(),r=0;r<e.length;r++)(t=e[r]).noOfChildren=t.getNoOfChildren()},h.prototype.calcGrid=function(t){var e,r;e=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),r=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var n=new Array(e),i=0;i<e;i++)n[i]=new Array(r);for(i=0;i<e;i++)for(var o=0;o<r;o++)n[i][o]=new Array;return n},h.prototype.addNodeToGrid=function(t,e,r){var n,i,o,s;n=parseInt(Math.floor((t.getRect().x-e)/this.repulsionRange)),i=parseInt(Math.floor((t.getRect().width+t.getRect().x-e)/this.repulsionRange)),o=parseInt(Math.floor((t.getRect().y-r)/this.repulsionRange)),s=parseInt(Math.floor((t.getRect().height+t.getRect().y-r)/this.repulsionRange));for(var a=n;a<=i;a++)for(var h=o;h<=s;h++)this.grid[a][h].push(t),t.setGridCoordinates(n,i,o,s)},h.prototype.updateGrid=function(){var t,e,r=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<r.length;t++)e=r[t],this.addNodeToGrid(e,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},h.prototype.calculateRepulsionForceOfANode=function(t,e,r,n){if(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&r||n){var o,s=new Set;t.surrounding=new Array;for(var a=this.grid,h=t.startX-1;h<t.finishX+2;h++)for(var u=t.startY-1;u<t.finishY+2;u++)if(!(h<0||u<0||h>=a.length||u>=a[0].length))for(var l=0;l<a[h][u].length;l++)if(o=a[h][u][l],t.getOwner()==o.getOwner()&&t!=o&&!e.has(o)&&!s.has(o)){var g=Math.abs(t.getCenterX()-o.getCenterX())-(t.getWidth()/2+o.getWidth()/2),c=Math.abs(t.getCenterY()-o.getCenterY())-(t.getHeight()/2+o.getHeight()/2);g<=this.repulsionRange&&c<=this.repulsionRange&&s.add(o)}t.surrounding=[].concat(function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}(s))}for(h=0;h<t.surrounding.length;h++)this.calcRepulsionForce(t,t.surrounding[h])},h.prototype.calcRepulsionRange=function(){return 0},t.exports=h},function(t,e,r){var n=r(1),i=r(7);function o(t,e,r){n.call(this,t,e,r),this.idealLength=i.DEFAULT_EDGE_LENGTH}for(var s in o.prototype=Object.create(n.prototype),n)o[s]=n[s];t.exports=o},function(t,e,r){var n=r(3);function i(t,e,r,i){n.call(this,t,e,r,i),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var o in i.prototype=Object.create(n.prototype),n)i[o]=n[o];i.prototype.setGridCoordinates=function(t,e,r,n){this.startX=t,this.finishX=e,this.startY=r,this.finishY=n},t.exports=i},function(t,e,r){function n(t,e){this.width=0,this.height=0,null!==t&&null!==e&&(this.height=e,this.width=t)}n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(t){this.width=t},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(t){this.height=t},t.exports=n},function(t,e,r){var n=r(14);function i(){this.map={},this.keys=[]}i.prototype.put=function(t,e){var r=n.createID(t);this.contains(r)||(this.map[r]=e,this.keys.push(t))},i.prototype.contains=function(t){return n.createID(t),null!=this.map[t]},i.prototype.get=function(t){var e=n.createID(t);return this.map[e]},i.prototype.keySet=function(){return this.keys},t.exports=i},function(t,e,r){var n=r(14);function i(){this.set={}}i.prototype.add=function(t){var e=n.createID(t);this.contains(e)||(this.set[e]=t)},i.prototype.remove=function(t){delete this.set[n.createID(t)]},i.prototype.clear=function(){this.set={}},i.prototype.contains=function(t){return this.set[n.createID(t)]==t},i.prototype.isEmpty=function(){return 0===this.size()},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAllTo=function(t){for(var e=Object.keys(this.set),r=e.length,n=0;n<r;n++)t.push(this.set[e[n]])},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAll=function(t){for(var e=t.length,r=0;r<e;r++){var n=t[r];this.add(n)}},t.exports=i},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=r(11),o=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),null===r&&void 0===r||(this.compareFunction=this._defaultCompareFunction);var n=void 0;n=e instanceof i?e.size():e.length,this._quicksort(e,0,n-1)}return n(t,[{key:"_quicksort",value:function(t,e,r){if(e<r){var n=this._partition(t,e,r);this._quicksort(t,e,n),this._quicksort(t,n+1,r)}}},{key:"_partition",value:function(t,e,r){for(var n=this._get(t,e),i=e,o=r;;){for(;this.compareFunction(n,this._get(t,o));)o--;for(;this.compareFunction(this._get(t,i),n);)i++;if(!(i<o))return o;this._swap(t,i,o),i++,o--}}},{key:"_get",value:function(t,e){return t instanceof i?t.get_object_at(e):t[e]}},{key:"_set",value:function(t,e,r){t instanceof i?t.set_object_at(e,r):t[e]=r}},{key:"_swap",value:function(t,e,r){var n=this._get(t,e);this._set(t,e,this._get(t,r)),this._set(t,r,n)}},{key:"_defaultCompareFunction",value:function(t,e){return e>t}}]),t}();t.exports=o},function(t,e,r){var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=function(){function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.sequence1=e,this.sequence2=r,this.match_score=n,this.mismatch_penalty=i,this.gap_penalty=o,this.iMax=e.length+1,this.jMax=r.length+1,this.grid=new Array(this.iMax);for(var s=0;s<this.iMax;s++){this.grid[s]=new Array(this.jMax);for(var a=0;a<this.jMax;a++)this.grid[s][a]=0}this.tracebackGrid=new Array(this.iMax);for(var h=0;h<this.iMax;h++){this.tracebackGrid[h]=new Array(this.jMax);for(var u=0;u<this.jMax;u++)this.tracebackGrid[h][u]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return n(t,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var t=1;t<this.jMax;t++)this.grid[0][t]=this.grid[0][t-1]+this.gap_penalty,this.tracebackGrid[0][t]=[!1,!1,!0];for(var e=1;e<this.iMax;e++)this.grid[e][0]=this.grid[e-1][0]+this.gap_penalty,this.tracebackGrid[e][0]=[!1,!0,!1];for(var r=1;r<this.iMax;r++)for(var n=1;n<this.jMax;n++){var i=[this.sequence1[r-1]===this.sequence2[n-1]?this.grid[r-1][n-1]+this.match_score:this.grid[r-1][n-1]+this.mismatch_penalty,this.grid[r-1][n]+this.gap_penalty,this.grid[r][n-1]+this.gap_penalty],o=this.arrayAllMaxIndexes(i);this.grid[r][n]=i[o[0]],this.tracebackGrid[r][n]=[o.includes(0),o.includes(1),o.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var t=[];for(t.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});t[0];){var e=t[0],r=this.tracebackGrid[e.pos[0]][e.pos[1]];r[0]&&t.push({pos:[e.pos[0]-1,e.pos[1]-1],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),r[1]&&t.push({pos:[e.pos[0]-1,e.pos[1]],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:"-"+e.seq2}),r[2]&&t.push({pos:[e.pos[0],e.pos[1]-1],seq1:"-"+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),0===e.pos[0]&&0===e.pos[1]&&this.alignments.push({sequence1:e.seq1,sequence2:e.seq2}),t.shift()}return this.alignments}},{key:"getAllIndexes",value:function(t,e){for(var r=[],n=-1;-1!==(n=t.indexOf(e,n+1));)r.push(n);return r}},{key:"arrayAllMaxIndexes",value:function(t){return this.getAllIndexes(t,Math.max.apply(null,t))}}]),t}();t.exports=i},function(t,e,r){var n=function(){};n.FDLayout=r(18),n.FDLayoutConstants=r(7),n.FDLayoutEdge=r(19),n.FDLayoutNode=r(20),n.DimensionD=r(21),n.HashMap=r(22),n.HashSet=r(23),n.IGeometry=r(8),n.IMath=r(9),n.Integer=r(10),n.Point=r(12),n.PointD=r(4),n.RandomSeed=r(16),n.RectangleD=r(13),n.Transform=r(17),n.UniqueIDGeneretor=r(14),n.Quicksort=r(24),n.LinkedList=r(11),n.LGraphObject=r(2),n.LGraph=r(5),n.LEdge=r(1),n.LGraphManager=r(6),n.LNode=r(3),n.Layout=r(15),n.LayoutConstants=r(0),n.NeedlemanWunsch=r(25),t.exports=n},function(t,e,r){function n(){this.listeners=[]}var i=n.prototype;i.addListener=function(t,e){this.listeners.push({event:t,callback:e})},i.removeListener=function(t,e){for(var r=this.listeners.length;r>=0;r--){var n=this.listeners[r];n.event===t&&n.callback===e&&this.listeners.splice(r,1)}},i.emit=function(t,e){for(var r=0;r<this.listeners.length;r++){var n=this.listeners[r];t===n.event&&n.callback(e)}},t.exports=n}])},t.exports=n()),e.exports;var t,n}e.exports;export{n as __require};
|