mdts 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/frontend/bundle.js +184 -96
- package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_architecture-U656AL7Q_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_architecture-PBZL5I3N_mjs.bundle.js} +4 -4
- package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_gitGraph-F6HP7TQM_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_gitGraph-HDMCJU4V_mjs.bundle.js} +4 -4
- package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_info-NVLQJR56_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_info-3K5VOQVL_mjs.bundle.js} +4 -4
- package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_packet-BFZMPI3H_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_packet-RMMSAZCW_mjs.bundle.js} +4 -4
- package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_pie-7BOR55EZ_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_pie-UPGHQEXC_mjs.bundle.js} +4 -4
- package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_radar-NHE76QYJ_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_radar-KQ55EAFF_mjs.bundle.js} +4 -4
- package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_treemap-KMMF4GRG_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_treemap-KZPCXAKY_mjs.bundle.js} +4 -4
- package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_classDiagram-VBA2DB6C_mjs.bundle.js +22 -0
- package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_classDiagram-v2-RAHNMMFH_mjs.bundle.js +22 -0
- package/dist/frontend/{node_modules_mermaid_dist_chunks_mermaid_core_diagram-S2PKOQOG_mjs.bundle.js → node_modules_mermaid_dist_chunks_mermaid_core_diagram-P4PSJMXO_mjs.bundle.js} +4 -4
- package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_infoDiagram-LFFYTUFH_mjs.bundle.js +22 -0
- package/dist/frontend/{node_modules_mermaid_dist_chunks_mermaid_core_pieDiagram-ADFJNKIX_mjs.bundle.js → node_modules_mermaid_dist_chunks_mermaid_core_pieDiagram-SKSYHLDU_mjs.bundle.js} +4 -4
- package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_stateDiagram-v2-FVOUBMTO_mjs.bundle.js +22 -0
- package/dist/frontend/vendors-node_modules_cytoscape_dist_cytoscape_esm_mjs.bundle.js +1 -1
- package/dist/frontend/vendors-node_modules_dagre-d3-es_src_dagre_index_js.bundle.js +14 -14
- package/dist/frontend/vendors-node_modules_dagre-d3-es_src_graphlib_index_js.bundle.js +1 -1
- package/dist/frontend/vendors-node_modules_mermaid-js_parser_dist_mermaid-parser_core_mjs.bundle.js +476 -76
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_architectureDiagram-VXUJARFQ_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_architectureDiagram-2XIMDMQ5_mjs.bundle.js} +4 -4
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_blockDiagram-WCTKOSBZ_mjs.bundle.js +52 -0
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_c4Diagram-IC4MRINW_mjs.bundle.js +32 -0
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_chunk-DI55MBZ5_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_chunk-NQ4KR5QH_mjs.bundle.js} +7 -7
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_chunk-WL4C6EOR_mjs.bundle.js +62 -0
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_dagre-6UL2VRFP_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_dagre-KLK3FWXG_mjs.bundle.js} +5 -5
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_diagram-E7M64L7V_mjs.bundle.js +42 -0
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_diagram-IFDJBPK2_mjs.bundle.js +32 -0
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_erDiagram-INFDFZHY_mjs.bundle.js +52 -0
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_flowDiagram-PKNHOUZH_mjs.bundle.js +72 -0
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_ganttDiagram-JELNMOA3_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_ganttDiagram-A5KZAMGK_mjs.bundle.js} +4 -4
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_gitGraphDiagram-K3NZZRJ6_mjs.bundle.js +42 -0
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_ishikawaDiagram-PHBUUO56_mjs.bundle.js +22 -0
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_journeyDiagram-XKPGCS4Q_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_journeyDiagram-4ABVD52K_mjs.bundle.js} +7 -7
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_kanban-definition-3W4ZIXB7_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_kanban-definition-K7BYSVSG_mjs.bundle.js} +4 -4
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_mindmap-definition-VGOIOE7T_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_mindmap-definition-YRQLILUH_mjs.bundle.js} +7 -7
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_quadrantDiagram-AYHSOK5B_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_quadrantDiagram-337W2JSQ_mjs.bundle.js} +4 -4
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_requirementDiagram-UZGBJVZJ_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_requirementDiagram-Z7DCOOCP_mjs.bundle.js} +7 -7
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_sankeyDiagram-TZEHDZUN_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_sankeyDiagram-WA2Y5GQK_mjs.bundle.js} +4 -4
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_sequenceDiagram-2WXFIKYE_mjs.bundle.js +42 -0
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_stateDiagram-FKZM4ZOC_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_stateDiagram-RAJIS63D_mjs.bundle.js} +4 -4
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_timeline-definition-IT6M3QCI_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_timeline-definition-YZTLITO2_mjs.bundle.js} +4 -4
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_vennDiagram-LZ73GAT5_mjs.bundle.js +42 -0
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_xychartDiagram-PRI3JC2R_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_xychartDiagram-JWTSCODW_mjs.bundle.js} +4 -4
- package/dist/server/routes/diff.js +87 -0
- package/dist/server/routes/filetree.js +1 -1
- package/dist/server/server.js +3 -0
- package/package.json +4 -3
- package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_classDiagram-2ON5EDUG_mjs.bundle.js +0 -22
- package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_classDiagram-v2-WZHVMYZB_mjs.bundle.js +0 -22
- package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_infoDiagram-WHAUD3N6_mjs.bundle.js +0 -22
- package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_stateDiagram-v2-4FDKWEC3_mjs.bundle.js +0 -22
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_blockDiagram-VD42YOAC_mjs.bundle.js +0 -52
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_c4Diagram-YG6GDRKO_mjs.bundle.js +0 -32
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_chunk-B4BG7PRW_mjs.bundle.js +0 -52
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_diagram-PSM6KHXK_mjs.bundle.js +0 -42
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_diagram-QEK2KX5R_mjs.bundle.js +0 -32
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_erDiagram-Q2GNP2WA_mjs.bundle.js +0 -52
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_flowDiagram-NV44I4VS_mjs.bundle.js +0 -62
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_gitGraphDiagram-NY62KEGX_mjs.bundle.js +0 -42
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_sequenceDiagram-WL72ISMW_mjs.bundle.js +0 -42
|
@@ -205,7 +205,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
205
205
|
\***********************************************************/
|
|
206
206
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
207
207
|
|
|
208
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ addConflict: () => (/* binding */ addConflict),\n/* harmony export */ alignCoordinates: () => (/* binding */ alignCoordinates),\n/* harmony export */ balance: () => (/* binding */ balance),\n/* harmony export */ findSmallestWidthAlignment: () => (/* binding */ findSmallestWidthAlignment),\n/* harmony export */ findType1Conflicts: () => (/* binding */ findType1Conflicts),\n/* harmony export */ findType2Conflicts: () => (/* binding */ findType2Conflicts),\n/* harmony export */ hasConflict: () => (/* binding */ hasConflict),\n/* harmony export */ horizontalCompaction: () => (/* binding */ horizontalCompaction),\n/* harmony export */ positionX: () => (/* binding */ positionX),\n/* harmony export */ verticalAlignment: () => (/* binding */ verticalAlignment)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/find.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/forEach.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/forIn.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/last.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/map.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/mapValues.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/max.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/merge.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/min.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/minBy.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/range.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/reduce.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/sortBy.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/values.js\");\n/* harmony import */ var _graphlib_index_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../graphlib/index.js */ \"./node_modules/dagre-d3-es/src/graphlib/index.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../util.js */ \"./node_modules/dagre-d3-es/src/dagre/util.js\");\n\n\n\n\n/*\n * This module provides coordinate assignment based on Brandes and Köpf, \"Fast\n * and Simple Horizontal Coordinate Assignment.\"\n */\n\n\n\n/*\n * Marks all edges in the graph with a type-1 conflict with the \"type1Conflict\"\n * property. A type-1 conflict is one where a non-inner segment crosses an\n * inner segment. An inner segment is an edge with both incident nodes marked\n * with the \"dummy\" property.\n *\n * This algorithm scans layer by layer, starting with the second, for type-1\n * conflicts between the current layer and the previous layer. For each layer\n * it scans the nodes from left to right until it reaches one that is incident\n * on an inner segment. It then scans predecessors to determine if they have\n * edges that cross that inner segment. At the end a final scan is done for all\n * nodes on the current rank to see if they cross the last visited inner\n * segment.\n *\n * This algorithm (safely) assumes that a dummy node will only be incident on a\n * single node in the layers being scanned.\n */\nfunction findType1Conflicts(g, layering) {\n /** @type {{[nodeId: string | number]: {[nodeId: string | number]: true}}} */\n var conflicts = {};\n\n function visitLayer(prevLayer, layer) {\n var // last visited node in the previous layer that is incident on an inner\n // segment.\n k0 = 0,\n // Tracks the last node in this layer scanned for crossings with a type-1\n // segment.\n scanPos = 0,\n prevLayerLength = prevLayer.length,\n lastNode = lodash_es__WEBPACK_IMPORTED_MODULE_3__[\"default\"](layer);\n\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](layer, function (v, i) {\n var w = findOtherInnerSegmentNode(g, v),\n k1 = w ? g.node(w).order : prevLayerLength;\n\n if (w || v === lastNode) {\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](layer.slice(scanPos, i + 1), function (scanNode) {\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](g.predecessors(scanNode), function (u) {\n var uLabel = g.node(u),\n uPos = uLabel.order;\n if ((uPos < k0 || k1 < uPos) && !(uLabel.dummy && g.node(scanNode).dummy)) {\n addConflict(conflicts, u, scanNode);\n }\n });\n });\n // @ts-expect-error\n scanPos = i + 1;\n k0 = k1;\n }\n });\n\n return layer;\n }\n\n lodash_es__WEBPACK_IMPORTED_MODULE_11__[\"default\"](layering, visitLayer);\n return conflicts;\n}\n\nfunction findType2Conflicts(g, layering) {\n /** @type {{[nodeId: string | number]: {[nodeId: string | number]: true}}} */\n var conflicts = {};\n\n function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) {\n var v;\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](lodash_es__WEBPACK_IMPORTED_MODULE_10__[\"default\"](southPos, southEnd), function (i) {\n v = south[i];\n if (g.node(v).dummy) {\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](g.predecessors(v), function (u) {\n var uNode = g.node(u);\n if (uNode.dummy && (uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) {\n addConflict(conflicts, u, v);\n }\n });\n }\n });\n }\n\n function visitLayer(north, south) {\n var prevNorthPos = -1,\n nextNorthPos,\n southPos = 0;\n\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](south, function (v, southLookahead) {\n if (g.node(v).dummy === 'border') {\n var predecessors = g.predecessors(v);\n if (predecessors.length) {\n nextNorthPos = g.node(predecessors[0]).order;\n scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos);\n // @ts-expect-error\n southPos = southLookahead;\n prevNorthPos = nextNorthPos;\n }\n }\n scan(south, southPos, south.length, nextNorthPos, north.length);\n });\n\n return south;\n }\n\n lodash_es__WEBPACK_IMPORTED_MODULE_11__[\"default\"](layering, visitLayer);\n return conflicts;\n}\n\nfunction findOtherInnerSegmentNode(g, v) {\n if (g.node(v).dummy) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](g.predecessors(v), function (u) {\n return g.node(u).dummy;\n });\n }\n}\n\n/**\n * Sets `conflicts[v][w] = true`, creating objects if needed.\n *\n * @param {{[nodeId: string | number]: {[nodeId: string | number]: true}}} conflicts - Object to set.\n * @param {string | number} v - First Node ID\n * @param {string | number} w - Second Node ID\n */\nfunction addConflict(conflicts, v, w) {\n if (v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n\n if (!Object.prototype.hasOwnProperty.call(conflicts, v)) {\n // can't use conflicts[v] = {} since it's unsafe if v = `__proto__`\n Object.defineProperty(conflicts, v, {\n enumerable: true,\n configurable: true,\n value: {},\n writable: true,\n });\n }\n var conflictsV = conflicts[v];\n Object.defineProperty(conflictsV, w, {\n enumerable: true,\n configurable: true,\n value: true,\n writable: true,\n });\n}\n\nfunction hasConflict(conflicts, v, w) {\n if (v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n return !!conflicts[v] && Object.prototype.hasOwnProperty.call(conflicts[v], w);\n}\n\n/*\n * Try to align nodes into vertical \"blocks\" where possible. This algorithm\n * attempts to align a node with one of its median neighbors. If the edge\n * connecting a neighbor is a type-1 conflict then we ignore that possibility.\n * If a previous node has already formed a block with a node after the node\n * we're trying to form a block with, we also ignore that possibility - our\n * blocks would be split in that scenario.\n */\nfunction verticalAlignment(g, layering, conflicts, neighborFn) {\n var root = {},\n align = {},\n pos = {};\n\n // We cache the position here based on the layering because the graph and\n // layering may be out of sync. The layering matrix is manipulated to\n // generate different extreme alignments.\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](layering, function (layer) {\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](layer, function (v, order) {\n root[v] = v;\n align[v] = v;\n pos[v] = order;\n });\n });\n\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](layering, function (layer) {\n var prevIdx = -1;\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](layer, function (v) {\n var ws = neighborFn(v);\n if (ws.length) {\n ws = lodash_es__WEBPACK_IMPORTED_MODULE_12__[\"default\"](ws, function (w) {\n return pos[w];\n });\n var mp = (ws.length - 1) / 2;\n for (var i = Math.floor(mp), il = Math.ceil(mp); i <= il; ++i) {\n var w = ws[i];\n if (align[v] === v && prevIdx < pos[w] && !hasConflict(conflicts, v, w)) {\n align[w] = v;\n align[v] = root[v] = root[w];\n prevIdx = pos[w];\n }\n }\n }\n });\n });\n\n return { root: root, align: align };\n}\n\nfunction horizontalCompaction(g, layering, root, align, reverseSep) {\n // This portion of the algorithm differs from BK due to a number of problems.\n // Instead of their algorithm we construct a new block graph and do two\n // sweeps. The first sweep places blocks with the smallest possible\n // coordinates. The second sweep removes unused space by moving blocks to the\n // greatest coordinates without violating separation.\n var xs = {},\n blockG = buildBlockGraph(g, layering, root, reverseSep),\n borderType = reverseSep ? 'borderLeft' : 'borderRight';\n\n function iterate(setXsFunc, nextNodesFunc) {\n var stack = blockG.nodes();\n var elem = stack.pop();\n var visited = {};\n while (elem) {\n if (visited[elem]) {\n setXsFunc(elem);\n } else {\n visited[elem] = true;\n stack.push(elem);\n stack = stack.concat(nextNodesFunc(elem));\n }\n\n elem = stack.pop();\n }\n }\n\n // First pass, assign smallest coordinates\n function pass1(elem) {\n xs[elem] = blockG.inEdges(elem).reduce(function (acc, e) {\n return Math.max(acc, xs[e.v] + blockG.edge(e));\n }, 0);\n }\n\n // Second pass, assign greatest coordinates\n function pass2(elem) {\n var min = blockG.outEdges(elem).reduce(function (acc, e) {\n return Math.min(acc, xs[e.w] - blockG.edge(e));\n }, Number.POSITIVE_INFINITY);\n\n var node = g.node(elem);\n if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) {\n xs[elem] = Math.max(xs[elem], min);\n }\n }\n\n iterate(pass1, blockG.predecessors.bind(blockG));\n iterate(pass2, blockG.successors.bind(blockG));\n\n // Assign x coordinates to all nodes\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](align, function (v) {\n xs[v] = xs[root[v]];\n });\n\n return xs;\n}\n\nfunction buildBlockGraph(g, layering, root, reverseSep) {\n var blockGraph = new _graphlib_index_js__WEBPACK_IMPORTED_MODULE_14__.Graph(),\n graphLabel = g.graph(),\n sepFn = sep(graphLabel.nodesep, graphLabel.edgesep, reverseSep);\n\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](layering, function (layer) {\n var u;\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](layer, function (v) {\n var vRoot = root[v];\n blockGraph.setNode(vRoot);\n if (u) {\n var uRoot = root[u],\n prevMax = blockGraph.edge(uRoot, vRoot);\n blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0));\n }\n u = v;\n });\n });\n\n return blockGraph;\n}\n\n/*\n * Returns the alignment that has the smallest width of the given alignments.\n */\nfunction findSmallestWidthAlignment(g, xss) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_9__[\"default\"](lodash_es__WEBPACK_IMPORTED_MODULE_13__[\"default\"](xss), function (xs) {\n var max = Number.NEGATIVE_INFINITY;\n var min = Number.POSITIVE_INFINITY;\n\n lodash_es__WEBPACK_IMPORTED_MODULE_2__[\"default\"](xs, function (x, v) {\n var halfWidth = width(g, v) / 2;\n\n max = Math.max(x + halfWidth, max);\n min = Math.min(x - halfWidth, min);\n });\n\n return max - min;\n });\n}\n\n/*\n * Align the coordinates of each of the layout alignments such that\n * left-biased alignments have their minimum coordinate at the same point as\n * the minimum coordinate of the smallest width alignment and right-biased\n * alignments have their maximum coordinate at the same point as the maximum\n * coordinate of the smallest width alignment.\n */\nfunction alignCoordinates(xss, alignTo) {\n var alignToVals = lodash_es__WEBPACK_IMPORTED_MODULE_13__[\"default\"](alignTo),\n alignToMin = lodash_es__WEBPACK_IMPORTED_MODULE_8__[\"default\"](alignToVals),\n alignToMax = lodash_es__WEBPACK_IMPORTED_MODULE_6__[\"default\"](alignToVals);\n\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](['u', 'd'], function (vert) {\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](['l', 'r'], function (horiz) {\n var alignment = vert + horiz,\n xs = xss[alignment],\n delta;\n if (xs === alignTo) return;\n\n var xsVals = lodash_es__WEBPACK_IMPORTED_MODULE_13__[\"default\"](xs);\n delta = horiz === 'l' ? alignToMin - lodash_es__WEBPACK_IMPORTED_MODULE_8__[\"default\"](xsVals) : alignToMax - lodash_es__WEBPACK_IMPORTED_MODULE_6__[\"default\"](xsVals);\n\n if (delta) {\n xss[alignment] = lodash_es__WEBPACK_IMPORTED_MODULE_5__[\"default\"](xs, function (x) {\n return x + delta;\n });\n }\n });\n });\n}\n\nfunction balance(xss, align) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_5__[\"default\"](xss.ul, function (ignore, v) {\n if (align) {\n return xss[align.toLowerCase()][v];\n } else {\n var xs = lodash_es__WEBPACK_IMPORTED_MODULE_12__[\"default\"](lodash_es__WEBPACK_IMPORTED_MODULE_4__[\"default\"](xss, v));\n return (xs[1] + xs[2]) / 2;\n }\n });\n}\n\nfunction positionX(g) {\n var layering = _util_js__WEBPACK_IMPORTED_MODULE_15__.buildLayerMatrix(g);\n var conflicts = lodash_es__WEBPACK_IMPORTED_MODULE_7__[\"default\"](findType1Conflicts(g, layering), findType2Conflicts(g, layering));\n\n var xss = {};\n var adjustedLayering;\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](['u', 'd'], function (vert) {\n adjustedLayering = vert === 'u' ? layering : lodash_es__WEBPACK_IMPORTED_MODULE_13__[\"default\"](layering).reverse();\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](['l', 'r'], function (horiz) {\n if (horiz === 'r') {\n adjustedLayering = lodash_es__WEBPACK_IMPORTED_MODULE_4__[\"default\"](adjustedLayering, function (inner) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_13__[\"default\"](inner).reverse();\n });\n }\n\n var neighborFn = (vert === 'u' ? g.predecessors : g.successors).bind(g);\n var align = verticalAlignment(g, adjustedLayering, conflicts, neighborFn);\n var xs = horizontalCompaction(g, adjustedLayering, align.root, align.align, horiz === 'r');\n if (horiz === 'r') {\n xs = lodash_es__WEBPACK_IMPORTED_MODULE_5__[\"default\"](xs, function (x) {\n return -x;\n });\n }\n xss[vert + horiz] = xs;\n });\n });\n\n var smallestWidth = findSmallestWidthAlignment(g, xss);\n alignCoordinates(xss, smallestWidth);\n return balance(xss, g.graph().align);\n}\n\nfunction sep(nodeSep, edgeSep, reverseSep) {\n return function (g, v, w) {\n var vLabel = g.node(v);\n var wLabel = g.node(w);\n var sum = 0;\n var delta;\n\n sum += vLabel.width / 2;\n if (Object.prototype.hasOwnProperty.call(vLabel, 'labelpos')) {\n switch (vLabel.labelpos.toLowerCase()) {\n case 'l':\n delta = -vLabel.width / 2;\n break;\n case 'r':\n delta = vLabel.width / 2;\n break;\n }\n }\n if (delta) {\n sum += reverseSep ? delta : -delta;\n }\n delta = 0;\n\n sum += (vLabel.dummy ? edgeSep : nodeSep) / 2;\n sum += (wLabel.dummy ? edgeSep : nodeSep) / 2;\n\n sum += wLabel.width / 2;\n if (Object.prototype.hasOwnProperty.call(wLabel, 'labelpos')) {\n switch (wLabel.labelpos.toLowerCase()) {\n case 'l':\n delta = wLabel.width / 2;\n break;\n case 'r':\n delta = -wLabel.width / 2;\n break;\n }\n }\n if (delta) {\n sum += reverseSep ? delta : -delta;\n }\n delta = 0;\n\n return sum;\n };\n}\n\nfunction width(g, v) {\n return g.node(v).width;\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/dagre/position/bk.js?\n}");
|
|
208
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ addConflict: () => (/* binding */ addConflict),\n/* harmony export */ alignCoordinates: () => (/* binding */ alignCoordinates),\n/* harmony export */ balance: () => (/* binding */ balance),\n/* harmony export */ findSmallestWidthAlignment: () => (/* binding */ findSmallestWidthAlignment),\n/* harmony export */ findType1Conflicts: () => (/* binding */ findType1Conflicts),\n/* harmony export */ findType2Conflicts: () => (/* binding */ findType2Conflicts),\n/* harmony export */ hasConflict: () => (/* binding */ hasConflict),\n/* harmony export */ horizontalCompaction: () => (/* binding */ horizontalCompaction),\n/* harmony export */ positionX: () => (/* binding */ positionX),\n/* harmony export */ verticalAlignment: () => (/* binding */ verticalAlignment)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/find.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/forEach.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/forIn.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/last.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/map.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/mapValues.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/max.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/merge.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/min.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/minBy.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/range.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/reduce.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/sortBy.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/values.js\");\n/* harmony import */ var _graphlib_index_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../graphlib/index.js */ \"./node_modules/dagre-d3-es/src/graphlib/index.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../util.js */ \"./node_modules/dagre-d3-es/src/dagre/util.js\");\n\n\n\n\n/*\n * This module provides coordinate assignment based on Brandes and Köpf, \"Fast\n * and Simple Horizontal Coordinate Assignment.\"\n */\n\n\n\n/*\n * Marks all edges in the graph with a type-1 conflict with the \"type1Conflict\"\n * property. A type-1 conflict is one where a non-inner segment crosses an\n * inner segment. An inner segment is an edge with both incident nodes marked\n * with the \"dummy\" property.\n *\n * This algorithm scans layer by layer, starting with the second, for type-1\n * conflicts between the current layer and the previous layer. For each layer\n * it scans the nodes from left to right until it reaches one that is incident\n * on an inner segment. It then scans predecessors to determine if they have\n * edges that cross that inner segment. At the end a final scan is done for all\n * nodes on the current rank to see if they cross the last visited inner\n * segment.\n *\n * This algorithm (safely) assumes that a dummy node will only be incident on a\n * single node in the layers being scanned.\n */\nfunction findType1Conflicts(g, layering) {\n /** @type {{[nodeId: string | number]: {[nodeId: string | number]: true}}} */\n var conflicts = {};\n\n function visitLayer(prevLayer, layer) {\n var // last visited node in the previous layer that is incident on an inner\n // segment.\n k0 = 0,\n // Tracks the last node in this layer scanned for crossings with a type-1\n // segment.\n scanPos = 0,\n prevLayerLength = prevLayer.length,\n lastNode = lodash_es__WEBPACK_IMPORTED_MODULE_3__[\"default\"](layer);\n\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](layer, function (v, i) {\n var w = findOtherInnerSegmentNode(g, v),\n k1 = w ? g.node(w).order : prevLayerLength;\n\n if (w || v === lastNode) {\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](layer.slice(scanPos, i + 1), function (scanNode) {\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](g.predecessors(scanNode), function (u) {\n var uLabel = g.node(u),\n uPos = uLabel.order;\n if ((uPos < k0 || k1 < uPos) && !(uLabel.dummy && g.node(scanNode).dummy)) {\n addConflict(conflicts, u, scanNode);\n }\n });\n });\n // @ts-expect-error\n scanPos = i + 1;\n k0 = k1;\n }\n });\n\n return layer;\n }\n\n lodash_es__WEBPACK_IMPORTED_MODULE_11__[\"default\"](layering, visitLayer);\n return conflicts;\n}\n\nfunction findType2Conflicts(g, layering) {\n /** @type {{[nodeId: string | number]: {[nodeId: string | number]: true}}} */\n var conflicts = {};\n\n function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) {\n var v;\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](lodash_es__WEBPACK_IMPORTED_MODULE_10__[\"default\"](southPos, southEnd), function (i) {\n v = south[i];\n if (g.node(v).dummy) {\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](g.predecessors(v), function (u) {\n var uNode = g.node(u);\n if (uNode.dummy && (uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) {\n addConflict(conflicts, u, v);\n }\n });\n }\n });\n }\n\n function visitLayer(north, south) {\n var prevNorthPos = -1,\n nextNorthPos,\n southPos = 0;\n\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](south, function (v, southLookahead) {\n if (g.node(v).dummy === 'border') {\n var predecessors = g.predecessors(v);\n if (predecessors.length) {\n nextNorthPos = g.node(predecessors[0]).order;\n scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos);\n // @ts-expect-error\n southPos = southLookahead;\n prevNorthPos = nextNorthPos;\n }\n }\n scan(south, southPos, south.length, nextNorthPos, north.length);\n });\n\n return south;\n }\n\n lodash_es__WEBPACK_IMPORTED_MODULE_11__[\"default\"](layering, visitLayer);\n return conflicts;\n}\n\nfunction findOtherInnerSegmentNode(g, v) {\n if (g.node(v).dummy) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](g.predecessors(v), function (u) {\n return g.node(u).dummy;\n });\n }\n}\n\n/**\n * Sets `conflicts[v][w] = true`, creating objects if needed.\n *\n * @param {{[nodeId: string | number]: {[nodeId: string | number]: true}}} conflicts - Object to set.\n * @param {string | number} v - First Node ID\n * @param {string | number} w - Second Node ID\n */\nfunction addConflict(conflicts, v, w) {\n if (v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n\n if (!Object.prototype.hasOwnProperty.call(conflicts, v)) {\n // can't use conflicts[v] = {} since it's unsafe if v = `__proto__`\n Object.defineProperty(conflicts, v, {\n enumerable: true,\n configurable: true,\n value: {},\n writable: true,\n });\n }\n var conflictsV = conflicts[v];\n Object.defineProperty(conflictsV, w, {\n enumerable: true,\n configurable: true,\n value: true,\n writable: true,\n });\n}\n\nfunction hasConflict(conflicts, v, w) {\n if (v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n return !!conflicts[v] && Object.prototype.hasOwnProperty.call(conflicts[v], w);\n}\n\n/*\n * Try to align nodes into vertical \"blocks\" where possible. This algorithm\n * attempts to align a node with one of its median neighbors. If the edge\n * connecting a neighbor is a type-1 conflict then we ignore that possibility.\n * If a previous node has already formed a block with a node after the node\n * we're trying to form a block with, we also ignore that possibility - our\n * blocks would be split in that scenario.\n */\nfunction verticalAlignment(g, layering, conflicts, neighborFn) {\n var root = {},\n align = {},\n pos = {};\n\n // We cache the position here based on the layering because the graph and\n // layering may be out of sync. The layering matrix is manipulated to\n // generate different extreme alignments.\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](layering, function (layer) {\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](layer, function (v, order) {\n root[v] = v;\n align[v] = v;\n pos[v] = order;\n });\n });\n\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](layering, function (layer) {\n var prevIdx = -1;\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](layer, function (v) {\n var ws = neighborFn(v);\n if (ws.length) {\n ws = lodash_es__WEBPACK_IMPORTED_MODULE_12__[\"default\"](ws, function (w) {\n return pos[w];\n });\n var mp = (ws.length - 1) / 2;\n for (var i = Math.floor(mp), il = Math.ceil(mp); i <= il; ++i) {\n var w = ws[i];\n if (align[v] === v && prevIdx < pos[w] && !hasConflict(conflicts, v, w)) {\n align[w] = v;\n align[v] = root[v] = root[w];\n prevIdx = pos[w];\n }\n }\n }\n });\n });\n\n return { root: root, align: align };\n}\n\nfunction horizontalCompaction(g, layering, root, align, reverseSep) {\n // This portion of the algorithm differs from BK due to a number of problems.\n // Instead of their algorithm we construct a new block graph and do two\n // sweeps. The first sweep places blocks with the smallest possible\n // coordinates. The second sweep removes unused space by moving blocks to the\n // greatest coordinates without violating separation.\n /** @type {Record<import('../../graphlib/graph.js').NodeID, number>} */\n var xs = {},\n blockG = buildBlockGraph(g, layering, root, reverseSep),\n borderType = reverseSep ? 'borderLeft' : 'borderRight';\n\n function iterate(setXsFunc, nextNodesFunc) {\n var stack = blockG.nodes();\n var elem = stack.pop();\n var visited = {};\n while (elem) {\n if (visited[elem]) {\n setXsFunc(elem);\n } else {\n visited[elem] = true;\n stack.push(elem);\n stack = stack.concat(nextNodesFunc(elem));\n }\n\n elem = stack.pop();\n }\n }\n\n // First pass, assign smallest coordinates\n function pass1(elem) {\n xs[elem] = blockG.inEdges(elem).reduce(function (acc, e) {\n return Math.max(acc, xs[e.v] + blockG.edge(e));\n }, 0);\n }\n\n // Second pass, assign greatest coordinates\n function pass2(elem) {\n var min = blockG.outEdges(elem).reduce(function (acc, e) {\n return Math.min(acc, xs[e.w] - blockG.edge(e));\n }, Number.POSITIVE_INFINITY);\n\n var node = g.node(elem);\n if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) {\n xs[elem] = Math.max(xs[elem], min);\n }\n }\n\n iterate(pass1, blockG.predecessors.bind(blockG));\n iterate(pass2, blockG.successors.bind(blockG));\n\n // Assign x coordinates to all nodes\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](align, function (v) {\n xs[v] = xs[root[v]];\n });\n\n return xs;\n}\n\nfunction buildBlockGraph(g, layering, root, reverseSep) {\n var blockGraph = new _graphlib_index_js__WEBPACK_IMPORTED_MODULE_14__.Graph(),\n graphLabel = g.graph(),\n sepFn = sep(graphLabel.nodesep, graphLabel.edgesep, reverseSep);\n\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](layering, function (layer) {\n var u;\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](layer, function (v) {\n var vRoot = root[v];\n blockGraph.setNode(vRoot);\n if (u) {\n var uRoot = root[u],\n prevMax = blockGraph.edge(uRoot, vRoot);\n blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0));\n }\n u = v;\n });\n });\n\n return blockGraph;\n}\n\n/*\n * Returns the alignment that has the smallest width of the given alignments.\n */\nfunction findSmallestWidthAlignment(g, xss) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_9__[\"default\"](lodash_es__WEBPACK_IMPORTED_MODULE_13__[\"default\"](xss), function (xs) {\n var max = Number.NEGATIVE_INFINITY;\n var min = Number.POSITIVE_INFINITY;\n\n lodash_es__WEBPACK_IMPORTED_MODULE_2__[\"default\"](xs, function (x, v) {\n var halfWidth = width(g, v) / 2;\n\n max = Math.max(x + halfWidth, max);\n min = Math.min(x - halfWidth, min);\n });\n\n return max - min;\n });\n}\n\n/*\n * Align the coordinates of each of the layout alignments such that\n * left-biased alignments have their minimum coordinate at the same point as\n * the minimum coordinate of the smallest width alignment and right-biased\n * alignments have their maximum coordinate at the same point as the maximum\n * coordinate of the smallest width alignment.\n */\nfunction alignCoordinates(xss, alignTo) {\n var alignToVals = lodash_es__WEBPACK_IMPORTED_MODULE_13__[\"default\"](alignTo),\n alignToMin = lodash_es__WEBPACK_IMPORTED_MODULE_8__[\"default\"](alignToVals),\n alignToMax = lodash_es__WEBPACK_IMPORTED_MODULE_6__[\"default\"](alignToVals);\n\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](['u', 'd'], function (vert) {\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](['l', 'r'], function (horiz) {\n var alignment = vert + horiz,\n xs = xss[alignment],\n delta;\n if (xs === alignTo) return;\n\n var xsVals = lodash_es__WEBPACK_IMPORTED_MODULE_13__[\"default\"](xs);\n delta = horiz === 'l' ? alignToMin - lodash_es__WEBPACK_IMPORTED_MODULE_8__[\"default\"](xsVals) : alignToMax - lodash_es__WEBPACK_IMPORTED_MODULE_6__[\"default\"](xsVals);\n\n if (delta) {\n xss[alignment] = lodash_es__WEBPACK_IMPORTED_MODULE_5__[\"default\"](xs, function (x) {\n return x + delta;\n });\n }\n });\n });\n}\n\nfunction balance(xss, align) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_5__[\"default\"](xss.ul, function (ignore, v) {\n if (align) {\n return xss[align.toLowerCase()][v];\n } else {\n var xs = lodash_es__WEBPACK_IMPORTED_MODULE_12__[\"default\"](lodash_es__WEBPACK_IMPORTED_MODULE_4__[\"default\"](xss, v));\n return (xs[1] + xs[2]) / 2;\n }\n });\n}\n\nfunction positionX(g) {\n var layering = _util_js__WEBPACK_IMPORTED_MODULE_15__.buildLayerMatrix(g);\n var conflicts = lodash_es__WEBPACK_IMPORTED_MODULE_7__[\"default\"](findType1Conflicts(g, layering), findType2Conflicts(g, layering));\n\n var xss = {};\n var adjustedLayering;\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](['u', 'd'], function (vert) {\n adjustedLayering = vert === 'u' ? layering : lodash_es__WEBPACK_IMPORTED_MODULE_13__[\"default\"](layering).reverse();\n lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](['l', 'r'], function (horiz) {\n if (horiz === 'r') {\n adjustedLayering = lodash_es__WEBPACK_IMPORTED_MODULE_4__[\"default\"](adjustedLayering, function (inner) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_13__[\"default\"](inner).reverse();\n });\n }\n\n var neighborFn = (vert === 'u' ? g.predecessors : g.successors).bind(g);\n var align = verticalAlignment(g, adjustedLayering, conflicts, neighborFn);\n var xs = horizontalCompaction(g, adjustedLayering, align.root, align.align, horiz === 'r');\n if (horiz === 'r') {\n xs = lodash_es__WEBPACK_IMPORTED_MODULE_5__[\"default\"](xs, function (x) {\n return -x;\n });\n }\n xss[vert + horiz] = xs;\n });\n });\n\n var smallestWidth = findSmallestWidthAlignment(g, xss);\n alignCoordinates(xss, smallestWidth);\n return balance(xss, g.graph().align);\n}\n\nfunction sep(nodeSep, edgeSep, reverseSep) {\n return function (g, v, w) {\n var vLabel = g.node(v);\n var wLabel = g.node(w);\n var sum = 0;\n var delta;\n\n sum += vLabel.width / 2;\n if (Object.prototype.hasOwnProperty.call(vLabel, 'labelpos')) {\n switch (vLabel.labelpos.toLowerCase()) {\n case 'l':\n delta = -vLabel.width / 2;\n break;\n case 'r':\n delta = vLabel.width / 2;\n break;\n }\n }\n if (delta) {\n sum += reverseSep ? delta : -delta;\n }\n delta = 0;\n\n sum += (vLabel.dummy ? edgeSep : nodeSep) / 2;\n sum += (wLabel.dummy ? edgeSep : nodeSep) / 2;\n\n sum += wLabel.width / 2;\n if (Object.prototype.hasOwnProperty.call(wLabel, 'labelpos')) {\n switch (wLabel.labelpos.toLowerCase()) {\n case 'l':\n delta = wLabel.width / 2;\n break;\n case 'r':\n delta = -wLabel.width / 2;\n break;\n }\n }\n if (delta) {\n sum += reverseSep ? delta : -delta;\n }\n delta = 0;\n\n return sum;\n };\n}\n\nfunction width(g, v) {\n return g.node(v).width;\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/dagre/position/bk.js?\n}");
|
|
209
209
|
|
|
210
210
|
/***/ },
|
|
211
211
|
|
|
@@ -275,7 +275,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
275
275
|
\*****************************************************************/
|
|
276
276
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
277
277
|
|
|
278
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ components: () => (/* binding */ components)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/forEach.js\");\n\n\n\n\nfunction components(g) {\n var visited = {};\n var cmpts = [];\n var cmpt;\n\n function dfs(v) {\n if (Object.prototype.hasOwnProperty.call(visited, v)) return;\n visited[v] = true;\n cmpt.push(v);\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](g.successors(v), dfs);\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](g.predecessors(v), dfs);\n }\n\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](g.nodes(), function (v) {\n cmpt = [];\n dfs(v);\n if (cmpt.length) {\n cmpts.push(cmpt);\n }\n });\n\n return cmpts;\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/components.js?\n}");
|
|
278
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ components: () => (/* binding */ components)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/forEach.js\");\n\n\n/**\n * @import { Graph, NodeID } from '../graph.js';\n */\n\n\n\n/**\n * Finds all [connected components][] in a graph and returns an array of these\n * components. Each component is itself an array that contains the ids of nodes\n * in the component.\n *\n * [connected components]: http://en.wikipedia.org/wiki/Connected_component_(graph_theory)\n *\n * @example\n *\n * \n *\n * ```js\n * graphlib.alg.components(g);\n * // => [ [ 'A', 'B', 'C', 'D' ],\n * // [ 'E', 'F', 'G' ],\n * // [ 'H', 'I' ] ]\n * ```\n *\n * @param {Graph} g - The graph to find components in.\n * @returns {NodeID[][]} An array of components, each of which is an array of node IDs.\n *\n * @remarks This function takes `O(|V|)` time.\n */\nfunction components(g) {\n /**\n * @type {Record<NodeID, true>}\n */\n var visited = {};\n /**\n * @type {NodeID[][]}\n */\n var cmpts = [];\n /**\n * @type {NodeID[]}\n */\n var cmpt;\n\n /**\n * @param {NodeID} v - The node to visit.\n */\n function dfs(v) {\n if (Object.prototype.hasOwnProperty.call(visited, v)) return;\n visited[v] = true;\n cmpt.push(v);\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](g.successors(v), dfs);\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](g.predecessors(v), dfs);\n }\n\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](g.nodes(), function (v) {\n cmpt = [];\n dfs(v);\n if (cmpt.length) {\n cmpts.push(cmpt);\n }\n });\n\n return cmpts;\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/components.js?\n}");
|
|
279
279
|
|
|
280
280
|
/***/ },
|
|
281
281
|
|
|
@@ -285,7 +285,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
285
285
|
\**********************************************************/
|
|
286
286
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
287
287
|
|
|
288
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ dfs: () => (/* binding */ dfs)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/forEach.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/isArray.js\");\n\n\n\n\n
|
|
288
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ dfs: () => (/* binding */ dfs)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/forEach.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/isArray.js\");\n\n\n/**\n * @import { Graph, NodeID } from '../graph.js';\n */\n\n\n\n/**\n * A helper that preforms a pre- or post-order traversal on the input graph\n * and returns the nodes in the order they were visited. If the graph is\n * undirected then this algorithm will navigate using neighbors. If the graph\n * is directed then this algorithm will navigate using successors.\n *\n * @param {Graph} g - Input graph.\n * @param {NodeID[] | NodeID} vs - Starting node or array of nodes.\n * @param {'post' | 'pre'} order - The order to use. Must be one of \"pre\" or \"post\".\n * @returns {NodeID[]} The nodes in the order they were visited.\n */\nfunction dfs(g, vs, order) {\n if (!lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](vs)) {\n vs = [vs];\n }\n\n /** @type {Parameters<typeof doDfs>[4]} */\n var navigation = (g.isDirected() ? g.successors : g.neighbors).bind(g);\n /** @type {Parameters<typeof doDfs>[5]} */\n var acc = [];\n /** @type {Parameters<typeof doDfs>[3]} */\n var visited = {};\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](vs, function (v) {\n if (!g.hasNode(v)) {\n throw new Error('Graph does not have node: ' + v);\n }\n\n doDfs(g, v, order === 'post', visited, navigation, acc);\n });\n return acc;\n}\n\n/**\n * @param {Graph} g - Input graph.\n * @param {NodeID} v - The node to visit.\n * @param {boolean} postorder - Whether to do postorder traversal.\n * @param {Record<NodeID, true>} visited - Visited nodes.\n * @param {(node: NodeID) => (NodeID[] | undefined)} navigation - Function to get\n * neighbors/successors.\n * @param {NodeID[]} acc - Accumulator for visited nodes.\n */\nfunction doDfs(g, v, postorder, visited, navigation, acc) {\n if (!Object.prototype.hasOwnProperty.call(visited, v)) {\n visited[v] = true;\n\n if (!postorder) {\n acc.push(v);\n }\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](navigation(v), function (w) {\n doDfs(g, w, postorder, visited, navigation, acc);\n });\n if (postorder) {\n acc.push(v);\n }\n }\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/dfs.js?\n}");
|
|
289
289
|
|
|
290
290
|
/***/ },
|
|
291
291
|
|
|
@@ -295,7 +295,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
295
295
|
\*******************************************************************/
|
|
296
296
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
297
297
|
|
|
298
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ dijkstraAll: () => (/* binding */ dijkstraAll)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/transform.js\");\n/* harmony import */ var _dijkstra_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dijkstra.js */ \"./node_modules/dagre-d3-es/src/graphlib/alg/dijkstra.js\");\n\n\n\n\n\nfunction dijkstraAll(g, weightFunc, edgeFunc) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](\n g.nodes(),\n function (acc, v) {\n acc[v] = (0,_dijkstra_js__WEBPACK_IMPORTED_MODULE_1__.dijkstra)(g, v, weightFunc, edgeFunc);\n },\n {},\n );\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/dijkstra-all.js?\n}");
|
|
298
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ dijkstraAll: () => (/* binding */ dijkstraAll)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/transform.js\");\n/* harmony import */ var _dijkstra_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dijkstra.js */ \"./node_modules/dagre-d3-es/src/graphlib/alg/dijkstra.js\");\n\n\n\n/**\n * @import { EdgeObj, Graph, NodeID } from '../graph.js';\n */\n\n\n\n/**\n * This function finds the shortest path from each node to every other\n * reachable node in the graph. It is similar to\n * {@link dijkstra}, but instead of returning a single-source\n * array, it returns a mapping of of `source -> alg.dijksta(g, source,\n * weightFn, edgeFn)`.\n *\n * @remarks This function takes `O(|V| * (|E| + |V|) * log |V|)` time.\n *\n * @example\n *\n * \n *\n * ```js\n * function weight(e) { return g.edge(e); }\n *\n * graphlib.alg.dijkstraAll(g, function(e) { return g.edge(e); });\n *\n * // => { A:\n * // { A: { distance: 0 },\n * // B: { distance: 6, predecessor: 'C' },\n * // C: { distance: 4, predecessor: 'A' },\n * // D: { distance: 2, predecessor: 'A' },\n * // E: { distance: 8, predecessor: 'F' },\n * // F: { distance: 4, predecessor: 'D' } },\n * // B:\n * // { A: { distance: Infinity },\n * // B: { distance: 0 },\n * // C: { distance: Infinity },\n * // D: { distance: Infinity },\n * // E: { distance: 6, predecessor: 'B' },\n * // F: { distance: Infinity } },\n * // C: { ... },\n * // D: { ... },\n * // E: { ... },\n * // F: { ... } }\n * ```\n *\n * @param {Graph} g - Input graph.\n * @param {(e: EdgeObj) => number} [weightFunc] - Optional function that returns\n * the weight for edge `e`. If no `weightFn` is supplied then each edge is\n * assumed to have a weight of 1.\n * @param {(v: NodeID) => EdgeObj[]} [edgeFunc] - Optional function that returns\n * the ids of all edges incident to the node `v` for the purposes of shortest\n * path traversal. By default this function uses the {@link Graph.outEdges}.\n * @returns {Record<NodeID, ReturnType<typeof dijkstra>>} a mapping of of\n * `source -> alg.dijksta(g, source, weightFn, edgeFn)`.\n * @throws {Error} If any of the traversed edges has a negative edge weight.\n */\nfunction dijkstraAll(g, weightFunc, edgeFunc) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](\n g.nodes(),\n /**\n * @param {Record<NodeID, ReturnType<typeof dijkstra>>} acc\n * @param {NodeID} v\n */\n function (acc, v) {\n acc[v] = (0,_dijkstra_js__WEBPACK_IMPORTED_MODULE_1__.dijkstra)(g, v, weightFunc, edgeFunc);\n },\n {},\n );\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/dijkstra-all.js?\n}");
|
|
299
299
|
|
|
300
300
|
/***/ },
|
|
301
301
|
|
|
@@ -305,7 +305,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
305
305
|
\***************************************************************/
|
|
306
306
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
307
307
|
|
|
308
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ dijkstra: () => (/* binding */ dijkstra)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/constant.js\");\n/* harmony import */ var _data_priority_queue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../data/priority-queue.js */ \"./node_modules/dagre-d3-es/src/graphlib/data/priority-queue.js\");\n\n\n\n\n\nvar DEFAULT_WEIGHT_FUNC = lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](1);\n\nfunction dijkstra(g, source, weightFn, edgeFn) {\n return runDijkstra(\n g,\n String(source),\n weightFn || DEFAULT_WEIGHT_FUNC,\n edgeFn ||\n function (v) {\n return g.outEdges(v);\n },\n );\n}\n\nfunction runDijkstra(g, source, weightFn, edgeFn) {\n var results = {};\n var pq = new _data_priority_queue_js__WEBPACK_IMPORTED_MODULE_1__.PriorityQueue();\n var v
|
|
308
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ dijkstra: () => (/* binding */ dijkstra)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/constant.js\");\n/* harmony import */ var _data_priority_queue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../data/priority-queue.js */ \"./node_modules/dagre-d3-es/src/graphlib/data/priority-queue.js\");\n\n\n\n/**\n * @import { EdgeObj, Graph, NodeID } from '../graph.js';\n */\n\n\n\nvar DEFAULT_WEIGHT_FUNC = lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](1);\n\n/**\n * @typedef {Object} PathEntry\n * @property {number} distance The sum of the weights from `source` to `v`\n * along the shortest path or `Number.POSITIVE_INFINITY` if there is no path\n * from `source`.\n * @property {NodeID} [predecessor] Can be used to walk the individual\n * elements of the path from `source` to `v` in reverse order.\n */\n\n/**\n * This function is an implementation of [Dijkstra's algorithm][] which finds\n * the shortest path from `source` to all other nodes in `g`. This\n * function returns\n *\n * [Dijkstra's algorithm]: http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm\n *\n * @example\n *\n * \n * <!-- SOURCE:\n * http://dagrejs.github.io/project/dagre-d3/latest/demo/interactive-demo.html?graph=digraph%20%7B%0Anode%20%5Bshape%3Dcircle%2C%20style%3D%22fill%3Awhite%3Bstroke%3A%23333%3Bstroke-width%3A1.5px%22%5D%0Aedge%20%5Blabeloffset%3D2%20labelpos%3Dr%5D%0Arankdir%3Dlr%0A%20%20A%20-%3E%20B%5Blabel%3D10%5D%0A%20%20A%20-%3E%20C%5Blabel%3D4%5D%0A%20%20A%20-%3E%20D%5Blabel%3D2%5D%0A%20%20C%20-%3E%20B%5Blabel%3D2%5D%0A%20%20C%20-%3E%20D%5Blabel%3D8%5D%0A%20%20B%20-%3E%20E%5Blabel%3D6%5D%0A%20%20D%20-%3E%20F%5Blabel%3D2%5D%0A%20%20F%20-%3E%20E%5Blabel%3D4%5D%0A%7D\n * -->\n *\n * ```js\n * function weight(e) { return g.edge(e); }\n *\n * graphlib.alg.dijkstra(g, \"A\", weight);\n * // => { A: { distance: 0 },\n * // B: { distance: 6, predecessor: 'C' },\n * // C: { distance: 4, predecessor: 'A' },\n * // D: { distance: 2, predecessor: 'A' },\n * // E: { distance: 8, predecessor: 'F' },\n * // F: { distance: 4, predecessor: 'D' } }\n * ```\n *\n * @remarks It takes `O((|E| + |V|) * log |V|)` time.\n *\n * @param {Graph} g - Input graph.\n * @param {NodeID | number} source - The source node id. Converted to a string.\n * @param {(e: EdgeObj) => number} [weightFn] - Optional function that returns\n * the weight for edge `e`. If no `weightFn` is supplied then each edge is\n * assumed to have a weight of 1.\n * @param {(v: NodeID) => EdgeObj[]} [edgeFn] - Optional function that returns\n * the ids of all edges incident to the node `v` for the purposes of shortest\n * path traversal.\n * By default this function uses the {@link Graph.outEdges} function on the\n * supplied graph.\n * @returns {Record<NodeID, PathEntry>} a map of `v -> { distance, predecessor }`.\n * @throws {Error} If any of the traversed edges has a negative edge weight.\n */\nfunction dijkstra(g, source, weightFn, edgeFn) {\n return runDijkstra(\n g,\n String(source),\n weightFn || DEFAULT_WEIGHT_FUNC,\n edgeFn ||\n function (v) {\n return g.outEdges(v);\n },\n );\n}\n\n/**\n * @param {Graph} g - Input graph.\n * @param {NodeID} source - The source node id.\n * @param {(e: EdgeObj) => number} weightFn - Required weight function.\n * @param {(v: NodeID) => EdgeObj[]} edgeFn - Required edge function.\n */\nfunction runDijkstra(g, source, weightFn, edgeFn) {\n /** @type {Record<NodeID, PathEntry>} */\n var results = {};\n var pq = new _data_priority_queue_js__WEBPACK_IMPORTED_MODULE_1__.PriorityQueue();\n /** @type {NodeID} */\n var v;\n /** @type {PathEntry} */\n var vEntry;\n\n /** @param {EdgeObj} edge */\n var updateNeighbors = function (edge) {\n var w = edge.v !== v ? edge.v : edge.w;\n var wEntry = results[w];\n var weight = weightFn(edge);\n var distance = vEntry.distance + weight;\n\n if (weight < 0) {\n throw new Error(\n 'dijkstra does not allow negative edge weights. ' +\n 'Bad edge: ' +\n edge +\n ' Weight: ' +\n weight,\n );\n }\n\n if (distance < wEntry.distance) {\n wEntry.distance = distance;\n wEntry.predecessor = v;\n pq.decrease(w, distance);\n }\n };\n\n g.nodes().forEach(function (v) {\n var distance = v === source ? 0 : Number.POSITIVE_INFINITY;\n results[v] = { distance: distance };\n pq.add(v, distance);\n });\n\n while (pq.size() > 0) {\n v = pq.removeMin();\n vEntry = results[v];\n if (vEntry.distance === Number.POSITIVE_INFINITY) {\n break;\n }\n\n edgeFn(v).forEach(updateNeighbors);\n }\n\n return results;\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/dijkstra.js?\n}");
|
|
309
309
|
|
|
310
310
|
/***/ },
|
|
311
311
|
|
|
@@ -315,7 +315,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
315
315
|
\******************************************************************/
|
|
316
316
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
317
317
|
|
|
318
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ findCycles: () => (/* binding */ findCycles)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/filter.js\");\n/* harmony import */ var _tarjan_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tarjan.js */ \"./node_modules/dagre-d3-es/src/graphlib/alg/tarjan.js\");\n\n\n\n\n\nfunction findCycles(g) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"]((0,_tarjan_js__WEBPACK_IMPORTED_MODULE_1__.tarjan)(g), function (cmpt) {\n return cmpt.length > 1 || (cmpt.length === 1 && g.hasEdge(cmpt[0], cmpt[0]));\n });\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/find-cycles.js?\n}");
|
|
318
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ findCycles: () => (/* binding */ findCycles)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/filter.js\");\n/* harmony import */ var _tarjan_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tarjan.js */ \"./node_modules/dagre-d3-es/src/graphlib/alg/tarjan.js\");\n\n\n\n/**\n * @import { Graph, NodeID } from '../graph.js';\n */\n\n\n\n/**\n * Given a Graph, `g`, this function returns all nodes that\n * are part of a cycle. As there may be more than one cycle in a graph this\n * function return an array of these cycles, where each cycle is itself\n * represented by an array of ids for each node involved in that cycle.\n *\n * @remarks\n *\n * {@link isAcyclic} is more efficient if you only need to\n * determine whether a graph has a cycle or not.\n *\n * @example\n *\n * ```js\n * var g = new graphlib.Graph();\n * g.setNode(1);\n * g.setNode(2);\n * g.setNode(3);\n * g.setEdge(1, 2);\n * g.setEdge(2, 3);\n *\n * graphlib.alg.findCycles(g);\n * // => []\n *\n * g.setEdge(3, 1);\n * graphlib.alg.findCycles(g);\n * // => [ [ '3', '2', '1' ] ]\n *\n * g.setNode(4);\n * g.setNode(5);\n * g.setEdge(4, 5);\n * g.setEdge(5, 4);\n * graphlib.alg.findCycles(g);\n * // => [ [ '3', '2', '1' ], [ '5', '4' ] ]\n * ```\n *\n * @param {Graph} g - The graph to analyze.\n * @returns {NodeID[][]} An array of cycles. Each cycle is itself an array\n * that contains the ids of all nodes in the cycle.\n */\nfunction findCycles(g) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"]((0,_tarjan_js__WEBPACK_IMPORTED_MODULE_1__.tarjan)(g), function (cmpt) {\n return cmpt.length > 1 || (cmpt.length === 1 && g.hasEdge(cmpt[0], cmpt[0]));\n });\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/find-cycles.js?\n}");
|
|
319
319
|
|
|
320
320
|
/***/ },
|
|
321
321
|
|
|
@@ -325,7 +325,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
325
325
|
\*********************************************************************/
|
|
326
326
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
327
327
|
|
|
328
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ floydWarshall: () => (/* binding */ floydWarshall)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/constant.js\");\n\n\n\n\nvar DEFAULT_WEIGHT_FUNC = lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](1);\n\nfunction floydWarshall(g, weightFn, edgeFn) {\n return runFloydWarshall(\n g,\n weightFn || DEFAULT_WEIGHT_FUNC,\n edgeFn ||\n function (v) {\n return g.outEdges(v);\n },\n );\n}\n\nfunction runFloydWarshall(g, weightFn, edgeFn) {\n var results = {};\n var nodes = g.nodes();\n\n nodes.forEach(function (v) {\n results[v] = {};\n results[v][v] = { distance: 0 };\n nodes.forEach(function (w) {\n if (v !== w) {\n results[v][w] = { distance: Number.POSITIVE_INFINITY };\n }\n });\n edgeFn(v).forEach(function (edge) {\n var w = edge.v === v ? edge.w : edge.v;\n var d = weightFn(edge);\n results[v][w] = { distance: d, predecessor: v };\n });\n });\n\n nodes.forEach(function (k) {\n var rowK = results[k];\n nodes.forEach(function (i) {\n var rowI = results[i];\n nodes.forEach(function (j) {\n var ik = rowI[k];\n var kj = rowK[j];\n var ij = rowI[j];\n var altDistance = ik.distance + kj.distance;\n if (altDistance < ij.distance) {\n ij.distance = altDistance;\n ij.predecessor = kj.predecessor;\n }\n });\n });\n });\n\n return results;\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/floyd-warshall.js?\n}");
|
|
328
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ floydWarshall: () => (/* binding */ floydWarshall)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/constant.js\");\n\n\n/**\n * @import { Graph, EdgeObj, NodeID } from '../graph.js';\n * @import { PathEntry } from './dijkstra.js';\n */\n\n\n\nvar DEFAULT_WEIGHT_FUNC = lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](1);\n\n/**\n * This function is an implementation of the [Floyd-Warshall algorithm][],\n * which finds the shortest path from each node to every other reachable node\n * in the graph. It is similar to {@link dijkstraAll}, but\n * it handles negative edge weights and is more efficient for some types of\n * graphs.\n *\n * [Floyd-Warshall algorithm]: https://en.wikipedia.org/wiki/Floyd-Warshall_algorithm\n *\n * @remarks This algorithm takes `O(|V|^3)` time.\n *\n * @example\n *\n * \n *\n * ```js\n * function weight(e) { return g.edge(e); }\n *\n * graphlib.alg.floydWarshall(g, function(e) { return g.edge(e); });\n *\n * // => { A:\n * // { A: { distance: 0 },\n * // B: { distance: 6, predecessor: 'C' },\n * // C: { distance: 4, predecessor: 'A' },\n * // D: { distance: 2, predecessor: 'A' },\n * // E: { distance: 8, predecessor: 'F' },\n * // F: { distance: 4, predecessor: 'D' } },\n * // B:\n * // { A: { distance: Infinity },\n * // B: { distance: 0 },\n * // C: { distance: Infinity },\n * // D: { distance: Infinity },\n * // E: { distance: 6, predecessor: 'B' },\n * // F: { distance: Infinity } },\n * // C: { ... },\n * // D: { ... },\n * // E: { ... },\n * // F: { ... } }\n * ```\n *\n * @param {Graph} g - The graph to analyze.\n * @param {(e: EdgeObj) => number} [weightFn] - Optional function that returns\n * the weight for edge `e`. If no `weightFn` is supplied then each edge is\n * assumed to have a weight of 1.\n * @param {(v: NodeID) => EdgeObj[]} [edgeFn] - Optional function that returns\n * the ids of all edges incident to the node `v` for the purposes of shortest\n * path traversal.\n * By default this function uses the {@link Graph.outEdges} function on the\n * supplied graph.\n * @returns {Record<NodeID, Record<NodeID, PathEntry>>} a map of\n * `source -> { target -> { distance, predecessor }`.\n */\nfunction floydWarshall(g, weightFn, edgeFn) {\n return runFloydWarshall(\n g,\n weightFn || DEFAULT_WEIGHT_FUNC,\n edgeFn ||\n function (v) {\n return g.outEdges(v);\n },\n );\n}\n\n/**\n * @param {Graph} g - Input graph.\n * @param {(e: EdgeObj) => number} weightFn - Required weight function.\n * @param {(v: NodeID) => EdgeObj[]} edgeFn - Required edge function.\n */\nfunction runFloydWarshall(g, weightFn, edgeFn) {\n /** @type {Record<NodeID, Record<NodeID, PathEntry>>} */\n var results = {};\n var nodes = g.nodes();\n\n nodes.forEach(function (v) {\n results[v] = {};\n results[v][v] = { distance: 0 };\n nodes.forEach(function (w) {\n if (v !== w) {\n results[v][w] = { distance: Number.POSITIVE_INFINITY };\n }\n });\n edgeFn(v).forEach(function (edge) {\n var w = edge.v === v ? edge.w : edge.v;\n var d = weightFn(edge);\n results[v][w] = { distance: d, predecessor: v };\n });\n });\n\n nodes.forEach(function (k) {\n var rowK = results[k];\n nodes.forEach(function (i) {\n var rowI = results[i];\n nodes.forEach(function (j) {\n var ik = rowI[k];\n var kj = rowK[j];\n var ij = rowI[j];\n var altDistance = ik.distance + kj.distance;\n if (altDistance < ij.distance) {\n ij.distance = altDistance;\n ij.predecessor = kj.predecessor;\n }\n });\n });\n });\n\n return results;\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/floyd-warshall.js?\n}");
|
|
329
329
|
|
|
330
330
|
/***/ },
|
|
331
331
|
|
|
@@ -345,7 +345,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
345
345
|
\*****************************************************************/
|
|
346
346
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
347
347
|
|
|
348
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ isAcyclic: () => (/* binding */ isAcyclic)\n/* harmony export */ });\n/* harmony import */ var _topsort_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./topsort.js */ \"./node_modules/dagre-d3-es/src/graphlib/alg/topsort.js\");\n\n\n\n\nfunction isAcyclic(g) {\n try {\n (0,_topsort_js__WEBPACK_IMPORTED_MODULE_0__.topsort)(g);\n } catch (e) {\n if (e instanceof _topsort_js__WEBPACK_IMPORTED_MODULE_0__.CycleException) {\n return false;\n }\n throw e;\n }\n return true;\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/is-acyclic.js?\n}");
|
|
348
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ isAcyclic: () => (/* binding */ isAcyclic)\n/* harmony export */ });\n/* harmony import */ var _topsort_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./topsort.js */ \"./node_modules/dagre-d3-es/src/graphlib/alg/topsort.js\");\n\n\n/**\n * @import { Graph } from '../graph.js';\n */\n\n\n\n/**\n * Given a Graph, `g`, this function returns `true` if the\n * graph has no cycles and returns `false` if it does.\n *\n * @remarks\n * This algorithm returns\n * as soon as it detects the first cycle. You can use\n * {@link ../findCycles} to get the actual list of cycles in the\n * graph.\n *\n * @example\n *\n * ```js\n * var g = new graphlib.Graph();\n * g.setNode(1);\n * g.setNode(2);\n * g.setNode(3);\n * g.setEdge(1, 2);\n * g.setEdge(2, 3);\n *\n * graphlib.alg.isAcyclic(g);\n * // => true\n *\n * g.setEdge(3, 1);\n * graphlib.alg.isAcyclic(g);\n * // => false\n * ```\n *\n * @param {Graph} g - The graph to analyze.\n * @returns {boolean} `true` if the graph is acyclic, `false` otherwise.\n */\nfunction isAcyclic(g) {\n try {\n (0,_topsort_js__WEBPACK_IMPORTED_MODULE_0__.topsort)(g);\n } catch (e) {\n if (e instanceof _topsort_js__WEBPACK_IMPORTED_MODULE_0__.CycleException) {\n return false;\n }\n throw e;\n }\n return true;\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/is-acyclic.js?\n}");
|
|
349
349
|
|
|
350
350
|
/***/ },
|
|
351
351
|
|
|
@@ -355,7 +355,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
355
355
|
\****************************************************************/
|
|
356
356
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
357
357
|
|
|
358
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ postorder: () => (/* binding */ postorder)\n/* harmony export */ });\n/* harmony import */ var _dfs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dfs.js */ \"./node_modules/dagre-d3-es/src/graphlib/alg/dfs.js\");\n\n\n\n\nfunction postorder(g, vs) {\n return (0,_dfs_js__WEBPACK_IMPORTED_MODULE_0__.dfs)(g, vs, 'post');\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/postorder.js?\n}");
|
|
358
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ postorder: () => (/* binding */ postorder)\n/* harmony export */ });\n/* harmony import */ var _dfs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dfs.js */ \"./node_modules/dagre-d3-es/src/graphlib/alg/dfs.js\");\n\n\n\n\n/**\n * This function performs a [postorder traversal][] of the graph `g` starting\n * at the nodes `vs`. For each node visited, `v`, the function `callback(v)`\n * is called.\n *\n * [postorder traversal]: https://en.wikipedia.org/wiki/Tree_traversal#Depth-first\n *\n * @example\n *\n * \n *\n * ```js\n * graphlib.alg.postorder(g, \"A\");\n * // => One of:\n * // [ \"B\", \"D\", \"E\", C\", \"A\" ]\n * // [ \"B\", \"E\", \"D\", C\", \"A\" ]\n * // [ \"D\", \"E\", \"C\", B\", \"A\" ]\n * // [ \"E\", \"D\", \"C\", B\", \"A\" ]\n * ```\n *\n * @param {Parameters<typeof dfs>[0]} g - The graph to traverse.\n * @param {Parameters<typeof dfs>[1]} vs - Nodes to start the traversal from.\n * @returns {ReturnType<typeof dfs>} The nodes in the order they were visited.\n */\nfunction postorder(g, vs) {\n return (0,_dfs_js__WEBPACK_IMPORTED_MODULE_0__.dfs)(g, vs, 'post');\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/postorder.js?\n}");
|
|
359
359
|
|
|
360
360
|
/***/ },
|
|
361
361
|
|
|
@@ -365,7 +365,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
365
365
|
\***************************************************************/
|
|
366
366
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
367
367
|
|
|
368
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ preorder: () => (/* binding */ preorder)\n/* harmony export */ });\n/* harmony import */ var _dfs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dfs.js */ \"./node_modules/dagre-d3-es/src/graphlib/alg/dfs.js\");\n\n\n\n\nfunction preorder(g, vs) {\n return (0,_dfs_js__WEBPACK_IMPORTED_MODULE_0__.dfs)(g, vs, 'pre');\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/preorder.js?\n}");
|
|
368
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ preorder: () => (/* binding */ preorder)\n/* harmony export */ });\n/* harmony import */ var _dfs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dfs.js */ \"./node_modules/dagre-d3-es/src/graphlib/alg/dfs.js\");\n\n\n\n\n/**\n * This function performs a [preorder traversal][] of the graph `g` starting\n * at the nodes `vs`. For each node visited, `v`, the function `callback(v)`\n * is called.\n *\n * [preorder traversal]: https://en.wikipedia.org/wiki/Tree_traversal#Depth-first\n *\n * @example\n *\n * \n * <!-- SOURCE:\n * http://dagrejs.github.io/project/dagre-d3/latest/demo/interactive-demo.html?graph=digraph%20%7B%0Anode%20%5Bshape%3Dcircle%2C%20style%3D%22fill%3Awhite%3Bstroke%3A%23333%3Bstroke-width%3A1.5px%22%5D%0Aedge%20%5Blabeloffset%3D2%20labelpos%3Dr%5D%0Arankdir%3Dlr%0A%20%20A%20-%3E%20B%0A%20%20A%20-%3E%20C%0A%20%20C%20-%3E%20D%0A%20%20C%20-%3E%20E%0A%7D\n * -->\n *\n * ```js\n * graphlib.alg.preorder(g, \"A\");\n * // => One of:\n * // [ \"A\", \"B\", \"C\", \"D\", \"E\" ]\n * // [ \"A\", \"B\", \"C\", \"E\", \"D\" ]\n * // [ \"A\", \"C\", \"D\", \"E\", \"B\" ]\n * // [ \"A\", \"C\", \"E\", \"D\", \"B\" ]\n * ```\n *\n * @param {Parameters<typeof dfs>[0]} g - The graph to traverse.\n * @param {Parameters<typeof dfs>[1]} vs - Nodes to start the traversal from.\n * @returns {ReturnType<typeof dfs>} The nodes in the order they were visited.\n */\nfunction preorder(g, vs) {\n return (0,_dfs_js__WEBPACK_IMPORTED_MODULE_0__.dfs)(g, vs, 'pre');\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/preorder.js?\n}");
|
|
369
369
|
|
|
370
370
|
/***/ },
|
|
371
371
|
|
|
@@ -375,7 +375,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
375
375
|
\***********************************************************/
|
|
376
376
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
377
377
|
|
|
378
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ prim: () => (/* binding */ prim)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/forEach.js\");\n/* harmony import */ var _data_priority_queue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../data/priority-queue.js */ \"./node_modules/dagre-d3-es/src/graphlib/data/priority-queue.js\");\n/* harmony import */ var _graph_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../graph.js */ \"./node_modules/dagre-d3-es/src/graphlib/graph.js\");\n\n\n\n\n\n\nfunction prim(g, weightFunc) {\n var result = new _graph_js__WEBPACK_IMPORTED_MODULE_2__.Graph();\n var parents = {};\n var pq = new _data_priority_queue_js__WEBPACK_IMPORTED_MODULE_1__.PriorityQueue();\n var v;\n\n function updateNeighbors(edge) {\n var w = edge.v === v ? edge.w : edge.v;\n var pri = pq.priority(w);\n if (pri !== undefined) {\n var edgeWeight = weightFunc(edge);\n if (edgeWeight < pri) {\n parents[w] = v;\n pq.decrease(w, edgeWeight);\n }\n }\n }\n\n if (g.nodeCount() === 0) {\n return result;\n }\n\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](g.nodes(), function (v) {\n pq.add(v, Number.POSITIVE_INFINITY);\n result.setNode(v);\n });\n\n // Start from an arbitrary node\n pq.decrease(g.nodes()[0], 0);\n\n var init = false;\n while (pq.size() > 0) {\n v = pq.removeMin();\n if (Object.prototype.hasOwnProperty.call(parents, v)) {\n result.setEdge(v, parents[v]);\n } else if (init) {\n throw new Error('Input graph is not connected: ' + g);\n } else {\n init = true;\n }\n\n g.nodeEdges(v).forEach(updateNeighbors);\n }\n\n return result;\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/prim.js?\n}");
|
|
378
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ prim: () => (/* binding */ prim)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/forEach.js\");\n/* harmony import */ var _data_priority_queue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../data/priority-queue.js */ \"./node_modules/dagre-d3-es/src/graphlib/data/priority-queue.js\");\n/* harmony import */ var _graph_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../graph.js */ \"./node_modules/dagre-d3-es/src/graphlib/graph.js\");\n\n\n\n\n/**\n * @import { EdgeObj, NodeID } from '../graph.js';\n */\n\n\n\n/**\n * [Prim's algorithm][] takes a connected undirected graph and generates a\n * [minimum spanning tree][]. This function returns the minimum spanning\n * tree as an undirected graph. This algorithm is derived from the description\n * in \"Introduction to Algorithms\", Third Edition, Cormen, et al., Pg 634.\n *\n * [Prim's algorithm]: https://en.wikipedia.org/wiki/Prim's_algorithm\n * [minimum spanning tree]: https://en.wikipedia.org/wiki/Minimum_spanning_tree\n *\n * @remarks This function takes `O(|E| log |V|)` time.\n *\n * @example\n *\n * \n * <!-- SOURCE:\n * digraph {\n * node [shape=circle, style=\"fill:white;stroke:#333;stroke-width:1.5px\"]\n * edge [labeloffset=2 labelpos=r arrowhead=\"none\"]\n * rankdir=lr\n * A -> B [label=3]\n * A -> D [label=12]\n * B -> C [label=6]\n * B -> D [label=1]\n * C -> D [label=1]\n * D -> E [label=2]\n * C -> E [label=9]\n * }\n * -->\n *\n * ```js\n * function weight(e) { return g(e); }\n * graphlib.alg.prim(g, weight);\n * ```\n *\n * Returns a tree (represented as a Graph) of the following form:\n *\n * \n * <!-- SOURCE:\n * digraph {\n * node [shape=circle, style=\"fill:white;stroke:#333;stroke-width:1.5px\"]\n * edge [labeloffset=2 labelpos=r arrowhead=\"none\"]\n * rankdir=lr\n * A -> B\n * B -> D\n * C -> D\n * D -> E\n * }\n * -->\n *\n * @param {Graph} g - The input undirected connected graph.\n * @param {(e: EdgeObj) => number} weightFunc - Function that returns\n * the weight for edge `e`.\n * @returns {Graph<undefined, undefined, undefined>} The minimum spanning tree\n * as an undirected graph.\n * @throws {Error} If the input graph is not connected.\n */\nfunction prim(g, weightFunc) {\n var result = new _graph_js__WEBPACK_IMPORTED_MODULE_2__.Graph();\n /** @type {Record<NodeID, NodeID>} */\n var parents = {};\n var pq = new _data_priority_queue_js__WEBPACK_IMPORTED_MODULE_1__.PriorityQueue();\n /** @type {NodeID} */\n var v;\n\n /**\n * @param {EdgeObj} edge - Edge to examine for possible inclusion in the\n * minimum spanning tree.\n */\n function updateNeighbors(edge) {\n var w = edge.v === v ? edge.w : edge.v;\n var pri = pq.priority(w);\n if (pri !== undefined) {\n var edgeWeight = weightFunc(edge);\n if (edgeWeight < pri) {\n parents[w] = v;\n pq.decrease(w, edgeWeight);\n }\n }\n }\n\n if (g.nodeCount() === 0) {\n return result;\n }\n\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](g.nodes(), function (v) {\n pq.add(v, Number.POSITIVE_INFINITY);\n result.setNode(v);\n });\n\n // Start from an arbitrary node\n pq.decrease(g.nodes()[0], 0);\n\n var init = false;\n while (pq.size() > 0) {\n v = pq.removeMin();\n if (Object.prototype.hasOwnProperty.call(parents, v)) {\n result.setEdge(v, parents[v]);\n } else if (init) {\n throw new Error('Input graph is not connected: ' + g);\n } else {\n init = true;\n }\n\n g.nodeEdges(v).forEach(updateNeighbors);\n }\n\n return result;\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/prim.js?\n}");
|
|
379
379
|
|
|
380
380
|
/***/ },
|
|
381
381
|
|
|
@@ -385,7 +385,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
385
385
|
\*************************************************************/
|
|
386
386
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
387
387
|
|
|
388
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ tarjan: () => (/* binding */ tarjan)\n/* harmony export */ });\n\n\nfunction tarjan(g) {\n var index = 0;\n var stack = [];\n
|
|
388
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ tarjan: () => (/* binding */ tarjan)\n/* harmony export */ });\n/**\n * @import { Graph, NodeID } from '../graph.js';\n */\n\n\n\n/**\n * This function is an implementation of [Tarjan's algorithm][] which finds\n * all [strongly connected components][] in the directed graph `g`. Each\n * strongly connected component is composed of nodes that can reach all other\n * nodes in the component via directed edges. A strongly connected component\n * can consist of a single node if that node cannot both reach and be reached\n * by any other specific node in the graph. Components of more than one node\n * are guaranteed to have at least one cycle.\n *\n * [Tarjan's algorithm]: http://en.wikipedia.org/wiki/Tarjan's_strongly_connected_components_algorithm\n * [strongly connected components]: http://en.wikipedia.org/wiki/Strongly_connected_component\n *\n * @example\n *\n * \n * <!-- SOURCE:\n * digraph {\n * node [shape=circle, style=\"fill:white;stroke:#333;stroke-width:1.5px\"]\n * edge [lineInterpolate=bundle]\n * rankdir=lr\n *\n * A -> B -> C -> D -> H -> G -> F\n * F -> G\n * D -> C\n * H -> D\n * B -> E -> G\n * E -> A\n * }\n * -->\n *\n * ```js\n * graphlib.alg.tarjan(g);\n * // => [ [ 'F', 'G' ],\n * // [ 'H', 'D', 'C' ],\n * // [ 'E', 'B', 'A' ] ]\n * ```\n *\n * @param {Graph} g - The directed graph to analyze.\n * @returns {NodeID[][]} an array of components. Each component is itself an\n * array that contains the ids of all nodes in the component.\n */\nfunction tarjan(g) {\n var index = 0;\n /** @type {NodeID[]} */\n var stack = [];\n /**\n * @type {Record<NodeID, { onStack: boolean, lowlink: number, index: number }>}\n */\n var visited = {};\n /** @type {NodeID[][]} */\n var results = [];\n\n /**\n * @param {NodeID} v - Node to recursively visit\n */\n function dfs(v) {\n var entry = (visited[v] = {\n onStack: true,\n lowlink: index,\n index: index++,\n });\n stack.push(v);\n\n g.successors(v).forEach(function (w) {\n if (!Object.prototype.hasOwnProperty.call(visited, w)) {\n dfs(w);\n entry.lowlink = Math.min(entry.lowlink, visited[w].lowlink);\n } else if (visited[w].onStack) {\n entry.lowlink = Math.min(entry.lowlink, visited[w].index);\n }\n });\n\n if (entry.lowlink === entry.index) {\n /** @type {NodeID[]} */\n var cmpt = [];\n /** @type {NodeID} */\n var w;\n do {\n w = stack.pop();\n visited[w].onStack = false;\n cmpt.push(w);\n } while (v !== w);\n results.push(cmpt);\n }\n }\n\n g.nodes().forEach(function (v) {\n if (!Object.prototype.hasOwnProperty.call(visited, v)) {\n dfs(v);\n }\n });\n\n return results;\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/tarjan.js?\n}");
|
|
389
389
|
|
|
390
390
|
/***/ },
|
|
391
391
|
|
|
@@ -395,7 +395,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
395
395
|
\**************************************************************/
|
|
396
396
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
397
397
|
|
|
398
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CycleException: () => (/* binding */ CycleException),\n/* harmony export */ topsort: () => (/* binding */ topsort)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/forEach.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/size.js\");\n\n\n\n\ntopsort.CycleException = CycleException;\n\nfunction topsort(g) {\n var visited = {};\n var stack = {};\n var results = [];\n\n function visit(node) {\n if (Object.prototype.hasOwnProperty.call(stack, node)) {\n throw new CycleException();\n }\n\n if (!Object.prototype.hasOwnProperty.call(visited, node)) {\n stack[node] = true;\n visited[node] = true;\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](g.predecessors(node), visit);\n delete stack[node];\n results.push(node);\n }\n }\n\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](g.sinks(), visit);\n\n if (lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](visited) !== g.nodeCount()) {\n throw new CycleException();\n }\n\n return results;\n}\n\nfunction CycleException() {}\nCycleException.prototype = new Error(); // must be an instance of Error to pass testing\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/topsort.js?\n}");
|
|
398
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CycleException: () => (/* binding */ CycleException),\n/* harmony export */ topsort: () => (/* binding */ topsort)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/forEach.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/size.js\");\n\n\n/**\n * @import { Graph, NodeID } from '../graph.js';\n */\n\n\n\ntopsort.CycleException = CycleException;\n\n/**\n * An implementation of [topological sorting](https://en.wikipedia.org/wiki/Topological_sorting).\n *\n * @remarks Takes `O(|V| + |E|)` time.\n *\n * @example\n *\n * \n *\n * ```js\n * graphlib.alg.topsort(g)\n * // [ '1', '2', '3', '4' ] or [ '1', '3', '2', '4' ]\n * ```\n *\n * @param {Graph} g - The graph to sort.\n * @returns {NodeID[]} an array of nodes\n * such that for each edge `u -> v`, `u` appears before `v` in the array.\n * @throws {CycleException} If the graph has a cycle so that it is impossible\n * to generate a topological sort.\n */\nfunction topsort(g) {\n /** @type {Record<NodeID, true>} */\n var visited = {};\n /** @type {Record<NodeID, true>} */\n var stack = {};\n /** @type {NodeID[]} */\n var results = [];\n\n /**\n * @param {NodeID} node - Node to recursively visit.\n */\n function visit(node) {\n if (Object.prototype.hasOwnProperty.call(stack, node)) {\n throw new CycleException();\n }\n\n if (!Object.prototype.hasOwnProperty.call(visited, node)) {\n stack[node] = true;\n visited[node] = true;\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](g.predecessors(node), visit);\n delete stack[node];\n results.push(node);\n }\n }\n\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](g.sinks(), visit);\n\n if (lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](visited) !== g.nodeCount()) {\n throw new CycleException();\n }\n\n return results;\n}\n\n/**\n * @class\n */\nfunction CycleException() {}\nCycleException.prototype = new Error(); // must be an instance of Error to pass testing\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/alg/topsort.js?\n}");
|
|
399
399
|
|
|
400
400
|
/***/ },
|
|
401
401
|
|
|
@@ -405,7 +405,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
405
405
|
\**********************************************************************/
|
|
406
406
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
407
407
|
|
|
408
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ PriorityQueue: () => (/* binding */ PriorityQueue)\n/* harmony export */ });\n\n\n/**\n * A min-priority queue data structure. This algorithm is derived from Cormen,\n * et al., \"Introduction to Algorithms\". The basic idea of a min-priority\n * queue is that you can efficiently (in O(1) time) get the smallest key in\n * the queue. Adding and removing elements takes O(log n) time. A key can\n * have its priority decreased in O(log n) time.\n */\nclass PriorityQueue {\n constructor() {\n this._arr = [];\n this._keyIndices = {};\n }\n /**\n *
|
|
408
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ PriorityQueue: () => (/* binding */ PriorityQueue)\n/* harmony export */ });\n\n\n/**\n * A min-priority queue data structure. This algorithm is derived from Cormen,\n * et al., \"Introduction to Algorithms\". The basic idea of a min-priority\n * queue is that you can efficiently (in O(1) time) get the smallest key in\n * the queue. Adding and removing elements takes O(log n) time. A key can\n * have its priority decreased in O(log n) time.\n */\nclass PriorityQueue {\n constructor() {\n /**\n * @private\n * @type {Array<{key: string, priority: number}>}\n */\n this._arr = [];\n /**\n * @private\n * @type {Record<string, number>}\n */\n this._keyIndices = {};\n }\n /**\n * @returns {number} the number of elements in the queue.\n * @remarks Takes `O(1)` time.\n */\n size() {\n return this._arr.length;\n }\n /**\n * @returns {string[]} the keys that are in the queue.\n * @remarks Takes `O(n)` time.\n */\n keys() {\n return this._arr.map(function (x) {\n return x.key;\n });\n }\n /**\n * @param {Object} key - The key to check for presence in the queue.\n * @returns {boolean} `true` if **key** is in the queue and `false` if not.\n */\n has(key) {\n return Object.prototype.hasOwnProperty.call(this._keyIndices, key);\n }\n /**\n * @param {Object} key - The key to get the priority for.\n * @returns {number | undefined} the priority for **key**.\n * If **key** is not present in the queue then this function returns `undefined`.\n * @remarks Takes `O(1)` time.\n */\n priority(key) {\n var index = this._keyIndices[key];\n if (index !== undefined) {\n return this._arr[index].priority;\n }\n }\n /**\n * @returns {string} the key for the minimum element in this queue.\n * @throws {Error} if the queue is empty.\n * @remarks Takes `O(1)` time.\n */\n min() {\n if (this.size() === 0) {\n throw new Error('Queue underflow');\n }\n return this._arr[0].key;\n }\n /**\n * Inserts a new key into the priority queue.\n *\n * @remarks Takes `O(n)` time.\n *\n * @param {Object} key the key to add. This will be coerced to a `string`.\n * @param {Number} priority the initial priority for the key\n * @returns {boolean} `true` if the key was added and `false` if it was already\n * present in the queue.\n */\n add(key, priority) {\n var keyIndices = this._keyIndices;\n key = String(key);\n if (!Object.prototype.hasOwnProperty.call(keyIndices, key)) {\n var arr = this._arr;\n var index = arr.length;\n keyIndices[key] = index;\n arr.push({ key: key, priority: priority });\n this._decrease(index);\n return true;\n }\n return false;\n }\n /**\n * Removes and returns the smallest key in the queue.\n * @returns {string} the key with the smallest priority\n * @remarks Takes `O(log n)` time.\n */\n removeMin() {\n this._swap(0, this._arr.length - 1);\n var min = this._arr.pop();\n delete this._keyIndices[min.key];\n this._heapify(0);\n return min.key;\n }\n /**\n * Decreases the priority for **key** to **priority**.\n *\n * @param {Object} key the key for which to raise priority\n * @param {Number} priority the new priority for the key\n * @throws {Error} if the new priority is greater than the previous priority.\n */\n decrease(key, priority) {\n var index = this._keyIndices[key];\n if (priority > this._arr[index].priority) {\n throw new Error(\n 'New priority is greater than current priority. ' +\n 'Key: ' +\n key +\n ' Old: ' +\n this._arr[index].priority +\n ' New: ' +\n priority,\n );\n }\n this._arr[index].priority = priority;\n this._decrease(index);\n }\n /**\n * @param {number} i - Lower index.\n * @private\n */\n _heapify(i) {\n var arr = this._arr;\n var l = 2 * i;\n var r = l + 1;\n var largest = i;\n if (l < arr.length) {\n largest = arr[l].priority < arr[largest].priority ? l : largest;\n if (r < arr.length) {\n largest = arr[r].priority < arr[largest].priority ? r : largest;\n }\n if (largest !== i) {\n this._swap(i, largest);\n this._heapify(largest);\n }\n }\n }\n /**\n * @param {number} index - Index to decrease.\n * @private\n */\n _decrease(index) {\n var arr = this._arr;\n var priority = arr[index].priority;\n var parent;\n while (index !== 0) {\n parent = index >> 1;\n if (arr[parent].priority < priority) {\n break;\n }\n this._swap(index, parent);\n index = parent;\n }\n }\n /**\n * @param {number} i - First index\n * @param {number} j - Second index\n * @private\n */\n _swap(i, j) {\n var arr = this._arr;\n var keyIndices = this._keyIndices;\n var origArrI = arr[i];\n var origArrJ = arr[j];\n arr[i] = origArrJ;\n arr[j] = origArrI;\n keyIndices[origArrJ.key] = i;\n keyIndices[origArrI.key] = j;\n }\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/data/priority-queue.js?\n}");
|
|
409
409
|
|
|
410
410
|
/***/ },
|
|
411
411
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
\********************************************************/
|
|
16
16
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
17
17
|
|
|
18
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Graph: () => (/* binding */ Graph)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/forEach.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/constant.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/filter.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/isEmpty.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/isFunction.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/isUndefined.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/keys.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/reduce.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/union.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/values.js\");\n\n\nvar DEFAULT_EDGE_NAME = '\\x00';\nvar GRAPH_NODE = '\\x00';\nvar EDGE_KEY_DELIM = '\\x01';\n\n// Implementation notes:\n//\n// * Node id query functions should return string ids for the nodes\n// * Edge id query functions should return an \"edgeObj\", edge object, that is\n// composed of enough information to uniquely identify an edge: {v, w, name}.\n// * Internally we use an \"edgeId\", a stringified form of the edgeObj, to\n// reference edges. This is because we need a performant way to look these\n// edges up and, object properties, which have string keys, are the closest\n// we're going to get to a performant hashtable in JavaScript.\n\n// Implementation notes:\n//\n// * Node id query functions should return string ids for the nodes\n// * Edge id query functions should return an \"edgeObj\", edge object, that is\n// composed of enough information to uniquely identify an edge: {v, w, name}.\n// * Internally we use an \"edgeId\", a stringified form of the edgeObj, to\n// reference edges. This is because we need a performant way to look these\n// edges up and, object properties, which have string keys, are the closest\n// we're going to get to a performant hashtable in JavaScript.\nclass Graph {\n constructor(opts = {}) {\n this._isDirected = Object.prototype.hasOwnProperty.call(opts, 'directed')\n ? opts.directed\n : true;\n this._isMultigraph = Object.prototype.hasOwnProperty.call(opts, 'multigraph')\n ? opts.multigraph\n : false;\n this._isCompound = Object.prototype.hasOwnProperty.call(opts, 'compound')\n ? opts.compound\n : false;\n\n // Label for the graph itself\n this._label = undefined;\n\n // Defaults to be set when creating a new node\n this._defaultNodeLabelFn = lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](undefined);\n\n // Defaults to be set when creating a new edge\n this._defaultEdgeLabelFn = lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](undefined);\n\n // v -> label\n this._nodes = {};\n\n if (this._isCompound) {\n // v -> parent\n this._parent = {};\n\n // v -> children\n this._children = {};\n this._children[GRAPH_NODE] = {};\n }\n\n // v -> edgeObj\n this._in = {};\n\n // u -> v -> Number\n this._preds = {};\n\n // v -> edgeObj\n this._out = {};\n\n // v -> w -> Number\n this._sucs = {};\n\n // e -> edgeObj\n this._edgeObjs = {};\n\n // e -> label\n this._edgeLabels = {};\n }\n /* === Graph functions ========= */\n isDirected() {\n return this._isDirected;\n }\n isMultigraph() {\n return this._isMultigraph;\n }\n isCompound() {\n return this._isCompound;\n }\n setGraph(label) {\n this._label = label;\n return this;\n }\n graph() {\n return this._label;\n }\n /* === Node functions ========== */\n setDefaultNodeLabel(newDefault) {\n if (!lodash_es__WEBPACK_IMPORTED_MODULE_4__[\"default\"](newDefault)) {\n newDefault = lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](newDefault);\n }\n this._defaultNodeLabelFn = newDefault;\n return this;\n }\n nodeCount() {\n return this._nodeCount;\n }\n nodes() {\n return lodash_es__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this._nodes);\n }\n sources() {\n var self = this;\n return lodash_es__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.nodes(), function (v) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_3__[\"default\"](self._in[v]);\n });\n }\n sinks() {\n var self = this;\n return lodash_es__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.nodes(), function (v) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_3__[\"default\"](self._out[v]);\n });\n }\n setNodes(vs, value) {\n var args = arguments;\n var self = this;\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](vs, function (v) {\n if (args.length > 1) {\n self.setNode(v, value);\n } else {\n self.setNode(v);\n }\n });\n return this;\n }\n setNode(v, value) {\n if (Object.prototype.hasOwnProperty.call(this._nodes, v)) {\n if (arguments.length > 1) {\n this._nodes[v] = value;\n }\n return this;\n }\n\n // @ts-expect-error\n this._nodes[v] = arguments.length > 1 ? value : this._defaultNodeLabelFn(v);\n if (this._isCompound) {\n this._parent[v] = GRAPH_NODE;\n this._children[v] = {};\n this._children[GRAPH_NODE][v] = true;\n }\n this._in[v] = {};\n this._preds[v] = {};\n this._out[v] = {};\n this._sucs[v] = {};\n ++this._nodeCount;\n return this;\n }\n node(v) {\n return this._nodes[v];\n }\n hasNode(v) {\n return Object.prototype.hasOwnProperty.call(this._nodes, v);\n }\n removeNode(v) {\n if (Object.prototype.hasOwnProperty.call(this._nodes, v)) {\n var removeEdge = (e) => this.removeEdge(this._edgeObjs[e]);\n delete this._nodes[v];\n if (this._isCompound) {\n this._removeFromParentsChildList(v);\n delete this._parent[v];\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](this.children(v), (child) => {\n this.setParent(child);\n });\n delete this._children[v];\n }\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](lodash_es__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this._in[v]), removeEdge);\n delete this._in[v];\n delete this._preds[v];\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](lodash_es__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this._out[v]), removeEdge);\n delete this._out[v];\n delete this._sucs[v];\n --this._nodeCount;\n }\n return this;\n }\n setParent(v, parent) {\n if (!this._isCompound) {\n throw new Error('Cannot set parent in a non-compound graph');\n }\n\n if (lodash_es__WEBPACK_IMPORTED_MODULE_5__[\"default\"](parent)) {\n parent = GRAPH_NODE;\n } else {\n // Coerce parent to string\n parent += '';\n for (var ancestor = parent; !lodash_es__WEBPACK_IMPORTED_MODULE_5__[\"default\"](ancestor); ancestor = this.parent(ancestor)) {\n if (ancestor === v) {\n throw new Error('Setting ' + parent + ' as parent of ' + v + ' would create a cycle');\n }\n }\n\n this.setNode(parent);\n }\n\n this.setNode(v);\n this._removeFromParentsChildList(v);\n this._parent[v] = parent;\n this._children[parent][v] = true;\n return this;\n }\n _removeFromParentsChildList(v) {\n delete this._children[this._parent[v]][v];\n }\n parent(v) {\n if (this._isCompound) {\n var parent = this._parent[v];\n if (parent !== GRAPH_NODE) {\n return parent;\n }\n }\n }\n children(v) {\n if (lodash_es__WEBPACK_IMPORTED_MODULE_5__[\"default\"](v)) {\n v = GRAPH_NODE;\n }\n\n if (this._isCompound) {\n var children = this._children[v];\n if (children) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_6__[\"default\"](children);\n }\n } else if (v === GRAPH_NODE) {\n return this.nodes();\n } else if (this.hasNode(v)) {\n return [];\n }\n }\n predecessors(v) {\n var predsV = this._preds[v];\n if (predsV) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_6__[\"default\"](predsV);\n }\n }\n successors(v) {\n var sucsV = this._sucs[v];\n if (sucsV) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_6__[\"default\"](sucsV);\n }\n }\n neighbors(v) {\n var preds = this.predecessors(v);\n if (preds) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_8__[\"default\"](preds, this.successors(v));\n }\n }\n isLeaf(v) {\n var neighbors;\n if (this.isDirected()) {\n neighbors = this.successors(v);\n } else {\n neighbors = this.neighbors(v);\n }\n return neighbors.length === 0;\n }\n filterNodes(filter) {\n // @ts-expect-error\n var copy = new this.constructor({\n directed: this._isDirected,\n multigraph: this._isMultigraph,\n compound: this._isCompound,\n });\n\n copy.setGraph(this.graph());\n\n var self = this;\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](this._nodes, function (value, v) {\n if (filter(v)) {\n copy.setNode(v, value);\n }\n });\n\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](this._edgeObjs, function (e) {\n // @ts-expect-error\n if (copy.hasNode(e.v) && copy.hasNode(e.w)) {\n copy.setEdge(e, self.edge(e));\n }\n });\n\n var parents = {};\n function findParent(v) {\n var parent = self.parent(v);\n if (parent === undefined || copy.hasNode(parent)) {\n parents[v] = parent;\n return parent;\n } else if (parent in parents) {\n return parents[parent];\n } else {\n return findParent(parent);\n }\n }\n\n if (this._isCompound) {\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](copy.nodes(), function (v) {\n copy.setParent(v, findParent(v));\n });\n }\n\n return copy;\n }\n /* === Edge functions ========== */\n setDefaultEdgeLabel(newDefault) {\n if (!lodash_es__WEBPACK_IMPORTED_MODULE_4__[\"default\"](newDefault)) {\n newDefault = lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](newDefault);\n }\n this._defaultEdgeLabelFn = newDefault;\n return this;\n }\n edgeCount() {\n return this._edgeCount;\n }\n edges() {\n return lodash_es__WEBPACK_IMPORTED_MODULE_9__[\"default\"](this._edgeObjs);\n }\n setPath(vs, value) {\n var self = this;\n var args = arguments;\n lodash_es__WEBPACK_IMPORTED_MODULE_7__[\"default\"](vs, function (v, w) {\n if (args.length > 1) {\n self.setEdge(v, w, value);\n } else {\n self.setEdge(v, w);\n }\n return w;\n });\n return this;\n }\n /*\n * setEdge(v, w, [value, [name]])\n * setEdge({ v, w, [name] }, [value])\n */\n setEdge() {\n var v, w, name, value;\n var valueSpecified = false;\n var arg0 = arguments[0];\n\n if (typeof arg0 === 'object' && arg0 !== null && 'v' in arg0) {\n v = arg0.v;\n w = arg0.w;\n name = arg0.name;\n if (arguments.length === 2) {\n value = arguments[1];\n valueSpecified = true;\n }\n } else {\n v = arg0;\n w = arguments[1];\n name = arguments[3];\n if (arguments.length > 2) {\n value = arguments[2];\n valueSpecified = true;\n }\n }\n\n v = '' + v;\n w = '' + w;\n if (!lodash_es__WEBPACK_IMPORTED_MODULE_5__[\"default\"](name)) {\n name = '' + name;\n }\n\n var e = edgeArgsToId(this._isDirected, v, w, name);\n if (Object.prototype.hasOwnProperty.call(this._edgeLabels, e)) {\n if (valueSpecified) {\n this._edgeLabels[e] = value;\n }\n return this;\n }\n\n if (!lodash_es__WEBPACK_IMPORTED_MODULE_5__[\"default\"](name) && !this._isMultigraph) {\n throw new Error('Cannot set a named edge when isMultigraph = false');\n }\n\n // It didn't exist, so we need to create it.\n // First ensure the nodes exist.\n this.setNode(v);\n this.setNode(w);\n\n // @ts-expect-error\n this._edgeLabels[e] = valueSpecified ? value : this._defaultEdgeLabelFn(v, w, name);\n\n var edgeObj = edgeArgsToObj(this._isDirected, v, w, name);\n // Ensure we add undirected edges in a consistent way.\n v = edgeObj.v;\n w = edgeObj.w;\n\n Object.freeze(edgeObj);\n this._edgeObjs[e] = edgeObj;\n incrementOrInitEntry(this._preds[w], v);\n incrementOrInitEntry(this._sucs[v], w);\n this._in[w][e] = edgeObj;\n this._out[v][e] = edgeObj;\n this._edgeCount++;\n return this;\n }\n edge(v, w, name) {\n var e =\n arguments.length === 1\n ? edgeObjToId(this._isDirected, arguments[0])\n : edgeArgsToId(this._isDirected, v, w, name);\n return this._edgeLabels[e];\n }\n hasEdge(v, w, name) {\n var e =\n arguments.length === 1\n ? edgeObjToId(this._isDirected, arguments[0])\n : edgeArgsToId(this._isDirected, v, w, name);\n return Object.prototype.hasOwnProperty.call(this._edgeLabels, e);\n }\n removeEdge(v, w, name) {\n var e =\n arguments.length === 1\n ? edgeObjToId(this._isDirected, arguments[0])\n : edgeArgsToId(this._isDirected, v, w, name);\n var edge = this._edgeObjs[e];\n if (edge) {\n v = edge.v;\n w = edge.w;\n delete this._edgeLabels[e];\n delete this._edgeObjs[e];\n decrementOrRemoveEntry(this._preds[w], v);\n decrementOrRemoveEntry(this._sucs[v], w);\n delete this._in[w][e];\n delete this._out[v][e];\n this._edgeCount--;\n }\n return this;\n }\n inEdges(v, u) {\n var inV = this._in[v];\n if (inV) {\n var edges = lodash_es__WEBPACK_IMPORTED_MODULE_9__[\"default\"](inV);\n if (!u) {\n return edges;\n }\n return lodash_es__WEBPACK_IMPORTED_MODULE_2__[\"default\"](edges, function (edge) {\n return edge.v === u;\n });\n }\n }\n outEdges(v, w) {\n var outV = this._out[v];\n if (outV) {\n var edges = lodash_es__WEBPACK_IMPORTED_MODULE_9__[\"default\"](outV);\n if (!w) {\n return edges;\n }\n return lodash_es__WEBPACK_IMPORTED_MODULE_2__[\"default\"](edges, function (edge) {\n return edge.w === w;\n });\n }\n }\n nodeEdges(v, w) {\n var inEdges = this.inEdges(v, w);\n if (inEdges) {\n return inEdges.concat(this.outEdges(v, w));\n }\n }\n}\n\n/* Number of nodes in the graph. Should only be changed by the implementation. */\nGraph.prototype._nodeCount = 0;\n\n/* Number of edges in the graph. Should only be changed by the implementation. */\nGraph.prototype._edgeCount = 0;\n\nfunction incrementOrInitEntry(map, k) {\n if (map[k]) {\n map[k]++;\n } else {\n map[k] = 1;\n }\n}\n\nfunction decrementOrRemoveEntry(map, k) {\n if (!--map[k]) {\n delete map[k];\n }\n}\n\nfunction edgeArgsToId(isDirected, v_, w_, name) {\n var v = '' + v_;\n var w = '' + w_;\n if (!isDirected && v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n return v + EDGE_KEY_DELIM + w + EDGE_KEY_DELIM + (lodash_es__WEBPACK_IMPORTED_MODULE_5__[\"default\"](name) ? DEFAULT_EDGE_NAME : name);\n}\n\nfunction edgeArgsToObj(isDirected, v_, w_, name) {\n var v = '' + v_;\n var w = '' + w_;\n if (!isDirected && v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n var edgeObj = { v: v, w: w };\n if (name) {\n edgeObj.name = name;\n }\n return edgeObj;\n}\n\nfunction edgeObjToId(isDirected, edgeObj) {\n return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name);\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/graph.js?\n}");
|
|
18
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Graph: () => (/* binding */ Graph)\n/* harmony export */ });\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/forEach.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/constant.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/filter.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/isEmpty.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/isFunction.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/isUndefined.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/keys.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/reduce.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/union.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/values.js\");\n\n\nvar DEFAULT_EDGE_NAME = '\\x00';\nvar GRAPH_NODE = '\\x00';\nvar EDGE_KEY_DELIM = '\\x01';\n\n/**\n * @typedef {string} NodeID ID of a node.\n */\n\n/**\n * @typedef {`${string}${typeof EDGE_KEY_DELIM}${string}${typeof EDGE_KEY_DELIM}${string}`} EdgeID ID of an edge.\n * @internal - All public APIs use {@link EdgeObj} instead to refer to edges.\n */\n\n/**\n * @typedef {object} EdgeObj\n * @property {NodeID} v the id of the source or tail node of an edge\n * @property {NodeID} w the id of the target or head node of an edge\n * @property {string | number} [name] Name of the edge. Needed to uniquely identify\n * multiple edges between the same pair of nodes in a multigraph.\n */\n\n/**\n * @template {unknown} T\n * @typedef {T[] | Record<any, T>} Collection\n * Lodash object that can be iterated over with `_.each`.\n *\n * Beware, objects with `.length` are treated as arrays, see\n * https://lodash.com/docs/4.17.15#forEach\n */\n\n// Implementation notes:\n//\n// * Node id query functions should return string ids for the nodes\n// * Edge id query functions should return an \"edgeObj\", edge object, that is\n// composed of enough information to uniquely identify an edge: {v, w, name}.\n// * Internally we use an \"edgeId\", a stringified form of the edgeObj, to\n// reference edges. This is because we need a performant way to look these\n// edges up and, object properties, which have string keys, are the closest\n// we're going to get to a performant hashtable in JavaScript.\n\n// Implementation notes:\n//\n// * Node id query functions should return string ids for the nodes\n// * Edge id query functions should return an \"edgeObj\", edge object, that is\n// composed of enough information to uniquely identify an edge: {v, w, name}.\n// * Internally we use an \"edgeId\", a stringified form of the edgeObj, to\n// reference edges. This is because we need a performant way to look these\n// edges up and, object properties, which have string keys, are the closest\n// we're going to get to a performant hashtable in JavaScript.\n\n/**\n * @typedef {object} GraphOptions\n * @property {boolean | undefined} [directed] - set to `true` to get a\n * directed graph and `false` to get an undirected graph.\n * An undirected graph does not treat the order of nodes in an edge as\n * significant.\n * In other words, `g.edge(\"a\", \"b\") === g.edge(\"b\", \"a\")` for\n * an undirected graph.\n * Default: `true`\n * @property {boolean | undefined} [multigraph] - set to `true` to allow a\n * graph to have multiple edges between the same pair of nodes.\n * Default: `false`.\n * @property {boolean | undefined} [compound] - set to `true` to allow a\n * graph to have compound nodes - nodes which can be the parent of other\n * nodes.\n * Default: `false`.\n */\n\n/**\n * Graphlib has a single graph type: {@link Graph}. To create a new instance:\n *\n * ```js\n * var g = new Graph();\n * ```\n *\n * By default this will create a directed graph that does not allow multi-edges\n * or compound nodes.\n * The following options can be used when constructing a new graph:\n *\n * * {@link GraphOptions#directed}: set to `true` to get a directed graph and `false` to get an\n * undirected graph.\n * An undirected graph does not treat the order of nodes in an edge as\n * significant. In other words,\n * `g.edge(\"a\", \"b\") === g.edge(\"b\", \"a\")` for an undirected graph.\n * Default: `true`.\n * * {@link GraphOptions#multigraph}: set to `true` to allow a graph to have multiple edges\n * between the same pair of nodes. Default: `false`.\n * * {@link GraphOptions#compound}: set to `true` to allow a graph to have compound nodes -\n * nodes which can be the parent of other nodes. Default: `false`.\n *\n * To set the options, pass in an options object to the `Graph` constructor.\n * For example, to create a directed compound multigraph:\n *\n * ```js\n * var g = new Graph({ directed: true, compound: true, multigraph: true });\n * ```\n *\n * ### Node and Edge Representation\n *\n * In graphlib, a node is represented by a user-supplied String id.\n * All node related functions use this String id as a way to uniquely identify\n * the node. Here is an example of interacting with nodes:\n *\n * ```js\n * var g = new Graph();\n * g.setNode(\"my-id\", \"my-label\");\n * g.node(\"my-id\"); // returns \"my-label\"\n * ```\n *\n * Edges in graphlib are identified by the nodes they connect. For example:\n *\n * ```js\n * var g = new Graph();\n * g.setEdge(\"source\", \"target\", \"my-label\");\n * g.edge(\"source\", \"target\"); // returns \"my-label\"\n * ```\n *\n * However, we need a way to uniquely identify an edge in a single object for\n * various edge queries (e.g. {@link Graph#outEdges}).\n * We use {@link EdgeObj}s for this purpose.\n * They consist of the following properties:\n *\n * * {@link EdgeObj#v}: the id of the source or tail node of an edge\n * * {@link EdgeObj#w}: the id of the target or head node of an edge\n * * {@link EdgeObj#name} (optional): the name that uniquely identifies a multiedge.\n *\n * Any edge function that takes an edge id will also work with an {@link EdgeObj}. For example:\n *\n * ```js\n * var g = new Graph();\n * g.setEdge(\"source\", \"target\", \"my-label\");\n * g.edge({ v: \"source\", w: \"target\" }); // returns \"my-label\"\n * ```\n *\n * ### Multigraphs\n *\n * A [multigraph](https://en.wikipedia.org/wiki/Multigraph) is a graph that can\n * have more than one edge between the same pair of nodes.\n * By default graphlib graphs are not multigraphs, but a multigraph can be\n * constructed by setting the {@link GraphOptions#multigraph} property to true:\n *\n * ```js\n * var g = new Graph({ multigraph: true });\n * ```\n *\n * With multiple edges between two nodes we need some way to uniquely identify\n * each edge. We call this the {@link EdgeObj#name} property.\n * Here's an example of creating a couple of edges between the same nodes:\n *\n * ```js\n * var g = new Graph({ multigraph: true });\n * g.setEdge(\"a\", \"b\", \"edge1-label\", \"edge1\");\n * g.setEdge(\"a\", \"b\", \"edge2-label\", \"edge2\");\n * g.edge(\"a\", \"b\", \"edge1\"); // returns \"edge1-label\"\n * g.edge(\"a\", \"b\", \"edge2\"); // returns \"edge2-label\"\n * g.edges(); // returns [{ v: \"a\", w: \"b\", name: \"edge1\" },\n * // { v: \"a\", w: \"b\", name: \"edge2\" }]\n * ```\n *\n * A multigraph still allows an edge with no name to be created:\n *\n * ```js\n * var g = new Graph({ multigraph: true });\n * g.setEdge(\"a\", \"b\", \"my-label\");\n * g.edge({ v: \"a\", w: \"b\" }); // returns \"my-label\"\n * ```\n *\n * ### Compound Graphs\n *\n * A compound graph is one where a node can be the parent of other nodes.\n * The child nodes form a \"subgraph\".\n * Here's an example of constructing and interacting with a compound graph:\n *\n * ```js\n * var g = new Graph({ compound: true });\n * g.setParent(\"a\", \"parent\");\n * g.setParent(\"b\", \"parent\");\n * g.parent(\"a\"); // returns \"parent\"\n * g.parent(\"b\"); // returns \"parent\"\n * g.parent(\"parent\"); // returns undefined\n * ```\n *\n * ### Default Labels\n *\n * When a node or edge is created without a label, a default label can be assigned.\n * See {@link setDefaultNodeLabel} and {@link setDefaultEdgeLabel}.\n *\n * @template [GraphLabel=any] - Label of the graph.\n * @template [NodeLabel=any] - Label of a node.\n * Even though this is a \"label\", this could be any type that the user requires\n * (and may need to be an object for some layout/ranking algorithms in dagre).\n * @template [EdgeLabel=any] - Label of an edge.\n * Even though this is a \"label\", this could be any type that the user requires,\n * (and may need to be a object for ranking in dagre).\n */\nclass Graph {\n /**\n * @param {GraphOptions} [opts] - Graph options.\n */\n constructor(opts = {}) {\n /**\n * @type {boolean}\n * @private\n */\n this._isDirected = Object.prototype.hasOwnProperty.call(opts, 'directed')\n ? opts.directed\n : true;\n /**\n * @type {boolean}\n * @private\n */\n this._isMultigraph = Object.prototype.hasOwnProperty.call(opts, 'multigraph')\n ? opts.multigraph\n : false;\n /**\n * @type {boolean}\n * @private\n */\n this._isCompound = Object.prototype.hasOwnProperty.call(opts, 'compound')\n ? opts.compound\n : false;\n\n /**\n * @type {GraphLabel | undefined}\n * Label for the graph itself\n */\n this._label = undefined;\n\n /**\n * Default label to be set when creating a new node.\n *\n * @private\n * @type {(v: NodeID | number) => NodeLabel}\n */\n this._defaultNodeLabelFn = lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](undefined);\n\n /**\n * Default label to be set when creating a new edge\n *\n * @private\n * @type {(v: NodeID, w: NodeID, name: string | undefined) => EdgeLabel}\n */\n this._defaultEdgeLabelFn = lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](undefined);\n\n /**\n * @type {Record<NodeID, NodeLabel>}\n * @private\n *\n * v -> label\n */\n this._nodes = {};\n\n if (this._isCompound) {\n /**\n * @type {Record<NodeID, NodeID>}\n * @private\n * v -> parent\n */\n this._parent = {};\n\n /**\n * @type {Record<NodeID, Record<NodeID, true>>}\n * @private\n * v -> children\n */\n this._children = {};\n this._children[GRAPH_NODE] = {};\n }\n\n /**\n * @type {Record<NodeID, Record<EdgeID, EdgeObj>>}\n * @private\n * v -> edgeObj\n */\n this._in = {};\n\n /**\n * @type {Record<NodeID, Record<NodeID, number>>}\n * @private\n * u -> v -> Number\n */\n this._preds = {};\n\n /**\n * @type {Record<NodeID, Record<EdgeID, EdgeObj>>}\n * @private\n * v -> edgeObj\n */\n this._out = {};\n\n /**\n * @type {Record<NodeID, Record<NodeID, number>>}\n * @private\n * v -> w -> Number\n */\n this._sucs = {};\n\n /**\n * @type {Record<EdgeID, EdgeObj>}\n * @private\n * e -> edgeObj\n */\n this._edgeObjs = {};\n\n /**\n * @type {Record<EdgeID, EdgeLabel>}\n * @private\n * e -> label\n */\n this._edgeLabels = {};\n }\n\n /* === Graph functions ========= */\n\n /**\n *\n * @returns {boolean} `true` if the graph is [directed](https://en.wikipedia.org/wiki/Directed_graph).\n * A directed graph treats the order of nodes in an edge as significant whereas an\n * [undirected](https://en.wikipedia.org/wiki/Graph_(mathematics)#Undirected_graph)\n * graph does not.\n * This example demonstrates the difference:\n *\n * @example\n *\n * ```js\n * var directed = new Graph({ directed: true });\n * directed.setEdge(\"a\", \"b\", \"my-label\");\n * directed.edge(\"a\", \"b\"); // returns \"my-label\"\n * directed.edge(\"b\", \"a\"); // returns undefined\n *\n * var undirected = new Graph({ directed: false });\n * undirected.setEdge(\"a\", \"b\", \"my-label\");\n * undirected.edge(\"a\", \"b\"); // returns \"my-label\"\n * undirected.edge(\"b\", \"a\"); // returns \"my-label\"\n * ```\n */\n isDirected() {\n return this._isDirected;\n }\n /**\n * @returns {boolean} `true` if the graph is a multigraph.\n */\n isMultigraph() {\n return this._isMultigraph;\n }\n /**\n * @returns {boolean} `true` if the graph is compound.\n */\n isCompound() {\n return this._isCompound;\n }\n\n /**\n * Sets the label for the graph to `label`.\n *\n * @param {GraphLabel} label - Label for the graph.\n * @returns {this}\n */\n setGraph(label) {\n this._label = label;\n return this;\n }\n\n /**\n * @returns {GraphLabel | undefined} the currently assigned label for the graph.\n * If no label has been assigned, returns `undefined`.\n *\n * @example\n *\n * ```js\n * var g = new Graph();\n * g.graph(); // returns undefined\n * g.setGraph(\"graph-label\");\n * g.graph(); // returns \"graph-label\"\n * ```\n */\n graph() {\n return this._label;\n }\n /* === Node functions ========== */\n\n /**\n * Sets a new default value that is assigned to nodes that are created without\n * a label.\n *\n * @param {typeof this._defaultNodeLabelFn | NodeLabel} newDefault - If a function,\n * it is called with the id of the node being created.\n * Otherwise, it is assigned as the label directly.\n * @returns {this}\n */\n setDefaultNodeLabel(newDefault) {\n if (!lodash_es__WEBPACK_IMPORTED_MODULE_4__[\"default\"](newDefault)) {\n newDefault = lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](newDefault);\n }\n this._defaultNodeLabelFn = newDefault;\n return this;\n }\n\n /**\n * @returns {number} the number of nodes in the graph.\n */\n nodeCount() {\n return this._nodeCount;\n }\n\n /**\n * @returns {NodeID[]} the ids of the nodes in the graph.\n *\n * @remarks\n * Use {@link node()} to get the label for each node.\n * Takes `O(|V|)` time.\n */\n nodes() {\n return lodash_es__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this._nodes);\n }\n /**\n * @returns {NodeID[]} those nodes in the graph that have no in-edges.\n * @remarks Takes `O(|V|)` time.\n */\n sources() {\n var self = this;\n return lodash_es__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.nodes(), function (v) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_3__[\"default\"](self._in[v]);\n });\n }\n /**\n * @returns {NodeID[]} those nodes in the graph that have no out-edges.\n * @remarks Takes `O(|V|)` time.\n */\n sinks() {\n var self = this;\n return lodash_es__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.nodes(), function (v) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_3__[\"default\"](self._out[v]);\n });\n }\n\n /**\n * Invokes setNode method for each node in `vs` list.\n *\n * @param {Collection<NodeID | number>} vs - List of node IDs to create/set.\n * @param {NodeLabel} [value] - If set, update all nodes with this value.\n * @returns {this}\n * @remarks Complexity: O(|names|).\n */\n setNodes(vs, value) {\n var args = arguments;\n var self = this;\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](vs, function (v) {\n if (args.length > 1) {\n self.setNode(v, value);\n } else {\n self.setNode(v);\n }\n });\n return this;\n }\n\n /**\n * Creates or updates the value for the node `v` in the graph.\n *\n * @param {NodeID | number} v - ID of the node to create/set.\n * @param {NodeLabel} [value] - If supplied, it is set as the value for the node.\n * If not supplied and the node was created by this call then\n * {@link setDefaultNodeLabel} will be used to set the node's value.\n * @returns {this} the graph, allowing this to be chained with other functions.\n * @remarks Takes `O(1)` time.\n */\n setNode(v, value) {\n if (Object.prototype.hasOwnProperty.call(this._nodes, v)) {\n if (arguments.length > 1) {\n this._nodes[v] = value;\n }\n return this;\n }\n\n this._nodes[v] = arguments.length > 1 ? value : this._defaultNodeLabelFn(v);\n if (this._isCompound) {\n this._parent[v] = GRAPH_NODE;\n this._children[v] = {};\n this._children[GRAPH_NODE][v] = true;\n }\n this._in[v] = {};\n this._preds[v] = {};\n this._out[v] = {};\n this._sucs[v] = {};\n ++this._nodeCount;\n return this;\n }\n\n /**\n * Gets the label of node with specified name.\n *\n * @param {NodeID | number} v - Node ID.\n * @returns {NodeLabel | undefined} the label assigned to the node with the id `v`\n * if it is in the graph.\n * Otherwise returns `undefined`.\n * @remarks Takes `O(1)` time.\n */\n node(v) {\n return this._nodes[v];\n }\n\n /**\n * Detects whether graph has a node with specified name or not.\n *\n * @param {NodeID | number} v - Node ID.\n * @returns {boolean} Returns `true` the graph has a node with the id.\n * @remarks Takes `O(1)` time.\n */\n hasNode(v) {\n return Object.prototype.hasOwnProperty.call(this._nodes, v);\n }\n\n /**\n * Remove the node with the id `v` in the graph or do nothing if the node is\n * not in the graph.\n *\n * If the node was removed this function also removes any incident edges.\n *\n * @param {NodeID | number} v - Node ID to remove.\n * @returns {this} the graph, allowing this to be chained with other functions.\n * @remarks Takes `O(|E|)` time.\n */\n removeNode(v) {\n if (Object.prototype.hasOwnProperty.call(this._nodes, v)) {\n var removeEdge = (e) => this.removeEdge(this._edgeObjs[e]);\n delete this._nodes[v];\n if (this._isCompound) {\n this._removeFromParentsChildList(v);\n delete this._parent[v];\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](this.children(v), (child) => {\n this.setParent(child);\n });\n delete this._children[v];\n }\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](lodash_es__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this._in[v]), removeEdge);\n delete this._in[v];\n delete this._preds[v];\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](lodash_es__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this._out[v]), removeEdge);\n delete this._out[v];\n delete this._sucs[v];\n --this._nodeCount;\n }\n return this;\n }\n\n /**\n * Sets the parent for `v` to `parent` if it is defined or removes the parent\n * for `v` if `parent` is undefined.\n *\n * @param {NodeID | number} v - Node ID to set the parent for.\n * @param {NodeID | number} [parent] - Parent node ID. If not defined, removes the parent.\n * @returns {this} the graph, allowing this to be chained with other functions.\n * @throws if the graph is not compound.\n * @throws if setting the parent would create a cycle.\n * @remarks Takes `O(1)` time.\n */\n setParent(v, parent) {\n if (!this._isCompound) {\n throw new Error('Cannot set parent in a non-compound graph');\n }\n\n if (lodash_es__WEBPACK_IMPORTED_MODULE_5__[\"default\"](parent)) {\n parent = GRAPH_NODE;\n } else {\n // Coerce parent to string\n parent += '';\n for (var ancestor = parent; !lodash_es__WEBPACK_IMPORTED_MODULE_5__[\"default\"](ancestor); ancestor = this.parent(ancestor)) {\n if (ancestor === v) {\n throw new Error('Setting ' + parent + ' as parent of ' + v + ' would create a cycle');\n }\n }\n\n this.setNode(parent);\n }\n\n this.setNode(v);\n this._removeFromParentsChildList(v);\n // @ts-expect-error -- We coerced parent to a string above\n this._parent[v] = parent;\n this._children[parent][v] = true;\n return this;\n }\n\n /**\n * @private\n * @param {NodeID | number} v - Node ID.\n */\n _removeFromParentsChildList(v) {\n delete this._children[this._parent[v]][v];\n }\n\n /**\n * Get parent node for node `v`.\n *\n * @param {NodeID | number} v - Node ID.\n * @returns {NodeID | undefined} the node that is a parent of node `v`\n * or `undefined` if node `v` does not have a parent or is not a member of\n * the graph.\n * Always returns `undefined` for graphs that are not compound.\n * @remarks Takes `O(1)` time.\n */\n parent(v) {\n if (this._isCompound) {\n var parent = this._parent[v];\n if (parent !== GRAPH_NODE) {\n return parent;\n }\n }\n }\n\n /**\n * Gets list of direct children of node v.\n *\n * @param {NodeID | number} [v] - Node ID. If not specified, gets nodes\n * with no parent (top-level nodes).\n * @returns {NodeID[] | undefined} all nodes that are children of node `v` or\n * `undefined` if node `v` is not in the graph.\n * Always returns `[]` for graphs that are not compound.\n * @remarks Takes `O(|V|)` time.\n */\n children(v) {\n if (lodash_es__WEBPACK_IMPORTED_MODULE_5__[\"default\"](v)) {\n v = GRAPH_NODE;\n }\n\n if (this._isCompound) {\n var children = this._children[v];\n if (children) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_6__[\"default\"](children);\n }\n } else if (v === GRAPH_NODE) {\n return this.nodes();\n } else if (this.hasNode(v)) {\n return [];\n }\n }\n\n /**\n * @param {NodeID | number} v - Node ID.\n * @returns {NodeID[] | undefined} all nodes that are predecessors of the\n * specified node or `undefined` if node `v` is not in the graph.\n * @remarks\n * Behavior is undefined for undirected graphs - use {@link neighbors} instead.\n * Takes `O(|V|)` time.\n */\n predecessors(v) {\n var predsV = this._preds[v];\n if (predsV) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_6__[\"default\"](predsV);\n }\n }\n\n /**\n * @param {NodeID | number} v - Node ID.\n * @returns {NodeID[] | undefined} all nodes that are successors of the\n * specified node or `undefined` if node `v` is not in the graph.\n * @remarks\n * Behavior is undefined for undirected graphs - use {@link neighbors} instead.\n * Takes `O(|V|)` time.\n */\n successors(v) {\n var sucsV = this._sucs[v];\n if (sucsV) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_6__[\"default\"](sucsV);\n }\n }\n\n /**\n * @param {NodeID | number} v - Node ID.\n * @returns {NodeID[] | undefined} all nodes that are predecessors or\n * successors of the specified node\n * or `undefined` if node `v` is not in the graph.\n * @remarks Takes `O(|V|)` time.\n */\n neighbors(v) {\n var preds = this.predecessors(v);\n if (preds) {\n return lodash_es__WEBPACK_IMPORTED_MODULE_8__[\"default\"](preds, this.successors(v));\n }\n }\n\n /**\n * @param {NodeID | number} v - Node ID.\n * @returns {boolean} True if the node is a leaf (has no successors), false otherwise.\n */\n isLeaf(v) {\n var neighbors;\n if (this.isDirected()) {\n neighbors = this.successors(v);\n } else {\n neighbors = this.neighbors(v);\n }\n return neighbors.length === 0;\n }\n\n /**\n * Creates new graph with nodes filtered via `filter`.\n * Edges incident to rejected node\n * are also removed.\n * \n * In case of compound graph, if parent is rejected by `filter`,\n * than all its children are rejected too.\n\n * @param {(v: NodeID) => boolean} filter - Function that returns `true` for nodes to keep.\n * @returns {Graph<GraphLabel, NodeLabel, EdgeLabel>} A new graph containing only the nodes for which `filter` returns `true`.\n * @remarks Average-case complexity: O(|E|+|V|).\n */\n filterNodes(filter) {\n /**\n * @type {Graph<GraphLabel, NodeLabel, EdgeLabel>}\n */\n // @ts-expect-error\n var copy = new this.constructor({\n directed: this._isDirected,\n multigraph: this._isMultigraph,\n compound: this._isCompound,\n });\n\n copy.setGraph(this.graph());\n\n var self = this;\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](this._nodes, function (value, v) {\n if (filter(v)) {\n copy.setNode(v, value);\n }\n });\n\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](this._edgeObjs, function (e) {\n if (copy.hasNode(e.v) && copy.hasNode(e.w)) {\n copy.setEdge(e, self.edge(e));\n }\n });\n\n var parents = {};\n function findParent(v) {\n var parent = self.parent(v);\n if (parent === undefined || copy.hasNode(parent)) {\n parents[v] = parent;\n return parent;\n } else if (parent in parents) {\n return parents[parent];\n } else {\n return findParent(parent);\n }\n }\n\n if (this._isCompound) {\n lodash_es__WEBPACK_IMPORTED_MODULE_0__[\"default\"](copy.nodes(), function (v) {\n copy.setParent(v, findParent(v));\n });\n }\n\n return copy;\n }\n\n /* === Edge functions ========== */\n\n /**\n * Sets a new default value that is assigned to edges that are created without\n * a label.\n *\n * @param {typeof this._defaultEdgeLabelFn | EdgeLabel} newDefault - If a function,\n * it is called with the parameters `(v, w, name)`.\n * Otherwise, it is assigned as the label directly.\n * @returns {this}\n */\n setDefaultEdgeLabel(newDefault) {\n if (!lodash_es__WEBPACK_IMPORTED_MODULE_4__[\"default\"](newDefault)) {\n newDefault = lodash_es__WEBPACK_IMPORTED_MODULE_1__[\"default\"](newDefault);\n }\n this._defaultEdgeLabelFn = newDefault;\n return this;\n }\n\n /**\n * @returns {number} the number of edges in the graph.\n * @remarks Complexity: O(1).\n */\n edgeCount() {\n return this._edgeCount;\n }\n\n /**\n * Gets edges of the graph.\n *\n * @returns {EdgeObj[]} the {@link EdgeObj} for each edge in the graph.\n *\n * @remarks\n * In case of compound graph subgraphs are not considered.\n * Use {@link edge()} to get the label for each edge.\n * Takes `O(|E|)` time.\n */\n edges() {\n return lodash_es__WEBPACK_IMPORTED_MODULE_9__[\"default\"](this._edgeObjs);\n }\n\n /**\n * Establish an edges path over the nodes in nodes list.\n *\n * If some edge is already exists, it will update its label, otherwise it will\n * create an edge between pair of nodes with label provided or default label\n * if no label provided.\n *\n * @param {Collection<NodeID>} vs - List of node IDs to create edges between.\n * @param {EdgeLabel} [value] - If set, update all edges with this value.\n * @returns {this}\n * @remarks Complexity: O(|nodes|).\n */\n setPath(vs, value) {\n var self = this;\n var args = arguments;\n lodash_es__WEBPACK_IMPORTED_MODULE_7__[\"default\"](vs, function (v, w) {\n if (args.length > 1) {\n self.setEdge(v, w, value);\n } else {\n self.setEdge(v, w);\n }\n return w;\n });\n return this;\n }\n\n /**\n * Creates or updates the label for the edge (`v`, `w`) with the optionally\n * supplied `name`.\n *\n * @overload\n * @param {EdgeObj} arg0 - Edge object.\n * @param {EdgeLabel} [value] - If supplied, it is set as the label for the edge.\n * If not supplied and the edge was created by this call then\n * {@link setDefaultEdgeLabel} will be used to assign the edge's label.\n * @returns {this} the graph, allowing this to be chained with other functions.\n * @remarks Takes `O(1)` time.\n */\n /**\n * Creates or updates the label for the edge (`v`, `w`) with the optionally\n * supplied `name`.\n *\n * @overload\n * @param {NodeID | number} v - Source node ID. Number values will be coerced to strings.\n * @param {NodeID | number} w - Target node ID. Number values will be coerced to strings.\n * @param {EdgeLabel} [value] - If supplied, it is set as the label for the edge.\n * If not supplied and the edge was created by this call then\n * {@link setDefaultEdgeLabel} will be used to assign the edge's label.\n * @param {string | number} [name] - Edge name. Only useful with multigraphs.\n * @returns {this} the graph, allowing this to be chained with other functions.\n * @remarks Takes `O(1)` time.\n */\n setEdge() {\n var v, w, name, value;\n var valueSpecified = false;\n var arg0 = arguments[0];\n\n if (typeof arg0 === 'object' && arg0 !== null && 'v' in arg0) {\n v = arg0.v;\n w = arg0.w;\n name = arg0.name;\n if (arguments.length === 2) {\n value = arguments[1];\n valueSpecified = true;\n }\n } else {\n v = arg0;\n w = arguments[1];\n name = arguments[3];\n if (arguments.length > 2) {\n value = arguments[2];\n valueSpecified = true;\n }\n }\n\n v = '' + v;\n w = '' + w;\n if (!lodash_es__WEBPACK_IMPORTED_MODULE_5__[\"default\"](name)) {\n name = '' + name;\n }\n\n var e = edgeArgsToId(this._isDirected, v, w, name);\n if (Object.prototype.hasOwnProperty.call(this._edgeLabels, e)) {\n if (valueSpecified) {\n this._edgeLabels[e] = value;\n }\n return this;\n }\n\n if (!lodash_es__WEBPACK_IMPORTED_MODULE_5__[\"default\"](name) && !this._isMultigraph) {\n throw new Error('Cannot set a named edge when isMultigraph = false');\n }\n\n // It didn't exist, so we need to create it.\n // First ensure the nodes exist.\n this.setNode(v);\n this.setNode(w);\n\n this._edgeLabels[e] = valueSpecified ? value : this._defaultEdgeLabelFn(v, w, name);\n\n var edgeObj = edgeArgsToObj(this._isDirected, v, w, name);\n // Ensure we add undirected edges in a consistent way.\n v = edgeObj.v;\n w = edgeObj.w;\n\n Object.freeze(edgeObj);\n this._edgeObjs[e] = edgeObj;\n incrementOrInitEntry(this._preds[w], v);\n incrementOrInitEntry(this._sucs[v], w);\n this._in[w][e] = edgeObj;\n this._out[v][e] = edgeObj;\n this._edgeCount++;\n return this;\n }\n\n /**\n * Gets the label for the specified edge.\n *\n * @overload\n * @param {EdgeObj} v - Edge object.\n * @returns {EdgeLabel | undefined} the label for the edge (`v`, `w`) if the\n * graph has an edge between `v` and `w` with the optional `name`.\n * Returned `undefined` if there is no such edge in the graph.\n * @remarks\n * `v` and `w` can be interchanged for undirected graphs.\n * Takes `O(1)` time.\n */\n /**\n * Gets the label for the specified edge.\n *\n * @overload\n * @param {NodeID | number} v - Source node ID.\n * @param {NodeID | number} w - Target node ID.\n * @param {string | number} [name] - Edge name. Only useful with multigraphs.\n * @returns {EdgeLabel | undefined} the label for the edge (`v`, `w`) if the\n * graph has an edge between `v` and `w` with the optional `name`.\n * Returned `undefined` if there is no such edge in the graph.\n * @remarks\n * `v` and `w` can be interchanged for undirected graphs.\n * Takes `O(1)` time.\n */\n edge(v, w, name) {\n var e =\n arguments.length === 1\n ? edgeObjToId(this._isDirected, arguments[0])\n : edgeArgsToId(this._isDirected, v, w, name);\n return this._edgeLabels[e];\n }\n\n /**\n * Detects whether the graph contains specified edge or not.\n *\n * @overload\n * @param {EdgeObj} v - Edge object.\n * @returns {boolean} `true` if the graph has an edge between `v` and `w`\n * with the optional `name`.\n * @remarks\n * `v` and `w` can be interchanged for undirected graphs.\n * No subgraphs are considered.\n * Takes `O(1)` time.\n */\n /**\n * Detects whether the graph contains specified edge or not.\n *\n * @overload\n * @param {NodeID | number} v - Source node ID.\n * @param {NodeID | number} w - Target node ID.\n * @param {string | number} [name] - Edge name. Only useful with multigraphs.\n * @returns {boolean} `true` if the graph has an edge between `v` and `w`\n * with the optional `name`.\n * @remarks\n * `v` and `w` can be interchanged for undirected graphs.\n * No subgraphs are considered.\n * Takes `O(1)` time.\n */\n hasEdge(v, w, name) {\n var e =\n arguments.length === 1\n ? edgeObjToId(this._isDirected, arguments[0])\n : edgeArgsToId(this._isDirected, v, w, name);\n return Object.prototype.hasOwnProperty.call(this._edgeLabels, e);\n }\n\n /**\n * Removes the edge (`v`, `w`) if the graph has an edge between `v` and `w`\n * with the optional `name`. If not this function does nothing.\n *\n * @overload\n * @param {EdgeObj} v - Edge object.\n * @returns {this}\n * @remarks\n * `v` and `w` can be interchanged for undirected graphs.\n * No subgraphs are considered.\n * Takes `O(1)` time.\n */\n /**\n * Removes the edge (`v`, `w`) if the graph has an edge between `v` and `w`\n * with the optional `name`. If not this function does nothing.\n *\n * @overload\n * @param {NodeID | number} v - Source node ID.\n * @param {NodeID | number} w - Target node ID.\n * @param {string | number} [name] - Edge name. Only useful with multigraphs.\n * @returns {this}\n * @remarks\n * `v` and `w` can be interchanged for undirected graphs.\n * Takes `O(1)` time.\n */\n removeEdge(v, w, name) {\n var e =\n arguments.length === 1\n ? edgeObjToId(this._isDirected, arguments[0])\n : edgeArgsToId(this._isDirected, v, w, name);\n var edge = this._edgeObjs[e];\n if (edge) {\n v = edge.v;\n w = edge.w;\n delete this._edgeLabels[e];\n delete this._edgeObjs[e];\n decrementOrRemoveEntry(this._preds[w], v);\n decrementOrRemoveEntry(this._sucs[v], w);\n delete this._in[w][e];\n delete this._out[v][e];\n this._edgeCount--;\n }\n return this;\n }\n\n /**\n * @param {NodeID | number} v - Target node ID.\n * @param {NodeID | number} [u] - Optionally filters edges down to just those\n * coming from node `u`.\n * @returns {EdgeObj[] | undefined} all edges that point to the node `v`.\n * Returns `undefined` if node `v` is not in the graph.\n * @remarks\n * Behavior is undefined for undirected graphs - use {@link nodeEdges} instead.\n * Takes `O(|E|)` time.\n */\n inEdges(v, u) {\n var inV = this._in[v];\n if (inV) {\n var edges = lodash_es__WEBPACK_IMPORTED_MODULE_9__[\"default\"](inV);\n if (!u) {\n return edges;\n }\n return lodash_es__WEBPACK_IMPORTED_MODULE_2__[\"default\"](edges, function (edge) {\n return edge.v === u;\n });\n }\n }\n\n /**\n * @param {NodeID | number} v - Target node ID.\n * @param {NodeID | number} [w] - Optionally filters edges down to just those\n * that point to `w`.\n * @returns {EdgeObj[] | undefined} all edges that point to the node `v`.\n * Returns `undefined` if node `v` is not in the graph.\n * @remarks\n * Behavior is undefined for undirected graphs - use {@link nodeEdges} instead.\n * Takes `O(|E|)` time.\n */\n outEdges(v, w) {\n var outV = this._out[v];\n if (outV) {\n var edges = lodash_es__WEBPACK_IMPORTED_MODULE_9__[\"default\"](outV);\n if (!w) {\n return edges;\n }\n return lodash_es__WEBPACK_IMPORTED_MODULE_2__[\"default\"](edges, function (edge) {\n return edge.w === w;\n });\n }\n }\n\n /**\n * @param {NodeID | number} v - Target Node ID.\n * @param {NodeID | number} [w] - If set, filters those edges down to just\n * those between nodes `v` and `w` regardless of direction\n * @returns {EdgeObj[] | undefined} all edges to or from node `v` regardless\n * of direction. Returns `undefined` if node `v` is not in the graph.\n * @remarks Takes `O(|E|)` time.\n */\n nodeEdges(v, w) {\n var inEdges = this.inEdges(v, w);\n if (inEdges) {\n return inEdges.concat(this.outEdges(v, w));\n }\n }\n}\n\n/* Number of nodes in the graph. Should only be changed by the implementation. */\nGraph.prototype._nodeCount = 0;\n\n/* Number of edges in the graph. Should only be changed by the implementation. */\nGraph.prototype._edgeCount = 0;\n\n/**\n * @param {Record<NodeID, number>} map - Object mapping node IDs to counts.\n * @param {NodeID | number} k - Node ID.\n */\nfunction incrementOrInitEntry(map, k) {\n if (map[k]) {\n map[k]++;\n } else {\n map[k] = 1;\n }\n}\n\n/**\n * @param {Record<NodeID, number>} map - Object mapping node IDs to counts.\n * @param {NodeID | number} k - Node ID.\n */\nfunction decrementOrRemoveEntry(map, k) {\n if (!--map[k]) {\n delete map[k];\n }\n}\n\n/**\n * @param {boolean} isDirected - If `false`, sorts v and w to ensure a consistent ID.\n * @param {EdgeObj['v'] | number} v_ - Source node ID.\n * @param {EdgeObj['w'] | number} w_ - Target node ID.\n * @param {EdgeObj['name']} [name] - Edge name (for multiple edges between the same nodes).\n * @returns {EdgeID} Unique ID for the edge.\n */\nfunction edgeArgsToId(isDirected, v_, w_, name) {\n var v = '' + v_;\n var w = '' + w_;\n if (!isDirected && v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n return v + EDGE_KEY_DELIM + w + EDGE_KEY_DELIM + (lodash_es__WEBPACK_IMPORTED_MODULE_5__[\"default\"](name) ? DEFAULT_EDGE_NAME : name);\n}\n\n/**\n * @param {boolean} isDirected - If `false`, sorts v and w to ensure a consistent ID.\n * @param {EdgeObj['v'] | number} v_ - Source node ID.\n * @param {EdgeObj['w'] | number} w_ - Target node ID.\n * @param {EdgeObj['name']} [name] - Edge name (for multiple edges between the same nodes).\n * @returns {EdgeObj}\n */\nfunction edgeArgsToObj(isDirected, v_, w_, name) {\n var v = '' + v_;\n var w = '' + w_;\n if (!isDirected && v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n var edgeObj = { v: v, w: w };\n if (name) {\n edgeObj.name = name;\n }\n return edgeObj;\n}\n\n/**\n * @param {boolean} isDirected - If `false`, sorts v and w to ensure a consistent ID.\n * @param {EdgeObj} edgeObj - Edge object.\n * @returns {EdgeID} Unique ID for the edge.\n */\nfunction edgeObjToId(isDirected, edgeObj) {\n return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name);\n}\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/dagre-d3-es/src/graphlib/graph.js?\n}");
|
|
19
19
|
|
|
20
20
|
/***/ },
|
|
21
21
|
|