markdown-flow-ui 0.1.123 → 0.1.124

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.
Files changed (26) hide show
  1. package/dist/components/Slide/Player.cjs.js +1 -1
  2. package/dist/components/Slide/Player.cjs.js.map +1 -1
  3. package/dist/components/Slide/Player.es.js +191 -201
  4. package/dist/components/Slide/Player.es.js.map +1 -1
  5. package/dist/components/Slide/Slide.cjs.js +1 -1
  6. package/dist/components/Slide/Slide.cjs.js.map +1 -1
  7. package/dist/components/Slide/Slide.es.js +116 -116
  8. package/dist/components/Slide/Slide.es.js.map +1 -1
  9. package/dist/components/Slide/utils/playbackPreference.cjs.js +1 -1
  10. package/dist/components/Slide/utils/playbackPreference.cjs.js.map +1 -1
  11. package/dist/components/Slide/utils/playbackPreference.d.ts +1 -6
  12. package/dist/components/Slide/utils/playbackPreference.es.js +4 -9
  13. package/dist/components/Slide/utils/playbackPreference.es.js.map +1 -1
  14. package/dist/node_modules/cose-base/cose-base.cjs.js +1 -1
  15. package/dist/node_modules/cose-base/cose-base.cjs.js.map +1 -1
  16. package/dist/node_modules/cose-base/cose-base.es.js +1 -1
  17. package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs.js +1 -1
  18. package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs.js.map +1 -1
  19. package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.es.js +1 -1
  20. package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs.js +1 -1
  21. package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs.js.map +1 -1
  22. package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.es.js +1 -1
  23. package/dist/node_modules/layout-base/layout-base.cjs.js +1 -1
  24. package/dist/node_modules/layout-base/layout-base.cjs.js.map +1 -1
  25. package/dist/node_modules/layout-base/layout-base.es.js +1 -1
  26. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"cose-base.cjs.js","sources":["../../../node_modules/cose-base/cose-base.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"layout-base\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"layout-base\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"coseBase\"] = factory(require(\"layout-base\"));\n\telse\n\t\troot[\"coseBase\"] = factory(root[\"layoutBase\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_0__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 7);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_0__;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar FDLayoutConstants = __webpack_require__(0).FDLayoutConstants;\n\nfunction CoSEConstants() {}\n\n//CoSEConstants inherits static props in FDLayoutConstants\nfor (var prop in FDLayoutConstants) {\n CoSEConstants[prop] = FDLayoutConstants[prop];\n}\n\nCoSEConstants.DEFAULT_USE_MULTI_LEVEL_SCALING = false;\nCoSEConstants.DEFAULT_RADIAL_SEPARATION = FDLayoutConstants.DEFAULT_EDGE_LENGTH;\nCoSEConstants.DEFAULT_COMPONENT_SEPERATION = 60;\nCoSEConstants.TILE = true;\nCoSEConstants.TILING_PADDING_VERTICAL = 10;\nCoSEConstants.TILING_PADDING_HORIZONTAL = 10;\nCoSEConstants.TREE_REDUCTION_ON_INCREMENTAL = false; // make this true when cose is used incrementally as a part of other non-incremental layout\n\nmodule.exports = CoSEConstants;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar FDLayoutEdge = __webpack_require__(0).FDLayoutEdge;\n\nfunction CoSEEdge(source, target, vEdge) {\n FDLayoutEdge.call(this, source, target, vEdge);\n}\n\nCoSEEdge.prototype = Object.create(FDLayoutEdge.prototype);\nfor (var prop in FDLayoutEdge) {\n CoSEEdge[prop] = FDLayoutEdge[prop];\n}\n\nmodule.exports = CoSEEdge;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LGraph = __webpack_require__(0).LGraph;\n\nfunction CoSEGraph(parent, graphMgr, vGraph) {\n LGraph.call(this, parent, graphMgr, vGraph);\n}\n\nCoSEGraph.prototype = Object.create(LGraph.prototype);\nfor (var prop in LGraph) {\n CoSEGraph[prop] = LGraph[prop];\n}\n\nmodule.exports = CoSEGraph;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LGraphManager = __webpack_require__(0).LGraphManager;\n\nfunction CoSEGraphManager(layout) {\n LGraphManager.call(this, layout);\n}\n\nCoSEGraphManager.prototype = Object.create(LGraphManager.prototype);\nfor (var prop in LGraphManager) {\n CoSEGraphManager[prop] = LGraphManager[prop];\n}\n\nmodule.exports = CoSEGraphManager;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar FDLayoutNode = __webpack_require__(0).FDLayoutNode;\nvar IMath = __webpack_require__(0).IMath;\n\nfunction CoSENode(gm, loc, size, vNode) {\n FDLayoutNode.call(this, gm, loc, size, vNode);\n}\n\nCoSENode.prototype = Object.create(FDLayoutNode.prototype);\nfor (var prop in FDLayoutNode) {\n CoSENode[prop] = FDLayoutNode[prop];\n}\n\nCoSENode.prototype.move = function () {\n var layout = this.graphManager.getLayout();\n this.displacementX = layout.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren;\n this.displacementY = layout.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren;\n\n if (Math.abs(this.displacementX) > layout.coolingFactor * layout.maxNodeDisplacement) {\n this.displacementX = layout.coolingFactor * layout.maxNodeDisplacement * IMath.sign(this.displacementX);\n }\n\n if (Math.abs(this.displacementY) > layout.coolingFactor * layout.maxNodeDisplacement) {\n this.displacementY = layout.coolingFactor * layout.maxNodeDisplacement * IMath.sign(this.displacementY);\n }\n\n // a simple node, just move it\n if (this.child == null) {\n this.moveBy(this.displacementX, this.displacementY);\n }\n // an empty compound node, again just move it\n else if (this.child.getNodes().length == 0) {\n this.moveBy(this.displacementX, this.displacementY);\n }\n // non-empty compound node, propogate movement to children as well\n else {\n this.propogateDisplacementToChildren(this.displacementX, this.displacementY);\n }\n\n layout.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY);\n\n this.springForceX = 0;\n this.springForceY = 0;\n this.repulsionForceX = 0;\n this.repulsionForceY = 0;\n this.gravitationForceX = 0;\n this.gravitationForceY = 0;\n this.displacementX = 0;\n this.displacementY = 0;\n};\n\nCoSENode.prototype.propogateDisplacementToChildren = function (dX, dY) {\n var nodes = this.getChild().getNodes();\n var node;\n for (var i = 0; i < nodes.length; i++) {\n node = nodes[i];\n if (node.getChild() == null) {\n node.moveBy(dX, dY);\n node.displacementX += dX;\n node.displacementY += dY;\n } else {\n node.propogateDisplacementToChildren(dX, dY);\n }\n }\n};\n\nCoSENode.prototype.setPred1 = function (pred1) {\n this.pred1 = pred1;\n};\n\nCoSENode.prototype.getPred1 = function () {\n return pred1;\n};\n\nCoSENode.prototype.getPred2 = function () {\n return pred2;\n};\n\nCoSENode.prototype.setNext = function (next) {\n this.next = next;\n};\n\nCoSENode.prototype.getNext = function () {\n return next;\n};\n\nCoSENode.prototype.setProcessed = function (processed) {\n this.processed = processed;\n};\n\nCoSENode.prototype.isProcessed = function () {\n return processed;\n};\n\nmodule.exports = CoSENode;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar FDLayout = __webpack_require__(0).FDLayout;\nvar CoSEGraphManager = __webpack_require__(4);\nvar CoSEGraph = __webpack_require__(3);\nvar CoSENode = __webpack_require__(5);\nvar CoSEEdge = __webpack_require__(2);\nvar CoSEConstants = __webpack_require__(1);\nvar FDLayoutConstants = __webpack_require__(0).FDLayoutConstants;\nvar LayoutConstants = __webpack_require__(0).LayoutConstants;\nvar Point = __webpack_require__(0).Point;\nvar PointD = __webpack_require__(0).PointD;\nvar Layout = __webpack_require__(0).Layout;\nvar Integer = __webpack_require__(0).Integer;\nvar IGeometry = __webpack_require__(0).IGeometry;\nvar LGraph = __webpack_require__(0).LGraph;\nvar Transform = __webpack_require__(0).Transform;\n\nfunction CoSELayout() {\n FDLayout.call(this);\n\n this.toBeTiled = {}; // Memorize if a node is to be tiled or is tiled\n}\n\nCoSELayout.prototype = Object.create(FDLayout.prototype);\n\nfor (var prop in FDLayout) {\n CoSELayout[prop] = FDLayout[prop];\n}\n\nCoSELayout.prototype.newGraphManager = function () {\n var gm = new CoSEGraphManager(this);\n this.graphManager = gm;\n return gm;\n};\n\nCoSELayout.prototype.newGraph = function (vGraph) {\n return new CoSEGraph(null, this.graphManager, vGraph);\n};\n\nCoSELayout.prototype.newNode = function (vNode) {\n return new CoSENode(this.graphManager, vNode);\n};\n\nCoSELayout.prototype.newEdge = function (vEdge) {\n return new CoSEEdge(null, null, vEdge);\n};\n\nCoSELayout.prototype.initParameters = function () {\n FDLayout.prototype.initParameters.call(this, arguments);\n if (!this.isSubLayout) {\n if (CoSEConstants.DEFAULT_EDGE_LENGTH < 10) {\n this.idealEdgeLength = 10;\n } else {\n this.idealEdgeLength = CoSEConstants.DEFAULT_EDGE_LENGTH;\n }\n\n this.useSmartIdealEdgeLengthCalculation = CoSEConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION;\n this.springConstant = FDLayoutConstants.DEFAULT_SPRING_STRENGTH;\n this.repulsionConstant = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH;\n this.gravityConstant = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH;\n this.compoundGravityConstant = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH;\n this.gravityRangeFactor = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR;\n this.compoundGravityRangeFactor = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR;\n\n // variables for tree reduction support\n this.prunedNodesAll = [];\n this.growTreeIterations = 0;\n this.afterGrowthIterations = 0;\n this.isTreeGrowing = false;\n this.isGrowthFinished = false;\n\n // variables for cooling\n this.coolingCycle = 0;\n this.maxCoolingCycle = this.maxIterations / FDLayoutConstants.CONVERGENCE_CHECK_PERIOD;\n this.finalTemperature = FDLayoutConstants.CONVERGENCE_CHECK_PERIOD / this.maxIterations;\n this.coolingAdjuster = 1;\n }\n};\n\nCoSELayout.prototype.layout = function () {\n var createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED;\n if (createBendsAsNeeded) {\n this.createBendpoints();\n this.graphManager.resetAllEdges();\n }\n\n this.level = 0;\n return this.classicLayout();\n};\n\nCoSELayout.prototype.classicLayout = function () {\n this.nodesWithGravity = this.calculateNodesToApplyGravitationTo();\n this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity);\n this.calcNoOfChildrenForAllNodes();\n this.graphManager.calcLowestCommonAncestors();\n this.graphManager.calcInclusionTreeDepths();\n this.graphManager.getRoot().calcEstimatedSize();\n this.calcIdealEdgeLengths();\n\n if (!this.incremental) {\n var forest = this.getFlatForest();\n\n // The graph associated with this layout is flat and a forest\n if (forest.length > 0) {\n this.positionNodesRadially(forest);\n }\n // The graph associated with this layout is not flat or a forest\n else {\n // Reduce the trees when incremental mode is not enabled and graph is not a forest \n this.reduceTrees();\n // Update nodes that gravity will be applied\n this.graphManager.resetAllNodesToApplyGravitation();\n var allNodes = new Set(this.getAllNodes());\n var intersection = this.nodesWithGravity.filter(function (x) {\n return allNodes.has(x);\n });\n this.graphManager.setAllNodesToApplyGravitation(intersection);\n\n this.positionNodesRandomly();\n }\n } else {\n if (CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL) {\n // Reduce the trees in incremental mode if only this constant is set to true \n this.reduceTrees();\n // Update nodes that gravity will be applied\n this.graphManager.resetAllNodesToApplyGravitation();\n var allNodes = new Set(this.getAllNodes());\n var intersection = this.nodesWithGravity.filter(function (x) {\n return allNodes.has(x);\n });\n this.graphManager.setAllNodesToApplyGravitation(intersection);\n }\n }\n\n this.initSpringEmbedder();\n this.runSpringEmbedder();\n\n return true;\n};\n\nCoSELayout.prototype.tick = function () {\n this.totalIterations++;\n\n if (this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) {\n if (this.prunedNodesAll.length > 0) {\n this.isTreeGrowing = true;\n } else {\n return true;\n }\n }\n\n if (this.totalIterations % FDLayoutConstants.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {\n if (this.isConverged()) {\n if (this.prunedNodesAll.length > 0) {\n this.isTreeGrowing = true;\n } else {\n return true;\n }\n }\n\n this.coolingCycle++;\n\n if (this.layoutQuality == 0) {\n // quality - \"draft\"\n this.coolingAdjuster = this.coolingCycle;\n } else if (this.layoutQuality == 1) {\n // quality - \"default\"\n this.coolingAdjuster = this.coolingCycle / 3;\n }\n\n // cooling schedule is based on http://www.btluke.com/simanf1.html -> cooling schedule 3\n 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);\n this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor));\n }\n // Operations while tree is growing again \n if (this.isTreeGrowing) {\n if (this.growTreeIterations % 10 == 0) {\n if (this.prunedNodesAll.length > 0) {\n this.graphManager.updateBounds();\n this.updateGrid();\n this.growTree(this.prunedNodesAll);\n // Update nodes that gravity will be applied\n this.graphManager.resetAllNodesToApplyGravitation();\n var allNodes = new Set(this.getAllNodes());\n var intersection = this.nodesWithGravity.filter(function (x) {\n return allNodes.has(x);\n });\n this.graphManager.setAllNodesToApplyGravitation(intersection);\n\n this.graphManager.updateBounds();\n this.updateGrid();\n this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL;\n } else {\n this.isTreeGrowing = false;\n this.isGrowthFinished = true;\n }\n }\n this.growTreeIterations++;\n }\n // Operations after growth is finished\n if (this.isGrowthFinished) {\n if (this.isConverged()) {\n return true;\n }\n if (this.afterGrowthIterations % 10 == 0) {\n this.graphManager.updateBounds();\n this.updateGrid();\n }\n this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100);\n this.afterGrowthIterations++;\n }\n\n var gridUpdateAllowed = !this.isTreeGrowing && !this.isGrowthFinished;\n var forceToNodeSurroundingUpdate = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;\n\n this.totalDisplacement = 0;\n this.graphManager.updateBounds();\n this.calcSpringForces();\n this.calcRepulsionForces(gridUpdateAllowed, forceToNodeSurroundingUpdate);\n this.calcGravitationalForces();\n this.moveNodes();\n this.animate();\n\n return false; // Layout is not ended yet return false\n};\n\nCoSELayout.prototype.getPositionsData = function () {\n var allNodes = this.graphManager.getAllNodes();\n var pData = {};\n for (var i = 0; i < allNodes.length; i++) {\n var rect = allNodes[i].rect;\n var id = allNodes[i].id;\n pData[id] = {\n id: id,\n x: rect.getCenterX(),\n y: rect.getCenterY(),\n w: rect.width,\n h: rect.height\n };\n }\n\n return pData;\n};\n\nCoSELayout.prototype.runSpringEmbedder = function () {\n this.initialAnimationPeriod = 25;\n this.animationPeriod = this.initialAnimationPeriod;\n var layoutEnded = false;\n\n // If aminate option is 'during' signal that layout is supposed to start iterating\n if (FDLayoutConstants.ANIMATE === 'during') {\n this.emit('layoutstarted');\n } else {\n // If aminate option is 'during' tick() function will be called on index.js\n while (!layoutEnded) {\n layoutEnded = this.tick();\n }\n\n this.graphManager.updateBounds();\n }\n};\n\nCoSELayout.prototype.calculateNodesToApplyGravitationTo = function () {\n var nodeList = [];\n var graph;\n\n var graphs = this.graphManager.getGraphs();\n var size = graphs.length;\n var i;\n for (i = 0; i < size; i++) {\n graph = graphs[i];\n\n graph.updateConnected();\n\n if (!graph.isConnected) {\n nodeList = nodeList.concat(graph.getNodes());\n }\n }\n\n return nodeList;\n};\n\nCoSELayout.prototype.createBendpoints = function () {\n var edges = [];\n edges = edges.concat(this.graphManager.getAllEdges());\n var visited = new Set();\n var i;\n for (i = 0; i < edges.length; i++) {\n var edge = edges[i];\n\n if (!visited.has(edge)) {\n var source = edge.getSource();\n var target = edge.getTarget();\n\n if (source == target) {\n edge.getBendpoints().push(new PointD());\n edge.getBendpoints().push(new PointD());\n this.createDummyNodesForBendpoints(edge);\n visited.add(edge);\n } else {\n var edgeList = [];\n\n edgeList = edgeList.concat(source.getEdgeListToNode(target));\n edgeList = edgeList.concat(target.getEdgeListToNode(source));\n\n if (!visited.has(edgeList[0])) {\n if (edgeList.length > 1) {\n var k;\n for (k = 0; k < edgeList.length; k++) {\n var multiEdge = edgeList[k];\n multiEdge.getBendpoints().push(new PointD());\n this.createDummyNodesForBendpoints(multiEdge);\n }\n }\n edgeList.forEach(function (edge) {\n visited.add(edge);\n });\n }\n }\n }\n\n if (visited.size == edges.length) {\n break;\n }\n }\n};\n\nCoSELayout.prototype.positionNodesRadially = function (forest) {\n // We tile the trees to a grid row by row; first tree starts at (0,0)\n var currentStartingPoint = new Point(0, 0);\n var numberOfColumns = Math.ceil(Math.sqrt(forest.length));\n var height = 0;\n var currentY = 0;\n var currentX = 0;\n var point = new PointD(0, 0);\n\n for (var i = 0; i < forest.length; i++) {\n if (i % numberOfColumns == 0) {\n // Start of a new row, make the x coordinate 0, increment the\n // y coordinate with the max height of the previous row\n currentX = 0;\n currentY = height;\n\n if (i != 0) {\n currentY += CoSEConstants.DEFAULT_COMPONENT_SEPERATION;\n }\n\n height = 0;\n }\n\n var tree = forest[i];\n\n // Find the center of the tree\n var centerNode = Layout.findCenterOfTree(tree);\n\n // Set the staring point of the next tree\n currentStartingPoint.x = currentX;\n currentStartingPoint.y = currentY;\n\n // Do a radial layout starting with the center\n point = CoSELayout.radialLayout(tree, centerNode, currentStartingPoint);\n\n if (point.y > height) {\n height = Math.floor(point.y);\n }\n\n currentX = Math.floor(point.x + CoSEConstants.DEFAULT_COMPONENT_SEPERATION);\n }\n\n this.transform(new PointD(LayoutConstants.WORLD_CENTER_X - point.x / 2, LayoutConstants.WORLD_CENTER_Y - point.y / 2));\n};\n\nCoSELayout.radialLayout = function (tree, centerNode, startingPoint) {\n var radialSep = Math.max(this.maxDiagonalInTree(tree), CoSEConstants.DEFAULT_RADIAL_SEPARATION);\n CoSELayout.branchRadialLayout(centerNode, null, 0, 359, 0, radialSep);\n var bounds = LGraph.calculateBounds(tree);\n\n var transform = new Transform();\n transform.setDeviceOrgX(bounds.getMinX());\n transform.setDeviceOrgY(bounds.getMinY());\n transform.setWorldOrgX(startingPoint.x);\n transform.setWorldOrgY(startingPoint.y);\n\n for (var i = 0; i < tree.length; i++) {\n var node = tree[i];\n node.transform(transform);\n }\n\n var bottomRight = new PointD(bounds.getMaxX(), bounds.getMaxY());\n\n return transform.inverseTransformPoint(bottomRight);\n};\n\nCoSELayout.branchRadialLayout = function (node, parentOfNode, startAngle, endAngle, distance, radialSeparation) {\n // First, position this node by finding its angle.\n var halfInterval = (endAngle - startAngle + 1) / 2;\n\n if (halfInterval < 0) {\n halfInterval += 180;\n }\n\n var nodeAngle = (halfInterval + startAngle) % 360;\n var teta = nodeAngle * IGeometry.TWO_PI / 360;\n\n // Make polar to java cordinate conversion.\n var cos_teta = Math.cos(teta);\n var x_ = distance * Math.cos(teta);\n var y_ = distance * Math.sin(teta);\n\n node.setCenter(x_, y_);\n\n // Traverse all neighbors of this node and recursively call this\n // function.\n var neighborEdges = [];\n neighborEdges = neighborEdges.concat(node.getEdges());\n var childCount = neighborEdges.length;\n\n if (parentOfNode != null) {\n childCount--;\n }\n\n var branchCount = 0;\n\n var incEdgesCount = neighborEdges.length;\n var startIndex;\n\n var edges = node.getEdgesBetween(parentOfNode);\n\n // If there are multiple edges, prune them until there remains only one\n // edge.\n while (edges.length > 1) {\n //neighborEdges.remove(edges.remove(0));\n var temp = edges[0];\n edges.splice(0, 1);\n var index = neighborEdges.indexOf(temp);\n if (index >= 0) {\n neighborEdges.splice(index, 1);\n }\n incEdgesCount--;\n childCount--;\n }\n\n if (parentOfNode != null) {\n //assert edges.length == 1;\n startIndex = (neighborEdges.indexOf(edges[0]) + 1) % incEdgesCount;\n } else {\n startIndex = 0;\n }\n\n var stepAngle = Math.abs(endAngle - startAngle) / childCount;\n\n for (var i = startIndex; branchCount != childCount; i = ++i % incEdgesCount) {\n var currentNeighbor = neighborEdges[i].getOtherEnd(node);\n\n // Don't back traverse to root node in current tree.\n if (currentNeighbor == parentOfNode) {\n continue;\n }\n\n var childStartAngle = (startAngle + branchCount * stepAngle) % 360;\n var childEndAngle = (childStartAngle + stepAngle) % 360;\n\n CoSELayout.branchRadialLayout(currentNeighbor, node, childStartAngle, childEndAngle, distance + radialSeparation, radialSeparation);\n\n branchCount++;\n }\n};\n\nCoSELayout.maxDiagonalInTree = function (tree) {\n var maxDiagonal = Integer.MIN_VALUE;\n\n for (var i = 0; i < tree.length; i++) {\n var node = tree[i];\n var diagonal = node.getDiagonal();\n\n if (diagonal > maxDiagonal) {\n maxDiagonal = diagonal;\n }\n }\n\n return maxDiagonal;\n};\n\nCoSELayout.prototype.calcRepulsionRange = function () {\n // formula is 2 x (level + 1) x idealEdgeLength\n return 2 * (this.level + 1) * this.idealEdgeLength;\n};\n\n// Tiling methods\n\n// Group zero degree members whose parents are not to be tiled, create dummy parents where needed and fill memberGroups by their dummp parent id's\nCoSELayout.prototype.groupZeroDegreeMembers = function () {\n var self = this;\n // array of [parent_id x oneDegreeNode_id]\n var tempMemberGroups = {}; // A temporary map of parent node and its zero degree members\n this.memberGroups = {}; // A map of dummy parent node and its zero degree members whose parents are not to be tiled\n this.idToDummyNode = {}; // A map of id to dummy node \n\n var zeroDegree = []; // List of zero degree nodes whose parents are not to be tiled\n var allNodes = this.graphManager.getAllNodes();\n\n // Fill zero degree list\n for (var i = 0; i < allNodes.length; i++) {\n var node = allNodes[i];\n var parent = node.getParent();\n // If a node has zero degree and its parent is not to be tiled if exists add that node to zeroDegres list\n if (this.getNodeDegreeWithChildren(node) === 0 && (parent.id == undefined || !this.getToBeTiled(parent))) {\n zeroDegree.push(node);\n }\n }\n\n // Create a map of parent node and its zero degree members\n for (var i = 0; i < zeroDegree.length; i++) {\n var node = zeroDegree[i]; // Zero degree node itself\n var p_id = node.getParent().id; // Parent id\n\n if (typeof tempMemberGroups[p_id] === \"undefined\") tempMemberGroups[p_id] = [];\n\n tempMemberGroups[p_id] = tempMemberGroups[p_id].concat(node); // Push node to the list belongs to its parent in tempMemberGroups\n }\n\n // If there are at least two nodes at a level, create a dummy compound for them\n Object.keys(tempMemberGroups).forEach(function (p_id) {\n if (tempMemberGroups[p_id].length > 1) {\n var dummyCompoundId = \"DummyCompound_\" + p_id; // The id of dummy compound which will be created soon\n self.memberGroups[dummyCompoundId] = tempMemberGroups[p_id]; // Add dummy compound to memberGroups\n\n var parent = tempMemberGroups[p_id][0].getParent(); // The parent of zero degree nodes will be the parent of new dummy compound\n\n // Create a dummy compound with calculated id\n var dummyCompound = new CoSENode(self.graphManager);\n dummyCompound.id = dummyCompoundId;\n dummyCompound.paddingLeft = parent.paddingLeft || 0;\n dummyCompound.paddingRight = parent.paddingRight || 0;\n dummyCompound.paddingBottom = parent.paddingBottom || 0;\n dummyCompound.paddingTop = parent.paddingTop || 0;\n\n self.idToDummyNode[dummyCompoundId] = dummyCompound;\n\n var dummyParentGraph = self.getGraphManager().add(self.newGraph(), dummyCompound);\n var parentGraph = parent.getChild();\n\n // Add dummy compound to parent the graph\n parentGraph.add(dummyCompound);\n\n // For each zero degree node in this level remove it from its parent graph and add it to the graph of dummy parent\n for (var i = 0; i < tempMemberGroups[p_id].length; i++) {\n var node = tempMemberGroups[p_id][i];\n\n parentGraph.remove(node);\n dummyParentGraph.add(node);\n }\n }\n });\n};\n\nCoSELayout.prototype.clearCompounds = function () {\n var childGraphMap = {};\n var idToNode = {};\n\n // Get compound ordering by finding the inner one first\n this.performDFSOnCompounds();\n\n for (var i = 0; i < this.compoundOrder.length; i++) {\n\n idToNode[this.compoundOrder[i].id] = this.compoundOrder[i];\n childGraphMap[this.compoundOrder[i].id] = [].concat(this.compoundOrder[i].getChild().getNodes());\n\n // Remove children of compounds\n this.graphManager.remove(this.compoundOrder[i].getChild());\n this.compoundOrder[i].child = null;\n }\n\n this.graphManager.resetAllNodes();\n\n // Tile the removed children\n this.tileCompoundMembers(childGraphMap, idToNode);\n};\n\nCoSELayout.prototype.clearZeroDegreeMembers = function () {\n var self = this;\n var tiledZeroDegreePack = this.tiledZeroDegreePack = [];\n\n Object.keys(this.memberGroups).forEach(function (id) {\n var compoundNode = self.idToDummyNode[id]; // Get the dummy compound\n\n tiledZeroDegreePack[id] = self.tileNodes(self.memberGroups[id], compoundNode.paddingLeft + compoundNode.paddingRight);\n\n // Set the width and height of the dummy compound as calculated\n compoundNode.rect.width = tiledZeroDegreePack[id].width;\n compoundNode.rect.height = tiledZeroDegreePack[id].height;\n });\n};\n\nCoSELayout.prototype.repopulateCompounds = function () {\n for (var i = this.compoundOrder.length - 1; i >= 0; i--) {\n var lCompoundNode = this.compoundOrder[i];\n var id = lCompoundNode.id;\n var horizontalMargin = lCompoundNode.paddingLeft;\n var verticalMargin = lCompoundNode.paddingTop;\n\n this.adjustLocations(this.tiledMemberPack[id], lCompoundNode.rect.x, lCompoundNode.rect.y, horizontalMargin, verticalMargin);\n }\n};\n\nCoSELayout.prototype.repopulateZeroDegreeMembers = function () {\n var self = this;\n var tiledPack = this.tiledZeroDegreePack;\n\n Object.keys(tiledPack).forEach(function (id) {\n var compoundNode = self.idToDummyNode[id]; // Get the dummy compound by its id\n var horizontalMargin = compoundNode.paddingLeft;\n var verticalMargin = compoundNode.paddingTop;\n\n // Adjust the positions of nodes wrt its compound\n self.adjustLocations(tiledPack[id], compoundNode.rect.x, compoundNode.rect.y, horizontalMargin, verticalMargin);\n });\n};\n\nCoSELayout.prototype.getToBeTiled = function (node) {\n var id = node.id;\n //firstly check the previous results\n if (this.toBeTiled[id] != null) {\n return this.toBeTiled[id];\n }\n\n //only compound nodes are to be tiled\n var childGraph = node.getChild();\n if (childGraph == null) {\n this.toBeTiled[id] = false;\n return false;\n }\n\n var children = childGraph.getNodes(); // Get the children nodes\n\n //a compound node is not to be tiled if all of its compound children are not to be tiled\n for (var i = 0; i < children.length; i++) {\n var theChild = children[i];\n\n if (this.getNodeDegree(theChild) > 0) {\n this.toBeTiled[id] = false;\n return false;\n }\n\n //pass the children not having the compound structure\n if (theChild.getChild() == null) {\n this.toBeTiled[theChild.id] = false;\n continue;\n }\n\n if (!this.getToBeTiled(theChild)) {\n this.toBeTiled[id] = false;\n return false;\n }\n }\n this.toBeTiled[id] = true;\n return true;\n};\n\n// Get degree of a node depending of its edges and independent of its children\nCoSELayout.prototype.getNodeDegree = function (node) {\n var id = node.id;\n var edges = node.getEdges();\n var degree = 0;\n\n // For the edges connected\n for (var i = 0; i < edges.length; i++) {\n var edge = edges[i];\n if (edge.getSource().id !== edge.getTarget().id) {\n degree = degree + 1;\n }\n }\n return degree;\n};\n\n// Get degree of a node with its children\nCoSELayout.prototype.getNodeDegreeWithChildren = function (node) {\n var degree = this.getNodeDegree(node);\n if (node.getChild() == null) {\n return degree;\n }\n var children = node.getChild().getNodes();\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n degree += this.getNodeDegreeWithChildren(child);\n }\n return degree;\n};\n\nCoSELayout.prototype.performDFSOnCompounds = function () {\n this.compoundOrder = [];\n this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());\n};\n\nCoSELayout.prototype.fillCompexOrderByDFS = function (children) {\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (child.getChild() != null) {\n this.fillCompexOrderByDFS(child.getChild().getNodes());\n }\n if (this.getToBeTiled(child)) {\n this.compoundOrder.push(child);\n }\n }\n};\n\n/**\n* This method places each zero degree member wrt given (x,y) coordinates (top left).\n*/\nCoSELayout.prototype.adjustLocations = function (organization, x, y, compoundHorizontalMargin, compoundVerticalMargin) {\n x += compoundHorizontalMargin;\n y += compoundVerticalMargin;\n\n var left = x;\n\n for (var i = 0; i < organization.rows.length; i++) {\n var row = organization.rows[i];\n x = left;\n var maxHeight = 0;\n\n for (var j = 0; j < row.length; j++) {\n var lnode = row[j];\n\n lnode.rect.x = x; // + lnode.rect.width / 2;\n lnode.rect.y = y; // + lnode.rect.height / 2;\n\n x += lnode.rect.width + organization.horizontalPadding;\n\n if (lnode.rect.height > maxHeight) maxHeight = lnode.rect.height;\n }\n\n y += maxHeight + organization.verticalPadding;\n }\n};\n\nCoSELayout.prototype.tileCompoundMembers = function (childGraphMap, idToNode) {\n var self = this;\n this.tiledMemberPack = [];\n\n Object.keys(childGraphMap).forEach(function (id) {\n // Get the compound node\n var compoundNode = idToNode[id];\n\n self.tiledMemberPack[id] = self.tileNodes(childGraphMap[id], compoundNode.paddingLeft + compoundNode.paddingRight);\n\n compoundNode.rect.width = self.tiledMemberPack[id].width;\n compoundNode.rect.height = self.tiledMemberPack[id].height;\n });\n};\n\nCoSELayout.prototype.tileNodes = function (nodes, minWidth) {\n var verticalPadding = CoSEConstants.TILING_PADDING_VERTICAL;\n var horizontalPadding = CoSEConstants.TILING_PADDING_HORIZONTAL;\n var organization = {\n rows: [],\n rowWidth: [],\n rowHeight: [],\n width: 0,\n height: minWidth, // assume minHeight equals to minWidth\n verticalPadding: verticalPadding,\n horizontalPadding: horizontalPadding\n };\n\n // Sort the nodes in ascending order of their areas\n nodes.sort(function (n1, n2) {\n if (n1.rect.width * n1.rect.height > n2.rect.width * n2.rect.height) return -1;\n if (n1.rect.width * n1.rect.height < n2.rect.width * n2.rect.height) return 1;\n return 0;\n });\n\n // Create the organization -> tile members\n for (var i = 0; i < nodes.length; i++) {\n var lNode = nodes[i];\n\n if (organization.rows.length == 0) {\n this.insertNodeToRow(organization, lNode, 0, minWidth);\n } else if (this.canAddHorizontal(organization, lNode.rect.width, lNode.rect.height)) {\n this.insertNodeToRow(organization, lNode, this.getShortestRowIndex(organization), minWidth);\n } else {\n this.insertNodeToRow(organization, lNode, organization.rows.length, minWidth);\n }\n\n this.shiftToLastRow(organization);\n }\n\n return organization;\n};\n\nCoSELayout.prototype.insertNodeToRow = function (organization, node, rowIndex, minWidth) {\n var minCompoundSize = minWidth;\n\n // Add new row if needed\n if (rowIndex == organization.rows.length) {\n var secondDimension = [];\n\n organization.rows.push(secondDimension);\n organization.rowWidth.push(minCompoundSize);\n organization.rowHeight.push(0);\n }\n\n // Update row width\n var w = organization.rowWidth[rowIndex] + node.rect.width;\n\n if (organization.rows[rowIndex].length > 0) {\n w += organization.horizontalPadding;\n }\n\n organization.rowWidth[rowIndex] = w;\n // Update compound width\n if (organization.width < w) {\n organization.width = w;\n }\n\n // Update height\n var h = node.rect.height;\n if (rowIndex > 0) h += organization.verticalPadding;\n\n var extraHeight = 0;\n if (h > organization.rowHeight[rowIndex]) {\n extraHeight = organization.rowHeight[rowIndex];\n organization.rowHeight[rowIndex] = h;\n extraHeight = organization.rowHeight[rowIndex] - extraHeight;\n }\n\n organization.height += extraHeight;\n\n // Insert node\n organization.rows[rowIndex].push(node);\n};\n\n//Scans the rows of an organization and returns the one with the min width\nCoSELayout.prototype.getShortestRowIndex = function (organization) {\n var r = -1;\n var min = Number.MAX_VALUE;\n\n for (var i = 0; i < organization.rows.length; i++) {\n if (organization.rowWidth[i] < min) {\n r = i;\n min = organization.rowWidth[i];\n }\n }\n return r;\n};\n\n//Scans the rows of an organization and returns the one with the max width\nCoSELayout.prototype.getLongestRowIndex = function (organization) {\n var r = -1;\n var max = Number.MIN_VALUE;\n\n for (var i = 0; i < organization.rows.length; i++) {\n\n if (organization.rowWidth[i] > max) {\n r = i;\n max = organization.rowWidth[i];\n }\n }\n\n return r;\n};\n\n/**\n* This method checks whether adding extra width to the organization violates\n* the aspect ratio(1) or not.\n*/\nCoSELayout.prototype.canAddHorizontal = function (organization, extraWidth, extraHeight) {\n\n var sri = this.getShortestRowIndex(organization);\n\n if (sri < 0) {\n return true;\n }\n\n var min = organization.rowWidth[sri];\n\n if (min + organization.horizontalPadding + extraWidth <= organization.width) return true;\n\n var hDiff = 0;\n\n // Adding to an existing row\n if (organization.rowHeight[sri] < extraHeight) {\n if (sri > 0) hDiff = extraHeight + organization.verticalPadding - organization.rowHeight[sri];\n }\n\n var add_to_row_ratio;\n if (organization.width - min >= extraWidth + organization.horizontalPadding) {\n add_to_row_ratio = (organization.height + hDiff) / (min + extraWidth + organization.horizontalPadding);\n } else {\n add_to_row_ratio = (organization.height + hDiff) / organization.width;\n }\n\n // Adding a new row for this node\n hDiff = extraHeight + organization.verticalPadding;\n var add_new_row_ratio;\n if (organization.width < extraWidth) {\n add_new_row_ratio = (organization.height + hDiff) / extraWidth;\n } else {\n add_new_row_ratio = (organization.height + hDiff) / organization.width;\n }\n\n if (add_new_row_ratio < 1) add_new_row_ratio = 1 / add_new_row_ratio;\n\n if (add_to_row_ratio < 1) add_to_row_ratio = 1 / add_to_row_ratio;\n\n return add_to_row_ratio < add_new_row_ratio;\n};\n\n//If moving the last node from the longest row and adding it to the last\n//row makes the bounding box smaller, do it.\nCoSELayout.prototype.shiftToLastRow = function (organization) {\n var longest = this.getLongestRowIndex(organization);\n var last = organization.rowWidth.length - 1;\n var row = organization.rows[longest];\n var node = row[row.length - 1];\n\n var diff = node.width + organization.horizontalPadding;\n\n // Check if there is enough space on the last row\n if (organization.width - organization.rowWidth[last] > diff && longest != last) {\n // Remove the last element of the longest row\n row.splice(-1, 1);\n\n // Push it to the last row\n organization.rows[last].push(node);\n\n organization.rowWidth[longest] = organization.rowWidth[longest] - diff;\n organization.rowWidth[last] = organization.rowWidth[last] + diff;\n organization.width = organization.rowWidth[instance.getLongestRowIndex(organization)];\n\n // Update heights of the organization\n var maxHeight = Number.MIN_VALUE;\n for (var i = 0; i < row.length; i++) {\n if (row[i].height > maxHeight) maxHeight = row[i].height;\n }\n if (longest > 0) maxHeight += organization.verticalPadding;\n\n var prevTotal = organization.rowHeight[longest] + organization.rowHeight[last];\n\n organization.rowHeight[longest] = maxHeight;\n if (organization.rowHeight[last] < node.height + organization.verticalPadding) organization.rowHeight[last] = node.height + organization.verticalPadding;\n\n var finalTotal = organization.rowHeight[longest] + organization.rowHeight[last];\n organization.height += finalTotal - prevTotal;\n\n this.shiftToLastRow(organization);\n }\n};\n\nCoSELayout.prototype.tilingPreLayout = function () {\n if (CoSEConstants.TILE) {\n // Find zero degree nodes and create a compound for each level\n this.groupZeroDegreeMembers();\n // Tile and clear children of each compound\n this.clearCompounds();\n // Separately tile and clear zero degree nodes for each level\n this.clearZeroDegreeMembers();\n }\n};\n\nCoSELayout.prototype.tilingPostLayout = function () {\n if (CoSEConstants.TILE) {\n this.repopulateZeroDegreeMembers();\n this.repopulateCompounds();\n }\n};\n\n// -----------------------------------------------------------------------------\n// Section: Tree Reduction methods\n// -----------------------------------------------------------------------------\n// Reduce trees \nCoSELayout.prototype.reduceTrees = function () {\n var prunedNodesAll = [];\n var containsLeaf = true;\n var node;\n\n while (containsLeaf) {\n var allNodes = this.graphManager.getAllNodes();\n var prunedNodesInStepTemp = [];\n containsLeaf = false;\n\n for (var i = 0; i < allNodes.length; i++) {\n node = allNodes[i];\n if (node.getEdges().length == 1 && !node.getEdges()[0].isInterGraph && node.getChild() == null) {\n prunedNodesInStepTemp.push([node, node.getEdges()[0], node.getOwner()]);\n containsLeaf = true;\n }\n }\n if (containsLeaf == true) {\n var prunedNodesInStep = [];\n for (var j = 0; j < prunedNodesInStepTemp.length; j++) {\n if (prunedNodesInStepTemp[j][0].getEdges().length == 1) {\n prunedNodesInStep.push(prunedNodesInStepTemp[j]);\n prunedNodesInStepTemp[j][0].getOwner().remove(prunedNodesInStepTemp[j][0]);\n }\n }\n prunedNodesAll.push(prunedNodesInStep);\n this.graphManager.resetAllNodes();\n this.graphManager.resetAllEdges();\n }\n }\n this.prunedNodesAll = prunedNodesAll;\n};\n\n// Grow tree one step \nCoSELayout.prototype.growTree = function (prunedNodesAll) {\n var lengthOfPrunedNodesInStep = prunedNodesAll.length;\n var prunedNodesInStep = prunedNodesAll[lengthOfPrunedNodesInStep - 1];\n\n var nodeData;\n for (var i = 0; i < prunedNodesInStep.length; i++) {\n nodeData = prunedNodesInStep[i];\n\n this.findPlaceforPrunedNode(nodeData);\n\n nodeData[2].add(nodeData[0]);\n nodeData[2].add(nodeData[1], nodeData[1].source, nodeData[1].target);\n }\n\n prunedNodesAll.splice(prunedNodesAll.length - 1, 1);\n this.graphManager.resetAllNodes();\n this.graphManager.resetAllEdges();\n};\n\n// Find an appropriate position to replace pruned node, this method can be improved\nCoSELayout.prototype.findPlaceforPrunedNode = function (nodeData) {\n\n var gridForPrunedNode;\n var nodeToConnect;\n var prunedNode = nodeData[0];\n if (prunedNode == nodeData[1].source) {\n nodeToConnect = nodeData[1].target;\n } else {\n nodeToConnect = nodeData[1].source;\n }\n var startGridX = nodeToConnect.startX;\n var finishGridX = nodeToConnect.finishX;\n var startGridY = nodeToConnect.startY;\n var finishGridY = nodeToConnect.finishY;\n\n var upNodeCount = 0;\n var downNodeCount = 0;\n var rightNodeCount = 0;\n var leftNodeCount = 0;\n var controlRegions = [upNodeCount, rightNodeCount, downNodeCount, leftNodeCount];\n\n if (startGridY > 0) {\n for (var i = startGridX; i <= finishGridX; i++) {\n controlRegions[0] += this.grid[i][startGridY - 1].length + this.grid[i][startGridY].length - 1;\n }\n }\n if (finishGridX < this.grid.length - 1) {\n for (var i = startGridY; i <= finishGridY; i++) {\n controlRegions[1] += this.grid[finishGridX + 1][i].length + this.grid[finishGridX][i].length - 1;\n }\n }\n if (finishGridY < this.grid[0].length - 1) {\n for (var i = startGridX; i <= finishGridX; i++) {\n controlRegions[2] += this.grid[i][finishGridY + 1].length + this.grid[i][finishGridY].length - 1;\n }\n }\n if (startGridX > 0) {\n for (var i = startGridY; i <= finishGridY; i++) {\n controlRegions[3] += this.grid[startGridX - 1][i].length + this.grid[startGridX][i].length - 1;\n }\n }\n var min = Integer.MAX_VALUE;\n var minCount;\n var minIndex;\n for (var j = 0; j < controlRegions.length; j++) {\n if (controlRegions[j] < min) {\n min = controlRegions[j];\n minCount = 1;\n minIndex = j;\n } else if (controlRegions[j] == min) {\n minCount++;\n }\n }\n\n if (minCount == 3 && min == 0) {\n if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[2] == 0) {\n gridForPrunedNode = 1;\n } else if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[3] == 0) {\n gridForPrunedNode = 0;\n } else if (controlRegions[0] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) {\n gridForPrunedNode = 3;\n } else if (controlRegions[1] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) {\n gridForPrunedNode = 2;\n }\n } else if (minCount == 2 && min == 0) {\n var random = Math.floor(Math.random() * 2);\n if (controlRegions[0] == 0 && controlRegions[1] == 0) {\n ;\n if (random == 0) {\n gridForPrunedNode = 0;\n } else {\n gridForPrunedNode = 1;\n }\n } else if (controlRegions[0] == 0 && controlRegions[2] == 0) {\n if (random == 0) {\n gridForPrunedNode = 0;\n } else {\n gridForPrunedNode = 2;\n }\n } else if (controlRegions[0] == 0 && controlRegions[3] == 0) {\n if (random == 0) {\n gridForPrunedNode = 0;\n } else {\n gridForPrunedNode = 3;\n }\n } else if (controlRegions[1] == 0 && controlRegions[2] == 0) {\n if (random == 0) {\n gridForPrunedNode = 1;\n } else {\n gridForPrunedNode = 2;\n }\n } else if (controlRegions[1] == 0 && controlRegions[3] == 0) {\n if (random == 0) {\n gridForPrunedNode = 1;\n } else {\n gridForPrunedNode = 3;\n }\n } else {\n if (random == 0) {\n gridForPrunedNode = 2;\n } else {\n gridForPrunedNode = 3;\n }\n }\n } else if (minCount == 4 && min == 0) {\n var random = Math.floor(Math.random() * 4);\n gridForPrunedNode = random;\n } else {\n gridForPrunedNode = minIndex;\n }\n\n if (gridForPrunedNode == 0) {\n prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() - nodeToConnect.getHeight() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getHeight() / 2);\n } else if (gridForPrunedNode == 1) {\n prunedNode.setCenter(nodeToConnect.getCenterX() + nodeToConnect.getWidth() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getWidth() / 2, nodeToConnect.getCenterY());\n } else if (gridForPrunedNode == 2) {\n prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() + nodeToConnect.getHeight() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getHeight() / 2);\n } else {\n prunedNode.setCenter(nodeToConnect.getCenterX() - nodeToConnect.getWidth() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getWidth() / 2, nodeToConnect.getCenterY());\n }\n};\n\nmodule.exports = CoSELayout;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar coseBase = {};\n\ncoseBase.layoutBase = __webpack_require__(0);\ncoseBase.CoSEConstants = __webpack_require__(1);\ncoseBase.CoSEEdge = __webpack_require__(2);\ncoseBase.CoSEGraph = __webpack_require__(3);\ncoseBase.CoSEGraphManager = __webpack_require__(4);\ncoseBase.CoSELayout = __webpack_require__(6);\ncoseBase.CoSENode = __webpack_require__(5);\n\nmodule.exports = coseBase;\n\n/***/ })\n/******/ ]);\n});"],"names":["root","factory","module","require$$0","this","__WEBPACK_EXTERNAL_MODULE_0__","modules","installedModules","__webpack_require__","moduleId","value","exports","name","getter","object","property","FDLayoutConstants","CoSEConstants","prop","FDLayoutEdge","CoSEEdge","source","target","vEdge","LGraph","CoSEGraph","parent","graphMgr","vGraph","LGraphManager","CoSEGraphManager","layout","FDLayoutNode","IMath","CoSENode","gm","loc","size","vNode","dX","dY","nodes","node","i","pred1","next","processed","FDLayout","LayoutConstants","Point","PointD","Layout","Integer","IGeometry","Transform","CoSELayout","createBendsAsNeeded","allNodes","intersection","x","forest","gridUpdateAllowed","forceToNodeSurroundingUpdate","pData","rect","id","layoutEnded","nodeList","graph","graphs","edges","visited","edge","edgeList","k","multiEdge","currentStartingPoint","numberOfColumns","height","currentY","currentX","point","tree","centerNode","startingPoint","radialSep","bounds","transform","bottomRight","parentOfNode","startAngle","endAngle","distance","radialSeparation","halfInterval","nodeAngle","teta","x_","y_","neighborEdges","childCount","branchCount","incEdgesCount","startIndex","temp","index","stepAngle","currentNeighbor","childStartAngle","childEndAngle","maxDiagonal","diagonal","self","tempMemberGroups","zeroDegree","p_id","dummyCompoundId","dummyCompound","dummyParentGraph","parentGraph","childGraphMap","idToNode","tiledZeroDegreePack","compoundNode","lCompoundNode","horizontalMargin","verticalMargin","tiledPack","childGraph","children","theChild","degree","child","organization","y","compoundHorizontalMargin","compoundVerticalMargin","left","row","maxHeight","j","lnode","minWidth","verticalPadding","horizontalPadding","n1","n2","lNode","rowIndex","minCompoundSize","secondDimension","w","extraHeight","r","min","max","extraWidth","sri","hDiff","add_to_row_ratio","add_new_row_ratio","longest","last","diff","prevTotal","finalTotal","prunedNodesAll","containsLeaf","prunedNodesInStepTemp","prunedNodesInStep","lengthOfPrunedNodesInStep","nodeData","gridForPrunedNode","nodeToConnect","prunedNode","startGridX","finishGridX","startGridY","finishGridY","upNodeCount","downNodeCount","rightNodeCount","leftNodeCount","controlRegions","minCount","minIndex","random","coseBase"],"mappings":"0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AAqB,CAKtD,IAAImL,EAAW,CAAA,EAEfA,EAAS,WAAanL,EAAoB,CAAC,EAC3CmL,EAAS,cAAgBnL,EAAoB,CAAC,EAC9CmL,EAAS,SAAWnL,EAAoB,CAAC,EACzCmL,EAAS,UAAYnL,EAAoB,CAAC,EAC1CmL,EAAS,iBAAmBnL,EAAoB,CAAC,EACjDmL,EAAS,WAAanL,EAAoB,CAAC,EAC3CmL,EAAS,SAAWnL,EAAoB,CAAC,EAEzCN,EAAO,QAAUyL,CAEjB,EACA,CAAU,CACV,CAAC","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"cose-base.cjs.js","sources":["../../../node_modules/cose-base/cose-base.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"layout-base\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"layout-base\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"coseBase\"] = factory(require(\"layout-base\"));\n\telse\n\t\troot[\"coseBase\"] = factory(root[\"layoutBase\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_0__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 7);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_0__;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar FDLayoutConstants = __webpack_require__(0).FDLayoutConstants;\n\nfunction CoSEConstants() {}\n\n//CoSEConstants inherits static props in FDLayoutConstants\nfor (var prop in FDLayoutConstants) {\n CoSEConstants[prop] = FDLayoutConstants[prop];\n}\n\nCoSEConstants.DEFAULT_USE_MULTI_LEVEL_SCALING = false;\nCoSEConstants.DEFAULT_RADIAL_SEPARATION = FDLayoutConstants.DEFAULT_EDGE_LENGTH;\nCoSEConstants.DEFAULT_COMPONENT_SEPERATION = 60;\nCoSEConstants.TILE = true;\nCoSEConstants.TILING_PADDING_VERTICAL = 10;\nCoSEConstants.TILING_PADDING_HORIZONTAL = 10;\nCoSEConstants.TREE_REDUCTION_ON_INCREMENTAL = false; // make this true when cose is used incrementally as a part of other non-incremental layout\n\nmodule.exports = CoSEConstants;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar FDLayoutEdge = __webpack_require__(0).FDLayoutEdge;\n\nfunction CoSEEdge(source, target, vEdge) {\n FDLayoutEdge.call(this, source, target, vEdge);\n}\n\nCoSEEdge.prototype = Object.create(FDLayoutEdge.prototype);\nfor (var prop in FDLayoutEdge) {\n CoSEEdge[prop] = FDLayoutEdge[prop];\n}\n\nmodule.exports = CoSEEdge;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LGraph = __webpack_require__(0).LGraph;\n\nfunction CoSEGraph(parent, graphMgr, vGraph) {\n LGraph.call(this, parent, graphMgr, vGraph);\n}\n\nCoSEGraph.prototype = Object.create(LGraph.prototype);\nfor (var prop in LGraph) {\n CoSEGraph[prop] = LGraph[prop];\n}\n\nmodule.exports = CoSEGraph;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LGraphManager = __webpack_require__(0).LGraphManager;\n\nfunction CoSEGraphManager(layout) {\n LGraphManager.call(this, layout);\n}\n\nCoSEGraphManager.prototype = Object.create(LGraphManager.prototype);\nfor (var prop in LGraphManager) {\n CoSEGraphManager[prop] = LGraphManager[prop];\n}\n\nmodule.exports = CoSEGraphManager;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar FDLayoutNode = __webpack_require__(0).FDLayoutNode;\nvar IMath = __webpack_require__(0).IMath;\n\nfunction CoSENode(gm, loc, size, vNode) {\n FDLayoutNode.call(this, gm, loc, size, vNode);\n}\n\nCoSENode.prototype = Object.create(FDLayoutNode.prototype);\nfor (var prop in FDLayoutNode) {\n CoSENode[prop] = FDLayoutNode[prop];\n}\n\nCoSENode.prototype.move = function () {\n var layout = this.graphManager.getLayout();\n this.displacementX = layout.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren;\n this.displacementY = layout.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren;\n\n if (Math.abs(this.displacementX) > layout.coolingFactor * layout.maxNodeDisplacement) {\n this.displacementX = layout.coolingFactor * layout.maxNodeDisplacement * IMath.sign(this.displacementX);\n }\n\n if (Math.abs(this.displacementY) > layout.coolingFactor * layout.maxNodeDisplacement) {\n this.displacementY = layout.coolingFactor * layout.maxNodeDisplacement * IMath.sign(this.displacementY);\n }\n\n // a simple node, just move it\n if (this.child == null) {\n this.moveBy(this.displacementX, this.displacementY);\n }\n // an empty compound node, again just move it\n else if (this.child.getNodes().length == 0) {\n this.moveBy(this.displacementX, this.displacementY);\n }\n // non-empty compound node, propogate movement to children as well\n else {\n this.propogateDisplacementToChildren(this.displacementX, this.displacementY);\n }\n\n layout.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY);\n\n this.springForceX = 0;\n this.springForceY = 0;\n this.repulsionForceX = 0;\n this.repulsionForceY = 0;\n this.gravitationForceX = 0;\n this.gravitationForceY = 0;\n this.displacementX = 0;\n this.displacementY = 0;\n};\n\nCoSENode.prototype.propogateDisplacementToChildren = function (dX, dY) {\n var nodes = this.getChild().getNodes();\n var node;\n for (var i = 0; i < nodes.length; i++) {\n node = nodes[i];\n if (node.getChild() == null) {\n node.moveBy(dX, dY);\n node.displacementX += dX;\n node.displacementY += dY;\n } else {\n node.propogateDisplacementToChildren(dX, dY);\n }\n }\n};\n\nCoSENode.prototype.setPred1 = function (pred1) {\n this.pred1 = pred1;\n};\n\nCoSENode.prototype.getPred1 = function () {\n return pred1;\n};\n\nCoSENode.prototype.getPred2 = function () {\n return pred2;\n};\n\nCoSENode.prototype.setNext = function (next) {\n this.next = next;\n};\n\nCoSENode.prototype.getNext = function () {\n return next;\n};\n\nCoSENode.prototype.setProcessed = function (processed) {\n this.processed = processed;\n};\n\nCoSENode.prototype.isProcessed = function () {\n return processed;\n};\n\nmodule.exports = CoSENode;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar FDLayout = __webpack_require__(0).FDLayout;\nvar CoSEGraphManager = __webpack_require__(4);\nvar CoSEGraph = __webpack_require__(3);\nvar CoSENode = __webpack_require__(5);\nvar CoSEEdge = __webpack_require__(2);\nvar CoSEConstants = __webpack_require__(1);\nvar FDLayoutConstants = __webpack_require__(0).FDLayoutConstants;\nvar LayoutConstants = __webpack_require__(0).LayoutConstants;\nvar Point = __webpack_require__(0).Point;\nvar PointD = __webpack_require__(0).PointD;\nvar Layout = __webpack_require__(0).Layout;\nvar Integer = __webpack_require__(0).Integer;\nvar IGeometry = __webpack_require__(0).IGeometry;\nvar LGraph = __webpack_require__(0).LGraph;\nvar Transform = __webpack_require__(0).Transform;\n\nfunction CoSELayout() {\n FDLayout.call(this);\n\n this.toBeTiled = {}; // Memorize if a node is to be tiled or is tiled\n}\n\nCoSELayout.prototype = Object.create(FDLayout.prototype);\n\nfor (var prop in FDLayout) {\n CoSELayout[prop] = FDLayout[prop];\n}\n\nCoSELayout.prototype.newGraphManager = function () {\n var gm = new CoSEGraphManager(this);\n this.graphManager = gm;\n return gm;\n};\n\nCoSELayout.prototype.newGraph = function (vGraph) {\n return new CoSEGraph(null, this.graphManager, vGraph);\n};\n\nCoSELayout.prototype.newNode = function (vNode) {\n return new CoSENode(this.graphManager, vNode);\n};\n\nCoSELayout.prototype.newEdge = function (vEdge) {\n return new CoSEEdge(null, null, vEdge);\n};\n\nCoSELayout.prototype.initParameters = function () {\n FDLayout.prototype.initParameters.call(this, arguments);\n if (!this.isSubLayout) {\n if (CoSEConstants.DEFAULT_EDGE_LENGTH < 10) {\n this.idealEdgeLength = 10;\n } else {\n this.idealEdgeLength = CoSEConstants.DEFAULT_EDGE_LENGTH;\n }\n\n this.useSmartIdealEdgeLengthCalculation = CoSEConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION;\n this.springConstant = FDLayoutConstants.DEFAULT_SPRING_STRENGTH;\n this.repulsionConstant = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH;\n this.gravityConstant = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH;\n this.compoundGravityConstant = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH;\n this.gravityRangeFactor = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR;\n this.compoundGravityRangeFactor = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR;\n\n // variables for tree reduction support\n this.prunedNodesAll = [];\n this.growTreeIterations = 0;\n this.afterGrowthIterations = 0;\n this.isTreeGrowing = false;\n this.isGrowthFinished = false;\n\n // variables for cooling\n this.coolingCycle = 0;\n this.maxCoolingCycle = this.maxIterations / FDLayoutConstants.CONVERGENCE_CHECK_PERIOD;\n this.finalTemperature = FDLayoutConstants.CONVERGENCE_CHECK_PERIOD / this.maxIterations;\n this.coolingAdjuster = 1;\n }\n};\n\nCoSELayout.prototype.layout = function () {\n var createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED;\n if (createBendsAsNeeded) {\n this.createBendpoints();\n this.graphManager.resetAllEdges();\n }\n\n this.level = 0;\n return this.classicLayout();\n};\n\nCoSELayout.prototype.classicLayout = function () {\n this.nodesWithGravity = this.calculateNodesToApplyGravitationTo();\n this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity);\n this.calcNoOfChildrenForAllNodes();\n this.graphManager.calcLowestCommonAncestors();\n this.graphManager.calcInclusionTreeDepths();\n this.graphManager.getRoot().calcEstimatedSize();\n this.calcIdealEdgeLengths();\n\n if (!this.incremental) {\n var forest = this.getFlatForest();\n\n // The graph associated with this layout is flat and a forest\n if (forest.length > 0) {\n this.positionNodesRadially(forest);\n }\n // The graph associated with this layout is not flat or a forest\n else {\n // Reduce the trees when incremental mode is not enabled and graph is not a forest \n this.reduceTrees();\n // Update nodes that gravity will be applied\n this.graphManager.resetAllNodesToApplyGravitation();\n var allNodes = new Set(this.getAllNodes());\n var intersection = this.nodesWithGravity.filter(function (x) {\n return allNodes.has(x);\n });\n this.graphManager.setAllNodesToApplyGravitation(intersection);\n\n this.positionNodesRandomly();\n }\n } else {\n if (CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL) {\n // Reduce the trees in incremental mode if only this constant is set to true \n this.reduceTrees();\n // Update nodes that gravity will be applied\n this.graphManager.resetAllNodesToApplyGravitation();\n var allNodes = new Set(this.getAllNodes());\n var intersection = this.nodesWithGravity.filter(function (x) {\n return allNodes.has(x);\n });\n this.graphManager.setAllNodesToApplyGravitation(intersection);\n }\n }\n\n this.initSpringEmbedder();\n this.runSpringEmbedder();\n\n return true;\n};\n\nCoSELayout.prototype.tick = function () {\n this.totalIterations++;\n\n if (this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) {\n if (this.prunedNodesAll.length > 0) {\n this.isTreeGrowing = true;\n } else {\n return true;\n }\n }\n\n if (this.totalIterations % FDLayoutConstants.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {\n if (this.isConverged()) {\n if (this.prunedNodesAll.length > 0) {\n this.isTreeGrowing = true;\n } else {\n return true;\n }\n }\n\n this.coolingCycle++;\n\n if (this.layoutQuality == 0) {\n // quality - \"draft\"\n this.coolingAdjuster = this.coolingCycle;\n } else if (this.layoutQuality == 1) {\n // quality - \"default\"\n this.coolingAdjuster = this.coolingCycle / 3;\n }\n\n // cooling schedule is based on http://www.btluke.com/simanf1.html -> cooling schedule 3\n 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);\n this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor));\n }\n // Operations while tree is growing again \n if (this.isTreeGrowing) {\n if (this.growTreeIterations % 10 == 0) {\n if (this.prunedNodesAll.length > 0) {\n this.graphManager.updateBounds();\n this.updateGrid();\n this.growTree(this.prunedNodesAll);\n // Update nodes that gravity will be applied\n this.graphManager.resetAllNodesToApplyGravitation();\n var allNodes = new Set(this.getAllNodes());\n var intersection = this.nodesWithGravity.filter(function (x) {\n return allNodes.has(x);\n });\n this.graphManager.setAllNodesToApplyGravitation(intersection);\n\n this.graphManager.updateBounds();\n this.updateGrid();\n this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL;\n } else {\n this.isTreeGrowing = false;\n this.isGrowthFinished = true;\n }\n }\n this.growTreeIterations++;\n }\n // Operations after growth is finished\n if (this.isGrowthFinished) {\n if (this.isConverged()) {\n return true;\n }\n if (this.afterGrowthIterations % 10 == 0) {\n this.graphManager.updateBounds();\n this.updateGrid();\n }\n this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100);\n this.afterGrowthIterations++;\n }\n\n var gridUpdateAllowed = !this.isTreeGrowing && !this.isGrowthFinished;\n var forceToNodeSurroundingUpdate = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;\n\n this.totalDisplacement = 0;\n this.graphManager.updateBounds();\n this.calcSpringForces();\n this.calcRepulsionForces(gridUpdateAllowed, forceToNodeSurroundingUpdate);\n this.calcGravitationalForces();\n this.moveNodes();\n this.animate();\n\n return false; // Layout is not ended yet return false\n};\n\nCoSELayout.prototype.getPositionsData = function () {\n var allNodes = this.graphManager.getAllNodes();\n var pData = {};\n for (var i = 0; i < allNodes.length; i++) {\n var rect = allNodes[i].rect;\n var id = allNodes[i].id;\n pData[id] = {\n id: id,\n x: rect.getCenterX(),\n y: rect.getCenterY(),\n w: rect.width,\n h: rect.height\n };\n }\n\n return pData;\n};\n\nCoSELayout.prototype.runSpringEmbedder = function () {\n this.initialAnimationPeriod = 25;\n this.animationPeriod = this.initialAnimationPeriod;\n var layoutEnded = false;\n\n // If aminate option is 'during' signal that layout is supposed to start iterating\n if (FDLayoutConstants.ANIMATE === 'during') {\n this.emit('layoutstarted');\n } else {\n // If aminate option is 'during' tick() function will be called on index.js\n while (!layoutEnded) {\n layoutEnded = this.tick();\n }\n\n this.graphManager.updateBounds();\n }\n};\n\nCoSELayout.prototype.calculateNodesToApplyGravitationTo = function () {\n var nodeList = [];\n var graph;\n\n var graphs = this.graphManager.getGraphs();\n var size = graphs.length;\n var i;\n for (i = 0; i < size; i++) {\n graph = graphs[i];\n\n graph.updateConnected();\n\n if (!graph.isConnected) {\n nodeList = nodeList.concat(graph.getNodes());\n }\n }\n\n return nodeList;\n};\n\nCoSELayout.prototype.createBendpoints = function () {\n var edges = [];\n edges = edges.concat(this.graphManager.getAllEdges());\n var visited = new Set();\n var i;\n for (i = 0; i < edges.length; i++) {\n var edge = edges[i];\n\n if (!visited.has(edge)) {\n var source = edge.getSource();\n var target = edge.getTarget();\n\n if (source == target) {\n edge.getBendpoints().push(new PointD());\n edge.getBendpoints().push(new PointD());\n this.createDummyNodesForBendpoints(edge);\n visited.add(edge);\n } else {\n var edgeList = [];\n\n edgeList = edgeList.concat(source.getEdgeListToNode(target));\n edgeList = edgeList.concat(target.getEdgeListToNode(source));\n\n if (!visited.has(edgeList[0])) {\n if (edgeList.length > 1) {\n var k;\n for (k = 0; k < edgeList.length; k++) {\n var multiEdge = edgeList[k];\n multiEdge.getBendpoints().push(new PointD());\n this.createDummyNodesForBendpoints(multiEdge);\n }\n }\n edgeList.forEach(function (edge) {\n visited.add(edge);\n });\n }\n }\n }\n\n if (visited.size == edges.length) {\n break;\n }\n }\n};\n\nCoSELayout.prototype.positionNodesRadially = function (forest) {\n // We tile the trees to a grid row by row; first tree starts at (0,0)\n var currentStartingPoint = new Point(0, 0);\n var numberOfColumns = Math.ceil(Math.sqrt(forest.length));\n var height = 0;\n var currentY = 0;\n var currentX = 0;\n var point = new PointD(0, 0);\n\n for (var i = 0; i < forest.length; i++) {\n if (i % numberOfColumns == 0) {\n // Start of a new row, make the x coordinate 0, increment the\n // y coordinate with the max height of the previous row\n currentX = 0;\n currentY = height;\n\n if (i != 0) {\n currentY += CoSEConstants.DEFAULT_COMPONENT_SEPERATION;\n }\n\n height = 0;\n }\n\n var tree = forest[i];\n\n // Find the center of the tree\n var centerNode = Layout.findCenterOfTree(tree);\n\n // Set the staring point of the next tree\n currentStartingPoint.x = currentX;\n currentStartingPoint.y = currentY;\n\n // Do a radial layout starting with the center\n point = CoSELayout.radialLayout(tree, centerNode, currentStartingPoint);\n\n if (point.y > height) {\n height = Math.floor(point.y);\n }\n\n currentX = Math.floor(point.x + CoSEConstants.DEFAULT_COMPONENT_SEPERATION);\n }\n\n this.transform(new PointD(LayoutConstants.WORLD_CENTER_X - point.x / 2, LayoutConstants.WORLD_CENTER_Y - point.y / 2));\n};\n\nCoSELayout.radialLayout = function (tree, centerNode, startingPoint) {\n var radialSep = Math.max(this.maxDiagonalInTree(tree), CoSEConstants.DEFAULT_RADIAL_SEPARATION);\n CoSELayout.branchRadialLayout(centerNode, null, 0, 359, 0, radialSep);\n var bounds = LGraph.calculateBounds(tree);\n\n var transform = new Transform();\n transform.setDeviceOrgX(bounds.getMinX());\n transform.setDeviceOrgY(bounds.getMinY());\n transform.setWorldOrgX(startingPoint.x);\n transform.setWorldOrgY(startingPoint.y);\n\n for (var i = 0; i < tree.length; i++) {\n var node = tree[i];\n node.transform(transform);\n }\n\n var bottomRight = new PointD(bounds.getMaxX(), bounds.getMaxY());\n\n return transform.inverseTransformPoint(bottomRight);\n};\n\nCoSELayout.branchRadialLayout = function (node, parentOfNode, startAngle, endAngle, distance, radialSeparation) {\n // First, position this node by finding its angle.\n var halfInterval = (endAngle - startAngle + 1) / 2;\n\n if (halfInterval < 0) {\n halfInterval += 180;\n }\n\n var nodeAngle = (halfInterval + startAngle) % 360;\n var teta = nodeAngle * IGeometry.TWO_PI / 360;\n\n // Make polar to java cordinate conversion.\n var cos_teta = Math.cos(teta);\n var x_ = distance * Math.cos(teta);\n var y_ = distance * Math.sin(teta);\n\n node.setCenter(x_, y_);\n\n // Traverse all neighbors of this node and recursively call this\n // function.\n var neighborEdges = [];\n neighborEdges = neighborEdges.concat(node.getEdges());\n var childCount = neighborEdges.length;\n\n if (parentOfNode != null) {\n childCount--;\n }\n\n var branchCount = 0;\n\n var incEdgesCount = neighborEdges.length;\n var startIndex;\n\n var edges = node.getEdgesBetween(parentOfNode);\n\n // If there are multiple edges, prune them until there remains only one\n // edge.\n while (edges.length > 1) {\n //neighborEdges.remove(edges.remove(0));\n var temp = edges[0];\n edges.splice(0, 1);\n var index = neighborEdges.indexOf(temp);\n if (index >= 0) {\n neighborEdges.splice(index, 1);\n }\n incEdgesCount--;\n childCount--;\n }\n\n if (parentOfNode != null) {\n //assert edges.length == 1;\n startIndex = (neighborEdges.indexOf(edges[0]) + 1) % incEdgesCount;\n } else {\n startIndex = 0;\n }\n\n var stepAngle = Math.abs(endAngle - startAngle) / childCount;\n\n for (var i = startIndex; branchCount != childCount; i = ++i % incEdgesCount) {\n var currentNeighbor = neighborEdges[i].getOtherEnd(node);\n\n // Don't back traverse to root node in current tree.\n if (currentNeighbor == parentOfNode) {\n continue;\n }\n\n var childStartAngle = (startAngle + branchCount * stepAngle) % 360;\n var childEndAngle = (childStartAngle + stepAngle) % 360;\n\n CoSELayout.branchRadialLayout(currentNeighbor, node, childStartAngle, childEndAngle, distance + radialSeparation, radialSeparation);\n\n branchCount++;\n }\n};\n\nCoSELayout.maxDiagonalInTree = function (tree) {\n var maxDiagonal = Integer.MIN_VALUE;\n\n for (var i = 0; i < tree.length; i++) {\n var node = tree[i];\n var diagonal = node.getDiagonal();\n\n if (diagonal > maxDiagonal) {\n maxDiagonal = diagonal;\n }\n }\n\n return maxDiagonal;\n};\n\nCoSELayout.prototype.calcRepulsionRange = function () {\n // formula is 2 x (level + 1) x idealEdgeLength\n return 2 * (this.level + 1) * this.idealEdgeLength;\n};\n\n// Tiling methods\n\n// Group zero degree members whose parents are not to be tiled, create dummy parents where needed and fill memberGroups by their dummp parent id's\nCoSELayout.prototype.groupZeroDegreeMembers = function () {\n var self = this;\n // array of [parent_id x oneDegreeNode_id]\n var tempMemberGroups = {}; // A temporary map of parent node and its zero degree members\n this.memberGroups = {}; // A map of dummy parent node and its zero degree members whose parents are not to be tiled\n this.idToDummyNode = {}; // A map of id to dummy node \n\n var zeroDegree = []; // List of zero degree nodes whose parents are not to be tiled\n var allNodes = this.graphManager.getAllNodes();\n\n // Fill zero degree list\n for (var i = 0; i < allNodes.length; i++) {\n var node = allNodes[i];\n var parent = node.getParent();\n // If a node has zero degree and its parent is not to be tiled if exists add that node to zeroDegres list\n if (this.getNodeDegreeWithChildren(node) === 0 && (parent.id == undefined || !this.getToBeTiled(parent))) {\n zeroDegree.push(node);\n }\n }\n\n // Create a map of parent node and its zero degree members\n for (var i = 0; i < zeroDegree.length; i++) {\n var node = zeroDegree[i]; // Zero degree node itself\n var p_id = node.getParent().id; // Parent id\n\n if (typeof tempMemberGroups[p_id] === \"undefined\") tempMemberGroups[p_id] = [];\n\n tempMemberGroups[p_id] = tempMemberGroups[p_id].concat(node); // Push node to the list belongs to its parent in tempMemberGroups\n }\n\n // If there are at least two nodes at a level, create a dummy compound for them\n Object.keys(tempMemberGroups).forEach(function (p_id) {\n if (tempMemberGroups[p_id].length > 1) {\n var dummyCompoundId = \"DummyCompound_\" + p_id; // The id of dummy compound which will be created soon\n self.memberGroups[dummyCompoundId] = tempMemberGroups[p_id]; // Add dummy compound to memberGroups\n\n var parent = tempMemberGroups[p_id][0].getParent(); // The parent of zero degree nodes will be the parent of new dummy compound\n\n // Create a dummy compound with calculated id\n var dummyCompound = new CoSENode(self.graphManager);\n dummyCompound.id = dummyCompoundId;\n dummyCompound.paddingLeft = parent.paddingLeft || 0;\n dummyCompound.paddingRight = parent.paddingRight || 0;\n dummyCompound.paddingBottom = parent.paddingBottom || 0;\n dummyCompound.paddingTop = parent.paddingTop || 0;\n\n self.idToDummyNode[dummyCompoundId] = dummyCompound;\n\n var dummyParentGraph = self.getGraphManager().add(self.newGraph(), dummyCompound);\n var parentGraph = parent.getChild();\n\n // Add dummy compound to parent the graph\n parentGraph.add(dummyCompound);\n\n // For each zero degree node in this level remove it from its parent graph and add it to the graph of dummy parent\n for (var i = 0; i < tempMemberGroups[p_id].length; i++) {\n var node = tempMemberGroups[p_id][i];\n\n parentGraph.remove(node);\n dummyParentGraph.add(node);\n }\n }\n });\n};\n\nCoSELayout.prototype.clearCompounds = function () {\n var childGraphMap = {};\n var idToNode = {};\n\n // Get compound ordering by finding the inner one first\n this.performDFSOnCompounds();\n\n for (var i = 0; i < this.compoundOrder.length; i++) {\n\n idToNode[this.compoundOrder[i].id] = this.compoundOrder[i];\n childGraphMap[this.compoundOrder[i].id] = [].concat(this.compoundOrder[i].getChild().getNodes());\n\n // Remove children of compounds\n this.graphManager.remove(this.compoundOrder[i].getChild());\n this.compoundOrder[i].child = null;\n }\n\n this.graphManager.resetAllNodes();\n\n // Tile the removed children\n this.tileCompoundMembers(childGraphMap, idToNode);\n};\n\nCoSELayout.prototype.clearZeroDegreeMembers = function () {\n var self = this;\n var tiledZeroDegreePack = this.tiledZeroDegreePack = [];\n\n Object.keys(this.memberGroups).forEach(function (id) {\n var compoundNode = self.idToDummyNode[id]; // Get the dummy compound\n\n tiledZeroDegreePack[id] = self.tileNodes(self.memberGroups[id], compoundNode.paddingLeft + compoundNode.paddingRight);\n\n // Set the width and height of the dummy compound as calculated\n compoundNode.rect.width = tiledZeroDegreePack[id].width;\n compoundNode.rect.height = tiledZeroDegreePack[id].height;\n });\n};\n\nCoSELayout.prototype.repopulateCompounds = function () {\n for (var i = this.compoundOrder.length - 1; i >= 0; i--) {\n var lCompoundNode = this.compoundOrder[i];\n var id = lCompoundNode.id;\n var horizontalMargin = lCompoundNode.paddingLeft;\n var verticalMargin = lCompoundNode.paddingTop;\n\n this.adjustLocations(this.tiledMemberPack[id], lCompoundNode.rect.x, lCompoundNode.rect.y, horizontalMargin, verticalMargin);\n }\n};\n\nCoSELayout.prototype.repopulateZeroDegreeMembers = function () {\n var self = this;\n var tiledPack = this.tiledZeroDegreePack;\n\n Object.keys(tiledPack).forEach(function (id) {\n var compoundNode = self.idToDummyNode[id]; // Get the dummy compound by its id\n var horizontalMargin = compoundNode.paddingLeft;\n var verticalMargin = compoundNode.paddingTop;\n\n // Adjust the positions of nodes wrt its compound\n self.adjustLocations(tiledPack[id], compoundNode.rect.x, compoundNode.rect.y, horizontalMargin, verticalMargin);\n });\n};\n\nCoSELayout.prototype.getToBeTiled = function (node) {\n var id = node.id;\n //firstly check the previous results\n if (this.toBeTiled[id] != null) {\n return this.toBeTiled[id];\n }\n\n //only compound nodes are to be tiled\n var childGraph = node.getChild();\n if (childGraph == null) {\n this.toBeTiled[id] = false;\n return false;\n }\n\n var children = childGraph.getNodes(); // Get the children nodes\n\n //a compound node is not to be tiled if all of its compound children are not to be tiled\n for (var i = 0; i < children.length; i++) {\n var theChild = children[i];\n\n if (this.getNodeDegree(theChild) > 0) {\n this.toBeTiled[id] = false;\n return false;\n }\n\n //pass the children not having the compound structure\n if (theChild.getChild() == null) {\n this.toBeTiled[theChild.id] = false;\n continue;\n }\n\n if (!this.getToBeTiled(theChild)) {\n this.toBeTiled[id] = false;\n return false;\n }\n }\n this.toBeTiled[id] = true;\n return true;\n};\n\n// Get degree of a node depending of its edges and independent of its children\nCoSELayout.prototype.getNodeDegree = function (node) {\n var id = node.id;\n var edges = node.getEdges();\n var degree = 0;\n\n // For the edges connected\n for (var i = 0; i < edges.length; i++) {\n var edge = edges[i];\n if (edge.getSource().id !== edge.getTarget().id) {\n degree = degree + 1;\n }\n }\n return degree;\n};\n\n// Get degree of a node with its children\nCoSELayout.prototype.getNodeDegreeWithChildren = function (node) {\n var degree = this.getNodeDegree(node);\n if (node.getChild() == null) {\n return degree;\n }\n var children = node.getChild().getNodes();\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n degree += this.getNodeDegreeWithChildren(child);\n }\n return degree;\n};\n\nCoSELayout.prototype.performDFSOnCompounds = function () {\n this.compoundOrder = [];\n this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());\n};\n\nCoSELayout.prototype.fillCompexOrderByDFS = function (children) {\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (child.getChild() != null) {\n this.fillCompexOrderByDFS(child.getChild().getNodes());\n }\n if (this.getToBeTiled(child)) {\n this.compoundOrder.push(child);\n }\n }\n};\n\n/**\n* This method places each zero degree member wrt given (x,y) coordinates (top left).\n*/\nCoSELayout.prototype.adjustLocations = function (organization, x, y, compoundHorizontalMargin, compoundVerticalMargin) {\n x += compoundHorizontalMargin;\n y += compoundVerticalMargin;\n\n var left = x;\n\n for (var i = 0; i < organization.rows.length; i++) {\n var row = organization.rows[i];\n x = left;\n var maxHeight = 0;\n\n for (var j = 0; j < row.length; j++) {\n var lnode = row[j];\n\n lnode.rect.x = x; // + lnode.rect.width / 2;\n lnode.rect.y = y; // + lnode.rect.height / 2;\n\n x += lnode.rect.width + organization.horizontalPadding;\n\n if (lnode.rect.height > maxHeight) maxHeight = lnode.rect.height;\n }\n\n y += maxHeight + organization.verticalPadding;\n }\n};\n\nCoSELayout.prototype.tileCompoundMembers = function (childGraphMap, idToNode) {\n var self = this;\n this.tiledMemberPack = [];\n\n Object.keys(childGraphMap).forEach(function (id) {\n // Get the compound node\n var compoundNode = idToNode[id];\n\n self.tiledMemberPack[id] = self.tileNodes(childGraphMap[id], compoundNode.paddingLeft + compoundNode.paddingRight);\n\n compoundNode.rect.width = self.tiledMemberPack[id].width;\n compoundNode.rect.height = self.tiledMemberPack[id].height;\n });\n};\n\nCoSELayout.prototype.tileNodes = function (nodes, minWidth) {\n var verticalPadding = CoSEConstants.TILING_PADDING_VERTICAL;\n var horizontalPadding = CoSEConstants.TILING_PADDING_HORIZONTAL;\n var organization = {\n rows: [],\n rowWidth: [],\n rowHeight: [],\n width: 0,\n height: minWidth, // assume minHeight equals to minWidth\n verticalPadding: verticalPadding,\n horizontalPadding: horizontalPadding\n };\n\n // Sort the nodes in ascending order of their areas\n nodes.sort(function (n1, n2) {\n if (n1.rect.width * n1.rect.height > n2.rect.width * n2.rect.height) return -1;\n if (n1.rect.width * n1.rect.height < n2.rect.width * n2.rect.height) return 1;\n return 0;\n });\n\n // Create the organization -> tile members\n for (var i = 0; i < nodes.length; i++) {\n var lNode = nodes[i];\n\n if (organization.rows.length == 0) {\n this.insertNodeToRow(organization, lNode, 0, minWidth);\n } else if (this.canAddHorizontal(organization, lNode.rect.width, lNode.rect.height)) {\n this.insertNodeToRow(organization, lNode, this.getShortestRowIndex(organization), minWidth);\n } else {\n this.insertNodeToRow(organization, lNode, organization.rows.length, minWidth);\n }\n\n this.shiftToLastRow(organization);\n }\n\n return organization;\n};\n\nCoSELayout.prototype.insertNodeToRow = function (organization, node, rowIndex, minWidth) {\n var minCompoundSize = minWidth;\n\n // Add new row if needed\n if (rowIndex == organization.rows.length) {\n var secondDimension = [];\n\n organization.rows.push(secondDimension);\n organization.rowWidth.push(minCompoundSize);\n organization.rowHeight.push(0);\n }\n\n // Update row width\n var w = organization.rowWidth[rowIndex] + node.rect.width;\n\n if (organization.rows[rowIndex].length > 0) {\n w += organization.horizontalPadding;\n }\n\n organization.rowWidth[rowIndex] = w;\n // Update compound width\n if (organization.width < w) {\n organization.width = w;\n }\n\n // Update height\n var h = node.rect.height;\n if (rowIndex > 0) h += organization.verticalPadding;\n\n var extraHeight = 0;\n if (h > organization.rowHeight[rowIndex]) {\n extraHeight = organization.rowHeight[rowIndex];\n organization.rowHeight[rowIndex] = h;\n extraHeight = organization.rowHeight[rowIndex] - extraHeight;\n }\n\n organization.height += extraHeight;\n\n // Insert node\n organization.rows[rowIndex].push(node);\n};\n\n//Scans the rows of an organization and returns the one with the min width\nCoSELayout.prototype.getShortestRowIndex = function (organization) {\n var r = -1;\n var min = Number.MAX_VALUE;\n\n for (var i = 0; i < organization.rows.length; i++) {\n if (organization.rowWidth[i] < min) {\n r = i;\n min = organization.rowWidth[i];\n }\n }\n return r;\n};\n\n//Scans the rows of an organization and returns the one with the max width\nCoSELayout.prototype.getLongestRowIndex = function (organization) {\n var r = -1;\n var max = Number.MIN_VALUE;\n\n for (var i = 0; i < organization.rows.length; i++) {\n\n if (organization.rowWidth[i] > max) {\n r = i;\n max = organization.rowWidth[i];\n }\n }\n\n return r;\n};\n\n/**\n* This method checks whether adding extra width to the organization violates\n* the aspect ratio(1) or not.\n*/\nCoSELayout.prototype.canAddHorizontal = function (organization, extraWidth, extraHeight) {\n\n var sri = this.getShortestRowIndex(organization);\n\n if (sri < 0) {\n return true;\n }\n\n var min = organization.rowWidth[sri];\n\n if (min + organization.horizontalPadding + extraWidth <= organization.width) return true;\n\n var hDiff = 0;\n\n // Adding to an existing row\n if (organization.rowHeight[sri] < extraHeight) {\n if (sri > 0) hDiff = extraHeight + organization.verticalPadding - organization.rowHeight[sri];\n }\n\n var add_to_row_ratio;\n if (organization.width - min >= extraWidth + organization.horizontalPadding) {\n add_to_row_ratio = (organization.height + hDiff) / (min + extraWidth + organization.horizontalPadding);\n } else {\n add_to_row_ratio = (organization.height + hDiff) / organization.width;\n }\n\n // Adding a new row for this node\n hDiff = extraHeight + organization.verticalPadding;\n var add_new_row_ratio;\n if (organization.width < extraWidth) {\n add_new_row_ratio = (organization.height + hDiff) / extraWidth;\n } else {\n add_new_row_ratio = (organization.height + hDiff) / organization.width;\n }\n\n if (add_new_row_ratio < 1) add_new_row_ratio = 1 / add_new_row_ratio;\n\n if (add_to_row_ratio < 1) add_to_row_ratio = 1 / add_to_row_ratio;\n\n return add_to_row_ratio < add_new_row_ratio;\n};\n\n//If moving the last node from the longest row and adding it to the last\n//row makes the bounding box smaller, do it.\nCoSELayout.prototype.shiftToLastRow = function (organization) {\n var longest = this.getLongestRowIndex(organization);\n var last = organization.rowWidth.length - 1;\n var row = organization.rows[longest];\n var node = row[row.length - 1];\n\n var diff = node.width + organization.horizontalPadding;\n\n // Check if there is enough space on the last row\n if (organization.width - organization.rowWidth[last] > diff && longest != last) {\n // Remove the last element of the longest row\n row.splice(-1, 1);\n\n // Push it to the last row\n organization.rows[last].push(node);\n\n organization.rowWidth[longest] = organization.rowWidth[longest] - diff;\n organization.rowWidth[last] = organization.rowWidth[last] + diff;\n organization.width = organization.rowWidth[instance.getLongestRowIndex(organization)];\n\n // Update heights of the organization\n var maxHeight = Number.MIN_VALUE;\n for (var i = 0; i < row.length; i++) {\n if (row[i].height > maxHeight) maxHeight = row[i].height;\n }\n if (longest > 0) maxHeight += organization.verticalPadding;\n\n var prevTotal = organization.rowHeight[longest] + organization.rowHeight[last];\n\n organization.rowHeight[longest] = maxHeight;\n if (organization.rowHeight[last] < node.height + organization.verticalPadding) organization.rowHeight[last] = node.height + organization.verticalPadding;\n\n var finalTotal = organization.rowHeight[longest] + organization.rowHeight[last];\n organization.height += finalTotal - prevTotal;\n\n this.shiftToLastRow(organization);\n }\n};\n\nCoSELayout.prototype.tilingPreLayout = function () {\n if (CoSEConstants.TILE) {\n // Find zero degree nodes and create a compound for each level\n this.groupZeroDegreeMembers();\n // Tile and clear children of each compound\n this.clearCompounds();\n // Separately tile and clear zero degree nodes for each level\n this.clearZeroDegreeMembers();\n }\n};\n\nCoSELayout.prototype.tilingPostLayout = function () {\n if (CoSEConstants.TILE) {\n this.repopulateZeroDegreeMembers();\n this.repopulateCompounds();\n }\n};\n\n// -----------------------------------------------------------------------------\n// Section: Tree Reduction methods\n// -----------------------------------------------------------------------------\n// Reduce trees \nCoSELayout.prototype.reduceTrees = function () {\n var prunedNodesAll = [];\n var containsLeaf = true;\n var node;\n\n while (containsLeaf) {\n var allNodes = this.graphManager.getAllNodes();\n var prunedNodesInStepTemp = [];\n containsLeaf = false;\n\n for (var i = 0; i < allNodes.length; i++) {\n node = allNodes[i];\n if (node.getEdges().length == 1 && !node.getEdges()[0].isInterGraph && node.getChild() == null) {\n prunedNodesInStepTemp.push([node, node.getEdges()[0], node.getOwner()]);\n containsLeaf = true;\n }\n }\n if (containsLeaf == true) {\n var prunedNodesInStep = [];\n for (var j = 0; j < prunedNodesInStepTemp.length; j++) {\n if (prunedNodesInStepTemp[j][0].getEdges().length == 1) {\n prunedNodesInStep.push(prunedNodesInStepTemp[j]);\n prunedNodesInStepTemp[j][0].getOwner().remove(prunedNodesInStepTemp[j][0]);\n }\n }\n prunedNodesAll.push(prunedNodesInStep);\n this.graphManager.resetAllNodes();\n this.graphManager.resetAllEdges();\n }\n }\n this.prunedNodesAll = prunedNodesAll;\n};\n\n// Grow tree one step \nCoSELayout.prototype.growTree = function (prunedNodesAll) {\n var lengthOfPrunedNodesInStep = prunedNodesAll.length;\n var prunedNodesInStep = prunedNodesAll[lengthOfPrunedNodesInStep - 1];\n\n var nodeData;\n for (var i = 0; i < prunedNodesInStep.length; i++) {\n nodeData = prunedNodesInStep[i];\n\n this.findPlaceforPrunedNode(nodeData);\n\n nodeData[2].add(nodeData[0]);\n nodeData[2].add(nodeData[1], nodeData[1].source, nodeData[1].target);\n }\n\n prunedNodesAll.splice(prunedNodesAll.length - 1, 1);\n this.graphManager.resetAllNodes();\n this.graphManager.resetAllEdges();\n};\n\n// Find an appropriate position to replace pruned node, this method can be improved\nCoSELayout.prototype.findPlaceforPrunedNode = function (nodeData) {\n\n var gridForPrunedNode;\n var nodeToConnect;\n var prunedNode = nodeData[0];\n if (prunedNode == nodeData[1].source) {\n nodeToConnect = nodeData[1].target;\n } else {\n nodeToConnect = nodeData[1].source;\n }\n var startGridX = nodeToConnect.startX;\n var finishGridX = nodeToConnect.finishX;\n var startGridY = nodeToConnect.startY;\n var finishGridY = nodeToConnect.finishY;\n\n var upNodeCount = 0;\n var downNodeCount = 0;\n var rightNodeCount = 0;\n var leftNodeCount = 0;\n var controlRegions = [upNodeCount, rightNodeCount, downNodeCount, leftNodeCount];\n\n if (startGridY > 0) {\n for (var i = startGridX; i <= finishGridX; i++) {\n controlRegions[0] += this.grid[i][startGridY - 1].length + this.grid[i][startGridY].length - 1;\n }\n }\n if (finishGridX < this.grid.length - 1) {\n for (var i = startGridY; i <= finishGridY; i++) {\n controlRegions[1] += this.grid[finishGridX + 1][i].length + this.grid[finishGridX][i].length - 1;\n }\n }\n if (finishGridY < this.grid[0].length - 1) {\n for (var i = startGridX; i <= finishGridX; i++) {\n controlRegions[2] += this.grid[i][finishGridY + 1].length + this.grid[i][finishGridY].length - 1;\n }\n }\n if (startGridX > 0) {\n for (var i = startGridY; i <= finishGridY; i++) {\n controlRegions[3] += this.grid[startGridX - 1][i].length + this.grid[startGridX][i].length - 1;\n }\n }\n var min = Integer.MAX_VALUE;\n var minCount;\n var minIndex;\n for (var j = 0; j < controlRegions.length; j++) {\n if (controlRegions[j] < min) {\n min = controlRegions[j];\n minCount = 1;\n minIndex = j;\n } else if (controlRegions[j] == min) {\n minCount++;\n }\n }\n\n if (minCount == 3 && min == 0) {\n if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[2] == 0) {\n gridForPrunedNode = 1;\n } else if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[3] == 0) {\n gridForPrunedNode = 0;\n } else if (controlRegions[0] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) {\n gridForPrunedNode = 3;\n } else if (controlRegions[1] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) {\n gridForPrunedNode = 2;\n }\n } else if (minCount == 2 && min == 0) {\n var random = Math.floor(Math.random() * 2);\n if (controlRegions[0] == 0 && controlRegions[1] == 0) {\n ;\n if (random == 0) {\n gridForPrunedNode = 0;\n } else {\n gridForPrunedNode = 1;\n }\n } else if (controlRegions[0] == 0 && controlRegions[2] == 0) {\n if (random == 0) {\n gridForPrunedNode = 0;\n } else {\n gridForPrunedNode = 2;\n }\n } else if (controlRegions[0] == 0 && controlRegions[3] == 0) {\n if (random == 0) {\n gridForPrunedNode = 0;\n } else {\n gridForPrunedNode = 3;\n }\n } else if (controlRegions[1] == 0 && controlRegions[2] == 0) {\n if (random == 0) {\n gridForPrunedNode = 1;\n } else {\n gridForPrunedNode = 2;\n }\n } else if (controlRegions[1] == 0 && controlRegions[3] == 0) {\n if (random == 0) {\n gridForPrunedNode = 1;\n } else {\n gridForPrunedNode = 3;\n }\n } else {\n if (random == 0) {\n gridForPrunedNode = 2;\n } else {\n gridForPrunedNode = 3;\n }\n }\n } else if (minCount == 4 && min == 0) {\n var random = Math.floor(Math.random() * 4);\n gridForPrunedNode = random;\n } else {\n gridForPrunedNode = minIndex;\n }\n\n if (gridForPrunedNode == 0) {\n prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() - nodeToConnect.getHeight() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getHeight() / 2);\n } else if (gridForPrunedNode == 1) {\n prunedNode.setCenter(nodeToConnect.getCenterX() + nodeToConnect.getWidth() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getWidth() / 2, nodeToConnect.getCenterY());\n } else if (gridForPrunedNode == 2) {\n prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() + nodeToConnect.getHeight() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getHeight() / 2);\n } else {\n prunedNode.setCenter(nodeToConnect.getCenterX() - nodeToConnect.getWidth() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getWidth() / 2, nodeToConnect.getCenterY());\n }\n};\n\nmodule.exports = CoSELayout;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar coseBase = {};\n\ncoseBase.layoutBase = __webpack_require__(0);\ncoseBase.CoSEConstants = __webpack_require__(1);\ncoseBase.CoSEEdge = __webpack_require__(2);\ncoseBase.CoSEGraph = __webpack_require__(3);\ncoseBase.CoSEGraphManager = __webpack_require__(4);\ncoseBase.CoSELayout = __webpack_require__(6);\ncoseBase.CoSENode = __webpack_require__(5);\n\nmodule.exports = coseBase;\n\n/***/ })\n/******/ ]);\n});"],"names":["root","factory","module","require$$0","this","__WEBPACK_EXTERNAL_MODULE_0__","modules","installedModules","__webpack_require__","moduleId","value","exports","name","getter","object","property","FDLayoutConstants","CoSEConstants","prop","FDLayoutEdge","CoSEEdge","source","target","vEdge","LGraph","CoSEGraph","parent","graphMgr","vGraph","LGraphManager","CoSEGraphManager","layout","FDLayoutNode","IMath","CoSENode","gm","loc","size","vNode","dX","dY","nodes","node","i","pred1","next","processed","FDLayout","LayoutConstants","Point","PointD","Layout","Integer","IGeometry","Transform","CoSELayout","createBendsAsNeeded","allNodes","intersection","x","forest","gridUpdateAllowed","forceToNodeSurroundingUpdate","pData","rect","id","layoutEnded","nodeList","graph","graphs","edges","visited","edge","edgeList","k","multiEdge","currentStartingPoint","numberOfColumns","height","currentY","currentX","point","tree","centerNode","startingPoint","radialSep","bounds","transform","bottomRight","parentOfNode","startAngle","endAngle","distance","radialSeparation","halfInterval","nodeAngle","teta","x_","y_","neighborEdges","childCount","branchCount","incEdgesCount","startIndex","temp","index","stepAngle","currentNeighbor","childStartAngle","childEndAngle","maxDiagonal","diagonal","self","tempMemberGroups","zeroDegree","p_id","dummyCompoundId","dummyCompound","dummyParentGraph","parentGraph","childGraphMap","idToNode","tiledZeroDegreePack","compoundNode","lCompoundNode","horizontalMargin","verticalMargin","tiledPack","childGraph","children","theChild","degree","child","organization","y","compoundHorizontalMargin","compoundVerticalMargin","left","row","maxHeight","j","lnode","minWidth","verticalPadding","horizontalPadding","n1","n2","lNode","rowIndex","minCompoundSize","secondDimension","w","extraHeight","r","min","max","extraWidth","sri","hDiff","add_to_row_ratio","add_new_row_ratio","longest","last","diff","prevTotal","finalTotal","prunedNodesAll","containsLeaf","prunedNodesInStepTemp","prunedNodesInStep","lengthOfPrunedNodesInStep","nodeData","gridForPrunedNode","nodeToConnect","prunedNode","startGridX","finishGridX","startGridY","finishGridY","upNodeCount","downNodeCount","rightNodeCount","leftNodeCount","controlRegions","minCount","minIndex","random","coseBase"],"mappings":"yPAAC,SAA0CA,EAAMC,EAAS,CAExDC,EAAA,QAAiBD,EAAQE,EAAAA,WAAsB,CAOjD,GAAGC,EAAM,SAASC,EAA+B,CACjD,OAAiB,SAASC,EAAS,CAEzB,IAAIC,EAAmB,CAAA,EAGvB,SAASC,EAAoBC,EAAU,CAGtC,GAAGF,EAAiBE,CAAQ,EAC3B,OAAOF,EAAiBE,CAAQ,EAAE,QAGnC,IAAIP,EAASK,EAAiBE,CAAQ,EAAI,CACzC,EAAGA,EACH,EAAG,GACH,QAAS,CAAA,GAIV,OAAAH,EAAQG,CAAQ,EAAE,KAAKP,EAAO,QAASA,EAAQA,EAAO,QAASM,CAAmB,EAGlFN,EAAO,EAAI,GAGJA,EAAO,OACzB,CAIU,OAAAM,EAAoB,EAAIF,EAGxBE,EAAoB,EAAID,EAGxBC,EAAoB,EAAI,SAASE,EAAO,CAAE,OAAOA,CAAM,EAGvDF,EAAoB,EAAI,SAASG,EAASC,EAAMC,EAAQ,CACnDL,EAAoB,EAAEG,EAASC,CAAI,GACtC,OAAO,eAAeD,EAASC,EAAM,CACpC,aAAc,GACd,WAAY,GACZ,IAAKC,CAClB,CAAa,CAEb,EAGUL,EAAoB,EAAI,SAASN,EAAQ,CACxC,IAAIW,EAASX,GAAUA,EAAO,WAC7B,UAAsB,CAAE,OAAOA,EAAO,OAAW,EACjD,UAA4B,CAAE,OAAOA,CAAO,EAC7C,OAAAM,EA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W,SAAQ,EAAK,EAAGD,EAAc,YAAY,EACrKD,GAAqB,EAC9BE,EAAW,UAAUD,EAAc,WAAU,EAAIA,EAAc,aAAeA,EAAc,UAAS,EAAK,EAAI7J,EAAkB,oBAAsB8J,EAAW,UAAS,EAAK,CAAC,EAEhLA,EAAW,UAAUD,EAAc,WAAU,EAAKA,EAAc,WAAa,EAAI7J,EAAkB,oBAAsB8J,EAAW,SAAQ,EAAK,EAAGD,EAAc,YAAY,CAElL,EAEA3K,EAAO,QAAUqD,CAEjB,IAEO,SAASrD,EAAQS,EAASH,EAAqB,CAKtD,IAAImL,EAAW,CAAA,EAEfA,EAAS,WAAanL,EAAoB,CAAC,EAC3CmL,EAAS,cAAgBnL,EAAoB,CAAC,EAC9CmL,EAAS,SAAWnL,EAAoB,CAAC,EACzCmL,EAAS,UAAYnL,EAAoB,CAAC,EAC1CmL,EAAS,iBAAmBnL,EAAoB,CAAC,EACjDmL,EAAS,WAAanL,EAAoB,CAAC,EAC3CmL,EAAS,SAAWnL,EAAoB,CAAC,EAEzCN,EAAO,QAAUyL,CAEjB,EACA,CAAU,CACV,CAAC","x_google_ignoreList":[0]}
