@infinilabs/ai-chat 0.0.1 → 0.0.2
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/README.md +10 -1
- package/dist/{_baseUniq-BQcAhV7E.js → _baseUniq-BFn6cCm9.js} +1 -1
- package/dist/_baseUniq-nfJyj2zU.cjs +151 -0
- package/dist/arc-BWSMkwk2.cjs +130 -0
- package/dist/{arc-2jwvQ2TN.js → arc-DODeX7B9.js} +1 -1
- package/dist/{architecture-U656AL7Q-WuSilpZW.js → architecture-U656AL7Q-B4C0nw6C.js} +1 -1
- package/dist/architecture-U656AL7Q-CVURQXwt.cjs +5 -0
- package/dist/architectureDiagram-VXUJARFQ-2UbdzpNz.cjs +8681 -0
- package/dist/{architectureDiagram-VXUJARFQ-D6SKNy5z.js → architectureDiagram-VXUJARFQ-NCVmzKuE.js} +3 -3
- package/dist/blockDiagram-VD42YOAC-B3yCPK1N.cjs +3606 -0
- package/dist/{blockDiagram-VD42YOAC-Ct2DD8jj.js → blockDiagram-VD42YOAC-C4FsmQfk.js} +5 -5
- package/dist/{c4Diagram-YG6GDRKO-B7wBU4mz.js → c4Diagram-YG6GDRKO-ATyoKzFV.js} +2 -2
- package/dist/c4Diagram-YG6GDRKO-COwVcHWj.cjs +2481 -0
- package/dist/channel-2Y73gsu9.cjs +6 -0
- package/dist/{channel-BRREX19f.js → channel-oB8MffQV.js} +1 -1
- package/dist/chunk-4BX2VUAB-C3diNHZw.cjs +15 -0
- package/dist/{chunk-4BX2VUAB-BnghU1_v.js → chunk-4BX2VUAB-sd2zFBFz.js} +1 -1
- package/dist/{chunk-55IACEB6-Dduk-DEL.js → chunk-55IACEB6-6ohTnYE3.js} +1 -1
- package/dist/chunk-55IACEB6-T-CzlJke.cjs +12 -0
- package/dist/chunk-B4BG7PRW-B1zqG62l.cjs +1825 -0
- package/dist/{chunk-B4BG7PRW-DeHw-z-x.js → chunk-B4BG7PRW-E1dti26Y.js} +4 -4
- package/dist/chunk-DI55MBZ5-Dk0kfYBV.cjs +1914 -0
- package/dist/{chunk-DI55MBZ5-GTHMAr0M.js → chunk-DI55MBZ5-DpHw-vMw.js} +3 -3
- package/dist/{chunk-FMBD7UC4-Bchh4_3W.js → chunk-FMBD7UC4-B1vXpasq.js} +1 -1
- package/dist/chunk-FMBD7UC4-CShN9-qf.cjs +18 -0
- package/dist/{chunk-QN33PNHL-H6S-NYp0.js → chunk-QN33PNHL-Cw7FG91D.js} +1 -1
- package/dist/chunk-QN33PNHL-DJi1fhak.cjs +23 -0
- package/dist/{chunk-QZHKN3VN-DdcyNnvM.js → chunk-QZHKN3VN-BweiBR9P.js} +1 -1
- package/dist/chunk-QZHKN3VN-DfUW_gDw.cjs +16 -0
- package/dist/chunk-TZMSLE5B-DY2Kbag4.cjs +107 -0
- package/dist/{chunk-TZMSLE5B-C7te_j4V.js → chunk-TZMSLE5B-ZQ2Esoix.js} +1 -1
- package/dist/{classDiagram-2ON5EDUG-CNkHY_Y7.js → classDiagram-2ON5EDUG-D2tIbkjc.js} +2 -2
- package/dist/classDiagram-2ON5EDUG-DRhRmkUb.cjs +19 -0
- package/dist/{classDiagram-v2-WZHVMYZB-CNkHY_Y7.js → classDiagram-v2-WZHVMYZB-D2tIbkjc.js} +2 -2
- package/dist/classDiagram-v2-WZHVMYZB-DRhRmkUb.cjs +19 -0
- package/dist/clone-BMkj3yun.cjs +7 -0
- package/dist/{clone-DnOD7gQ4.js → clone-ChHXIoR6.js} +1 -1
- package/dist/cose-bilkent-S5V4N54A-BXnWH5Od.cjs +4942 -0
- package/dist/{cose-bilkent-S5V4N54A-2EKtTYth.js → cose-bilkent-S5V4N54A-D15BmpCb.js} +1 -1
- package/dist/cytoscape.esm-D8IBYQeQ.cjs +30238 -0
- package/dist/dagre-6UL2VRFP-DGQ6TW_g.cjs +693 -0
- package/dist/{dagre-6UL2VRFP-oJLNDO4O.js → dagre-6UL2VRFP-WmhUYWg8.js} +5 -5
- package/dist/defaultLocale-DwYGIg9G.cjs +203 -0
- package/dist/{diagram-PSM6KHXK-DhMgmu9h.js → diagram-PSM6KHXK-DSfHBoUT.js} +4 -4
- package/dist/diagram-PSM6KHXK-J4qyGeN7.cjs +845 -0
- package/dist/diagram-QEK2KX5R-D96wT5cH.cjs +300 -0
- package/dist/{diagram-QEK2KX5R-pB1vUeno.js → diagram-QEK2KX5R-I_nyexpY.js} +3 -3
- package/dist/diagram-S2PKOQOG-BC_WyKEe.cjs +210 -0
- package/dist/{diagram-S2PKOQOG-HTooIr24.js → diagram-S2PKOQOG-aooXSMNo.js} +3 -3
- package/dist/erDiagram-Q2GNP2WA-DQ8Lquay.cjs +1158 -0
- package/dist/{erDiagram-Q2GNP2WA-CCaN2EHf.js → erDiagram-Q2GNP2WA-DWF8e6EL.js} +4 -4
- package/dist/{flowDiagram-NV44I4VS-CG0erQtl.js → flowDiagram-NV44I4VS-CM9c4F1o.js} +5 -5
- package/dist/flowDiagram-NV44I4VS-DpYNkyM2.cjs +2331 -0
- package/dist/{ganttDiagram-JELNMOA3-D3rSLJec.js → ganttDiagram-JELNMOA3-CAsoD6rZ.js} +2 -2
- package/dist/ganttDiagram-JELNMOA3-DfKahpj4.cjs +3679 -0
- package/dist/{gitGraph-F6HP7TQM-BDWdXs6A.js → gitGraph-F6HP7TQM-BX2fz4_i.js} +1 -1
- package/dist/gitGraph-F6HP7TQM-DRkGg4T1.cjs +5 -0
- package/dist/{gitGraphDiagram-NY62KEGX-Ip-PiLDb.js → gitGraphDiagram-NY62KEGX-PXpI94u6.js} +4 -4
- package/dist/gitGraphDiagram-NY62KEGX-YhnKpooH.cjs +1203 -0
- package/dist/{graph-wCViE1vL.js → graph-BvxpI7Xc.js} +2 -2
- package/dist/graph-CI_TWBSn.cjs +595 -0
- package/dist/index-BctLGjTK.cjs +120500 -0
- package/dist/{index-BQvQI7yA.js → index-CjSgoo1P.js} +103324 -100141
- package/dist/index.cjs +19 -0
- package/dist/index.js +13 -1
- package/dist/info-NVLQJR56-BGbTE7dw.cjs +5 -0
- package/dist/info-NVLQJR56-DRxIh-N8.js +5 -0
- package/dist/infoDiagram-WHAUD3N6-BB2Bnbnh.cjs +31 -0
- package/dist/{infoDiagram-WHAUD3N6-BbVs4x8y.js → infoDiagram-WHAUD3N6-D_RrgwxS.js} +2 -2
- package/dist/init-DevvdK2U.cjs +15 -0
- package/dist/{journeyDiagram-XKPGCS4Q-Cz9ox9GA.js → journeyDiagram-XKPGCS4Q-BJjXlMIj.js} +4 -4
- package/dist/journeyDiagram-XKPGCS4Q-BcBLsfI9.cjs +1254 -0
- package/dist/{kanban-definition-3W4ZIXB7-ChdUHO5f.js → kanban-definition-3W4ZIXB7-0wwNBZ93.js} +2 -2
- package/dist/kanban-definition-3W4ZIXB7-CaY0q4j9.cjs +1047 -0
- package/dist/katex-BhpYeT3b.cjs +14523 -0
- package/dist/{layout-BaZPdTGN.js → layout-CcghncRv.js} +4 -4
- package/dist/layout-CvwzED_C.cjs +2182 -0
- package/dist/linear-CYow-mAK.cjs +339 -0
- package/dist/{linear-D_RX7hM-.js → linear-D_gKQzVp.js} +1 -1
- package/dist/mermaid-parser.core-CzmkR-3i.cjs +18703 -0
- package/dist/{mermaid-parser.core-_sn6A3wB.js → mermaid-parser.core-DCMDT-Cp.js} +10 -10
- package/dist/{min-BxeM4Drj.js → min-BBp7Smma.js} +2 -2
- package/dist/min-Gu1I_bJ9.cjs +40 -0
- package/dist/mindmap-definition-VGOIOE7T-D16Pp1u5.cjs +1126 -0
- package/dist/{mindmap-definition-VGOIOE7T-BkjJibdi.js → mindmap-definition-VGOIOE7T-PjSLRtz4.js} +3 -3
- package/dist/ordinal-D7sQNqXZ.cjs +75 -0
- package/dist/{packet-BFZMPI3H-D3RtU0mc.js → packet-BFZMPI3H-BvdogPiS.js} +1 -1
- package/dist/packet-BFZMPI3H-C7pOHUWY.cjs +5 -0
- package/dist/pie-7BOR55EZ-D-DxSHbP.cjs +5 -0
- package/dist/pie-7BOR55EZ-DEWJe4Xn.js +5 -0
- package/dist/{pieDiagram-ADFJNKIX-2Yr1gkth.js → pieDiagram-ADFJNKIX-CoDddKZl.js} +4 -4
- package/dist/pieDiagram-ADFJNKIX-DjN4DU9l.cjs +237 -0
- package/dist/{quadrantDiagram-AYHSOK5B-CjicpXRv.js → quadrantDiagram-AYHSOK5B-BZOg0JMm.js} +2 -2
- package/dist/quadrantDiagram-AYHSOK5B-DXjTSOL4.cjs +1335 -0
- package/dist/radar-NHE76QYJ-BrnDXy9q.cjs +5 -0
- package/dist/{radar-NHE76QYJ-CL0tHnUP.js → radar-NHE76QYJ-C2WmPmJ4.js} +1 -1
- package/dist/{requirementDiagram-UZGBJVZJ-DBnhlfjR.js → requirementDiagram-UZGBJVZJ-CCW1O1xH.js} +3 -3
- package/dist/requirementDiagram-UZGBJVZJ-e5F3-dDI.cjs +1161 -0
- package/dist/{sankeyDiagram-TZEHDZUN-B2FErKCa.js → sankeyDiagram-TZEHDZUN-BaGzCxTp.js} +1 -1
- package/dist/sankeyDiagram-TZEHDZUN-DtIvOvVI.cjs +1193 -0
- package/dist/sequenceDiagram-WL72ISMW-0vFhYnxn.cjs +3874 -0
- package/dist/{sequenceDiagram-WL72ISMW-BkNTlRlB.js → sequenceDiagram-WL72ISMW-DL3B7U56.js} +3 -3
- package/dist/stateDiagram-FKZM4ZOC-CXW608BR.cjs +447 -0
- package/dist/{stateDiagram-FKZM4ZOC-CAAFQtS9.js → stateDiagram-FKZM4ZOC-Ddw6HxPD.js} +4 -4
- package/dist/{stateDiagram-v2-4FDKWEC3-lF6kUebI.js → stateDiagram-v2-4FDKWEC3-DZCkQKmp.js} +2 -2
- package/dist/stateDiagram-v2-4FDKWEC3-DefWUbvq.cjs +19 -0
- package/dist/timeline-definition-IT6M3QCI-C3TfA9lE.cjs +1222 -0
- package/dist/{timeline-definition-IT6M3QCI-CQgMFEPA.js → timeline-definition-IT6M3QCI-DiS88lUo.js} +2 -2
- package/dist/treemap-KMMF4GRG-Bl-H6j2c.cjs +5 -0
- package/dist/{treemap-KMMF4GRG-B0Mc-u8X.js → treemap-KMMF4GRG-DGGr_R9A.js} +1 -1
- package/dist/{xychartDiagram-PRI3JC2R-Cee7LdLr.js → xychartDiagram-PRI3JC2R-BrOwRjfF.js} +2 -2
- package/dist/xychartDiagram-PRI3JC2R-CM06DttH.cjs +1886 -0
- package/package.json +17 -5
- package/dist/index.css +0 -3334
- package/dist/info-NVLQJR56-pJlVBPs6.js +0 -5
- package/dist/pie-7BOR55EZ-xH--CiaM.js +0 -5
|
@@ -0,0 +1,693 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const index = require("./index-BctLGjTK.cjs");
|
|
4
|
+
const graph = require("./graph-CI_TWBSn.cjs");
|
|
5
|
+
const layout = require("./layout-CvwzED_C.cjs");
|
|
6
|
+
const clone = require("./clone-BMkj3yun.cjs");
|
|
7
|
+
const min = require("./min-Gu1I_bJ9.cjs");
|
|
8
|
+
function write(g) {
|
|
9
|
+
var json = {
|
|
10
|
+
options: {
|
|
11
|
+
directed: g.isDirected(),
|
|
12
|
+
multigraph: g.isMultigraph(),
|
|
13
|
+
compound: g.isCompound()
|
|
14
|
+
},
|
|
15
|
+
nodes: writeNodes(g),
|
|
16
|
+
edges: writeEdges(g)
|
|
17
|
+
};
|
|
18
|
+
if (!graph.isUndefined(g.graph())) {
|
|
19
|
+
json.value = clone.clone(g.graph());
|
|
20
|
+
}
|
|
21
|
+
return json;
|
|
22
|
+
}
|
|
23
|
+
function writeNodes(g) {
|
|
24
|
+
return min.map(g.nodes(), function(v) {
|
|
25
|
+
var nodeValue = g.node(v);
|
|
26
|
+
var parent = g.parent(v);
|
|
27
|
+
var node = { v };
|
|
28
|
+
if (!graph.isUndefined(nodeValue)) {
|
|
29
|
+
node.value = nodeValue;
|
|
30
|
+
}
|
|
31
|
+
if (!graph.isUndefined(parent)) {
|
|
32
|
+
node.parent = parent;
|
|
33
|
+
}
|
|
34
|
+
return node;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function writeEdges(g) {
|
|
38
|
+
return min.map(g.edges(), function(e) {
|
|
39
|
+
var edgeValue = g.edge(e);
|
|
40
|
+
var edge = { v: e.v, w: e.w };
|
|
41
|
+
if (!graph.isUndefined(e.name)) {
|
|
42
|
+
edge.name = e.name;
|
|
43
|
+
}
|
|
44
|
+
if (!graph.isUndefined(edgeValue)) {
|
|
45
|
+
edge.value = edgeValue;
|
|
46
|
+
}
|
|
47
|
+
return edge;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
var clusterDb = /* @__PURE__ */ new Map();
|
|
51
|
+
var descendants = /* @__PURE__ */ new Map();
|
|
52
|
+
var parents = /* @__PURE__ */ new Map();
|
|
53
|
+
var clear4 = /* @__PURE__ */ index.__name(() => {
|
|
54
|
+
descendants.clear();
|
|
55
|
+
parents.clear();
|
|
56
|
+
clusterDb.clear();
|
|
57
|
+
}, "clear");
|
|
58
|
+
var isDescendant = /* @__PURE__ */ index.__name((id, ancestorId) => {
|
|
59
|
+
const ancestorDescendants = descendants.get(ancestorId) || [];
|
|
60
|
+
index.log.trace("In isDescendant", ancestorId, " ", id, " = ", ancestorDescendants.includes(id));
|
|
61
|
+
return ancestorDescendants.includes(id);
|
|
62
|
+
}, "isDescendant");
|
|
63
|
+
var edgeInCluster = /* @__PURE__ */ index.__name((edge, clusterId) => {
|
|
64
|
+
const clusterDescendants = descendants.get(clusterId) || [];
|
|
65
|
+
index.log.info("Descendants of ", clusterId, " is ", clusterDescendants);
|
|
66
|
+
index.log.info("Edge is ", edge);
|
|
67
|
+
if (edge.v === clusterId || edge.w === clusterId) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
if (!clusterDescendants) {
|
|
71
|
+
index.log.debug("Tilt, ", clusterId, ",not in descendants");
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
return clusterDescendants.includes(edge.v) || isDescendant(edge.v, clusterId) || isDescendant(edge.w, clusterId) || clusterDescendants.includes(edge.w);
|
|
75
|
+
}, "edgeInCluster");
|
|
76
|
+
var copy = /* @__PURE__ */ index.__name((clusterId, graph2, newGraph, rootId) => {
|
|
77
|
+
index.log.warn(
|
|
78
|
+
"Copying children of ",
|
|
79
|
+
clusterId,
|
|
80
|
+
"root",
|
|
81
|
+
rootId,
|
|
82
|
+
"data",
|
|
83
|
+
graph2.node(clusterId),
|
|
84
|
+
rootId
|
|
85
|
+
);
|
|
86
|
+
const nodes = graph2.children(clusterId) || [];
|
|
87
|
+
if (clusterId !== rootId) {
|
|
88
|
+
nodes.push(clusterId);
|
|
89
|
+
}
|
|
90
|
+
index.log.warn("Copying (nodes) clusterId", clusterId, "nodes", nodes);
|
|
91
|
+
nodes.forEach((node) => {
|
|
92
|
+
if (graph2.children(node).length > 0) {
|
|
93
|
+
copy(node, graph2, newGraph, rootId);
|
|
94
|
+
} else {
|
|
95
|
+
const data = graph2.node(node);
|
|
96
|
+
index.log.info("cp ", node, " to ", rootId, " with parent ", clusterId);
|
|
97
|
+
newGraph.setNode(node, data);
|
|
98
|
+
if (rootId !== graph2.parent(node)) {
|
|
99
|
+
index.log.warn("Setting parent", node, graph2.parent(node));
|
|
100
|
+
newGraph.setParent(node, graph2.parent(node));
|
|
101
|
+
}
|
|
102
|
+
if (clusterId !== rootId && node !== clusterId) {
|
|
103
|
+
index.log.debug("Setting parent", node, clusterId);
|
|
104
|
+
newGraph.setParent(node, clusterId);
|
|
105
|
+
} else {
|
|
106
|
+
index.log.info("In copy ", clusterId, "root", rootId, "data", graph2.node(clusterId), rootId);
|
|
107
|
+
index.log.debug(
|
|
108
|
+
"Not Setting parent for node=",
|
|
109
|
+
node,
|
|
110
|
+
"cluster!==rootId",
|
|
111
|
+
clusterId !== rootId,
|
|
112
|
+
"node!==clusterId",
|
|
113
|
+
node !== clusterId
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
const edges = graph2.edges(node);
|
|
117
|
+
index.log.debug("Copying Edges", edges);
|
|
118
|
+
edges.forEach((edge) => {
|
|
119
|
+
index.log.info("Edge", edge);
|
|
120
|
+
const data2 = graph2.edge(edge.v, edge.w, edge.name);
|
|
121
|
+
index.log.info("Edge data", data2, rootId);
|
|
122
|
+
try {
|
|
123
|
+
if (edgeInCluster(edge, rootId)) {
|
|
124
|
+
index.log.info("Copying as ", edge.v, edge.w, data2, edge.name);
|
|
125
|
+
newGraph.setEdge(edge.v, edge.w, data2, edge.name);
|
|
126
|
+
index.log.info("newGraph edges ", newGraph.edges(), newGraph.edge(newGraph.edges()[0]));
|
|
127
|
+
} else {
|
|
128
|
+
index.log.info(
|
|
129
|
+
"Skipping copy of edge ",
|
|
130
|
+
edge.v,
|
|
131
|
+
"-->",
|
|
132
|
+
edge.w,
|
|
133
|
+
" rootId: ",
|
|
134
|
+
rootId,
|
|
135
|
+
" clusterId:",
|
|
136
|
+
clusterId
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
} catch (e) {
|
|
140
|
+
index.log.error(e);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
index.log.debug("Removing node", node);
|
|
145
|
+
graph2.removeNode(node);
|
|
146
|
+
});
|
|
147
|
+
}, "copy");
|
|
148
|
+
var extractDescendants = /* @__PURE__ */ index.__name((id, graph2) => {
|
|
149
|
+
const children = graph2.children(id);
|
|
150
|
+
let res = [...children];
|
|
151
|
+
for (const child of children) {
|
|
152
|
+
parents.set(child, id);
|
|
153
|
+
res = [...res, ...extractDescendants(child, graph2)];
|
|
154
|
+
}
|
|
155
|
+
return res;
|
|
156
|
+
}, "extractDescendants");
|
|
157
|
+
var findCommonEdges = /* @__PURE__ */ index.__name((graph2, id1, id2) => {
|
|
158
|
+
const edges1 = graph2.edges().filter((edge) => edge.v === id1 || edge.w === id1);
|
|
159
|
+
const edges2 = graph2.edges().filter((edge) => edge.v === id2 || edge.w === id2);
|
|
160
|
+
const edges1Prim = edges1.map((edge) => {
|
|
161
|
+
return { v: edge.v === id1 ? id2 : edge.v, w: edge.w === id1 ? id1 : edge.w };
|
|
162
|
+
});
|
|
163
|
+
const edges2Prim = edges2.map((edge) => {
|
|
164
|
+
return { v: edge.v, w: edge.w };
|
|
165
|
+
});
|
|
166
|
+
const result = edges1Prim.filter((edgeIn1) => {
|
|
167
|
+
return edges2Prim.some((edge) => edgeIn1.v === edge.v && edgeIn1.w === edge.w);
|
|
168
|
+
});
|
|
169
|
+
return result;
|
|
170
|
+
}, "findCommonEdges");
|
|
171
|
+
var findNonClusterChild = /* @__PURE__ */ index.__name((id, graph2, clusterId) => {
|
|
172
|
+
const children = graph2.children(id);
|
|
173
|
+
index.log.trace("Searching children of id ", id, children);
|
|
174
|
+
if (children.length < 1) {
|
|
175
|
+
return id;
|
|
176
|
+
}
|
|
177
|
+
let reserve;
|
|
178
|
+
for (const child of children) {
|
|
179
|
+
const _id = findNonClusterChild(child, graph2, clusterId);
|
|
180
|
+
const commonEdges = findCommonEdges(graph2, clusterId, _id);
|
|
181
|
+
if (_id) {
|
|
182
|
+
if (commonEdges.length > 0) {
|
|
183
|
+
reserve = _id;
|
|
184
|
+
} else {
|
|
185
|
+
return _id;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return reserve;
|
|
190
|
+
}, "findNonClusterChild");
|
|
191
|
+
var getAnchorId = /* @__PURE__ */ index.__name((id) => {
|
|
192
|
+
if (!clusterDb.has(id)) {
|
|
193
|
+
return id;
|
|
194
|
+
}
|
|
195
|
+
if (!clusterDb.get(id).externalConnections) {
|
|
196
|
+
return id;
|
|
197
|
+
}
|
|
198
|
+
if (clusterDb.has(id)) {
|
|
199
|
+
return clusterDb.get(id).id;
|
|
200
|
+
}
|
|
201
|
+
return id;
|
|
202
|
+
}, "getAnchorId");
|
|
203
|
+
var adjustClustersAndEdges = /* @__PURE__ */ index.__name((graph2, depth) => {
|
|
204
|
+
if (!graph2 || depth > 10) {
|
|
205
|
+
index.log.debug("Opting out, no graph ");
|
|
206
|
+
return;
|
|
207
|
+
} else {
|
|
208
|
+
index.log.debug("Opting in, graph ");
|
|
209
|
+
}
|
|
210
|
+
graph2.nodes().forEach(function(id) {
|
|
211
|
+
const children = graph2.children(id);
|
|
212
|
+
if (children.length > 0) {
|
|
213
|
+
index.log.warn(
|
|
214
|
+
"Cluster identified",
|
|
215
|
+
id,
|
|
216
|
+
" Replacement id in edges: ",
|
|
217
|
+
findNonClusterChild(id, graph2, id)
|
|
218
|
+
);
|
|
219
|
+
descendants.set(id, extractDescendants(id, graph2));
|
|
220
|
+
clusterDb.set(id, { id: findNonClusterChild(id, graph2, id), clusterData: graph2.node(id) });
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
graph2.nodes().forEach(function(id) {
|
|
224
|
+
const children = graph2.children(id);
|
|
225
|
+
const edges = graph2.edges();
|
|
226
|
+
if (children.length > 0) {
|
|
227
|
+
index.log.debug("Cluster identified", id, descendants);
|
|
228
|
+
edges.forEach((edge) => {
|
|
229
|
+
const d1 = isDescendant(edge.v, id);
|
|
230
|
+
const d2 = isDescendant(edge.w, id);
|
|
231
|
+
if (d1 ^ d2) {
|
|
232
|
+
index.log.warn("Edge: ", edge, " leaves cluster ", id);
|
|
233
|
+
index.log.warn("Descendants of XXX ", id, ": ", descendants.get(id));
|
|
234
|
+
clusterDb.get(id).externalConnections = true;
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
} else {
|
|
238
|
+
index.log.debug("Not a cluster ", id, descendants);
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
for (let id of clusterDb.keys()) {
|
|
242
|
+
const nonClusterChild = clusterDb.get(id).id;
|
|
243
|
+
const parent = graph2.parent(nonClusterChild);
|
|
244
|
+
if (parent !== id && clusterDb.has(parent) && !clusterDb.get(parent).externalConnections) {
|
|
245
|
+
clusterDb.get(id).id = parent;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
graph2.edges().forEach(function(e) {
|
|
249
|
+
const edge = graph2.edge(e);
|
|
250
|
+
index.log.warn("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(e));
|
|
251
|
+
index.log.warn("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(graph2.edge(e)));
|
|
252
|
+
let v = e.v;
|
|
253
|
+
let w = e.w;
|
|
254
|
+
index.log.warn(
|
|
255
|
+
"Fix XXX",
|
|
256
|
+
clusterDb,
|
|
257
|
+
"ids:",
|
|
258
|
+
e.v,
|
|
259
|
+
e.w,
|
|
260
|
+
"Translating: ",
|
|
261
|
+
clusterDb.get(e.v),
|
|
262
|
+
" --- ",
|
|
263
|
+
clusterDb.get(e.w)
|
|
264
|
+
);
|
|
265
|
+
if (clusterDb.get(e.v) || clusterDb.get(e.w)) {
|
|
266
|
+
index.log.warn("Fixing and trying - removing XXX", e.v, e.w, e.name);
|
|
267
|
+
v = getAnchorId(e.v);
|
|
268
|
+
w = getAnchorId(e.w);
|
|
269
|
+
graph2.removeEdge(e.v, e.w, e.name);
|
|
270
|
+
if (v !== e.v) {
|
|
271
|
+
const parent = graph2.parent(v);
|
|
272
|
+
clusterDb.get(parent).externalConnections = true;
|
|
273
|
+
edge.fromCluster = e.v;
|
|
274
|
+
}
|
|
275
|
+
if (w !== e.w) {
|
|
276
|
+
const parent = graph2.parent(w);
|
|
277
|
+
clusterDb.get(parent).externalConnections = true;
|
|
278
|
+
edge.toCluster = e.w;
|
|
279
|
+
}
|
|
280
|
+
index.log.warn("Fix Replacing with XXX", v, w, e.name);
|
|
281
|
+
graph2.setEdge(v, w, edge, e.name);
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
index.log.warn("Adjusted Graph", write(graph2));
|
|
285
|
+
extractor(graph2, 0);
|
|
286
|
+
index.log.trace(clusterDb);
|
|
287
|
+
}, "adjustClustersAndEdges");
|
|
288
|
+
var extractor = /* @__PURE__ */ index.__name((graph$1, depth) => {
|
|
289
|
+
index.log.warn("extractor - ", depth, write(graph$1), graph$1.children("D"));
|
|
290
|
+
if (depth > 10) {
|
|
291
|
+
index.log.error("Bailing out");
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
let nodes = graph$1.nodes();
|
|
295
|
+
let hasChildren = false;
|
|
296
|
+
for (const node of nodes) {
|
|
297
|
+
const children = graph$1.children(node);
|
|
298
|
+
hasChildren = hasChildren || children.length > 0;
|
|
299
|
+
}
|
|
300
|
+
if (!hasChildren) {
|
|
301
|
+
index.log.debug("Done, no node has children", graph$1.nodes());
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
index.log.debug("Nodes = ", nodes, depth);
|
|
305
|
+
for (const node of nodes) {
|
|
306
|
+
index.log.debug(
|
|
307
|
+
"Extracting node",
|
|
308
|
+
node,
|
|
309
|
+
clusterDb,
|
|
310
|
+
clusterDb.has(node) && !clusterDb.get(node).externalConnections,
|
|
311
|
+
!graph$1.parent(node),
|
|
312
|
+
graph$1.node(node),
|
|
313
|
+
graph$1.children("D"),
|
|
314
|
+
" Depth ",
|
|
315
|
+
depth
|
|
316
|
+
);
|
|
317
|
+
if (!clusterDb.has(node)) {
|
|
318
|
+
index.log.debug("Not a cluster", node, depth);
|
|
319
|
+
} else if (!clusterDb.get(node).externalConnections && graph$1.children(node) && graph$1.children(node).length > 0) {
|
|
320
|
+
index.log.warn(
|
|
321
|
+
"Cluster without external connections, without a parent and with children",
|
|
322
|
+
node,
|
|
323
|
+
depth
|
|
324
|
+
);
|
|
325
|
+
const graphSettings = graph$1.graph();
|
|
326
|
+
let dir = graphSettings.rankdir === "TB" ? "LR" : "TB";
|
|
327
|
+
if (clusterDb.get(node)?.clusterData?.dir) {
|
|
328
|
+
dir = clusterDb.get(node).clusterData.dir;
|
|
329
|
+
index.log.warn("Fixing dir", clusterDb.get(node).clusterData.dir, dir);
|
|
330
|
+
}
|
|
331
|
+
const clusterGraph = new graph.Graph({
|
|
332
|
+
multigraph: true,
|
|
333
|
+
compound: true
|
|
334
|
+
}).setGraph({
|
|
335
|
+
rankdir: dir,
|
|
336
|
+
nodesep: 50,
|
|
337
|
+
ranksep: 50,
|
|
338
|
+
marginx: 8,
|
|
339
|
+
marginy: 8
|
|
340
|
+
}).setDefaultEdgeLabel(function() {
|
|
341
|
+
return {};
|
|
342
|
+
});
|
|
343
|
+
index.log.warn("Old graph before copy", write(graph$1));
|
|
344
|
+
copy(node, graph$1, clusterGraph, node);
|
|
345
|
+
graph$1.setNode(node, {
|
|
346
|
+
clusterNode: true,
|
|
347
|
+
id: node,
|
|
348
|
+
clusterData: clusterDb.get(node).clusterData,
|
|
349
|
+
label: clusterDb.get(node).label,
|
|
350
|
+
graph: clusterGraph
|
|
351
|
+
});
|
|
352
|
+
index.log.warn("New graph after copy node: (", node, ")", write(clusterGraph));
|
|
353
|
+
index.log.debug("Old graph after copy", write(graph$1));
|
|
354
|
+
} else {
|
|
355
|
+
index.log.warn(
|
|
356
|
+
"Cluster ** ",
|
|
357
|
+
node,
|
|
358
|
+
" **not meeting the criteria !externalConnections:",
|
|
359
|
+
!clusterDb.get(node).externalConnections,
|
|
360
|
+
" no parent: ",
|
|
361
|
+
!graph$1.parent(node),
|
|
362
|
+
" children ",
|
|
363
|
+
graph$1.children(node) && graph$1.children(node).length > 0,
|
|
364
|
+
graph$1.children("D"),
|
|
365
|
+
depth
|
|
366
|
+
);
|
|
367
|
+
index.log.debug(clusterDb);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
nodes = graph$1.nodes();
|
|
371
|
+
index.log.warn("New list of nodes", nodes);
|
|
372
|
+
for (const node of nodes) {
|
|
373
|
+
const data = graph$1.node(node);
|
|
374
|
+
index.log.warn(" Now next level", node, data);
|
|
375
|
+
if (data?.clusterNode) {
|
|
376
|
+
extractor(data.graph, depth + 1);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}, "extractor");
|
|
380
|
+
var sorter = /* @__PURE__ */ index.__name((graph2, nodes) => {
|
|
381
|
+
if (nodes.length === 0) {
|
|
382
|
+
return [];
|
|
383
|
+
}
|
|
384
|
+
let result = Object.assign([], nodes);
|
|
385
|
+
nodes.forEach((node) => {
|
|
386
|
+
const children = graph2.children(node);
|
|
387
|
+
const sorted = sorter(graph2, children);
|
|
388
|
+
result = [...result, ...sorted];
|
|
389
|
+
});
|
|
390
|
+
return result;
|
|
391
|
+
}, "sorter");
|
|
392
|
+
var sortNodesByHierarchy = /* @__PURE__ */ index.__name((graph2) => sorter(graph2, graph2.children()), "sortNodesByHierarchy");
|
|
393
|
+
var recursiveRender = /* @__PURE__ */ index.__name(async (_elem, graph2, diagramType, id, parentCluster, siteConfig) => {
|
|
394
|
+
index.log.warn("Graph in recursive render:XAX", write(graph2), parentCluster);
|
|
395
|
+
const dir = graph2.graph().rankdir;
|
|
396
|
+
index.log.trace("Dir in recursive render - dir:", dir);
|
|
397
|
+
const elem = _elem.insert("g").attr("class", "root");
|
|
398
|
+
if (!graph2.nodes()) {
|
|
399
|
+
index.log.info("No nodes found for", graph2);
|
|
400
|
+
} else {
|
|
401
|
+
index.log.info("Recursive render XXX", graph2.nodes());
|
|
402
|
+
}
|
|
403
|
+
if (graph2.edges().length > 0) {
|
|
404
|
+
index.log.info("Recursive edges", graph2.edge(graph2.edges()[0]));
|
|
405
|
+
}
|
|
406
|
+
const clusters = elem.insert("g").attr("class", "clusters");
|
|
407
|
+
const edgePaths = elem.insert("g").attr("class", "edgePaths");
|
|
408
|
+
const edgeLabels = elem.insert("g").attr("class", "edgeLabels");
|
|
409
|
+
const nodes = elem.insert("g").attr("class", "nodes");
|
|
410
|
+
await Promise.all(
|
|
411
|
+
graph2.nodes().map(async function(v) {
|
|
412
|
+
const node = graph2.node(v);
|
|
413
|
+
if (parentCluster !== void 0) {
|
|
414
|
+
const data = JSON.parse(JSON.stringify(parentCluster.clusterData));
|
|
415
|
+
index.log.trace(
|
|
416
|
+
"Setting data for parent cluster XXX\n Node.id = ",
|
|
417
|
+
v,
|
|
418
|
+
"\n data=",
|
|
419
|
+
data.height,
|
|
420
|
+
"\nParent cluster",
|
|
421
|
+
parentCluster.height
|
|
422
|
+
);
|
|
423
|
+
graph2.setNode(parentCluster.id, data);
|
|
424
|
+
if (!graph2.parent(v)) {
|
|
425
|
+
index.log.trace("Setting parent", v, parentCluster.id);
|
|
426
|
+
graph2.setParent(v, parentCluster.id, data);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
index.log.info("(Insert) Node XXX" + v + ": " + JSON.stringify(graph2.node(v)));
|
|
430
|
+
if (node?.clusterNode) {
|
|
431
|
+
index.log.info("Cluster identified XBX", v, node.width, graph2.node(v));
|
|
432
|
+
const { ranksep, nodesep } = graph2.graph();
|
|
433
|
+
node.graph.setGraph({
|
|
434
|
+
...node.graph.graph(),
|
|
435
|
+
ranksep: ranksep + 25,
|
|
436
|
+
nodesep
|
|
437
|
+
});
|
|
438
|
+
const o = await recursiveRender(
|
|
439
|
+
nodes,
|
|
440
|
+
node.graph,
|
|
441
|
+
diagramType,
|
|
442
|
+
id,
|
|
443
|
+
graph2.node(v),
|
|
444
|
+
siteConfig
|
|
445
|
+
);
|
|
446
|
+
const newEl = o.elem;
|
|
447
|
+
index.updateNodeBounds(node, newEl);
|
|
448
|
+
node.diff = o.diff || 0;
|
|
449
|
+
index.log.info(
|
|
450
|
+
"New compound node after recursive render XAX",
|
|
451
|
+
v,
|
|
452
|
+
"width",
|
|
453
|
+
// node,
|
|
454
|
+
node.width,
|
|
455
|
+
"height",
|
|
456
|
+
node.height
|
|
457
|
+
// node.x,
|
|
458
|
+
// node.y
|
|
459
|
+
);
|
|
460
|
+
index.setNodeElem(newEl, node);
|
|
461
|
+
} else {
|
|
462
|
+
if (graph2.children(v).length > 0) {
|
|
463
|
+
index.log.trace(
|
|
464
|
+
"Cluster - the non recursive path XBX",
|
|
465
|
+
v,
|
|
466
|
+
node.id,
|
|
467
|
+
node,
|
|
468
|
+
node.width,
|
|
469
|
+
"Graph:",
|
|
470
|
+
graph2
|
|
471
|
+
);
|
|
472
|
+
index.log.trace(findNonClusterChild(node.id, graph2));
|
|
473
|
+
clusterDb.set(node.id, { id: findNonClusterChild(node.id, graph2), node });
|
|
474
|
+
} else {
|
|
475
|
+
index.log.trace("Node - the non recursive path XAX", v, nodes, graph2.node(v), dir);
|
|
476
|
+
await index.insertNode(nodes, graph2.node(v), { config: siteConfig, dir });
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
})
|
|
480
|
+
);
|
|
481
|
+
const processEdges = /* @__PURE__ */ index.__name(async () => {
|
|
482
|
+
const edgePromises = graph2.edges().map(async function(e) {
|
|
483
|
+
const edge = graph2.edge(e.v, e.w, e.name);
|
|
484
|
+
index.log.info("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(e));
|
|
485
|
+
index.log.info("Edge " + e.v + " -> " + e.w + ": ", e, " ", JSON.stringify(graph2.edge(e)));
|
|
486
|
+
index.log.info(
|
|
487
|
+
"Fix",
|
|
488
|
+
clusterDb,
|
|
489
|
+
"ids:",
|
|
490
|
+
e.v,
|
|
491
|
+
e.w,
|
|
492
|
+
"Translating: ",
|
|
493
|
+
clusterDb.get(e.v),
|
|
494
|
+
clusterDb.get(e.w)
|
|
495
|
+
);
|
|
496
|
+
await index.insertEdgeLabel(edgeLabels, edge);
|
|
497
|
+
});
|
|
498
|
+
await Promise.all(edgePromises);
|
|
499
|
+
}, "processEdges");
|
|
500
|
+
await processEdges();
|
|
501
|
+
index.log.info("Graph before layout:", JSON.stringify(write(graph2)));
|
|
502
|
+
index.log.info("############################################# XXX");
|
|
503
|
+
index.log.info("### Layout ### XXX");
|
|
504
|
+
index.log.info("############################################# XXX");
|
|
505
|
+
layout.layout(graph2);
|
|
506
|
+
index.log.info("Graph after layout:", JSON.stringify(write(graph2)));
|
|
507
|
+
let diff = 0;
|
|
508
|
+
let { subGraphTitleTotalMargin } = index.getSubGraphTitleMargins(siteConfig);
|
|
509
|
+
await Promise.all(
|
|
510
|
+
sortNodesByHierarchy(graph2).map(async function(v) {
|
|
511
|
+
const node = graph2.node(v);
|
|
512
|
+
index.log.info(
|
|
513
|
+
"Position XBX => " + v + ": (" + node.x,
|
|
514
|
+
"," + node.y,
|
|
515
|
+
") width: ",
|
|
516
|
+
node.width,
|
|
517
|
+
" height: ",
|
|
518
|
+
node.height
|
|
519
|
+
);
|
|
520
|
+
if (node?.clusterNode) {
|
|
521
|
+
node.y += subGraphTitleTotalMargin;
|
|
522
|
+
index.log.info(
|
|
523
|
+
"A tainted cluster node XBX1",
|
|
524
|
+
v,
|
|
525
|
+
node.id,
|
|
526
|
+
node.width,
|
|
527
|
+
node.height,
|
|
528
|
+
node.x,
|
|
529
|
+
node.y,
|
|
530
|
+
graph2.parent(v)
|
|
531
|
+
);
|
|
532
|
+
clusterDb.get(node.id).node = node;
|
|
533
|
+
index.positionNode(node);
|
|
534
|
+
} else {
|
|
535
|
+
if (graph2.children(v).length > 0) {
|
|
536
|
+
index.log.info(
|
|
537
|
+
"A pure cluster node XBX1",
|
|
538
|
+
v,
|
|
539
|
+
node.id,
|
|
540
|
+
node.x,
|
|
541
|
+
node.y,
|
|
542
|
+
node.width,
|
|
543
|
+
node.height,
|
|
544
|
+
graph2.parent(v)
|
|
545
|
+
);
|
|
546
|
+
node.height += subGraphTitleTotalMargin;
|
|
547
|
+
graph2.node(node.parentId);
|
|
548
|
+
const halfPadding = node?.padding / 2 || 0;
|
|
549
|
+
const labelHeight = node?.labelBBox?.height || 0;
|
|
550
|
+
const offsetY = labelHeight - halfPadding || 0;
|
|
551
|
+
index.log.debug("OffsetY", offsetY, "labelHeight", labelHeight, "halfPadding", halfPadding);
|
|
552
|
+
await index.insertCluster(clusters, node);
|
|
553
|
+
clusterDb.get(node.id).node = node;
|
|
554
|
+
} else {
|
|
555
|
+
const parent = graph2.node(node.parentId);
|
|
556
|
+
node.y += subGraphTitleTotalMargin / 2;
|
|
557
|
+
index.log.info(
|
|
558
|
+
"A regular node XBX1 - using the padding",
|
|
559
|
+
node.id,
|
|
560
|
+
"parent",
|
|
561
|
+
node.parentId,
|
|
562
|
+
node.width,
|
|
563
|
+
node.height,
|
|
564
|
+
node.x,
|
|
565
|
+
node.y,
|
|
566
|
+
"offsetY",
|
|
567
|
+
node.offsetY,
|
|
568
|
+
"parent",
|
|
569
|
+
parent,
|
|
570
|
+
parent?.offsetY,
|
|
571
|
+
node
|
|
572
|
+
);
|
|
573
|
+
index.positionNode(node);
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
})
|
|
577
|
+
);
|
|
578
|
+
graph2.edges().forEach(function(e) {
|
|
579
|
+
const edge = graph2.edge(e);
|
|
580
|
+
index.log.info("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(edge), edge);
|
|
581
|
+
edge.points.forEach((point) => point.y += subGraphTitleTotalMargin / 2);
|
|
582
|
+
const startNode = graph2.node(e.v);
|
|
583
|
+
var endNode = graph2.node(e.w);
|
|
584
|
+
const paths = index.insertEdge(edgePaths, edge, clusterDb, diagramType, startNode, endNode, id);
|
|
585
|
+
index.positionEdgeLabel(edge, paths);
|
|
586
|
+
});
|
|
587
|
+
graph2.nodes().forEach(function(v) {
|
|
588
|
+
const n = graph2.node(v);
|
|
589
|
+
index.log.info(v, n.type, n.diff);
|
|
590
|
+
if (n.isGroup) {
|
|
591
|
+
diff = n.diff;
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
index.log.warn("Returning from recursive render XAX", elem, diff);
|
|
595
|
+
return { elem, diff };
|
|
596
|
+
}, "recursiveRender");
|
|
597
|
+
var render = /* @__PURE__ */ index.__name(async (data4Layout, svg) => {
|
|
598
|
+
const graph$1 = new graph.Graph({
|
|
599
|
+
multigraph: true,
|
|
600
|
+
compound: true
|
|
601
|
+
}).setGraph({
|
|
602
|
+
rankdir: data4Layout.direction,
|
|
603
|
+
nodesep: data4Layout.config?.nodeSpacing || data4Layout.config?.flowchart?.nodeSpacing || data4Layout.nodeSpacing,
|
|
604
|
+
ranksep: data4Layout.config?.rankSpacing || data4Layout.config?.flowchart?.rankSpacing || data4Layout.rankSpacing,
|
|
605
|
+
marginx: 8,
|
|
606
|
+
marginy: 8
|
|
607
|
+
}).setDefaultEdgeLabel(function() {
|
|
608
|
+
return {};
|
|
609
|
+
});
|
|
610
|
+
const element = svg.select("g");
|
|
611
|
+
index.markers_default(element, data4Layout.markers, data4Layout.type, data4Layout.diagramId);
|
|
612
|
+
index.clear2();
|
|
613
|
+
index.clear$1();
|
|
614
|
+
index.clear$2();
|
|
615
|
+
clear4();
|
|
616
|
+
data4Layout.nodes.forEach((node) => {
|
|
617
|
+
graph$1.setNode(node.id, { ...node });
|
|
618
|
+
if (node.parentId) {
|
|
619
|
+
graph$1.setParent(node.id, node.parentId);
|
|
620
|
+
}
|
|
621
|
+
});
|
|
622
|
+
index.log.debug("Edges:", data4Layout.edges);
|
|
623
|
+
data4Layout.edges.forEach((edge) => {
|
|
624
|
+
if (edge.start === edge.end) {
|
|
625
|
+
const nodeId = edge.start;
|
|
626
|
+
const specialId1 = nodeId + "---" + nodeId + "---1";
|
|
627
|
+
const specialId2 = nodeId + "---" + nodeId + "---2";
|
|
628
|
+
const node = graph$1.node(nodeId);
|
|
629
|
+
graph$1.setNode(specialId1, {
|
|
630
|
+
domId: specialId1,
|
|
631
|
+
id: specialId1,
|
|
632
|
+
parentId: node.parentId,
|
|
633
|
+
labelStyle: "",
|
|
634
|
+
label: "",
|
|
635
|
+
padding: 0,
|
|
636
|
+
shape: "labelRect",
|
|
637
|
+
// shape: 'rect',
|
|
638
|
+
style: "",
|
|
639
|
+
width: 10,
|
|
640
|
+
height: 10
|
|
641
|
+
});
|
|
642
|
+
graph$1.setParent(specialId1, node.parentId);
|
|
643
|
+
graph$1.setNode(specialId2, {
|
|
644
|
+
domId: specialId2,
|
|
645
|
+
id: specialId2,
|
|
646
|
+
parentId: node.parentId,
|
|
647
|
+
labelStyle: "",
|
|
648
|
+
padding: 0,
|
|
649
|
+
// shape: 'rect',
|
|
650
|
+
shape: "labelRect",
|
|
651
|
+
label: "",
|
|
652
|
+
style: "",
|
|
653
|
+
width: 10,
|
|
654
|
+
height: 10
|
|
655
|
+
});
|
|
656
|
+
graph$1.setParent(specialId2, node.parentId);
|
|
657
|
+
const edge1 = structuredClone(edge);
|
|
658
|
+
const edgeMid = structuredClone(edge);
|
|
659
|
+
const edge2 = structuredClone(edge);
|
|
660
|
+
edge1.label = "";
|
|
661
|
+
edge1.arrowTypeEnd = "none";
|
|
662
|
+
edge1.id = nodeId + "-cyclic-special-1";
|
|
663
|
+
edgeMid.arrowTypeStart = "none";
|
|
664
|
+
edgeMid.arrowTypeEnd = "none";
|
|
665
|
+
edgeMid.id = nodeId + "-cyclic-special-mid";
|
|
666
|
+
edge2.label = "";
|
|
667
|
+
if (node.isGroup) {
|
|
668
|
+
edge1.fromCluster = nodeId;
|
|
669
|
+
edge2.toCluster = nodeId;
|
|
670
|
+
}
|
|
671
|
+
edge2.id = nodeId + "-cyclic-special-2";
|
|
672
|
+
edge2.arrowTypeStart = "none";
|
|
673
|
+
graph$1.setEdge(nodeId, specialId1, edge1, nodeId + "-cyclic-special-0");
|
|
674
|
+
graph$1.setEdge(specialId1, specialId2, edgeMid, nodeId + "-cyclic-special-1");
|
|
675
|
+
graph$1.setEdge(specialId2, nodeId, edge2, nodeId + "-cyc<lic-special-2");
|
|
676
|
+
} else {
|
|
677
|
+
graph$1.setEdge(edge.start, edge.end, { ...edge }, edge.id);
|
|
678
|
+
}
|
|
679
|
+
});
|
|
680
|
+
index.log.warn("Graph at first:", JSON.stringify(write(graph$1)));
|
|
681
|
+
adjustClustersAndEdges(graph$1);
|
|
682
|
+
index.log.warn("Graph after XAX:", JSON.stringify(write(graph$1)));
|
|
683
|
+
const siteConfig = index.getConfig2();
|
|
684
|
+
await recursiveRender(
|
|
685
|
+
element,
|
|
686
|
+
graph$1,
|
|
687
|
+
data4Layout.type,
|
|
688
|
+
data4Layout.diagramId,
|
|
689
|
+
void 0,
|
|
690
|
+
siteConfig
|
|
691
|
+
);
|
|
692
|
+
}, "render");
|
|
693
|
+
exports.render = render;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as __name, ar as markers_default, as as clear2, at as clear, au as clear$1, l as log, c as getConfig2, av as updateNodeBounds, aw as setNodeElem, ag as insertNode, al as getSubGraphTitleMargins, ah as positionNode, af as insertCluster, ax as insertEdge, ay as positionEdgeLabel, az as insertEdgeLabel } from "./index-
|
|
2
|
-
import { i as isUndefined, G as Graph } from "./graph-
|
|
3
|
-
import { l as layout } from "./layout-
|
|
4
|
-
import { c as clone } from "./clone-
|
|
5
|
-
import { m as map } from "./min-
|
|
1
|
+
import { _ as __name, ar as markers_default, as as clear2, at as clear, au as clear$1, l as log, c as getConfig2, av as updateNodeBounds, aw as setNodeElem, ag as insertNode, al as getSubGraphTitleMargins, ah as positionNode, af as insertCluster, ax as insertEdge, ay as positionEdgeLabel, az as insertEdgeLabel } from "./index-CjSgoo1P.js";
|
|
2
|
+
import { i as isUndefined, G as Graph } from "./graph-BvxpI7Xc.js";
|
|
3
|
+
import { l as layout } from "./layout-CcghncRv.js";
|
|
4
|
+
import { c as clone } from "./clone-ChHXIoR6.js";
|
|
5
|
+
import { m as map } from "./min-BBp7Smma.js";
|
|
6
6
|
function write(g) {
|
|
7
7
|
var json = {
|
|
8
8
|
options: {
|