@@ -1,4 +1,4 @@
1
- import { __module as I } from "../../_virtual/cose-base.es2.js";
1
+ import { __module as I } from "../../_virtual/cose-base.es.js";
2
2
  import { __require as $ } from "../layout-base/layout-base.es.js";
3
3
  var J = I.exports, X;
4
4
  function z() {
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ye=require("../../../../_virtual/cose-base.cjs.js"),vt=require("../layout-base/layout-base.cjs.js");var dt=Ye.__module.exports,ot;function ct(){return ot||(ot=1,(function(st,ut){(function(Je,He){st.exports=He(vt.__require())})(dt,function($e){return(()=>{var Je={45:((Q,ge,A)=>{var L={};L.layoutBase=A(551),L.CoSEConstants=A(806),L.CoSEEdge=A(767),L.CoSEGraph=A(880),L.CoSEGraphManager=A(578),L.CoSELayout=A(765),L.CoSENode=A(991),L.ConstraintHandler=A(902),Q.exports=L}),806:((Q,ge,A)=>{var L=A(551).FDLayoutConstants;function G(){}for(var B in L)G[B]=L[B];G.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,G.DEFAULT_RADIAL_SEPARATION=L.DEFAULT_EDGE_LENGTH,G.DEFAULT_COMPONENT_SEPERATION=60,G.TILE=!0,G.TILING_PADDING_VERTICAL=10,G.TILING_PADDING_HORIZONTAL=10,G.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,G.ENFORCE_CONSTRAINTS=!0,G.APPLY_LAYOUT=!0,G.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,G.TREE_REDUCTION_ON_INCREMENTAL=!0,G.PURE_INCREMENTAL=G.DEFAULT_INCREMENTAL,Q.exports=G}),767:((Q,ge,A)=>{var L=A(551).FDLayoutEdge;function G(Z,V,W){L.call(this,Z,V,W)}G.prototype=Object.create(L.prototype);for(var B in L)G[B]=L[B];Q.exports=G}),880:((Q,ge,A)=>{var L=A(551).LGraph;function G(Z,V,W){L.call(this,Z,V,W)}G.prototype=Object.create(L.prototype);for(var B in L)G[B]=L[B];Q.exports=G}),578:((Q,ge,A)=>{var L=A(551).LGraphManager;function G(Z){L.call(this,Z)}G.prototype=Object.create(L.prototype);for(var B in L)G[B]=L[B];Q.exports=G}),765:((Q,ge,A)=>{var L=A(551).FDLayout,G=A(578),B=A(880),Z=A(991),V=A(767),W=A(806),q=A(902),d=A(551).FDLayoutConstants,re=A(551).LayoutConstants,u=A(551).Point,x=A(551).PointD,Y=A(551).DimensionD,Ce=A(551).Layout,xe=A(551).Integer,Re=A(551).IGeometry,ce=A(551).LGraph,Ue=A(551).Transform,Me=A(551).LinkedList;function T(){L.call(this),this.toBeTiled={},this.constraints={}}T.prototype=Object.create(L.prototype);for(var ye in L)T[ye]=L[ye];T.prototype.newGraphManager=function(){var e=new G(this);return this.graphManager=e,e},T.prototype.newGraph=function(e){return new B(null,this.graphManager,e)},T.prototype.newNode=function(e){return new Z(this.graphManager,e)},T.prototype.newEdge=function(e){return new V(null,null,e)},T.prototype.initParameters=function(){L.prototype.initParameters.call(this,arguments),this.isSubLayout||(W.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=W.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=W.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)},T.prototype.initSpringEmbedder=function(){L.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},T.prototype.layout=function(){var e=re.DEFAULT_CREATE_BENDS_AS_NEEDED;return e&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},T.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){if(W.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(n){return a.has(n)});this.graphManager.setAllNodesToApplyGravitation(t)}}else{var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(i){return a.has(i)});this.graphManager.setAllNodesToApplyGravitation(t),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(q.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),W.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},T.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(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 e=new Set(this.getAllNodes()),a=this.nodesWithGravity.filter(function(r){return e.has(r)});this.graphManager.setAllNodesToApplyGravitation(a),this.graphManager.updateBounds(),this.updateGrid(),W.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()),W.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 t=!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(t,i),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},T.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),a={},t=0;t<e.length;t++){var i=e[t].rect,r=e[t].id;a[r]={id:r,x:i.getCenterX(),y:i.getCenterY(),w:i.width,h:i.height}}return a},T.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var e=!1;if(d.ANIMATE==="during")this.emit("layoutstarted");else{for(;!e;)e=this.tick();this.graphManager.updateBounds()}},T.prototype.moveNodes=function(){for(var e=this.getAllNodes(),a,t=0;t<e.length;t++)a=e[t],a.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var t=0;t<e.length;t++)a=e[t],a.move()},T.prototype.initConstraintVariables=function(){var e=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var a=this.graphManager.getAllNodes(),t=0;t<a.length;t++){var i=a[t];this.idToNodeMap.set(i.id,i)}var r=function s(f){for(var m=f.getChild().getNodes(),y,U=0,J=0;J<m.length;J++)y=m[J],y.getChild()==null?e.fixedNodeSet.has(y.id)&&(U+=100):U+=s(y);return U};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(m){e.fixedNodeSet.add(m.nodeId)});for(var a=this.graphManager.getAllNodes(),i,t=0;t<a.length;t++)if(i=a[t],i.getChild()!=null){var n=r(i);n>0&&(i.fixedNodeWeight=n)}}if(this.constraints.relativePlacementConstraint){var o=new Map,h=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(s){e.fixedNodesOnHorizontal.add(s),e.fixedNodesOnVertical.add(s)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var c=this.constraints.alignmentConstraint.vertical,t=0;t<c.length;t++)this.dummyToNodeForVerticalAlignment.set("dummy"+t,[]),c[t].forEach(function(f){o.set(f,"dummy"+t),e.dummyToNodeForVerticalAlignment.get("dummy"+t).push(f),e.fixedNodeSet.has(f)&&e.fixedNodesOnHorizontal.add("dummy"+t)});if(this.constraints.alignmentConstraint.horizontal)for(var v=this.constraints.alignmentConstraint.horizontal,t=0;t<v.length;t++)this.dummyToNodeForHorizontalAlignment.set("dummy"+t,[]),v[t].forEach(function(f){h.set(f,"dummy"+t),e.dummyToNodeForHorizontalAlignment.get("dummy"+t).push(f),e.fixedNodeSet.has(f)&&e.fixedNodesOnVertical.add("dummy"+t)})}if(W.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(s){var f,m,y;for(y=s.length-1;y>=2*s.length/3;y--)f=Math.floor(Math.random()*(y+1)),m=s[y],s[y]=s[f],s[f]=m;return s},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(s){if(s.left){var f=o.has(s.left)?o.get(s.left):s.left,m=o.has(s.right)?o.get(s.right):s.right;e.nodesInRelativeHorizontal.includes(f)||(e.nodesInRelativeHorizontal.push(f),e.nodeToRelativeConstraintMapHorizontal.set(f,[]),e.dummyToNodeForVerticalAlignment.has(f)?e.nodeToTempPositionMapHorizontal.set(f,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(f)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(f,e.idToNodeMap.get(f).getCenterX())),e.nodesInRelativeHorizontal.includes(m)||(e.nodesInRelativeHorizontal.push(m),e.nodeToRelativeConstraintMapHorizontal.set(m,[]),e.dummyToNodeForVerticalAlignment.has(m)?e.nodeToTempPositionMapHorizontal.set(m,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(m)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(m,e.idToNodeMap.get(m).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(f).push({right:m,gap:s.gap}),e.nodeToRelativeConstraintMapHorizontal.get(m).push({left:f,gap:s.gap})}else{var y=h.has(s.top)?h.get(s.top):s.top,U=h.has(s.bottom)?h.get(s.bottom):s.bottom;e.nodesInRelativeVertical.includes(y)||(e.nodesInRelativeVertical.push(y),e.nodeToRelativeConstraintMapVertical.set(y,[]),e.dummyToNodeForHorizontalAlignment.has(y)?e.nodeToTempPositionMapVertical.set(y,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(y)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(y,e.idToNodeMap.get(y).getCenterY())),e.nodesInRelativeVertical.includes(U)||(e.nodesInRelativeVertical.push(U),e.nodeToRelativeConstraintMapVertical.set(U,[]),e.dummyToNodeForHorizontalAlignment.has(U)?e.nodeToTempPositionMapVertical.set(U,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(U)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(U,e.idToNodeMap.get(U).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(y).push({bottom:U,gap:s.gap}),e.nodeToRelativeConstraintMapVertical.get(U).push({top:y,gap:s.gap})}});else{var S=new Map,E=new Map;this.constraints.relativePlacementConstraint.forEach(function(s){if(s.left){var f=o.has(s.left)?o.get(s.left):s.left,m=o.has(s.right)?o.get(s.right):s.right;S.has(f)?S.get(f).push(m):S.set(f,[m]),S.has(m)?S.get(m).push(f):S.set(m,[f])}else{var y=h.has(s.top)?h.get(s.top):s.top,U=h.has(s.bottom)?h.get(s.bottom):s.bottom;E.has(y)?E.get(y).push(U):E.set(y,[U]),E.has(U)?E.get(U).push(y):E.set(U,[y])}});var g=function(f,m){var y=[],U=[],J=new Me,he=new Set,ie=0;return f.forEach(function(be,Se){if(!he.has(Se)){y[ie]=[],U[ie]=!1;var se=Se;for(J.push(se),he.add(se),y[ie].push(se);J.length!=0;){se=J.shift(),m.has(se)&&(U[ie]=!0);var Ge=f.get(se);Ge.forEach(function(we){he.has(we)||(J.push(we),he.add(we),y[ie].push(we))})}ie++}}),{components:y,isFixed:U}},C=g(S,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=C.components,this.fixedComponentsOnHorizontal=C.isFixed;var N=g(E,e.fixedNodesOnVertical);this.componentsOnVertical=N.components,this.fixedComponentsOnVertical=N.isFixed}}},T.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(N){var s=e.idToNodeMap.get(N.nodeId);s.displacementX=0,s.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var a=this.constraints.alignmentConstraint.vertical,t=0;t<a.length;t++){for(var i=0,r=0;r<a[t].length;r++){if(this.fixedNodeSet.has(a[t][r])){i=0;break}i+=this.idToNodeMap.get(a[t][r]).displacementX}for(var n=i/a[t].length,r=0;r<a[t].length;r++)this.idToNodeMap.get(a[t][r]).displacementX=n}if(this.constraints.alignmentConstraint.horizontal)for(var o=this.constraints.alignmentConstraint.horizontal,t=0;t<o.length;t++){for(var h=0,r=0;r<o[t].length;r++){if(this.fixedNodeSet.has(o[t][r])){h=0;break}h+=this.idToNodeMap.get(o[t][r]).displacementY}for(var c=h/o[t].length,r=0;r<o[t].length;r++)this.idToNodeMap.get(o[t][r]).displacementY=c}}if(this.constraints.relativePlacementConstraint)if(W.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(N){if(!e.fixedNodesOnHorizontal.has(N)){var s=0;e.dummyToNodeForVerticalAlignment.has(N)?s=e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(N)[0]).displacementX:s=e.idToNodeMap.get(N).displacementX,e.nodeToRelativeConstraintMapHorizontal.get(N).forEach(function(f){if(f.right){var m=e.nodeToTempPositionMapHorizontal.get(f.right)-e.nodeToTempPositionMapHorizontal.get(N)-s;m<f.gap&&(s-=f.gap-m)}else{var m=e.nodeToTempPositionMapHorizontal.get(N)-e.nodeToTempPositionMapHorizontal.get(f.left)+s;m<f.gap&&(s+=f.gap-m)}}),e.nodeToTempPositionMapHorizontal.set(N,e.nodeToTempPositionMapHorizontal.get(N)+s),e.dummyToNodeForVerticalAlignment.has(N)?e.dummyToNodeForVerticalAlignment.get(N).forEach(function(f){e.idToNodeMap.get(f).displacementX=s}):e.idToNodeMap.get(N).displacementX=s}}),this.nodesInRelativeVertical.forEach(function(N){if(!e.fixedNodesOnHorizontal.has(N)){var s=0;e.dummyToNodeForHorizontalAlignment.has(N)?s=e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(N)[0]).displacementY:s=e.idToNodeMap.get(N).displacementY,e.nodeToRelativeConstraintMapVertical.get(N).forEach(function(f){if(f.bottom){var m=e.nodeToTempPositionMapVertical.get(f.bottom)-e.nodeToTempPositionMapVertical.get(N)-s;m<f.gap&&(s-=f.gap-m)}else{var m=e.nodeToTempPositionMapVertical.get(N)-e.nodeToTempPositionMapVertical.get(f.top)+s;m<f.gap&&(s+=f.gap-m)}}),e.nodeToTempPositionMapVertical.set(N,e.nodeToTempPositionMapVertical.get(N)+s),e.dummyToNodeForHorizontalAlignment.has(N)?e.dummyToNodeForHorizontalAlignment.get(N).forEach(function(f){e.idToNodeMap.get(f).displacementY=s}):e.idToNodeMap.get(N).displacementY=s}});else{for(var t=0;t<this.componentsOnHorizontal.length;t++){var v=this.componentsOnHorizontal[t];if(this.fixedComponentsOnHorizontal[t])for(var r=0;r<v.length;r++)this.dummyToNodeForVerticalAlignment.has(v[r])?this.dummyToNodeForVerticalAlignment.get(v[r]).forEach(function(f){e.idToNodeMap.get(f).displacementX=0}):this.idToNodeMap.get(v[r]).displacementX=0;else{for(var S=0,E=0,r=0;r<v.length;r++)if(this.dummyToNodeForVerticalAlignment.has(v[r])){var g=this.dummyToNodeForVerticalAlignment.get(v[r]);S+=g.length*this.idToNodeMap.get(g[0]).displacementX,E+=g.length}else S+=this.idToNodeMap.get(v[r]).displacementX,E++;for(var C=S/E,r=0;r<v.length;r++)this.dummyToNodeForVerticalAlignment.has(v[r])?this.dummyToNodeForVerticalAlignment.get(v[r]).forEach(function(f){e.idToNodeMap.get(f).displacementX=C}):this.idToNodeMap.get(v[r]).displacementX=C}}for(var t=0;t<this.componentsOnVertical.length;t++){var v=this.componentsOnVertical[t];if(this.fixedComponentsOnVertical[t])for(var r=0;r<v.length;r++)this.dummyToNodeForHorizontalAlignment.has(v[r])?this.dummyToNodeForHorizontalAlignment.get(v[r]).forEach(function(m){e.idToNodeMap.get(m).displacementY=0}):this.idToNodeMap.get(v[r]).displacementY=0;else{for(var S=0,E=0,r=0;r<v.length;r++)if(this.dummyToNodeForHorizontalAlignment.has(v[r])){var g=this.dummyToNodeForHorizontalAlignment.get(v[r]);S+=g.length*this.idToNodeMap.get(g[0]).displacementY,E+=g.length}else S+=this.idToNodeMap.get(v[r]).displacementY,E++;for(var C=S/E,r=0;r<v.length;r++)this.dummyToNodeForHorizontalAlignment.has(v[r])?this.dummyToNodeForHorizontalAlignment.get(v[r]).forEach(function(J){e.idToNodeMap.get(J).displacementY=C}):this.idToNodeMap.get(v[r]).displacementY=C}}}},T.prototype.calculateNodesToApplyGravitationTo=function(){var e=[],a,t=this.graphManager.getGraphs(),i=t.length,r;for(r=0;r<i;r++)a=t[r],a.updateConnected(),a.isConnected||(e=e.concat(a.getNodes()));return e},T.prototype.createBendpoints=function(){var e=[];e=e.concat(this.graphManager.getAllEdges());var a=new Set,t;for(t=0;t<e.length;t++){var i=e[t];if(!a.has(i)){var r=i.getSource(),n=i.getTarget();if(r==n)i.getBendpoints().push(new x),i.getBendpoints().push(new x),this.createDummyNodesForBendpoints(i),a.add(i);else{var o=[];if(o=o.concat(r.getEdgeListToNode(n)),o=o.concat(n.getEdgeListToNode(r)),!a.has(o[0])){if(o.length>1){var h;for(h=0;h<o.length;h++){var c=o[h];c.getBendpoints().push(new x),this.createDummyNodesForBendpoints(c)}}o.forEach(function(v){a.add(v)})}}}if(a.size==e.length)break}},T.prototype.positionNodesRadially=function(e){for(var a=new u(0,0),t=Math.ceil(Math.sqrt(e.length)),i=0,r=0,n=0,o=new x(0,0),h=0;h<e.length;h++){h%t==0&&(n=0,r=i,h!=0&&(r+=W.DEFAULT_COMPONENT_SEPERATION),i=0);var c=e[h],v=Ce.findCenterOfTree(c);a.x=n,a.y=r,o=T.radialLayout(c,v,a),o.y>i&&(i=Math.floor(o.y)),n=Math.floor(o.x+W.DEFAULT_COMPONENT_SEPERATION)}this.transform(new x(re.WORLD_CENTER_X-o.x/2,re.WORLD_CENTER_Y-o.y/2))},T.radialLayout=function(e,a,t){var i=Math.max(this.maxDiagonalInTree(e),W.DEFAULT_RADIAL_SEPARATION);T.branchRadialLayout(a,null,0,359,0,i);var r=ce.calculateBounds(e),n=new Ue;n.setDeviceOrgX(r.getMinX()),n.setDeviceOrgY(r.getMinY()),n.setWorldOrgX(t.x),n.setWorldOrgY(t.y);for(var o=0;o<e.length;o++){var h=e[o];h.transform(n)}var c=new x(r.getMaxX(),r.getMaxY());return n.inverseTransformPoint(c)},T.branchRadialLayout=function(e,a,t,i,r,n){var o=(i-t+1)/2;o<0&&(o+=180);var h=(o+t)%360,c=h*Re.TWO_PI/360,v=r*Math.cos(c),S=r*Math.sin(c);e.setCenter(v,S);var E=[];E=E.concat(e.getEdges());var g=E.length;a!=null&&g--;for(var C=0,N=E.length,s,f=e.getEdgesBetween(a);f.length>1;){var m=f[0];f.splice(0,1);var y=E.indexOf(m);y>=0&&E.splice(y,1),N--,g--}a!=null?s=(E.indexOf(f[0])+1)%N:s=0;for(var U=Math.abs(i-t)/g,J=s;C!=g;J=++J%N){var he=E[J].getOtherEnd(e);if(he!=a){var ie=(t+C*U)%360,be=(ie+U)%360;T.branchRadialLayout(he,e,ie,be,r+n,n),C++}}},T.maxDiagonalInTree=function(e){for(var a=xe.MIN_VALUE,t=0;t<e.length;t++){var i=e[t],r=i.getDiagonal();r>a&&(a=r)}return a},T.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},T.prototype.groupZeroDegreeMembers=function(){var e=this,a={};this.memberGroups={},this.idToDummyNode={};for(var t=[],i=this.graphManager.getAllNodes(),r=0;r<i.length;r++){var n=i[r],o=n.getParent();this.getNodeDegreeWithChildren(n)===0&&(o.id==null||!this.getToBeTiled(o))&&t.push(n)}for(var r=0;r<t.length;r++){var n=t[r],h=n.getParent().id;typeof a[h]>"u"&&(a[h]=[]),a[h]=a[h].concat(n)}Object.keys(a).forEach(function(c){if(a[c].length>1){var v="DummyCompound_"+c;e.memberGroups[v]=a[c];var S=a[c][0].getParent(),E=new Z(e.graphManager);E.id=v,E.paddingLeft=S.paddingLeft||0,E.paddingRight=S.paddingRight||0,E.paddingBottom=S.paddingBottom||0,E.paddingTop=S.paddingTop||0,e.idToDummyNode[v]=E;var g=e.getGraphManager().add(e.newGraph(),E),C=S.getChild();C.add(E);for(var N=0;N<a[c].length;N++){var s=a[c][N];C.remove(s),g.add(s)}}})},T.prototype.clearCompounds=function(){var e={},a={};this.performDFSOnCompounds();for(var t=0;t<this.compoundOrder.length;t++)a[this.compoundOrder[t].id]=this.compoundOrder[t],e[this.compoundOrder[t].id]=[].concat(this.compoundOrder[t].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[t].getChild()),this.compoundOrder[t].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(e,a)},T.prototype.clearZeroDegreeMembers=function(){var e=this,a=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(t){var i=e.idToDummyNode[t];if(a[t]=e.tileNodes(e.memberGroups[t],i.paddingLeft+i.paddingRight),i.rect.width=a[t].width,i.rect.height=a[t].height,i.setCenter(a[t].centerX,a[t].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,W.NODE_DIMENSIONS_INCLUDE_LABELS){var r=i.rect.width,n=i.rect.height;i.labelWidth&&(i.labelPosHorizontal=="left"?(i.rect.x-=i.labelWidth,i.setWidth(r+i.labelWidth),i.labelMarginLeft=i.labelWidth):i.labelPosHorizontal=="center"&&i.labelWidth>r?(i.rect.x-=(i.labelWidth-r)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-r)/2):i.labelPosHorizontal=="right"&&i.setWidth(r+i.labelWidth)),i.labelHeight&&(i.labelPosVertical=="top"?(i.rect.y-=i.labelHeight,i.setHeight(n+i.labelHeight),i.labelMarginTop=i.labelHeight):i.labelPosVertical=="center"&&i.labelHeight>n?(i.rect.y-=(i.labelHeight-n)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-n)/2):i.labelPosVertical=="bottom"&&i.setHeight(n+i.labelHeight))}})},T.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var a=this.compoundOrder[e],t=a.id,i=a.paddingLeft,r=a.paddingTop,n=a.labelMarginLeft,o=a.labelMarginTop;this.adjustLocations(this.tiledMemberPack[t],a.rect.x,a.rect.y,i,r,n,o)}},T.prototype.repopulateZeroDegreeMembers=function(){var e=this,a=this.tiledZeroDegreePack;Object.keys(a).forEach(function(t){var i=e.idToDummyNode[t],r=i.paddingLeft,n=i.paddingTop,o=i.labelMarginLeft,h=i.labelMarginTop;e.adjustLocations(a[t],i.rect.x,i.rect.y,r,n,o,h)})},T.prototype.getToBeTiled=function(e){var a=e.id;if(this.toBeTiled[a]!=null)return this.toBeTiled[a];var t=e.getChild();if(t==null)return this.toBeTiled[a]=!1,!1;for(var i=t.getNodes(),r=0;r<i.length;r++){var n=i[r];if(this.getNodeDegree(n)>0)return this.toBeTiled[a]=!1,!1;if(n.getChild()==null){this.toBeTiled[n.id]=!1;continue}if(!this.getToBeTiled(n))return this.toBeTiled[a]=!1,!1}return this.toBeTiled[a]=!0,!0},T.prototype.getNodeDegree=function(e){e.id;for(var a=e.getEdges(),t=0,i=0;i<a.length;i++){var r=a[i];r.getSource().id!==r.getTarget().id&&(t=t+1)}return t},T.prototype.getNodeDegreeWithChildren=function(e){var a=this.getNodeDegree(e);if(e.getChild()==null)return a;for(var t=e.getChild().getNodes(),i=0;i<t.length;i++){var r=t[i];a+=this.getNodeDegreeWithChildren(r)}return a},T.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},T.prototype.fillCompexOrderByDFS=function(e){for(var a=0;a<e.length;a++){var t=e[a];t.getChild()!=null&&this.fillCompexOrderByDFS(t.getChild().getNodes()),this.getToBeTiled(t)&&this.compoundOrder.push(t)}},T.prototype.adjustLocations=function(e,a,t,i,r,n,o){a+=i+n,t+=r+o;for(var h=a,c=0;c<e.rows.length;c++){var v=e.rows[c];a=h;for(var S=0,E=0;E<v.length;E++){var g=v[E];g.rect.x=a,g.rect.y=t,a+=g.rect.width+e.horizontalPadding,g.rect.height>S&&(S=g.rect.height)}t+=S+e.verticalPadding}},T.prototype.tileCompoundMembers=function(e,a){var t=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(i){var r=a[i];if(t.tiledMemberPack[i]=t.tileNodes(e[i],r.paddingLeft+r.paddingRight),r.rect.width=t.tiledMemberPack[i].width,r.rect.height=t.tiledMemberPack[i].height,r.setCenter(t.tiledMemberPack[i].centerX,t.tiledMemberPack[i].centerY),r.labelMarginLeft=0,r.labelMarginTop=0,W.NODE_DIMENSIONS_INCLUDE_LABELS){var n=r.rect.width,o=r.rect.height;r.labelWidth&&(r.labelPosHorizontal=="left"?(r.rect.x-=r.labelWidth,r.setWidth(n+r.labelWidth),r.labelMarginLeft=r.labelWidth):r.labelPosHorizontal=="center"&&r.labelWidth>n?(r.rect.x-=(r.labelWidth-n)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-n)/2):r.labelPosHorizontal=="right"&&r.setWidth(n+r.labelWidth)),r.labelHeight&&(r.labelPosVertical=="top"?(r.rect.y-=r.labelHeight,r.setHeight(o+r.labelHeight),r.labelMarginTop=r.labelHeight):r.labelPosVertical=="center"&&r.labelHeight>o?(r.rect.y-=(r.labelHeight-o)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-o)/2):r.labelPosVertical=="bottom"&&r.setHeight(o+r.labelHeight))}})},T.prototype.tileNodes=function(e,a){var t=this.tileNodesByFavoringDim(e,a,!0),i=this.tileNodesByFavoringDim(e,a,!1),r=this.getOrgRatio(t),n=this.getOrgRatio(i),o;return n<r?o=i:o=t,o},T.prototype.getOrgRatio=function(e){var a=e.width,t=e.height,i=a/t;return i<1&&(i=1/i),i},T.prototype.calcIdealRowWidth=function(e,a){var t=W.TILING_PADDING_VERTICAL,i=W.TILING_PADDING_HORIZONTAL,r=e.length,n=0,o=0,h=0;e.forEach(function(N){n+=N.getWidth(),o+=N.getHeight(),N.getWidth()>h&&(h=N.getWidth())});var c=n/r,v=o/r,S=Math.pow(t-i,2)+4*(c+i)*(v+t)*r,E=(i-t+Math.sqrt(S))/(2*(c+i)),g;a?(g=Math.ceil(E),g==E&&g++):g=Math.floor(E);var C=g*(c+i)-i;return h>C&&(C=h),C+=i*2,C},T.prototype.tileNodesByFavoringDim=function(e,a,t){var i=W.TILING_PADDING_VERTICAL,r=W.TILING_PADDING_HORIZONTAL,n=W.TILING_COMPARE_BY,o={rows:[],rowWidth:[],rowHeight:[],width:0,height:a,verticalPadding:i,horizontalPadding:r,centerX:0,centerY:0};n&&(o.idealRowWidth=this.calcIdealRowWidth(e,t));var h=function(s){return s.rect.width*s.rect.height},c=function(s,f){return h(f)-h(s)};e.sort(function(N,s){var f=c;return o.idealRowWidth?(f=n,f(N.id,s.id)):f(N,s)});for(var v=0,S=0,E=0;E<e.length;E++){var g=e[E];v+=g.getCenterX(),S+=g.getCenterY()}o.centerX=v/e.length,o.centerY=S/e.length;for(var E=0;E<e.length;E++){var g=e[E];if(o.rows.length==0)this.insertNodeToRow(o,g,0,a);else if(this.canAddHorizontal(o,g.rect.width,g.rect.height)){var C=o.rows.length-1;o.idealRowWidth||(C=this.getShortestRowIndex(o)),this.insertNodeToRow(o,g,C,a)}else this.insertNodeToRow(o,g,o.rows.length,a);this.shiftToLastRow(o)}return o},T.prototype.insertNodeToRow=function(e,a,t,i){var r=i;if(t==e.rows.length){var n=[];e.rows.push(n),e.rowWidth.push(r),e.rowHeight.push(0)}var o=e.rowWidth[t]+a.rect.width;e.rows[t].length>0&&(o+=e.horizontalPadding),e.rowWidth[t]=o,e.width<o&&(e.width=o);var h=a.rect.height;t>0&&(h+=e.verticalPadding);var c=0;h>e.rowHeight[t]&&(c=e.rowHeight[t],e.rowHeight[t]=h,c=e.rowHeight[t]-c),e.height+=c,e.rows[t].push(a)},T.prototype.getShortestRowIndex=function(e){for(var a=-1,t=Number.MAX_VALUE,i=0;i<e.rows.length;i++)e.rowWidth[i]<t&&(a=i,t=e.rowWidth[i]);return a},T.prototype.getLongestRowIndex=function(e){for(var a=-1,t=Number.MIN_VALUE,i=0;i<e.rows.length;i++)e.rowWidth[i]>t&&(a=i,t=e.rowWidth[i]);return a},T.prototype.canAddHorizontal=function(e,a,t){if(e.idealRowWidth){var i=e.rows.length-1,r=e.rowWidth[i];return r+a+e.horizontalPadding<=e.idealRowWidth}var n=this.getShortestRowIndex(e);if(n<0)return!0;var o=e.rowWidth[n];if(o+e.horizontalPadding+a<=e.width)return!0;var h=0;e.rowHeight[n]<t&&n>0&&(h=t+e.verticalPadding-e.rowHeight[n]);var c;e.width-o>=a+e.horizontalPadding?c=(e.height+h)/(o+a+e.horizontalPadding):c=(e.height+h)/e.width,h=t+e.verticalPadding;var v;return e.width<a?v=(e.height+h)/a:v=(e.height+h)/e.width,v<1&&(v=1/v),c<1&&(c=1/c),c<v},T.prototype.shiftToLastRow=function(e){var a=this.getLongestRowIndex(e),t=e.rowWidth.length-1,i=e.rows[a],r=i[i.length-1],n=r.width+e.horizontalPadding;if(e.width-e.rowWidth[t]>n&&a!=t){i.splice(-1,1),e.rows[t].push(r),e.rowWidth[a]=e.rowWidth[a]-n,e.rowWidth[t]=e.rowWidth[t]+n,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,h=0;h<i.length;h++)i[h].height>o&&(o=i[h].height);a>0&&(o+=e.verticalPadding);var c=e.rowHeight[a]+e.rowHeight[t];e.rowHeight[a]=o,e.rowHeight[t]<r.height+e.verticalPadding&&(e.rowHeight[t]=r.height+e.verticalPadding);var v=e.rowHeight[a]+e.rowHeight[t];e.height+=v-c,this.shiftToLastRow(e)}},T.prototype.tilingPreLayout=function(){W.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},T.prototype.tilingPostLayout=function(){W.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},T.prototype.reduceTrees=function(){for(var e=[],a=!0,t;a;){var i=this.graphManager.getAllNodes(),r=[];a=!1;for(var n=0;n<i.length;n++)if(t=i[n],t.getEdges().length==1&&!t.getEdges()[0].isInterGraph&&t.getChild()==null){if(W.PURE_INCREMENTAL){var o=t.getEdges()[0].getOtherEnd(t),h=new Y(t.getCenterX()-o.getCenterX(),t.getCenterY()-o.getCenterY());r.push([t,t.getEdges()[0],t.getOwner(),h])}else r.push([t,t.getEdges()[0],t.getOwner()]);a=!0}if(a==!0){for(var c=[],v=0;v<r.length;v++)r[v][0].getEdges().length==1&&(c.push(r[v]),r[v][0].getOwner().remove(r[v][0]));e.push(c),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},T.prototype.growTree=function(e){for(var a=e.length,t=e[a-1],i,r=0;r<t.length;r++)i=t[r],this.findPlaceforPrunedNode(i),i[2].add(i[0]),i[2].add(i[1],i[1].source,i[1].target);e.splice(e.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},T.prototype.findPlaceforPrunedNode=function(e){var a,t,i=e[0];if(i==e[1].source?t=e[1].target:t=e[1].source,W.PURE_INCREMENTAL)i.setCenter(t.getCenterX()+e[3].getWidth(),t.getCenterY()+e[3].getHeight());else{var r=t.startX,n=t.finishX,o=t.startY,h=t.finishY,c=0,v=0,S=0,E=0,g=[c,S,v,E];if(o>0)for(var C=r;C<=n;C++)g[0]+=this.grid[C][o-1].length+this.grid[C][o].length-1;if(n<this.grid.length-1)for(var C=o;C<=h;C++)g[1]+=this.grid[n+1][C].length+this.grid[n][C].length-1;if(h<this.grid[0].length-1)for(var C=r;C<=n;C++)g[2]+=this.grid[C][h+1].length+this.grid[C][h].length-1;if(r>0)for(var C=o;C<=h;C++)g[3]+=this.grid[r-1][C].length+this.grid[r][C].length-1;for(var N=xe.MAX_VALUE,s,f,m=0;m<g.length;m++)g[m]<N?(N=g[m],s=1,f=m):g[m]==N&&s++;if(s==3&&N==0)g[0]==0&&g[1]==0&&g[2]==0?a=1:g[0]==0&&g[1]==0&&g[3]==0?a=0:g[0]==0&&g[2]==0&&g[3]==0?a=3:g[1]==0&&g[2]==0&&g[3]==0&&(a=2);else if(s==2&&N==0){var y=Math.floor(Math.random()*2);g[0]==0&&g[1]==0?y==0?a=0:a=1:g[0]==0&&g[2]==0?y==0?a=0:a=2:g[0]==0&&g[3]==0?y==0?a=0:a=3:g[1]==0&&g[2]==0?y==0?a=1:a=2:g[1]==0&&g[3]==0?y==0?a=1:a=3:y==0?a=2:a=3}else if(s==4&&N==0){var y=Math.floor(Math.random()*4);a=y}else a=f;a==0?i.setCenter(t.getCenterX(),t.getCenterY()-t.getHeight()/2-d.DEFAULT_EDGE_LENGTH-i.getHeight()/2):a==1?i.setCenter(t.getCenterX()+t.getWidth()/2+d.DEFAULT_EDGE_LENGTH+i.getWidth()/2,t.getCenterY()):a==2?i.setCenter(t.getCenterX(),t.getCenterY()+t.getHeight()/2+d.DEFAULT_EDGE_LENGTH+i.getHeight()/2):i.setCenter(t.getCenterX()-t.getWidth()/2-d.DEFAULT_EDGE_LENGTH-i.getWidth()/2,t.getCenterY())}},Q.exports=T}),991:((Q,ge,A)=>{var L=A(551).FDLayoutNode,G=A(551).IMath;function B(V,W,q,d){L.call(this,V,W,q,d)}B.prototype=Object.create(L.prototype);for(var Z in L)B[Z]=L[Z];B.prototype.calculateDisplacement=function(){var V=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=V.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=V.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=V.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=V.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>V.coolingFactor*V.maxNodeDisplacement&&(this.displacementX=V.coolingFactor*V.maxNodeDisplacement*G.sign(this.displacementX)),Math.abs(this.displacementY)>V.coolingFactor*V.maxNodeDisplacement&&(this.displacementY=V.coolingFactor*V.maxNodeDisplacement*G.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},B.prototype.propogateDisplacementToChildren=function(V,W){for(var q=this.getChild().getNodes(),d,re=0;re<q.length;re++)d=q[re],d.getChild()==null?(d.displacementX+=V,d.displacementY+=W):d.propogateDisplacementToChildren(V,W)},B.prototype.move=function(){var V=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),V.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},B.prototype.setPred1=function(V){this.pred1=V},B.prototype.getPred1=function(){return pred1},B.prototype.getPred2=function(){return pred2},B.prototype.setNext=function(V){this.next=V},B.prototype.getNext=function(){return next},B.prototype.setProcessed=function(V){this.processed=V},B.prototype.isProcessed=function(){return processed},Q.exports=B}),902:((Q,ge,A)=>{function L(q){if(Array.isArray(q)){for(var d=0,re=Array(q.length);d<q.length;d++)re[d]=q[d];return re}else return Array.from(q)}var G=A(806),B=A(551).LinkedList,Z=A(551).Matrix,V=A(551).SVD;function W(){}W.handleConstraints=function(q){var d={};d.fixedNodeConstraint=q.constraints.fixedNodeConstraint,d.alignmentConstraint=q.constraints.alignmentConstraint,d.relativePlacementConstraint=q.constraints.relativePlacementConstraint;for(var re=new Map,u=new Map,x=[],Y=[],Ce=q.getAllNodes(),xe=0,Re=0;Re<Ce.length;Re++){var ce=Ce[Re];ce.getChild()==null&&(u.set(ce.id,xe++),x.push(ce.getCenterX()),Y.push(ce.getCenterY()),re.set(ce.id,ce))}d.relativePlacementConstraint&&d.relativePlacementConstraint.forEach(function(l){!l.gap&&l.gap!=0&&(l.left?l.gap=G.DEFAULT_EDGE_LENGTH+re.get(l.left).getWidth()/2+re.get(l.right).getWidth()/2:l.gap=G.DEFAULT_EDGE_LENGTH+re.get(l.top).getHeight()/2+re.get(l.bottom).getHeight()/2)});var Ue=function(p,w){return{x:p.x-w.x,y:p.y-w.y}},Me=function(p){var w=0,P=0;return p.forEach(function(M){w+=x[u.get(M)],P+=Y[u.get(M)]}),{x:w/p.size,y:P/p.size}},T=function(p,w,P,M,b){function ee(X,F){var K=new Set(X),R=!0,O=!1,oe=void 0;try{for(var j=F[Symbol.iterator](),fe;!(R=(fe=j.next()).done);R=!0){var pe=fe.value;K.add(pe)}}catch(ve){O=!0,oe=ve}finally{try{!R&&j.return&&j.return()}finally{if(O)throw oe}}return K}var _=new Map;p.forEach(function(X,F){_.set(F,0)}),p.forEach(function(X,F){X.forEach(function(K){_.set(K.id,_.get(K.id)+1)})});var D=new Map,z=new Map,k=new B;_.forEach(function(X,F){X==0?(k.push(F),P||(w=="horizontal"?D.set(F,u.has(F)?x[u.get(F)]:M.get(F)):D.set(F,u.has(F)?Y[u.get(F)]:M.get(F)))):D.set(F,Number.NEGATIVE_INFINITY),P&&z.set(F,new Set([F]))}),P&&b.forEach(function(X){var F=[];if(X.forEach(function(O){P.has(O)&&F.push(O)}),F.length>0){var K=0;F.forEach(function(O){w=="horizontal"?(D.set(O,u.has(O)?x[u.get(O)]:M.get(O)),K+=D.get(O)):(D.set(O,u.has(O)?Y[u.get(O)]:M.get(O)),K+=D.get(O))}),K=K/F.length,X.forEach(function(O){P.has(O)||D.set(O,K)})}else{var R=0;X.forEach(function(O){w=="horizontal"?R+=u.has(O)?x[u.get(O)]:M.get(O):R+=u.has(O)?Y[u.get(O)]:M.get(O)}),R=R/X.length,X.forEach(function(O){D.set(O,R)})}});for(var ne=function(){var F=k.shift(),K=p.get(F);K.forEach(function(R){if(D.get(R.id)<D.get(F)+R.gap)if(P&&P.has(R.id)){var O=void 0;if(w=="horizontal"?O=u.has(R.id)?x[u.get(R.id)]:M.get(R.id):O=u.has(R.id)?Y[u.get(R.id)]:M.get(R.id),D.set(R.id,O),O<D.get(F)+R.gap){var oe=D.get(F)+R.gap-O;z.get(F).forEach(function(j){D.set(j,D.get(j)-oe)})}}else D.set(R.id,D.get(F)+R.gap);_.set(R.id,_.get(R.id)-1),_.get(R.id)==0&&k.push(R.id),P&&z.set(R.id,ee(z.get(F),z.get(R.id)))})};k.length!=0;)ne();if(P){var $=new Set;p.forEach(function(X,F){X.length==0&&$.add(F)});var ue=[];z.forEach(function(X,F){if($.has(F)){var K=!1,R=!0,O=!1,oe=void 0;try{for(var j=X[Symbol.iterator](),fe;!(R=(fe=j.next()).done);R=!0){var pe=fe.value;P.has(pe)&&(K=!0)}}catch(ae){O=!0,oe=ae}finally{try{!R&&j.return&&j.return()}finally{if(O)throw oe}}if(!K){var ve=!1,Te=void 0;ue.forEach(function(ae,de){ae.has([].concat(L(X))[0])&&(ve=!0,Te=de)}),ve?X.forEach(function(ae){ue[Te].add(ae)}):ue.push(new Set(X))}}}),ue.forEach(function(X,F){var K=Number.POSITIVE_INFINITY,R=Number.POSITIVE_INFINITY,O=Number.NEGATIVE_INFINITY,oe=Number.NEGATIVE_INFINITY,j=!0,fe=!1,pe=void 0;try{for(var ve=X[Symbol.iterator](),Te;!(j=(Te=ve.next()).done);j=!0){var ae=Te.value,de=void 0;w=="horizontal"?de=u.has(ae)?x[u.get(ae)]:M.get(ae):de=u.has(ae)?Y[u.get(ae)]:M.get(ae);var Le=D.get(ae);de<K&&(K=de),de>O&&(O=de),Le<R&&(R=Le),Le>oe&&(oe=Le)}}catch(De){fe=!0,pe=De}finally{try{!j&&ve.return&&ve.return()}finally{if(fe)throw pe}}var ze=(K+O)/2-(R+oe)/2,Ee=!0,Pe=!1,Fe=void 0;try{for(var me=X[Symbol.iterator](),Ve;!(Ee=(Ve=me.next()).done);Ee=!0){var Oe=Ve.value;D.set(Oe,D.get(Oe)+ze)}}catch(De){Pe=!0,Fe=De}finally{try{!Ee&&me.return&&me.return()}finally{if(Pe)throw Fe}}})}return D},ye=function(p){var w=0,P=0,M=0,b=0;if(p.forEach(function(z){z.left?x[u.get(z.left)]-x[u.get(z.right)]>=0?w++:P++:Y[u.get(z.top)]-Y[u.get(z.bottom)]>=0?M++:b++}),w>P&&M>b)for(var ee=0;ee<u.size;ee++)x[ee]=-1*x[ee],Y[ee]=-1*Y[ee];else if(w>P)for(var _=0;_<u.size;_++)x[_]=-1*x[_];else if(M>b)for(var D=0;D<u.size;D++)Y[D]=-1*Y[D]},e=function(p){var w=[],P=new B,M=new Set,b=0;return p.forEach(function(ee,_){if(!M.has(_)){w[b]=[];var D=_;for(P.push(D),M.add(D),w[b].push(D);P.length!=0;){D=P.shift();var z=p.get(D);z.forEach(function(k){M.has(k.id)||(P.push(k.id),M.add(k.id),w[b].push(k.id))})}b++}}),w},a=function(p){var w=new Map;return p.forEach(function(P,M){w.set(M,[])}),p.forEach(function(P,M){P.forEach(function(b){w.get(M).push(b),w.get(b.id).push({id:M,gap:b.gap,direction:b.direction})})}),w},t=function(p){var w=new Map;return p.forEach(function(P,M){w.set(M,[])}),p.forEach(function(P,M){P.forEach(function(b){w.get(b.id).push({id:M,gap:b.gap,direction:b.direction})})}),w},i=[],r=[],n=!1,o=!1,h=new Set,c=new Map,v=new Map,S=[];if(d.fixedNodeConstraint&&d.fixedNodeConstraint.forEach(function(l){h.add(l.nodeId)}),d.relativePlacementConstraint&&(d.relativePlacementConstraint.forEach(function(l){l.left?(c.has(l.left)?c.get(l.left).push({id:l.right,gap:l.gap,direction:"horizontal"}):c.set(l.left,[{id:l.right,gap:l.gap,direction:"horizontal"}]),c.has(l.right)||c.set(l.right,[])):(c.has(l.top)?c.get(l.top).push({id:l.bottom,gap:l.gap,direction:"vertical"}):c.set(l.top,[{id:l.bottom,gap:l.gap,direction:"vertical"}]),c.has(l.bottom)||c.set(l.bottom,[]))}),v=a(c),S=e(v)),G.TRANSFORM_ON_CONSTRAINT_HANDLING){if(d.fixedNodeConstraint&&d.fixedNodeConstraint.length>1)d.fixedNodeConstraint.forEach(function(l,p){i[p]=[l.position.x,l.position.y],r[p]=[x[u.get(l.nodeId)],Y[u.get(l.nodeId)]]}),n=!0;else if(d.alignmentConstraint)(function(){var l=0;if(d.alignmentConstraint.vertical){for(var p=d.alignmentConstraint.vertical,w=function(D){var z=new Set;p[D].forEach(function($){z.add($)});var k=new Set([].concat(L(z)).filter(function($){return h.has($)})),ne=void 0;k.size>0?ne=x[u.get(k.values().next().value)]:ne=Me(z).x,p[D].forEach(function($){i[l]=[ne,Y[u.get($)]],r[l]=[x[u.get($)],Y[u.get($)]],l++})},P=0;P<p.length;P++)w(P);n=!0}if(d.alignmentConstraint.horizontal){for(var M=d.alignmentConstraint.horizontal,b=function(D){var z=new Set;M[D].forEach(function($){z.add($)});var k=new Set([].concat(L(z)).filter(function($){return h.has($)})),ne=void 0;k.size>0?ne=x[u.get(k.values().next().value)]:ne=Me(z).y,M[D].forEach(function($){i[l]=[x[u.get($)],ne],r[l]=[x[u.get($)],Y[u.get($)]],l++})},ee=0;ee<M.length;ee++)b(ee);n=!0}d.relativePlacementConstraint&&(o=!0)})();else if(d.relativePlacementConstraint){for(var E=0,g=0,C=0;C<S.length;C++)S[C].length>E&&(E=S[C].length,g=C);if(E<v.size/2)ye(d.relativePlacementConstraint),n=!1,o=!1;else{var N=new Map,s=new Map,f=[];S[g].forEach(function(l){c.get(l).forEach(function(p){p.direction=="horizontal"?(N.has(l)?N.get(l).push(p):N.set(l,[p]),N.has(p.id)||N.set(p.id,[]),f.push({left:l,right:p.id})):(s.has(l)?s.get(l).push(p):s.set(l,[p]),s.has(p.id)||s.set(p.id,[]),f.push({top:l,bottom:p.id}))})}),ye(f),o=!1;var m=T(N,"horizontal"),y=T(s,"vertical");S[g].forEach(function(l,p){r[p]=[x[u.get(l)],Y[u.get(l)]],i[p]=[],m.has(l)?i[p][0]=m.get(l):i[p][0]=x[u.get(l)],y.has(l)?i[p][1]=y.get(l):i[p][1]=Y[u.get(l)]}),n=!0}}if(n){for(var U=void 0,J=Z.transpose(i),he=Z.transpose(r),ie=0;ie<J.length;ie++)J[ie]=Z.multGamma(J[ie]),he[ie]=Z.multGamma(he[ie]);var be=Z.multMat(J,Z.transpose(he)),Se=V.svd(be);U=Z.multMat(Se.V,Z.transpose(Se.U));for(var se=0;se<u.size;se++){var Ge=[x[se],Y[se]],we=[U[0][0],U[1][0]],lt=[U[0][1],U[1][1]];x[se]=Z.dotProduct(Ge,we),Y[se]=Z.dotProduct(Ge,lt)}o&&ye(d.relativePlacementConstraint)}}if(G.ENFORCE_CONSTRAINTS){if(d.fixedNodeConstraint&&d.fixedNodeConstraint.length>0){var Ae={x:0,y:0};d.fixedNodeConstraint.forEach(function(l,p){var w={x:x[u.get(l.nodeId)],y:Y[u.get(l.nodeId)]},P=l.position,M=Ue(P,w);Ae.x+=M.x,Ae.y+=M.y}),Ae.x/=d.fixedNodeConstraint.length,Ae.y/=d.fixedNodeConstraint.length,x.forEach(function(l,p){x[p]+=Ae.x}),Y.forEach(function(l,p){Y[p]+=Ae.y}),d.fixedNodeConstraint.forEach(function(l){x[u.get(l.nodeId)]=l.position.x,Y[u.get(l.nodeId)]=l.position.y})}if(d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var je=d.alignmentConstraint.vertical,ht=function(p){var w=new Set;je[p].forEach(function(b){w.add(b)});var P=new Set([].concat(L(w)).filter(function(b){return h.has(b)})),M=void 0;P.size>0?M=x[u.get(P.values().next().value)]:M=Me(w).x,w.forEach(function(b){h.has(b)||(x[u.get(b)]=M)})},Xe=0;Xe<je.length;Xe++)ht(Xe);if(d.alignmentConstraint.horizontal)for(var qe=d.alignmentConstraint.horizontal,ft=function(p){var w=new Set;qe[p].forEach(function(b){w.add(b)});var P=new Set([].concat(L(w)).filter(function(b){return h.has(b)})),M=void 0;P.size>0?M=Y[u.get(P.values().next().value)]:M=Me(w).y,w.forEach(function(b){h.has(b)||(Y[u.get(b)]=M)})},Be=0;Be<qe.length;Be++)ft(Be)}d.relativePlacementConstraint&&(function(){var l=new Map,p=new Map,w=new Map,P=new Map,M=new Map,b=new Map,ee=new Set,_=new Set;if(h.forEach(function(te){ee.add(te),_.add(te)}),d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var D=d.alignmentConstraint.vertical,z=function(H){w.set("dummy"+H,[]),D[H].forEach(function(I){l.set(I,"dummy"+H),w.get("dummy"+H).push(I),h.has(I)&&ee.add("dummy"+H)}),M.set("dummy"+H,x[u.get(D[H][0])])},k=0;k<D.length;k++)z(k);if(d.alignmentConstraint.horizontal)for(var ne=d.alignmentConstraint.horizontal,$=function(H){P.set("dummy"+H,[]),ne[H].forEach(function(I){p.set(I,"dummy"+H),P.get("dummy"+H).push(I),h.has(I)&&_.add("dummy"+H)}),b.set("dummy"+H,Y[u.get(ne[H][0])])},ue=0;ue<ne.length;ue++)$(ue)}var X=new Map,F=new Map,K=function(H){c.get(H).forEach(function(I){var Ne=void 0,le=void 0;I.direction=="horizontal"?(Ne=l.get(H)?l.get(H):H,l.get(I.id)?le={id:l.get(I.id),gap:I.gap,direction:I.direction}:le=I,X.has(Ne)?X.get(Ne).push(le):X.set(Ne,[le]),X.has(le.id)||X.set(le.id,[])):(Ne=p.get(H)?p.get(H):H,p.get(I.id)?le={id:p.get(I.id),gap:I.gap,direction:I.direction}:le=I,F.has(Ne)?F.get(Ne).push(le):F.set(Ne,[le]),F.has(le.id)||F.set(le.id,[]))})},R=!0,O=!1,oe=void 0;try{for(var j=c.keys()[Symbol.iterator](),fe;!(R=(fe=j.next()).done);R=!0){var pe=fe.value;K(pe)}}catch(te){O=!0,oe=te}finally{try{!R&&j.return&&j.return()}finally{if(O)throw oe}}var ve=a(X),Te=a(F),ae=e(ve),de=e(Te),Le=t(X),ze=t(F),Ee=[],Pe=[];ae.forEach(function(te,H){Ee[H]=[],te.forEach(function(I){Le.get(I).length==0&&Ee[H].push(I)})}),de.forEach(function(te,H){Pe[H]=[],te.forEach(function(I){ze.get(I).length==0&&Pe[H].push(I)})});var Fe=T(X,"horizontal",ee,M,Ee),me=T(F,"vertical",_,b,Pe),Ve=function(H){w.get(H)?w.get(H).forEach(function(I){x[u.get(I)]=Fe.get(H)}):x[u.get(H)]=Fe.get(H)},Oe=!0,De=!1,et=void 0;try{for(var Ze=Fe.keys()[Symbol.iterator](),tt;!(Oe=(tt=Ze.next()).done);Oe=!0){var Ke=tt.value;Ve(Ke)}}catch(te){De=!0,et=te}finally{try{!Oe&&Ze.return&&Ze.return()}finally{if(De)throw et}}var gt=function(H){P.get(H)?P.get(H).forEach(function(I){Y[u.get(I)]=me.get(H)}):Y[u.get(H)]=me.get(H)},Qe=!0,rt=!1,it=void 0;try{for(var _e=me.keys()[Symbol.iterator](),at;!(Qe=(at=_e.next()).done);Qe=!0){var Ke=at.value;gt(Ke)}}catch(te){rt=!0,it=te}finally{try{!Qe&&_e.return&&_e.return()}finally{if(rt)throw it}}})()}for(var Ie=0;Ie<Ce.length;Ie++){var We=Ce[Ie];We.getChild()==null&&We.setCenter(x[u.get(We.id)],Y[u.get(We.id)])}},Q.exports=W}),551:(Q=>{Q.exports=$e})},He={};function ke(Q){var ge=He[Q];if(ge!==void 0)return ge.exports;var A=He[Q]={exports:{}};return Je[Q](A,A.exports,ke),A.exports}var nt=ke(45);return nt})()})})(Ye.__module)),Ye.__module.exports}exports.__require=ct;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ye=require("../../../../_virtual/cose-base.cjs2.js"),vt=require("../layout-base/layout-base.cjs.js");var dt=Ye.__module.exports,ot;function ct(){return ot||(ot=1,(function(st,ut){(function(Je,He){st.exports=He(vt.__require())})(dt,function($e){return(()=>{var Je={45:((Q,ge,A)=>{var L={};L.layoutBase=A(551),L.CoSEConstants=A(806),L.CoSEEdge=A(767),L.CoSEGraph=A(880),L.CoSEGraphManager=A(578),L.CoSELayout=A(765),L.CoSENode=A(991),L.ConstraintHandler=A(902),Q.exports=L}),806:((Q,ge,A)=>{var L=A(551).FDLayoutConstants;function G(){}for(var B in L)G[B]=L[B];G.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,G.DEFAULT_RADIAL_SEPARATION=L.DEFAULT_EDGE_LENGTH,G.DEFAULT_COMPONENT_SEPERATION=60,G.TILE=!0,G.TILING_PADDING_VERTICAL=10,G.TILING_PADDING_HORIZONTAL=10,G.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,G.ENFORCE_CONSTRAINTS=!0,G.APPLY_LAYOUT=!0,G.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,G.TREE_REDUCTION_ON_INCREMENTAL=!0,G.PURE_INCREMENTAL=G.DEFAULT_INCREMENTAL,Q.exports=G}),767:((Q,ge,A)=>{var L=A(551).FDLayoutEdge;function G(Z,V,W){L.call(this,Z,V,W)}G.prototype=Object.create(L.prototype);for(var B in L)G[B]=L[B];Q.exports=G}),880:((Q,ge,A)=>{var L=A(551).LGraph;function G(Z,V,W){L.call(this,Z,V,W)}G.prototype=Object.create(L.prototype);for(var B in L)G[B]=L[B];Q.exports=G}),578:((Q,ge,A)=>{var L=A(551).LGraphManager;function G(Z){L.call(this,Z)}G.prototype=Object.create(L.prototype);for(var B in L)G[B]=L[B];Q.exports=G}),765:((Q,ge,A)=>{var L=A(551).FDLayout,G=A(578),B=A(880),Z=A(991),V=A(767),W=A(806),q=A(902),d=A(551).FDLayoutConstants,re=A(551).LayoutConstants,u=A(551).Point,x=A(551).PointD,Y=A(551).DimensionD,Ce=A(551).Layout,xe=A(551).Integer,Re=A(551).IGeometry,ce=A(551).LGraph,Ue=A(551).Transform,Me=A(551).LinkedList;function T(){L.call(this),this.toBeTiled={},this.constraints={}}T.prototype=Object.create(L.prototype);for(var ye in L)T[ye]=L[ye];T.prototype.newGraphManager=function(){var e=new G(this);return this.graphManager=e,e},T.prototype.newGraph=function(e){return new B(null,this.graphManager,e)},T.prototype.newNode=function(e){return new Z(this.graphManager,e)},T.prototype.newEdge=function(e){return new V(null,null,e)},T.prototype.initParameters=function(){L.prototype.initParameters.call(this,arguments),this.isSubLayout||(W.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=W.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=W.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)},T.prototype.initSpringEmbedder=function(){L.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},T.prototype.layout=function(){var e=re.DEFAULT_CREATE_BENDS_AS_NEEDED;return e&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},T.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){if(W.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(n){return a.has(n)});this.graphManager.setAllNodesToApplyGravitation(t)}}else{var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(i){return a.has(i)});this.graphManager.setAllNodesToApplyGravitation(t),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(q.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),W.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},T.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(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 e=new Set(this.getAllNodes()),a=this.nodesWithGravity.filter(function(r){return e.has(r)});this.graphManager.setAllNodesToApplyGravitation(a),this.graphManager.updateBounds(),this.updateGrid(),W.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()),W.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 t=!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(t,i),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},T.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),a={},t=0;t<e.length;t++){var i=e[t].rect,r=e[t].id;a[r]={id:r,x:i.getCenterX(),y:i.getCenterY(),w:i.width,h:i.height}}return a},T.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var e=!1;if(d.ANIMATE==="during")this.emit("layoutstarted");else{for(;!e;)e=this.tick();this.graphManager.updateBounds()}},T.prototype.moveNodes=function(){for(var e=this.getAllNodes(),a,t=0;t<e.length;t++)a=e[t],a.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var t=0;t<e.length;t++)a=e[t],a.move()},T.prototype.initConstraintVariables=function(){var e=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var a=this.graphManager.getAllNodes(),t=0;t<a.length;t++){var i=a[t];this.idToNodeMap.set(i.id,i)}var r=function s(f){for(var m=f.getChild().getNodes(),y,U=0,J=0;J<m.length;J++)y=m[J],y.getChild()==null?e.fixedNodeSet.has(y.id)&&(U+=100):U+=s(y);return U};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(m){e.fixedNodeSet.add(m.nodeId)});for(var a=this.graphManager.getAllNodes(),i,t=0;t<a.length;t++)if(i=a[t],i.getChild()!=null){var n=r(i);n>0&&(i.fixedNodeWeight=n)}}if(this.constraints.relativePlacementConstraint){var o=new Map,h=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(s){e.fixedNodesOnHorizontal.add(s),e.fixedNodesOnVertical.add(s)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var c=this.constraints.alignmentConstraint.vertical,t=0;t<c.length;t++)this.dummyToNodeForVerticalAlignment.set("dummy"+t,[]),c[t].forEach(function(f){o.set(f,"dummy"+t),e.dummyToNodeForVerticalAlignment.get("dummy"+t).push(f),e.fixedNodeSet.has(f)&&e.fixedNodesOnHorizontal.add("dummy"+t)});if(this.constraints.alignmentConstraint.horizontal)for(var v=this.constraints.alignmentConstraint.horizontal,t=0;t<v.length;t++)this.dummyToNodeForHorizontalAlignment.set("dummy"+t,[]),v[t].forEach(function(f){h.set(f,"dummy"+t),e.dummyToNodeForHorizontalAlignment.get("dummy"+t).push(f),e.fixedNodeSet.has(f)&&e.fixedNodesOnVertical.add("dummy"+t)})}if(W.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(s){var f,m,y;for(y=s.length-1;y>=2*s.length/3;y--)f=Math.floor(Math.random()*(y+1)),m=s[y],s[y]=s[f],s[f]=m;return s},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(s){if(s.left){var f=o.has(s.left)?o.get(s.left):s.left,m=o.has(s.right)?o.get(s.right):s.right;e.nodesInRelativeHorizontal.includes(f)||(e.nodesInRelativeHorizontal.push(f),e.nodeToRelativeConstraintMapHorizontal.set(f,[]),e.dummyToNodeForVerticalAlignment.has(f)?e.nodeToTempPositionMapHorizontal.set(f,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(f)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(f,e.idToNodeMap.get(f).getCenterX())),e.nodesInRelativeHorizontal.includes(m)||(e.nodesInRelativeHorizontal.push(m),e.nodeToRelativeConstraintMapHorizontal.set(m,[]),e.dummyToNodeForVerticalAlignment.has(m)?e.nodeToTempPositionMapHorizontal.set(m,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(m)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(m,e.idToNodeMap.get(m).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(f).push({right:m,gap:s.gap}),e.nodeToRelativeConstraintMapHorizontal.get(m).push({left:f,gap:s.gap})}else{var y=h.has(s.top)?h.get(s.top):s.top,U=h.has(s.bottom)?h.get(s.bottom):s.bottom;e.nodesInRelativeVertical.includes(y)||(e.nodesInRelativeVertical.push(y),e.nodeToRelativeConstraintMapVertical.set(y,[]),e.dummyToNodeForHorizontalAlignment.has(y)?e.nodeToTempPositionMapVertical.set(y,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(y)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(y,e.idToNodeMap.get(y).getCenterY())),e.nodesInRelativeVertical.includes(U)||(e.nodesInRelativeVertical.push(U),e.nodeToRelativeConstraintMapVertical.set(U,[]),e.dummyToNodeForHorizontalAlignment.has(U)?e.nodeToTempPositionMapVertical.set(U,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(U)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(U,e.idToNodeMap.get(U).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(y).push({bottom:U,gap:s.gap}),e.nodeToRelativeConstraintMapVertical.get(U).push({top:y,gap:s.gap})}});else{var S=new Map,E=new Map;this.constraints.relativePlacementConstraint.forEach(function(s){if(s.left){var f=o.has(s.left)?o.get(s.left):s.left,m=o.has(s.right)?o.get(s.right):s.right;S.has(f)?S.get(f).push(m):S.set(f,[m]),S.has(m)?S.get(m).push(f):S.set(m,[f])}else{var y=h.has(s.top)?h.get(s.top):s.top,U=h.has(s.bottom)?h.get(s.bottom):s.bottom;E.has(y)?E.get(y).push(U):E.set(y,[U]),E.has(U)?E.get(U).push(y):E.set(U,[y])}});var g=function(f,m){var y=[],U=[],J=new Me,he=new Set,ie=0;return f.forEach(function(be,Se){if(!he.has(Se)){y[ie]=[],U[ie]=!1;var se=Se;for(J.push(se),he.add(se),y[ie].push(se);J.length!=0;){se=J.shift(),m.has(se)&&(U[ie]=!0);var Ge=f.get(se);Ge.forEach(function(we){he.has(we)||(J.push(we),he.add(we),y[ie].push(we))})}ie++}}),{components:y,isFixed:U}},C=g(S,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=C.components,this.fixedComponentsOnHorizontal=C.isFixed;var N=g(E,e.fixedNodesOnVertical);this.componentsOnVertical=N.components,this.fixedComponentsOnVertical=N.isFixed}}},T.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(N){var s=e.idToNodeMap.get(N.nodeId);s.displacementX=0,s.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var a=this.constraints.alignmentConstraint.vertical,t=0;t<a.length;t++){for(var i=0,r=0;r<a[t].length;r++){if(this.fixedNodeSet.has(a[t][r])){i=0;break}i+=this.idToNodeMap.get(a[t][r]).displacementX}for(var n=i/a[t].length,r=0;r<a[t].length;r++)this.idToNodeMap.get(a[t][r]).displacementX=n}if(this.constraints.alignmentConstraint.horizontal)for(var o=this.constraints.alignmentConstraint.horizontal,t=0;t<o.length;t++){for(var h=0,r=0;r<o[t].length;r++){if(this.fixedNodeSet.has(o[t][r])){h=0;break}h+=this.idToNodeMap.get(o[t][r]).displacementY}for(var c=h/o[t].length,r=0;r<o[t].length;r++)this.idToNodeMap.get(o[t][r]).displacementY=c}}if(this.constraints.relativePlacementConstraint)if(W.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(N){if(!e.fixedNodesOnHorizontal.has(N)){var s=0;e.dummyToNodeForVerticalAlignment.has(N)?s=e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(N)[0]).displacementX:s=e.idToNodeMap.get(N).displacementX,e.nodeToRelativeConstraintMapHorizontal.get(N).forEach(function(f){if(f.right){var m=e.nodeToTempPositionMapHorizontal.get(f.right)-e.nodeToTempPositionMapHorizontal.get(N)-s;m<f.gap&&(s-=f.gap-m)}else{var m=e.nodeToTempPositionMapHorizontal.get(N)-e.nodeToTempPositionMapHorizontal.get(f.left)+s;m<f.gap&&(s+=f.gap-m)}}),e.nodeToTempPositionMapHorizontal.set(N,e.nodeToTempPositionMapHorizontal.get(N)+s),e.dummyToNodeForVerticalAlignment.has(N)?e.dummyToNodeForVerticalAlignment.get(N).forEach(function(f){e.idToNodeMap.get(f).displacementX=s}):e.idToNodeMap.get(N).displacementX=s}}),this.nodesInRelativeVertical.forEach(function(N){if(!e.fixedNodesOnHorizontal.has(N)){var s=0;e.dummyToNodeForHorizontalAlignment.has(N)?s=e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(N)[0]).displacementY:s=e.idToNodeMap.get(N).displacementY,e.nodeToRelativeConstraintMapVertical.get(N).forEach(function(f){if(f.bottom){var m=e.nodeToTempPositionMapVertical.get(f.bottom)-e.nodeToTempPositionMapVertical.get(N)-s;m<f.gap&&(s-=f.gap-m)}else{var m=e.nodeToTempPositionMapVertical.get(N)-e.nodeToTempPositionMapVertical.get(f.top)+s;m<f.gap&&(s+=f.gap-m)}}),e.nodeToTempPositionMapVertical.set(N,e.nodeToTempPositionMapVertical.get(N)+s),e.dummyToNodeForHorizontalAlignment.has(N)?e.dummyToNodeForHorizontalAlignment.get(N).forEach(function(f){e.idToNodeMap.get(f).displacementY=s}):e.idToNodeMap.get(N).displacementY=s}});else{for(var t=0;t<this.componentsOnHorizontal.length;t++){var v=this.componentsOnHorizontal[t];if(this.fixedComponentsOnHorizontal[t])for(var r=0;r<v.length;r++)this.dummyToNodeForVerticalAlignment.has(v[r])?this.dummyToNodeForVerticalAlignment.get(v[r]).forEach(function(f){e.idToNodeMap.get(f).displacementX=0}):this.idToNodeMap.get(v[r]).displacementX=0;else{for(var S=0,E=0,r=0;r<v.length;r++)if(this.dummyToNodeForVerticalAlignment.has(v[r])){var g=this.dummyToNodeForVerticalAlignment.get(v[r]);S+=g.length*this.idToNodeMap.get(g[0]).displacementX,E+=g.length}else S+=this.idToNodeMap.get(v[r]).displacementX,E++;for(var C=S/E,r=0;r<v.length;r++)this.dummyToNodeForVerticalAlignment.has(v[r])?this.dummyToNodeForVerticalAlignment.get(v[r]).forEach(function(f){e.idToNodeMap.get(f).displacementX=C}):this.idToNodeMap.get(v[r]).displacementX=C}}for(var t=0;t<this.componentsOnVertical.length;t++){var v=this.componentsOnVertical[t];if(this.fixedComponentsOnVertical[t])for(var r=0;r<v.length;r++)this.dummyToNodeForHorizontalAlignment.has(v[r])?this.dummyToNodeForHorizontalAlignment.get(v[r]).forEach(function(m){e.idToNodeMap.get(m).displacementY=0}):this.idToNodeMap.get(v[r]).displacementY=0;else{for(var S=0,E=0,r=0;r<v.length;r++)if(this.dummyToNodeForHorizontalAlignment.has(v[r])){var g=this.dummyToNodeForHorizontalAlignment.get(v[r]);S+=g.length*this.idToNodeMap.get(g[0]).displacementY,E+=g.length}else S+=this.idToNodeMap.get(v[r]).displacementY,E++;for(var C=S/E,r=0;r<v.length;r++)this.dummyToNodeForHorizontalAlignment.has(v[r])?this.dummyToNodeForHorizontalAlignment.get(v[r]).forEach(function(J){e.idToNodeMap.get(J).displacementY=C}):this.idToNodeMap.get(v[r]).displacementY=C}}}},T.prototype.calculateNodesToApplyGravitationTo=function(){var e=[],a,t=this.graphManager.getGraphs(),i=t.length,r;for(r=0;r<i;r++)a=t[r],a.updateConnected(),a.isConnected||(e=e.concat(a.getNodes()));return e},T.prototype.createBendpoints=function(){var e=[];e=e.concat(this.graphManager.getAllEdges());var a=new Set,t;for(t=0;t<e.length;t++){var i=e[t];if(!a.has(i)){var r=i.getSource(),n=i.getTarget();if(r==n)i.getBendpoints().push(new x),i.getBendpoints().push(new x),this.createDummyNodesForBendpoints(i),a.add(i);else{var o=[];if(o=o.concat(r.getEdgeListToNode(n)),o=o.concat(n.getEdgeListToNode(r)),!a.has(o[0])){if(o.length>1){var h;for(h=0;h<o.length;h++){var c=o[h];c.getBendpoints().push(new x),this.createDummyNodesForBendpoints(c)}}o.forEach(function(v){a.add(v)})}}}if(a.size==e.length)break}},T.prototype.positionNodesRadially=function(e){for(var a=new u(0,0),t=Math.ceil(Math.sqrt(e.length)),i=0,r=0,n=0,o=new x(0,0),h=0;h<e.length;h++){h%t==0&&(n=0,r=i,h!=0&&(r+=W.DEFAULT_COMPONENT_SEPERATION),i=0);var c=e[h],v=Ce.findCenterOfTree(c);a.x=n,a.y=r,o=T.radialLayout(c,v,a),o.y>i&&(i=Math.floor(o.y)),n=Math.floor(o.x+W.DEFAULT_COMPONENT_SEPERATION)}this.transform(new x(re.WORLD_CENTER_X-o.x/2,re.WORLD_CENTER_Y-o.y/2))},T.radialLayout=function(e,a,t){var i=Math.max(this.maxDiagonalInTree(e),W.DEFAULT_RADIAL_SEPARATION);T.branchRadialLayout(a,null,0,359,0,i);var r=ce.calculateBounds(e),n=new Ue;n.setDeviceOrgX(r.getMinX()),n.setDeviceOrgY(r.getMinY()),n.setWorldOrgX(t.x),n.setWorldOrgY(t.y);for(var o=0;o<e.length;o++){var h=e[o];h.transform(n)}var c=new x(r.getMaxX(),r.getMaxY());return n.inverseTransformPoint(c)},T.branchRadialLayout=function(e,a,t,i,r,n){var o=(i-t+1)/2;o<0&&(o+=180);var h=(o+t)%360,c=h*Re.TWO_PI/360,v=r*Math.cos(c),S=r*Math.sin(c);e.setCenter(v,S);var E=[];E=E.concat(e.getEdges());var g=E.length;a!=null&&g--;for(var C=0,N=E.length,s,f=e.getEdgesBetween(a);f.length>1;){var m=f[0];f.splice(0,1);var y=E.indexOf(m);y>=0&&E.splice(y,1),N--,g--}a!=null?s=(E.indexOf(f[0])+1)%N:s=0;for(var U=Math.abs(i-t)/g,J=s;C!=g;J=++J%N){var he=E[J].getOtherEnd(e);if(he!=a){var ie=(t+C*U)%360,be=(ie+U)%360;T.branchRadialLayout(he,e,ie,be,r+n,n),C++}}},T.maxDiagonalInTree=function(e){for(var a=xe.MIN_VALUE,t=0;t<e.length;t++){var i=e[t],r=i.getDiagonal();r>a&&(a=r)}return a},T.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},T.prototype.groupZeroDegreeMembers=function(){var e=this,a={};this.memberGroups={},this.idToDummyNode={};for(var t=[],i=this.graphManager.getAllNodes(),r=0;r<i.length;r++){var n=i[r],o=n.getParent();this.getNodeDegreeWithChildren(n)===0&&(o.id==null||!this.getToBeTiled(o))&&t.push(n)}for(var r=0;r<t.length;r++){var n=t[r],h=n.getParent().id;typeof a[h]>"u"&&(a[h]=[]),a[h]=a[h].concat(n)}Object.keys(a).forEach(function(c){if(a[c].length>1){var v="DummyCompound_"+c;e.memberGroups[v]=a[c];var S=a[c][0].getParent(),E=new Z(e.graphManager);E.id=v,E.paddingLeft=S.paddingLeft||0,E.paddingRight=S.paddingRight||0,E.paddingBottom=S.paddingBottom||0,E.paddingTop=S.paddingTop||0,e.idToDummyNode[v]=E;var g=e.getGraphManager().add(e.newGraph(),E),C=S.getChild();C.add(E);for(var N=0;N<a[c].length;N++){var s=a[c][N];C.remove(s),g.add(s)}}})},T.prototype.clearCompounds=function(){var e={},a={};this.performDFSOnCompounds();for(var t=0;t<this.compoundOrder.length;t++)a[this.compoundOrder[t].id]=this.compoundOrder[t],e[this.compoundOrder[t].id]=[].concat(this.compoundOrder[t].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[t].getChild()),this.compoundOrder[t].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(e,a)},T.prototype.clearZeroDegreeMembers=function(){var e=this,a=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(t){var i=e.idToDummyNode[t];if(a[t]=e.tileNodes(e.memberGroups[t],i.paddingLeft+i.paddingRight),i.rect.width=a[t].width,i.rect.height=a[t].height,i.setCenter(a[t].centerX,a[t].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,W.NODE_DIMENSIONS_INCLUDE_LABELS){var r=i.rect.width,n=i.rect.height;i.labelWidth&&(i.labelPosHorizontal=="left"?(i.rect.x-=i.labelWidth,i.setWidth(r+i.labelWidth),i.labelMarginLeft=i.labelWidth):i.labelPosHorizontal=="center"&&i.labelWidth>r?(i.rect.x-=(i.labelWidth-r)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-r)/2):i.labelPosHorizontal=="right"&&i.setWidth(r+i.labelWidth)),i.labelHeight&&(i.labelPosVertical=="top"?(i.rect.y-=i.labelHeight,i.setHeight(n+i.labelHeight),i.labelMarginTop=i.labelHeight):i.labelPosVertical=="center"&&i.labelHeight>n?(i.rect.y-=(i.labelHeight-n)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-n)/2):i.labelPosVertical=="bottom"&&i.setHeight(n+i.labelHeight))}})},T.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var a=this.compoundOrder[e],t=a.id,i=a.paddingLeft,r=a.paddingTop,n=a.labelMarginLeft,o=a.labelMarginTop;this.adjustLocations(this.tiledMemberPack[t],a.rect.x,a.rect.y,i,r,n,o)}},T.prototype.repopulateZeroDegreeMembers=function(){var e=this,a=this.tiledZeroDegreePack;Object.keys(a).forEach(function(t){var i=e.idToDummyNode[t],r=i.paddingLeft,n=i.paddingTop,o=i.labelMarginLeft,h=i.labelMarginTop;e.adjustLocations(a[t],i.rect.x,i.rect.y,r,n,o,h)})},T.prototype.getToBeTiled=function(e){var a=e.id;if(this.toBeTiled[a]!=null)return this.toBeTiled[a];var t=e.getChild();if(t==null)return this.toBeTiled[a]=!1,!1;for(var i=t.getNodes(),r=0;r<i.length;r++){var n=i[r];if(this.getNodeDegree(n)>0)return this.toBeTiled[a]=!1,!1;if(n.getChild()==null){this.toBeTiled[n.id]=!1;continue}if(!this.getToBeTiled(n))return this.toBeTiled[a]=!1,!1}return this.toBeTiled[a]=!0,!0},T.prototype.getNodeDegree=function(e){e.id;for(var a=e.getEdges(),t=0,i=0;i<a.length;i++){var r=a[i];r.getSource().id!==r.getTarget().id&&(t=t+1)}return t},T.prototype.getNodeDegreeWithChildren=function(e){var a=this.getNodeDegree(e);if(e.getChild()==null)return a;for(var t=e.getChild().getNodes(),i=0;i<t.length;i++){var r=t[i];a+=this.getNodeDegreeWithChildren(r)}return a},T.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},T.prototype.fillCompexOrderByDFS=function(e){for(var a=0;a<e.length;a++){var t=e[a];t.getChild()!=null&&this.fillCompexOrderByDFS(t.getChild().getNodes()),this.getToBeTiled(t)&&this.compoundOrder.push(t)}},T.prototype.adjustLocations=function(e,a,t,i,r,n,o){a+=i+n,t+=r+o;for(var h=a,c=0;c<e.rows.length;c++){var v=e.rows[c];a=h;for(var S=0,E=0;E<v.length;E++){var g=v[E];g.rect.x=a,g.rect.y=t,a+=g.rect.width+e.horizontalPadding,g.rect.height>S&&(S=g.rect.height)}t+=S+e.verticalPadding}},T.prototype.tileCompoundMembers=function(e,a){var t=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(i){var r=a[i];if(t.tiledMemberPack[i]=t.tileNodes(e[i],r.paddingLeft+r.paddingRight),r.rect.width=t.tiledMemberPack[i].width,r.rect.height=t.tiledMemberPack[i].height,r.setCenter(t.tiledMemberPack[i].centerX,t.tiledMemberPack[i].centerY),r.labelMarginLeft=0,r.labelMarginTop=0,W.NODE_DIMENSIONS_INCLUDE_LABELS){var n=r.rect.width,o=r.rect.height;r.labelWidth&&(r.labelPosHorizontal=="left"?(r.rect.x-=r.labelWidth,r.setWidth(n+r.labelWidth),r.labelMarginLeft=r.labelWidth):r.labelPosHorizontal=="center"&&r.labelWidth>n?(r.rect.x-=(r.labelWidth-n)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-n)/2):r.labelPosHorizontal=="right"&&r.setWidth(n+r.labelWidth)),r.labelHeight&&(r.labelPosVertical=="top"?(r.rect.y-=r.labelHeight,r.setHeight(o+r.labelHeight),r.labelMarginTop=r.labelHeight):r.labelPosVertical=="center"&&r.labelHeight>o?(r.rect.y-=(r.labelHeight-o)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-o)/2):r.labelPosVertical=="bottom"&&r.setHeight(o+r.labelHeight))}})},T.prototype.tileNodes=function(e,a){var t=this.tileNodesByFavoringDim(e,a,!0),i=this.tileNodesByFavoringDim(e,a,!1),r=this.getOrgRatio(t),n=this.getOrgRatio(i),o;return n<r?o=i:o=t,o},T.prototype.getOrgRatio=function(e){var a=e.width,t=e.height,i=a/t;return i<1&&(i=1/i),i},T.prototype.calcIdealRowWidth=function(e,a){var t=W.TILING_PADDING_VERTICAL,i=W.TILING_PADDING_HORIZONTAL,r=e.length,n=0,o=0,h=0;e.forEach(function(N){n+=N.getWidth(),o+=N.getHeight(),N.getWidth()>h&&(h=N.getWidth())});var c=n/r,v=o/r,S=Math.pow(t-i,2)+4*(c+i)*(v+t)*r,E=(i-t+Math.sqrt(S))/(2*(c+i)),g;a?(g=Math.ceil(E),g==E&&g++):g=Math.floor(E);var C=g*(c+i)-i;return h>C&&(C=h),C+=i*2,C},T.prototype.tileNodesByFavoringDim=function(e,a,t){var i=W.TILING_PADDING_VERTICAL,r=W.TILING_PADDING_HORIZONTAL,n=W.TILING_COMPARE_BY,o={rows:[],rowWidth:[],rowHeight:[],width:0,height:a,verticalPadding:i,horizontalPadding:r,centerX:0,centerY:0};n&&(o.idealRowWidth=this.calcIdealRowWidth(e,t));var h=function(s){return s.rect.width*s.rect.height},c=function(s,f){return h(f)-h(s)};e.sort(function(N,s){var f=c;return o.idealRowWidth?(f=n,f(N.id,s.id)):f(N,s)});for(var v=0,S=0,E=0;E<e.length;E++){var g=e[E];v+=g.getCenterX(),S+=g.getCenterY()}o.centerX=v/e.length,o.centerY=S/e.length;for(var E=0;E<e.length;E++){var g=e[E];if(o.rows.length==0)this.insertNodeToRow(o,g,0,a);else if(this.canAddHorizontal(o,g.rect.width,g.rect.height)){var C=o.rows.length-1;o.idealRowWidth||(C=this.getShortestRowIndex(o)),this.insertNodeToRow(o,g,C,a)}else this.insertNodeToRow(o,g,o.rows.length,a);this.shiftToLastRow(o)}return o},T.prototype.insertNodeToRow=function(e,a,t,i){var r=i;if(t==e.rows.length){var n=[];e.rows.push(n),e.rowWidth.push(r),e.rowHeight.push(0)}var o=e.rowWidth[t]+a.rect.width;e.rows[t].length>0&&(o+=e.horizontalPadding),e.rowWidth[t]=o,e.width<o&&(e.width=o);var h=a.rect.height;t>0&&(h+=e.verticalPadding);var c=0;h>e.rowHeight[t]&&(c=e.rowHeight[t],e.rowHeight[t]=h,c=e.rowHeight[t]-c),e.height+=c,e.rows[t].push(a)},T.prototype.getShortestRowIndex=function(e){for(var a=-1,t=Number.MAX_VALUE,i=0;i<e.rows.length;i++)e.rowWidth[i]<t&&(a=i,t=e.rowWidth[i]);return a},T.prototype.getLongestRowIndex=function(e){for(var a=-1,t=Number.MIN_VALUE,i=0;i<e.rows.length;i++)e.rowWidth[i]>t&&(a=i,t=e.rowWidth[i]);return a},T.prototype.canAddHorizontal=function(e,a,t){if(e.idealRowWidth){var i=e.rows.length-1,r=e.rowWidth[i];return r+a+e.horizontalPadding<=e.idealRowWidth}var n=this.getShortestRowIndex(e);if(n<0)return!0;var o=e.rowWidth[n];if(o+e.horizontalPadding+a<=e.width)return!0;var h=0;e.rowHeight[n]<t&&n>0&&(h=t+e.verticalPadding-e.rowHeight[n]);var c;e.width-o>=a+e.horizontalPadding?c=(e.height+h)/(o+a+e.horizontalPadding):c=(e.height+h)/e.width,h=t+e.verticalPadding;var v;return e.width<a?v=(e.height+h)/a:v=(e.height+h)/e.width,v<1&&(v=1/v),c<1&&(c=1/c),c<v},T.prototype.shiftToLastRow=function(e){var a=this.getLongestRowIndex(e),t=e.rowWidth.length-1,i=e.rows[a],r=i[i.length-1],n=r.width+e.horizontalPadding;if(e.width-e.rowWidth[t]>n&&a!=t){i.splice(-1,1),e.rows[t].push(r),e.rowWidth[a]=e.rowWidth[a]-n,e.rowWidth[t]=e.rowWidth[t]+n,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,h=0;h<i.length;h++)i[h].height>o&&(o=i[h].height);a>0&&(o+=e.verticalPadding);var c=e.rowHeight[a]+e.rowHeight[t];e.rowHeight[a]=o,e.rowHeight[t]<r.height+e.verticalPadding&&(e.rowHeight[t]=r.height+e.verticalPadding);var v=e.rowHeight[a]+e.rowHeight[t];e.height+=v-c,this.shiftToLastRow(e)}},T.prototype.tilingPreLayout=function(){W.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},T.prototype.tilingPostLayout=function(){W.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},T.prototype.reduceTrees=function(){for(var e=[],a=!0,t;a;){var i=this.graphManager.getAllNodes(),r=[];a=!1;for(var n=0;n<i.length;n++)if(t=i[n],t.getEdges().length==1&&!t.getEdges()[0].isInterGraph&&t.getChild()==null){if(W.PURE_INCREMENTAL){var o=t.getEdges()[0].getOtherEnd(t),h=new Y(t.getCenterX()-o.getCenterX(),t.getCenterY()-o.getCenterY());r.push([t,t.getEdges()[0],t.getOwner(),h])}else r.push([t,t.getEdges()[0],t.getOwner()]);a=!0}if(a==!0){for(var c=[],v=0;v<r.length;v++)r[v][0].getEdges().length==1&&(c.push(r[v]),r[v][0].getOwner().remove(r[v][0]));e.push(c),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},T.prototype.growTree=function(e){for(var a=e.length,t=e[a-1],i,r=0;r<t.length;r++)i=t[r],this.findPlaceforPrunedNode(i),i[2].add(i[0]),i[2].add(i[1],i[1].source,i[1].target);e.splice(e.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},T.prototype.findPlaceforPrunedNode=function(e){var a,t,i=e[0];if(i==e[1].source?t=e[1].target:t=e[1].source,W.PURE_INCREMENTAL)i.setCenter(t.getCenterX()+e[3].getWidth(),t.getCenterY()+e[3].getHeight());else{var r=t.startX,n=t.finishX,o=t.startY,h=t.finishY,c=0,v=0,S=0,E=0,g=[c,S,v,E];if(o>0)for(var C=r;C<=n;C++)g[0]+=this.grid[C][o-1].length+this.grid[C][o].length-1;if(n<this.grid.length-1)for(var C=o;C<=h;C++)g[1]+=this.grid[n+1][C].length+this.grid[n][C].length-1;if(h<this.grid[0].length-1)for(var C=r;C<=n;C++)g[2]+=this.grid[C][h+1].length+this.grid[C][h].length-1;if(r>0)for(var C=o;C<=h;C++)g[3]+=this.grid[r-1][C].length+this.grid[r][C].length-1;for(var N=xe.MAX_VALUE,s,f,m=0;m<g.length;m++)g[m]<N?(N=g[m],s=1,f=m):g[m]==N&&s++;if(s==3&&N==0)g[0]==0&&g[1]==0&&g[2]==0?a=1:g[0]==0&&g[1]==0&&g[3]==0?a=0:g[0]==0&&g[2]==0&&g[3]==0?a=3:g[1]==0&&g[2]==0&&g[3]==0&&(a=2);else if(s==2&&N==0){var y=Math.floor(Math.random()*2);g[0]==0&&g[1]==0?y==0?a=0:a=1:g[0]==0&&g[2]==0?y==0?a=0:a=2:g[0]==0&&g[3]==0?y==0?a=0:a=3:g[1]==0&&g[2]==0?y==0?a=1:a=2:g[1]==0&&g[3]==0?y==0?a=1:a=3:y==0?a=2:a=3}else if(s==4&&N==0){var y=Math.floor(Math.random()*4);a=y}else a=f;a==0?i.setCenter(t.getCenterX(),t.getCenterY()-t.getHeight()/2-d.DEFAULT_EDGE_LENGTH-i.getHeight()/2):a==1?i.setCenter(t.getCenterX()+t.getWidth()/2+d.DEFAULT_EDGE_LENGTH+i.getWidth()/2,t.getCenterY()):a==2?i.setCenter(t.getCenterX(),t.getCenterY()+t.getHeight()/2+d.DEFAULT_EDGE_LENGTH+i.getHeight()/2):i.setCenter(t.getCenterX()-t.getWidth()/2-d.DEFAULT_EDGE_LENGTH-i.getWidth()/2,t.getCenterY())}},Q.exports=T}),991:((Q,ge,A)=>{var L=A(551).FDLayoutNode,G=A(551).IMath;function B(V,W,q,d){L.call(this,V,W,q,d)}B.prototype=Object.create(L.prototype);for(var Z in L)B[Z]=L[Z];B.prototype.calculateDisplacement=function(){var V=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=V.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=V.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=V.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=V.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>V.coolingFactor*V.maxNodeDisplacement&&(this.displacementX=V.coolingFactor*V.maxNodeDisplacement*G.sign(this.displacementX)),Math.abs(this.displacementY)>V.coolingFactor*V.maxNodeDisplacement&&(this.displacementY=V.coolingFactor*V.maxNodeDisplacement*G.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},B.prototype.propogateDisplacementToChildren=function(V,W){for(var q=this.getChild().getNodes(),d,re=0;re<q.length;re++)d=q[re],d.getChild()==null?(d.displacementX+=V,d.displacementY+=W):d.propogateDisplacementToChildren(V,W)},B.prototype.move=function(){var V=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),V.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},B.prototype.setPred1=function(V){this.pred1=V},B.prototype.getPred1=function(){return pred1},B.prototype.getPred2=function(){return pred2},B.prototype.setNext=function(V){this.next=V},B.prototype.getNext=function(){return next},B.prototype.setProcessed=function(V){this.processed=V},B.prototype.isProcessed=function(){return processed},Q.exports=B}),902:((Q,ge,A)=>{function L(q){if(Array.isArray(q)){for(var d=0,re=Array(q.length);d<q.length;d++)re[d]=q[d];return re}else return Array.from(q)}var G=A(806),B=A(551).LinkedList,Z=A(551).Matrix,V=A(551).SVD;function W(){}W.handleConstraints=function(q){var d={};d.fixedNodeConstraint=q.constraints.fixedNodeConstraint,d.alignmentConstraint=q.constraints.alignmentConstraint,d.relativePlacementConstraint=q.constraints.relativePlacementConstraint;for(var re=new Map,u=new Map,x=[],Y=[],Ce=q.getAllNodes(),xe=0,Re=0;Re<Ce.length;Re++){var ce=Ce[Re];ce.getChild()==null&&(u.set(ce.id,xe++),x.push(ce.getCenterX()),Y.push(ce.getCenterY()),re.set(ce.id,ce))}d.relativePlacementConstraint&&d.relativePlacementConstraint.forEach(function(l){!l.gap&&l.gap!=0&&(l.left?l.gap=G.DEFAULT_EDGE_LENGTH+re.get(l.left).getWidth()/2+re.get(l.right).getWidth()/2:l.gap=G.DEFAULT_EDGE_LENGTH+re.get(l.top).getHeight()/2+re.get(l.bottom).getHeight()/2)});var Ue=function(p,w){return{x:p.x-w.x,y:p.y-w.y}},Me=function(p){var w=0,P=0;return p.forEach(function(M){w+=x[u.get(M)],P+=Y[u.get(M)]}),{x:w/p.size,y:P/p.size}},T=function(p,w,P,M,b){function ee(X,F){var K=new Set(X),R=!0,O=!1,oe=void 0;try{for(var j=F[Symbol.iterator](),fe;!(R=(fe=j.next()).done);R=!0){var pe=fe.value;K.add(pe)}}catch(ve){O=!0,oe=ve}finally{try{!R&&j.return&&j.return()}finally{if(O)throw oe}}return K}var _=new Map;p.forEach(function(X,F){_.set(F,0)}),p.forEach(function(X,F){X.forEach(function(K){_.set(K.id,_.get(K.id)+1)})});var D=new Map,z=new Map,k=new B;_.forEach(function(X,F){X==0?(k.push(F),P||(w=="horizontal"?D.set(F,u.has(F)?x[u.get(F)]:M.get(F)):D.set(F,u.has(F)?Y[u.get(F)]:M.get(F)))):D.set(F,Number.NEGATIVE_INFINITY),P&&z.set(F,new Set([F]))}),P&&b.forEach(function(X){var F=[];if(X.forEach(function(O){P.has(O)&&F.push(O)}),F.length>0){var K=0;F.forEach(function(O){w=="horizontal"?(D.set(O,u.has(O)?x[u.get(O)]:M.get(O)),K+=D.get(O)):(D.set(O,u.has(O)?Y[u.get(O)]:M.get(O)),K+=D.get(O))}),K=K/F.length,X.forEach(function(O){P.has(O)||D.set(O,K)})}else{var R=0;X.forEach(function(O){w=="horizontal"?R+=u.has(O)?x[u.get(O)]:M.get(O):R+=u.has(O)?Y[u.get(O)]:M.get(O)}),R=R/X.length,X.forEach(function(O){D.set(O,R)})}});for(var ne=function(){var F=k.shift(),K=p.get(F);K.forEach(function(R){if(D.get(R.id)<D.get(F)+R.gap)if(P&&P.has(R.id)){var O=void 0;if(w=="horizontal"?O=u.has(R.id)?x[u.get(R.id)]:M.get(R.id):O=u.has(R.id)?Y[u.get(R.id)]:M.get(R.id),D.set(R.id,O),O<D.get(F)+R.gap){var oe=D.get(F)+R.gap-O;z.get(F).forEach(function(j){D.set(j,D.get(j)-oe)})}}else D.set(R.id,D.get(F)+R.gap);_.set(R.id,_.get(R.id)-1),_.get(R.id)==0&&k.push(R.id),P&&z.set(R.id,ee(z.get(F),z.get(R.id)))})};k.length!=0;)ne();if(P){var $=new Set;p.forEach(function(X,F){X.length==0&&$.add(F)});var ue=[];z.forEach(function(X,F){if($.has(F)){var K=!1,R=!0,O=!1,oe=void 0;try{for(var j=X[Symbol.iterator](),fe;!(R=(fe=j.next()).done);R=!0){var pe=fe.value;P.has(pe)&&(K=!0)}}catch(ae){O=!0,oe=ae}finally{try{!R&&j.return&&j.return()}finally{if(O)throw oe}}if(!K){var ve=!1,Te=void 0;ue.forEach(function(ae,de){ae.has([].concat(L(X))[0])&&(ve=!0,Te=de)}),ve?X.forEach(function(ae){ue[Te].add(ae)}):ue.push(new Set(X))}}}),ue.forEach(function(X,F){var K=Number.POSITIVE_INFINITY,R=Number.POSITIVE_INFINITY,O=Number.NEGATIVE_INFINITY,oe=Number.NEGATIVE_INFINITY,j=!0,fe=!1,pe=void 0;try{for(var ve=X[Symbol.iterator](),Te;!(j=(Te=ve.next()).done);j=!0){var ae=Te.value,de=void 0;w=="horizontal"?de=u.has(ae)?x[u.get(ae)]:M.get(ae):de=u.has(ae)?Y[u.get(ae)]:M.get(ae);var Le=D.get(ae);de<K&&(K=de),de>O&&(O=de),Le<R&&(R=Le),Le>oe&&(oe=Le)}}catch(De){fe=!0,pe=De}finally{try{!j&&ve.return&&ve.return()}finally{if(fe)throw pe}}var ze=(K+O)/2-(R+oe)/2,Ee=!0,Pe=!1,Fe=void 0;try{for(var me=X[Symbol.iterator](),Ve;!(Ee=(Ve=me.next()).done);Ee=!0){var Oe=Ve.value;D.set(Oe,D.get(Oe)+ze)}}catch(De){Pe=!0,Fe=De}finally{try{!Ee&&me.return&&me.return()}finally{if(Pe)throw Fe}}})}return D},ye=function(p){var w=0,P=0,M=0,b=0;if(p.forEach(function(z){z.left?x[u.get(z.left)]-x[u.get(z.right)]>=0?w++:P++:Y[u.get(z.top)]-Y[u.get(z.bottom)]>=0?M++:b++}),w>P&&M>b)for(var ee=0;ee<u.size;ee++)x[ee]=-1*x[ee],Y[ee]=-1*Y[ee];else if(w>P)for(var _=0;_<u.size;_++)x[_]=-1*x[_];else if(M>b)for(var D=0;D<u.size;D++)Y[D]=-1*Y[D]},e=function(p){var w=[],P=new B,M=new Set,b=0;return p.forEach(function(ee,_){if(!M.has(_)){w[b]=[];var D=_;for(P.push(D),M.add(D),w[b].push(D);P.length!=0;){D=P.shift();var z=p.get(D);z.forEach(function(k){M.has(k.id)||(P.push(k.id),M.add(k.id),w[b].push(k.id))})}b++}}),w},a=function(p){var w=new Map;return p.forEach(function(P,M){w.set(M,[])}),p.forEach(function(P,M){P.forEach(function(b){w.get(M).push(b),w.get(b.id).push({id:M,gap:b.gap,direction:b.direction})})}),w},t=function(p){var w=new Map;return p.forEach(function(P,M){w.set(M,[])}),p.forEach(function(P,M){P.forEach(function(b){w.get(b.id).push({id:M,gap:b.gap,direction:b.direction})})}),w},i=[],r=[],n=!1,o=!1,h=new Set,c=new Map,v=new Map,S=[];if(d.fixedNodeConstraint&&d.fixedNodeConstraint.forEach(function(l){h.add(l.nodeId)}),d.relativePlacementConstraint&&(d.relativePlacementConstraint.forEach(function(l){l.left?(c.has(l.left)?c.get(l.left).push({id:l.right,gap:l.gap,direction:"horizontal"}):c.set(l.left,[{id:l.right,gap:l.gap,direction:"horizontal"}]),c.has(l.right)||c.set(l.right,[])):(c.has(l.top)?c.get(l.top).push({id:l.bottom,gap:l.gap,direction:"vertical"}):c.set(l.top,[{id:l.bottom,gap:l.gap,direction:"vertical"}]),c.has(l.bottom)||c.set(l.bottom,[]))}),v=a(c),S=e(v)),G.TRANSFORM_ON_CONSTRAINT_HANDLING){if(d.fixedNodeConstraint&&d.fixedNodeConstraint.length>1)d.fixedNodeConstraint.forEach(function(l,p){i[p]=[l.position.x,l.position.y],r[p]=[x[u.get(l.nodeId)],Y[u.get(l.nodeId)]]}),n=!0;else if(d.alignmentConstraint)(function(){var l=0;if(d.alignmentConstraint.vertical){for(var p=d.alignmentConstraint.vertical,w=function(D){var z=new Set;p[D].forEach(function($){z.add($)});var k=new Set([].concat(L(z)).filter(function($){return h.has($)})),ne=void 0;k.size>0?ne=x[u.get(k.values().next().value)]:ne=Me(z).x,p[D].forEach(function($){i[l]=[ne,Y[u.get($)]],r[l]=[x[u.get($)],Y[u.get($)]],l++})},P=0;P<p.length;P++)w(P);n=!0}if(d.alignmentConstraint.horizontal){for(var M=d.alignmentConstraint.horizontal,b=function(D){var z=new Set;M[D].forEach(function($){z.add($)});var k=new Set([].concat(L(z)).filter(function($){return h.has($)})),ne=void 0;k.size>0?ne=x[u.get(k.values().next().value)]:ne=Me(z).y,M[D].forEach(function($){i[l]=[x[u.get($)],ne],r[l]=[x[u.get($)],Y[u.get($)]],l++})},ee=0;ee<M.length;ee++)b(ee);n=!0}d.relativePlacementConstraint&&(o=!0)})();else if(d.relativePlacementConstraint){for(var E=0,g=0,C=0;C<S.length;C++)S[C].length>E&&(E=S[C].length,g=C);if(E<v.size/2)ye(d.relativePlacementConstraint),n=!1,o=!1;else{var N=new Map,s=new Map,f=[];S[g].forEach(function(l){c.get(l).forEach(function(p){p.direction=="horizontal"?(N.has(l)?N.get(l).push(p):N.set(l,[p]),N.has(p.id)||N.set(p.id,[]),f.push({left:l,right:p.id})):(s.has(l)?s.get(l).push(p):s.set(l,[p]),s.has(p.id)||s.set(p.id,[]),f.push({top:l,bottom:p.id}))})}),ye(f),o=!1;var m=T(N,"horizontal"),y=T(s,"vertical");S[g].forEach(function(l,p){r[p]=[x[u.get(l)],Y[u.get(l)]],i[p]=[],m.has(l)?i[p][0]=m.get(l):i[p][0]=x[u.get(l)],y.has(l)?i[p][1]=y.get(l):i[p][1]=Y[u.get(l)]}),n=!0}}if(n){for(var U=void 0,J=Z.transpose(i),he=Z.transpose(r),ie=0;ie<J.length;ie++)J[ie]=Z.multGamma(J[ie]),he[ie]=Z.multGamma(he[ie]);var be=Z.multMat(J,Z.transpose(he)),Se=V.svd(be);U=Z.multMat(Se.V,Z.transpose(Se.U));for(var se=0;se<u.size;se++){var Ge=[x[se],Y[se]],we=[U[0][0],U[1][0]],lt=[U[0][1],U[1][1]];x[se]=Z.dotProduct(Ge,we),Y[se]=Z.dotProduct(Ge,lt)}o&&ye(d.relativePlacementConstraint)}}if(G.ENFORCE_CONSTRAINTS){if(d.fixedNodeConstraint&&d.fixedNodeConstraint.length>0){var Ae={x:0,y:0};d.fixedNodeConstraint.forEach(function(l,p){var w={x:x[u.get(l.nodeId)],y:Y[u.get(l.nodeId)]},P=l.position,M=Ue(P,w);Ae.x+=M.x,Ae.y+=M.y}),Ae.x/=d.fixedNodeConstraint.length,Ae.y/=d.fixedNodeConstraint.length,x.forEach(function(l,p){x[p]+=Ae.x}),Y.forEach(function(l,p){Y[p]+=Ae.y}),d.fixedNodeConstraint.forEach(function(l){x[u.get(l.nodeId)]=l.position.x,Y[u.get(l.nodeId)]=l.position.y})}if(d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var je=d.alignmentConstraint.vertical,ht=function(p){var w=new Set;je[p].forEach(function(b){w.add(b)});var P=new Set([].concat(L(w)).filter(function(b){return h.has(b)})),M=void 0;P.size>0?M=x[u.get(P.values().next().value)]:M=Me(w).x,w.forEach(function(b){h.has(b)||(x[u.get(b)]=M)})},Xe=0;Xe<je.length;Xe++)ht(Xe);if(d.alignmentConstraint.horizontal)for(var qe=d.alignmentConstraint.horizontal,ft=function(p){var w=new Set;qe[p].forEach(function(b){w.add(b)});var P=new Set([].concat(L(w)).filter(function(b){return h.has(b)})),M=void 0;P.size>0?M=Y[u.get(P.values().next().value)]:M=Me(w).y,w.forEach(function(b){h.has(b)||(Y[u.get(b)]=M)})},Be=0;Be<qe.length;Be++)ft(Be)}d.relativePlacementConstraint&&(function(){var l=new Map,p=new Map,w=new Map,P=new Map,M=new Map,b=new Map,ee=new Set,_=new Set;if(h.forEach(function(te){ee.add(te),_.add(te)}),d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var D=d.alignmentConstraint.vertical,z=function(H){w.set("dummy"+H,[]),D[H].forEach(function(I){l.set(I,"dummy"+H),w.get("dummy"+H).push(I),h.has(I)&&ee.add("dummy"+H)}),M.set("dummy"+H,x[u.get(D[H][0])])},k=0;k<D.length;k++)z(k);if(d.alignmentConstraint.horizontal)for(var ne=d.alignmentConstraint.horizontal,$=function(H){P.set("dummy"+H,[]),ne[H].forEach(function(I){p.set(I,"dummy"+H),P.get("dummy"+H).push(I),h.has(I)&&_.add("dummy"+H)}),b.set("dummy"+H,Y[u.get(ne[H][0])])},ue=0;ue<ne.length;ue++)$(ue)}var X=new Map,F=new Map,K=function(H){c.get(H).forEach(function(I){var Ne=void 0,le=void 0;I.direction=="horizontal"?(Ne=l.get(H)?l.get(H):H,l.get(I.id)?le={id:l.get(I.id),gap:I.gap,direction:I.direction}:le=I,X.has(Ne)?X.get(Ne).push(le):X.set(Ne,[le]),X.has(le.id)||X.set(le.id,[])):(Ne=p.get(H)?p.get(H):H,p.get(I.id)?le={id:p.get(I.id),gap:I.gap,direction:I.direction}:le=I,F.has(Ne)?F.get(Ne).push(le):F.set(Ne,[le]),F.has(le.id)||F.set(le.id,[]))})},R=!0,O=!1,oe=void 0;try{for(var j=c.keys()[Symbol.iterator](),fe;!(R=(fe=j.next()).done);R=!0){var pe=fe.value;K(pe)}}catch(te){O=!0,oe=te}finally{try{!R&&j.return&&j.return()}finally{if(O)throw oe}}var ve=a(X),Te=a(F),ae=e(ve),de=e(Te),Le=t(X),ze=t(F),Ee=[],Pe=[];ae.forEach(function(te,H){Ee[H]=[],te.forEach(function(I){Le.get(I).length==0&&Ee[H].push(I)})}),de.forEach(function(te,H){Pe[H]=[],te.forEach(function(I){ze.get(I).length==0&&Pe[H].push(I)})});var Fe=T(X,"horizontal",ee,M,Ee),me=T(F,"vertical",_,b,Pe),Ve=function(H){w.get(H)?w.get(H).forEach(function(I){x[u.get(I)]=Fe.get(H)}):x[u.get(H)]=Fe.get(H)},Oe=!0,De=!1,et=void 0;try{for(var Ze=Fe.keys()[Symbol.iterator](),tt;!(Oe=(tt=Ze.next()).done);Oe=!0){var Ke=tt.value;Ve(Ke)}}catch(te){De=!0,et=te}finally{try{!Oe&&Ze.return&&Ze.return()}finally{if(De)throw et}}var gt=function(H){P.get(H)?P.get(H).forEach(function(I){Y[u.get(I)]=me.get(H)}):Y[u.get(H)]=me.get(H)},Qe=!0,rt=!1,it=void 0;try{for(var _e=me.keys()[Symbol.iterator](),at;!(Qe=(at=_e.next()).done);Qe=!0){var Ke=at.value;gt(Ke)}}catch(te){rt=!0,it=te}finally{try{!Qe&&_e.return&&_e.return()}finally{if(rt)throw it}}})()}for(var Ie=0;Ie<Ce.length;Ie++){var We=Ce[Ie];We.getChild()==null&&We.setCenter(x[u.get(We.id)],Y[u.get(We.id)])}},Q.exports=W}),551:(Q=>{Q.exports=$e})},He={};function ke(Q){var ge=He[Q];if(ge!==void 0)return ge.exports;var A=He[Q]={exports:{}};return Je[Q](A,A.exports,ke),A.exports}var nt=ke(45);return nt})()})})(Ye.__module)),Ye.__module.exports}exports.__require=ct;
2
2
  //# sourceMappingURL=cose-base.cjs.js.map