mio-previewer 0.1.8 → 0.2.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/README.md +1 -0
- package/dist/_basePickBy-DX8HyU0P.cjs +1 -0
- package/dist/{_basePickBy-CFTZygnR.js → _basePickBy-DcS5DfHY.js} +8 -8
- package/dist/{_baseUniq-COpRdEZm.js → _baseUniq-l83jS7_4.js} +1 -1
- package/dist/_baseUniq-vU0U1MCI.cjs +1 -0
- package/dist/arc-B70jSpTY.cjs +1 -0
- package/dist/{arc-CA-zaVHH.js → arc-bi7W8tLs.js} +15 -15
- package/dist/{architecture-O4VJ6CD3-DhXiEYF9.js → architecture-O4VJ6CD3-C8ByyxUN.js} +1 -1
- package/dist/{architecture-O4VJ6CD3-CpYFg8kG.cjs → architecture-O4VJ6CD3-jex9YPqE.cjs} +1 -1
- package/dist/architectureDiagram-VXUJARFQ-BSJVVbTt.cjs +36 -0
- package/dist/{architectureDiagram-VXUJARFQ-CMDGkfwW.js → architectureDiagram-VXUJARFQ-b-BL2UdP.js} +132 -132
- package/dist/{blockDiagram-VD42YOAC-BboMD6jZ.cjs → blockDiagram-VD42YOAC-D4nmxP-J.cjs} +4 -4
- package/dist/{blockDiagram-VD42YOAC-B6yyyBoP.js → blockDiagram-VD42YOAC-DhCRAnFr.js} +45 -45
- package/dist/{c4Diagram-YG6GDRKO-CAnMUU5Q.cjs → c4Diagram-YG6GDRKO-Bp_YQG1M.cjs} +1 -1
- package/dist/{c4Diagram-YG6GDRKO-Bk3UfYds.js → c4Diagram-YG6GDRKO-CM4iNQrU.js} +2 -2
- package/dist/channel-Bt4_zqKM.cjs +1 -0
- package/dist/{channel-CGHeB_wL.js → channel-C7wjr4b0.js} +1 -1
- package/dist/chunk-4BX2VUAB-DN9_7iVV.cjs +1 -0
- package/dist/{chunk-4BX2VUAB-DQLiny3u.js → chunk-4BX2VUAB-InZ28TEE.js} +1 -1
- package/dist/chunk-55IACEB6-BssN5TPL.cjs +1 -0
- package/dist/{chunk-55IACEB6-BvzkNW0T.js → chunk-55IACEB6-DuQdcZe5.js} +3 -3
- package/dist/{chunk-B4BG7PRW-DNWDyosT.cjs → chunk-B4BG7PRW-BLtyK5WN.cjs} +3 -3
- package/dist/{chunk-B4BG7PRW-XH3xle9g.js → chunk-B4BG7PRW-CZmD1mOP.js} +10 -10
- package/dist/{chunk-DI55MBZ5-7cI7r4vk.js → chunk-DI55MBZ5-BhYOpZgL.js} +3 -3
- package/dist/{chunk-DI55MBZ5-DBabq0PW.cjs → chunk-DI55MBZ5-Cq5UKCn9.cjs} +1 -1
- package/dist/{chunk-FMBD7UC4-BSSIfQJH.cjs → chunk-FMBD7UC4-D8L83VzX.cjs} +1 -1
- package/dist/{chunk-FMBD7UC4-Z_IXsR9N.js → chunk-FMBD7UC4-DieuQ34J.js} +1 -1
- package/dist/chunk-QN33PNHL-BVzK2uit.cjs +1 -0
- package/dist/{chunk-QN33PNHL-dvg-wDdg.js → chunk-QN33PNHL-D-qtZN_m.js} +1 -1
- package/dist/chunk-QZHKN3VN-BVy_lsPP.cjs +1 -0
- package/dist/{chunk-QZHKN3VN-Chg9twhX.js → chunk-QZHKN3VN-iq-B0BYI.js} +1 -1
- package/dist/chunk-TZMSLE5B-BdG0scu4.cjs +1 -0
- package/dist/{chunk-TZMSLE5B-CIgbKyu_.js → chunk-TZMSLE5B-CLskNwI1.js} +1 -1
- package/dist/{classDiagram-v2-WZHVMYZB-CC9xOx_t.js → classDiagram-2ON5EDUG-CRW-UrMH.js} +2 -2
- package/dist/classDiagram-2ON5EDUG-DynvEPIH.cjs +1 -0
- package/dist/{classDiagram-2ON5EDUG-CC9xOx_t.js → classDiagram-v2-WZHVMYZB-CRW-UrMH.js} +2 -2
- package/dist/classDiagram-v2-WZHVMYZB-DynvEPIH.cjs +1 -0
- package/dist/{clone-BrZZgHT6.js → clone-BTfuqUhz.js} +1 -1
- package/dist/clone-Tk5CWuEC.cjs +1 -0
- package/dist/cose-bilkent-S5V4N54A-BayjyXzv.cjs +1 -0
- package/dist/{cose-bilkent-S5V4N54A-CDs3BBYp.js → cose-bilkent-S5V4N54A-DWvW5ZH-.js} +1 -1
- package/dist/dagre-6UL2VRFP-CqJhtHGg.cjs +4 -0
- package/dist/{dagre-6UL2VRFP-BlMhpFnF.js → dagre-6UL2VRFP-CyO_II0i.js} +119 -119
- package/dist/diagram-PSM6KHXK-Deqqk-7H.cjs +24 -0
- package/dist/{diagram-PSM6KHXK-CoqSYWPX.js → diagram-PSM6KHXK-vEG2EZir.js} +53 -53
- package/dist/{diagram-QEK2KX5R-FqbXBaqH.js → diagram-QEK2KX5R-CcthhOYo.js} +20 -20
- package/dist/diagram-QEK2KX5R-CyVwjmz8.cjs +43 -0
- package/dist/{diagram-S2PKOQOG-u-4zOtyY.js → diagram-S2PKOQOG-C1nkRl8o.js} +23 -23
- package/dist/diagram-S2PKOQOG-D5cCXDLc.cjs +24 -0
- package/dist/{erDiagram-Q2GNP2WA-DWDeWLTL.cjs → erDiagram-Q2GNP2WA-BOk9K4o8.cjs} +1 -1
- package/dist/{erDiagram-Q2GNP2WA-CXn9GtvJ.js → erDiagram-Q2GNP2WA-DYZDQY9P.js} +4 -4
- package/dist/{flowDiagram-NV44I4VS-C60QhUiz.cjs → flowDiagram-NV44I4VS-CbBS7kpH.cjs} +3 -3
- package/dist/{flowDiagram-NV44I4VS-CvRJQSEg.js → flowDiagram-NV44I4VS-Cm5rGHKr.js} +14 -14
- package/dist/{ganttDiagram-LVOFAZNH-bsx5CB5d.js → ganttDiagram-LVOFAZNH-C9H8dTYM.js} +2 -2
- package/dist/ganttDiagram-LVOFAZNH-grl-NYJD.cjs +267 -0
- package/dist/{gitGraph-ZV4HHKMB-BjAayPSR.js → gitGraph-ZV4HHKMB-BMRuODZ5.js} +1 -1
- package/dist/{gitGraph-ZV4HHKMB-kRwxNQnW.cjs → gitGraph-ZV4HHKMB-DQol4cxY.cjs} +1 -1
- package/dist/{gitGraphDiagram-NY62KEGX-DPM59sAG.js → gitGraphDiagram-NY62KEGX-C8kfg2Wb.js} +45 -45
- package/dist/gitGraphDiagram-NY62KEGX-XHIAsakR.cjs +65 -0
- package/dist/graph-BP4aclXr.cjs +1 -0
- package/dist/{graph-CilVg985.js → graph-Cmal1ypF.js} +8 -8
- package/dist/info-63CPKGFF-BbRjNBBe.js +5 -0
- package/dist/{info-63CPKGFF-BKQtOsLZ.cjs → info-63CPKGFF-CxN4GUYe.cjs} +1 -1
- package/dist/{infoDiagram-F6ZHWCRC-B6bTTLIe.js → infoDiagram-F6ZHWCRC-D2_K2jLW.js} +2 -2
- package/dist/infoDiagram-F6ZHWCRC-DgwWwR_a.cjs +2 -0
- package/dist/{journeyDiagram-XKPGCS4Q-BKPpLUXu.js → journeyDiagram-XKPGCS4Q-BNauHD12.js} +4 -4
- package/dist/{journeyDiagram-XKPGCS4Q-CkWQvbbC.cjs → journeyDiagram-XKPGCS4Q-Cd1ptemy.cjs} +1 -1
- package/dist/{kanban-definition-3W4ZIXB7-DzI_mEvf.cjs → kanban-definition-3W4ZIXB7-BsVJ9Zr_.cjs} +2 -2
- package/dist/{kanban-definition-3W4ZIXB7-CLac2PpK.js → kanban-definition-3W4ZIXB7-aXwg7GQC.js} +44 -44
- package/dist/{layout-DOxjVt30.js → layout-CNXo_UYD.js} +4 -4
- package/dist/layout-UdmmrcAy.cjs +1 -0
- package/dist/{linear-nITCRSwN.js → linear-BJYenDkp.js} +25 -25
- package/dist/linear-yobfjqoN.cjs +1 -0
- package/dist/{mermaid-parser.core-YAHoRfr_.cjs → mermaid-parser.core-BGNM1z13.cjs} +2 -2
- package/dist/{mermaid-parser.core-BvyFzRhX.js → mermaid-parser.core-D65Eg7MW.js} +205 -205
- package/dist/{mindmap-definition-VGOIOE7T-8Pk45I0T.cjs → mindmap-definition-VGOIOE7T-BWwajGM9.cjs} +2 -2
- package/dist/{mindmap-definition-VGOIOE7T-BTlAV786.js → mindmap-definition-VGOIOE7T-Cj2T7UQL.js} +18 -18
- package/dist/mio-previewer.cjs.js +21 -13
- package/dist/mio-previewer.css +9 -1
- package/dist/mio-previewer.es.js +3647 -2009
- package/dist/{packet-HUATNLJX-Cn2d6cbh.js → packet-HUATNLJX-14SEU0O4.js} +1 -1
- package/dist/{packet-HUATNLJX-CNiEJWxQ.cjs → packet-HUATNLJX-Ckyin10q.cjs} +1 -1
- package/dist/{pie-WTHONI2E-CEUZL-GO.cjs → pie-WTHONI2E-BtmYKmK7.cjs} +1 -1
- package/dist/pie-WTHONI2E-C6yV7-lW.js +5 -0
- package/dist/{pieDiagram-ADFJNKIX-CgDIBKwo.js → pieDiagram-ADFJNKIX-BWiplVXs.js} +44 -44
- package/dist/pieDiagram-ADFJNKIX-DqeDsWS0.cjs +30 -0
- package/dist/plugins/custom.cjs.js +1 -1
- package/dist/plugins/custom.es.js +79 -5
- package/dist/{quadrantDiagram-AYHSOK5B-CExSZwWH.cjs → quadrantDiagram-AYHSOK5B-Bminc_qJ.cjs} +1 -1
- package/dist/{quadrantDiagram-AYHSOK5B-TlBxKPiG.js → quadrantDiagram-AYHSOK5B-FXg2sS-E.js} +2 -2
- package/dist/radar-NJJJXTRR-CF8VuBoZ.js +5 -0
- package/dist/{radar-NJJJXTRR-D3p36qrE.cjs → radar-NJJJXTRR-Dbtyn_33.cjs} +1 -1
- package/dist/{requirementDiagram-UZGBJVZJ-Dl5ijlU7.js → requirementDiagram-UZGBJVZJ-Ciz2mLOm.js} +27 -27
- package/dist/{requirementDiagram-UZGBJVZJ-BEcIIQ5C.cjs → requirementDiagram-UZGBJVZJ-Ct1bmEYE.cjs} +1 -1
- package/dist/{sankeyDiagram-TZEHDZUN-bIR5yy8v.js → sankeyDiagram-TZEHDZUN-B2xkf9t6.js} +56 -56
- package/dist/sankeyDiagram-TZEHDZUN-TSSR-gzu.cjs +10 -0
- package/dist/{sequenceDiagram-WL72ISMW-DT79Xx9V.js → sequenceDiagram-WL72ISMW-DIpwERDr.js} +3 -3
- package/dist/{sequenceDiagram-WL72ISMW-BG5OjhGw.cjs → sequenceDiagram-WL72ISMW-DtCHtJNZ.cjs} +9 -9
- package/dist/stateDiagram-FKZM4ZOC-B1VqtZxH.cjs +1 -0
- package/dist/{stateDiagram-FKZM4ZOC-CDfDuz0s.js → stateDiagram-FKZM4ZOC-DSCBCFG_.js} +16 -16
- package/dist/stateDiagram-v2-4FDKWEC3-CH9hsq70.cjs +1 -0
- package/dist/{stateDiagram-v2-4FDKWEC3-DroYR31A.js → stateDiagram-v2-4FDKWEC3-DeOAmcI6.js} +2 -2
- package/dist/{timeline-definition-IT6M3QCI-CzA493Rr.js → timeline-definition-IT6M3QCI-C2CJErQP.js} +24 -24
- package/dist/{timeline-definition-IT6M3QCI-BxCHgT34.cjs → timeline-definition-IT6M3QCI-Da0A3jAO.cjs} +5 -5
- package/dist/{treemap-75Q7IDZK-B7s32RV1.js → treemap-75Q7IDZK-BMEJe5sG.js} +1 -1
- package/dist/{treemap-75Q7IDZK-hLeVdex4.cjs → treemap-75Q7IDZK-obpm_ohS.cjs} +1 -1
- package/dist/types/composables/useImageViewerManager.d.ts +11 -0
- package/dist/types/main-image-viewer-demo.d.ts +1 -0
- package/dist/types/plugins/custom/imageViewerPlugin.d.ts +57 -0
- package/dist/types/plugins/custom/index.d.ts +2 -0
- package/dist/types/plugins/custom/mermaidPlugin.d.ts +15 -1
- package/dist/types/plugins/index.d.ts +2 -0
- package/dist/types/types.d.ts +23 -1
- package/dist/{cursorPlugin-vB5SgZWZ.cjs → viewer-3haLPWOp.cjs} +40 -40
- package/dist/{cursorPlugin-CLM_tkck.js → viewer-BVjz3IFH.js} +203 -202
- package/dist/{xychartDiagram-PRI3JC2R-DQLU-dCp.cjs → xychartDiagram-PRI3JC2R-DkdcvnXd.cjs} +1 -1
- package/dist/{xychartDiagram-PRI3JC2R-Bb_Kt4vj.js → xychartDiagram-PRI3JC2R-ttlQ38E3.js} +29 -29
- package/package.json +2 -1
- package/dist/_basePickBy-tPOC0EMH.cjs +0 -1
- package/dist/_baseUniq-DqpG5gxq.cjs +0 -1
- package/dist/arc-D6SpLjCN.cjs +0 -1
- package/dist/architectureDiagram-VXUJARFQ-C-ZDGP3T.cjs +0 -36
- package/dist/channel-By4yEUpY.cjs +0 -1
- package/dist/chunk-4BX2VUAB-r3h9zqZy.cjs +0 -1
- package/dist/chunk-55IACEB6-F8U2tzR2.cjs +0 -1
- package/dist/chunk-QN33PNHL-Cb-RTcJE.cjs +0 -1
- package/dist/chunk-QZHKN3VN-DR2ed2kF.cjs +0 -1
- package/dist/chunk-TZMSLE5B-D3CSz4N0.cjs +0 -1
- package/dist/classDiagram-2ON5EDUG-De8Dohf7.cjs +0 -1
- package/dist/classDiagram-v2-WZHVMYZB-De8Dohf7.cjs +0 -1
- package/dist/clone-CXoO9ncp.cjs +0 -1
- package/dist/cose-bilkent-S5V4N54A-0DFD6rcw.cjs +0 -1
- package/dist/dagre-6UL2VRFP-DuUBkSw0.cjs +0 -4
- package/dist/diagram-PSM6KHXK-CmQ4F2JN.cjs +0 -24
- package/dist/diagram-QEK2KX5R-DqSiNmiR.cjs +0 -43
- package/dist/diagram-S2PKOQOG-DYEcRvla.cjs +0 -24
- package/dist/ganttDiagram-LVOFAZNH-DuTD48a9.cjs +0 -267
- package/dist/gitGraphDiagram-NY62KEGX-DsyQIiCo.cjs +0 -65
- package/dist/graph-T55iHwif.cjs +0 -1
- package/dist/info-63CPKGFF-D-_lE7q9.js +0 -5
- package/dist/infoDiagram-F6ZHWCRC-Dfs9venE.cjs +0 -2
- package/dist/layout-LjH1X4pD.cjs +0 -1
- package/dist/linear-BZdfTIw6.cjs +0 -1
- package/dist/pie-WTHONI2E-COsOPmmh.js +0 -5
- package/dist/pieDiagram-ADFJNKIX-8mFQx_vI.cjs +0 -30
- package/dist/radar-NJJJXTRR-hKx4VhDB.js +0 -5
- package/dist/sankeyDiagram-TZEHDZUN-_AuPE8rx.cjs +0 -10
- package/dist/stateDiagram-FKZM4ZOC-CaZkY5ch.cjs +0 -1
- package/dist/stateDiagram-v2-4FDKWEC3-GfIoqgb_.cjs +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { _ as w,
|
|
2
|
-
import { G as B } from "./graph-
|
|
3
|
-
import { l as I } from "./layout-
|
|
4
|
-
import { i as b } from "./_baseUniq-
|
|
5
|
-
import { c as L } from "./clone-
|
|
6
|
-
import { m as A } from "./_basePickBy-
|
|
7
|
-
function
|
|
1
|
+
import { _ as w, ar as F, as as Y, at as _, au as H, l as r, c as V, av as z, aw as U, ag as $, al as q, ah as P, af as K, ax as Q, ay as W, az as Z } from "./viewer-BVjz3IFH.js";
|
|
2
|
+
import { G as B } from "./graph-Cmal1ypF.js";
|
|
3
|
+
import { l as I } from "./layout-CNXo_UYD.js";
|
|
4
|
+
import { i as b } from "./_baseUniq-l83jS7_4.js";
|
|
5
|
+
import { c as L } from "./clone-BTfuqUhz.js";
|
|
6
|
+
import { m as A } from "./_basePickBy-DcS5DfHY.js";
|
|
7
|
+
function h(e) {
|
|
8
8
|
var t = {
|
|
9
9
|
options: {
|
|
10
10
|
directed: e.isDirected(),
|
|
@@ -18,8 +18,8 @@ function v(e) {
|
|
|
18
18
|
}
|
|
19
19
|
function ee(e) {
|
|
20
20
|
return A(e.nodes(), function(t) {
|
|
21
|
-
var n = e.node(t), a = e.parent(t),
|
|
22
|
-
return b(n) || (
|
|
21
|
+
var n = e.node(t), a = e.parent(t), i = { v: t };
|
|
22
|
+
return b(n) || (i.value = n), b(a) || (i.parent = a), i;
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
function ne(e) {
|
|
@@ -28,16 +28,16 @@ function ne(e) {
|
|
|
28
28
|
return b(t.name) || (a.name = t.name), b(n) || (a.value = n), a;
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
var d = /* @__PURE__ */ new Map(),
|
|
32
|
-
|
|
31
|
+
var d = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ w(() => {
|
|
32
|
+
y.clear(), J.clear(), d.clear();
|
|
33
33
|
}, "clear"), D = /* @__PURE__ */ w((e, t) => {
|
|
34
|
-
const n =
|
|
35
|
-
return
|
|
34
|
+
const n = y.get(t) || [];
|
|
35
|
+
return r.trace("In isDescendant", t, " ", e, " = ", n.includes(e)), n.includes(e);
|
|
36
36
|
}, "isDescendant"), se = /* @__PURE__ */ w((e, t) => {
|
|
37
|
-
const n =
|
|
38
|
-
return
|
|
37
|
+
const n = y.get(t) || [];
|
|
38
|
+
return r.info("Descendants of ", t, " is ", n), r.info("Edge is ", e), e.v === t || e.w === t ? !1 : n ? n.includes(e.v) || D(e.v, t) || D(e.w, t) || n.includes(e.w) : (r.debug("Tilt, ", t, ",not in descendants"), !1);
|
|
39
39
|
}, "edgeInCluster"), G = /* @__PURE__ */ w((e, t, n, a) => {
|
|
40
|
-
|
|
40
|
+
r.warn(
|
|
41
41
|
"Copying children of ",
|
|
42
42
|
e,
|
|
43
43
|
"root",
|
|
@@ -46,13 +46,13 @@ var d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
46
46
|
t.node(e),
|
|
47
47
|
a
|
|
48
48
|
);
|
|
49
|
-
const
|
|
50
|
-
e !== a &&
|
|
49
|
+
const i = t.children(e) || [];
|
|
50
|
+
e !== a && i.push(e), r.warn("Copying (nodes) clusterId", e, "nodes", i), i.forEach((o) => {
|
|
51
51
|
if (t.children(o).length > 0)
|
|
52
52
|
G(o, t, n, a);
|
|
53
53
|
else {
|
|
54
54
|
const l = t.node(o);
|
|
55
|
-
|
|
55
|
+
r.info("cp ", o, " to ", a, " with parent ", e), n.setNode(o, l), a !== t.parent(o) && (r.warn("Setting parent", o, t.parent(o)), n.setParent(o, t.parent(o))), e !== a && o !== e ? (r.debug("Setting parent", o, e), n.setParent(o, e)) : (r.info("In copy ", e, "root", a, "data", t.node(e), a), r.debug(
|
|
56
56
|
"Not Setting parent for node=",
|
|
57
57
|
o,
|
|
58
58
|
"cluster!==rootId",
|
|
@@ -61,12 +61,12 @@ var d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
61
61
|
o !== e
|
|
62
62
|
));
|
|
63
63
|
const u = t.edges(o);
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
r.debug("Copying Edges", u), u.forEach((c) => {
|
|
65
|
+
r.info("Edge", c);
|
|
66
66
|
const m = t.edge(c.v, c.w, c.name);
|
|
67
|
-
|
|
67
|
+
r.info("Edge data", m, a);
|
|
68
68
|
try {
|
|
69
|
-
se(c, a) ? (
|
|
69
|
+
se(c, a) ? (r.info("Copying as ", c.v, c.w, m, c.name), n.setEdge(c.v, c.w, m, c.name), r.info("newGraph edges ", n.edges(), n.edge(n.edges()[0]))) : r.info(
|
|
70
70
|
"Skipping copy of edge ",
|
|
71
71
|
c.v,
|
|
72
72
|
"-->",
|
|
@@ -76,65 +76,65 @@ var d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
76
76
|
" clusterId:",
|
|
77
77
|
e
|
|
78
78
|
);
|
|
79
|
-
} catch (
|
|
80
|
-
|
|
79
|
+
} catch (v) {
|
|
80
|
+
r.error(v);
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
|
|
84
|
+
r.debug("Removing node", o), t.removeNode(o);
|
|
85
85
|
});
|
|
86
86
|
}, "copy"), R = /* @__PURE__ */ w((e, t) => {
|
|
87
87
|
const n = t.children(e);
|
|
88
88
|
let a = [...n];
|
|
89
|
-
for (const
|
|
90
|
-
J.set(
|
|
89
|
+
for (const i of n)
|
|
90
|
+
J.set(i, e), a = [...a, ...R(i, t)];
|
|
91
91
|
return a;
|
|
92
|
-
}, "extractDescendants"),
|
|
93
|
-
const a = e.edges().filter((c) => c.v === t || c.w === t),
|
|
92
|
+
}, "extractDescendants"), re = /* @__PURE__ */ w((e, t, n) => {
|
|
93
|
+
const a = e.edges().filter((c) => c.v === t || c.w === t), i = e.edges().filter((c) => c.v === n || c.w === n), o = a.map((c) => ({ v: c.v === t ? n : c.v, w: c.w === t ? t : c.w })), l = i.map((c) => ({ v: c.v, w: c.w }));
|
|
94
94
|
return o.filter((c) => l.some((m) => c.v === m.v && c.w === m.w));
|
|
95
95
|
}, "findCommonEdges"), C = /* @__PURE__ */ w((e, t, n) => {
|
|
96
96
|
const a = t.children(e);
|
|
97
|
-
if (
|
|
97
|
+
if (r.trace("Searching children of id ", e, a), a.length < 1)
|
|
98
98
|
return e;
|
|
99
|
-
let
|
|
99
|
+
let i;
|
|
100
100
|
for (const o of a) {
|
|
101
|
-
const l = C(o, t, n), u =
|
|
101
|
+
const l = C(o, t, n), u = re(t, n, l);
|
|
102
102
|
if (l)
|
|
103
103
|
if (u.length > 0)
|
|
104
|
-
|
|
104
|
+
i = l;
|
|
105
105
|
else
|
|
106
106
|
return l;
|
|
107
107
|
}
|
|
108
|
-
return
|
|
109
|
-
}, "findNonClusterChild"), k = /* @__PURE__ */ w((e) => !d.has(e) || !d.get(e).externalConnections ? e : d.has(e) ? d.get(e).id : e, "getAnchorId"),
|
|
108
|
+
return i;
|
|
109
|
+
}, "findNonClusterChild"), k = /* @__PURE__ */ w((e) => !d.has(e) || !d.get(e).externalConnections ? e : d.has(e) ? d.get(e).id : e, "getAnchorId"), ie = /* @__PURE__ */ w((e, t) => {
|
|
110
110
|
if (!e || t > 10) {
|
|
111
|
-
|
|
111
|
+
r.debug("Opting out, no graph ");
|
|
112
112
|
return;
|
|
113
113
|
} else
|
|
114
|
-
|
|
114
|
+
r.debug("Opting in, graph ");
|
|
115
115
|
e.nodes().forEach(function(n) {
|
|
116
|
-
e.children(n).length > 0 && (
|
|
116
|
+
e.children(n).length > 0 && (r.warn(
|
|
117
117
|
"Cluster identified",
|
|
118
118
|
n,
|
|
119
119
|
" Replacement id in edges: ",
|
|
120
120
|
C(n, e, n)
|
|
121
|
-
),
|
|
121
|
+
), y.set(n, R(n, e)), d.set(n, { id: C(n, e, n), clusterData: e.node(n) }));
|
|
122
122
|
}), e.nodes().forEach(function(n) {
|
|
123
|
-
const a = e.children(n),
|
|
124
|
-
a.length > 0 ? (
|
|
123
|
+
const a = e.children(n), i = e.edges();
|
|
124
|
+
a.length > 0 ? (r.debug("Cluster identified", n, y), i.forEach((o) => {
|
|
125
125
|
const l = D(o.v, n), u = D(o.w, n);
|
|
126
|
-
l ^ u && (
|
|
127
|
-
})) :
|
|
126
|
+
l ^ u && (r.warn("Edge: ", o, " leaves cluster ", n), r.warn("Descendants of XXX ", n, ": ", y.get(n)), d.get(n).externalConnections = !0);
|
|
127
|
+
})) : r.debug("Not a cluster ", n, y);
|
|
128
128
|
});
|
|
129
129
|
for (let n of d.keys()) {
|
|
130
|
-
const a = d.get(n).id,
|
|
131
|
-
|
|
130
|
+
const a = d.get(n).id, i = e.parent(a);
|
|
131
|
+
i !== n && d.has(i) && !d.get(i).externalConnections && (d.get(n).id = i);
|
|
132
132
|
}
|
|
133
133
|
e.edges().forEach(function(n) {
|
|
134
134
|
const a = e.edge(n);
|
|
135
|
-
|
|
136
|
-
let
|
|
137
|
-
if (
|
|
135
|
+
r.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(n)), r.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(e.edge(n)));
|
|
136
|
+
let i = n.v, o = n.w;
|
|
137
|
+
if (r.warn(
|
|
138
138
|
"Fix XXX",
|
|
139
139
|
d,
|
|
140
140
|
"ids:",
|
|
@@ -145,53 +145,53 @@ var d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
145
145
|
" --- ",
|
|
146
146
|
d.get(n.w)
|
|
147
147
|
), d.get(n.v) || d.get(n.w)) {
|
|
148
|
-
if (
|
|
149
|
-
const l = e.parent(
|
|
148
|
+
if (r.warn("Fixing and trying - removing XXX", n.v, n.w, n.name), i = k(n.v), o = k(n.w), e.removeEdge(n.v, n.w, n.name), i !== n.v) {
|
|
149
|
+
const l = e.parent(i);
|
|
150
150
|
d.get(l).externalConnections = !0, a.fromCluster = n.v;
|
|
151
151
|
}
|
|
152
152
|
if (o !== n.w) {
|
|
153
153
|
const l = e.parent(o);
|
|
154
154
|
d.get(l).externalConnections = !0, a.toCluster = n.w;
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
r.warn("Fix Replacing with XXX", i, o, n.name), e.setEdge(i, o, a, n.name);
|
|
157
157
|
}
|
|
158
|
-
}),
|
|
158
|
+
}), r.warn("Adjusted Graph", h(e)), T(e, 0), r.trace(d);
|
|
159
159
|
}, "adjustClustersAndEdges"), T = /* @__PURE__ */ w((e, t) => {
|
|
160
|
-
if (
|
|
161
|
-
|
|
160
|
+
if (r.warn("extractor - ", t, h(e), e.children("D")), t > 10) {
|
|
161
|
+
r.error("Bailing out");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
164
|
let n = e.nodes(), a = !1;
|
|
165
|
-
for (const
|
|
166
|
-
const o = e.children(
|
|
165
|
+
for (const i of n) {
|
|
166
|
+
const o = e.children(i);
|
|
167
167
|
a = a || o.length > 0;
|
|
168
168
|
}
|
|
169
169
|
if (!a) {
|
|
170
|
-
|
|
170
|
+
r.debug("Done, no node has children", e.nodes());
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
|
-
|
|
174
|
-
for (const
|
|
175
|
-
if (
|
|
173
|
+
r.debug("Nodes = ", n, t);
|
|
174
|
+
for (const i of n)
|
|
175
|
+
if (r.debug(
|
|
176
176
|
"Extracting node",
|
|
177
|
-
|
|
177
|
+
i,
|
|
178
178
|
d,
|
|
179
|
-
d.has(
|
|
180
|
-
!e.parent(
|
|
181
|
-
e.node(
|
|
179
|
+
d.has(i) && !d.get(i).externalConnections,
|
|
180
|
+
!e.parent(i),
|
|
181
|
+
e.node(i),
|
|
182
182
|
e.children("D"),
|
|
183
183
|
" Depth ",
|
|
184
184
|
t
|
|
185
|
-
), !d.has(
|
|
186
|
-
|
|
187
|
-
else if (!d.get(
|
|
188
|
-
|
|
185
|
+
), !d.has(i))
|
|
186
|
+
r.debug("Not a cluster", i, t);
|
|
187
|
+
else if (!d.get(i).externalConnections && e.children(i) && e.children(i).length > 0) {
|
|
188
|
+
r.warn(
|
|
189
189
|
"Cluster without external connections, without a parent and with children",
|
|
190
|
-
|
|
190
|
+
i,
|
|
191
191
|
t
|
|
192
192
|
);
|
|
193
193
|
let l = e.graph().rankdir === "TB" ? "LR" : "TB";
|
|
194
|
-
d.get(
|
|
194
|
+
d.get(i)?.clusterData?.dir && (l = d.get(i).clusterData.dir, r.warn("Fixing dir", d.get(i).clusterData.dir, l));
|
|
195
195
|
const u = new B({
|
|
196
196
|
multigraph: !0,
|
|
197
197
|
compound: !0
|
|
@@ -204,52 +204,52 @@ var d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
204
204
|
}).setDefaultEdgeLabel(function() {
|
|
205
205
|
return {};
|
|
206
206
|
});
|
|
207
|
-
|
|
207
|
+
r.warn("Old graph before copy", h(e)), G(i, e, u, i), e.setNode(i, {
|
|
208
208
|
clusterNode: !0,
|
|
209
|
-
id:
|
|
210
|
-
clusterData: d.get(
|
|
211
|
-
label: d.get(
|
|
209
|
+
id: i,
|
|
210
|
+
clusterData: d.get(i).clusterData,
|
|
211
|
+
label: d.get(i).label,
|
|
212
212
|
graph: u
|
|
213
|
-
}),
|
|
213
|
+
}), r.warn("New graph after copy node: (", i, ")", h(u)), r.debug("Old graph after copy", h(e));
|
|
214
214
|
} else
|
|
215
|
-
|
|
215
|
+
r.warn(
|
|
216
216
|
"Cluster ** ",
|
|
217
|
-
|
|
217
|
+
i,
|
|
218
218
|
" **not meeting the criteria !externalConnections:",
|
|
219
|
-
!d.get(
|
|
219
|
+
!d.get(i).externalConnections,
|
|
220
220
|
" no parent: ",
|
|
221
|
-
!e.parent(
|
|
221
|
+
!e.parent(i),
|
|
222
222
|
" children ",
|
|
223
|
-
e.children(
|
|
223
|
+
e.children(i) && e.children(i).length > 0,
|
|
224
224
|
e.children("D"),
|
|
225
225
|
t
|
|
226
|
-
),
|
|
227
|
-
n = e.nodes(),
|
|
228
|
-
for (const
|
|
229
|
-
const o = e.node(
|
|
230
|
-
|
|
226
|
+
), r.debug(d);
|
|
227
|
+
n = e.nodes(), r.warn("New list of nodes", n);
|
|
228
|
+
for (const i of n) {
|
|
229
|
+
const o = e.node(i);
|
|
230
|
+
r.warn(" Now next level", i, o), o?.clusterNode && T(o.graph, t + 1);
|
|
231
231
|
}
|
|
232
232
|
}, "extractor"), M = /* @__PURE__ */ w((e, t) => {
|
|
233
233
|
if (t.length === 0)
|
|
234
234
|
return [];
|
|
235
235
|
let n = Object.assign([], t);
|
|
236
236
|
return t.forEach((a) => {
|
|
237
|
-
const
|
|
237
|
+
const i = e.children(a), o = M(e, i);
|
|
238
238
|
n = [...n, ...o];
|
|
239
239
|
}), n;
|
|
240
|
-
}, "sorter"), oe = /* @__PURE__ */ w((e) => M(e, e.children()), "sortNodesByHierarchy"), j = /* @__PURE__ */ w(async (e, t, n, a,
|
|
241
|
-
|
|
240
|
+
}, "sorter"), oe = /* @__PURE__ */ w((e) => M(e, e.children()), "sortNodesByHierarchy"), j = /* @__PURE__ */ w(async (e, t, n, a, i, o) => {
|
|
241
|
+
r.warn("Graph in recursive render:XAX", h(t), i);
|
|
242
242
|
const l = t.graph().rankdir;
|
|
243
|
-
|
|
243
|
+
r.trace("Dir in recursive render - dir:", l);
|
|
244
244
|
const u = e.insert("g").attr("class", "root");
|
|
245
|
-
t.nodes() ?
|
|
246
|
-
const c = u.insert("g").attr("class", "clusters"), m = u.insert("g").attr("class", "edgePaths"),
|
|
245
|
+
t.nodes() ? r.info("Recursive render XXX", t.nodes()) : r.info("No nodes found for", t), t.edges().length > 0 && r.info("Recursive edges", t.edge(t.edges()[0]));
|
|
246
|
+
const c = u.insert("g").attr("class", "clusters"), m = u.insert("g").attr("class", "edgePaths"), v = u.insert("g").attr("class", "edgeLabels"), X = u.insert("g").attr("class", "nodes");
|
|
247
247
|
await Promise.all(
|
|
248
248
|
t.nodes().map(async function(f) {
|
|
249
249
|
const s = t.node(f);
|
|
250
|
-
if (
|
|
251
|
-
const g = JSON.parse(JSON.stringify(
|
|
252
|
-
|
|
250
|
+
if (i !== void 0) {
|
|
251
|
+
const g = JSON.parse(JSON.stringify(i.clusterData));
|
|
252
|
+
r.trace(
|
|
253
253
|
`Setting data for parent cluster XXX
|
|
254
254
|
Node.id = `,
|
|
255
255
|
f,
|
|
@@ -258,11 +258,11 @@ var d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
258
258
|
g.height,
|
|
259
259
|
`
|
|
260
260
|
Parent cluster`,
|
|
261
|
-
|
|
262
|
-
), t.setNode(
|
|
261
|
+
i.height
|
|
262
|
+
), t.setNode(i.id, g), t.parent(f) || (r.trace("Setting parent", f, i.id), t.setParent(f, i.id, g));
|
|
263
263
|
}
|
|
264
|
-
if (
|
|
265
|
-
|
|
264
|
+
if (r.info("(Insert) Node XXX" + f + ": " + JSON.stringify(t.node(f))), s?.clusterNode) {
|
|
265
|
+
r.info("Cluster identified XBX", f, s.width, t.node(f));
|
|
266
266
|
const { ranksep: g, nodesep: E } = t.graph();
|
|
267
267
|
s.graph.setGraph({
|
|
268
268
|
...s.graph.graph(),
|
|
@@ -277,7 +277,7 @@ Parent cluster`,
|
|
|
277
277
|
t.node(f),
|
|
278
278
|
o
|
|
279
279
|
), x = N.elem;
|
|
280
|
-
z(s, x), s.diff = N.diff || 0,
|
|
280
|
+
z(s, x), s.diff = N.diff || 0, r.info(
|
|
281
281
|
"New compound node after recursive render XAX",
|
|
282
282
|
f,
|
|
283
283
|
"width",
|
|
@@ -289,7 +289,7 @@ Parent cluster`,
|
|
|
289
289
|
// node.y
|
|
290
290
|
), U(x, s);
|
|
291
291
|
} else
|
|
292
|
-
t.children(f).length > 0 ? (
|
|
292
|
+
t.children(f).length > 0 ? (r.trace(
|
|
293
293
|
"Cluster - the non recursive path XBX",
|
|
294
294
|
f,
|
|
295
295
|
s.id,
|
|
@@ -297,12 +297,12 @@ Parent cluster`,
|
|
|
297
297
|
s.width,
|
|
298
298
|
"Graph:",
|
|
299
299
|
t
|
|
300
|
-
),
|
|
300
|
+
), r.trace(C(s.id, t)), d.set(s.id, { id: C(s.id, t), node: s })) : (r.trace("Node - the non recursive path XAX", f, X, t.node(f), l), await $(X, t.node(f), { config: o, dir: l }));
|
|
301
301
|
})
|
|
302
302
|
), await (/* @__PURE__ */ w(async () => {
|
|
303
303
|
const f = t.edges().map(async function(s) {
|
|
304
304
|
const g = t.edge(s.v, s.w, s.name);
|
|
305
|
-
|
|
305
|
+
r.info("Edge " + s.v + " -> " + s.w + ": " + JSON.stringify(s)), r.info("Edge " + s.v + " -> " + s.w + ": ", s, " ", JSON.stringify(t.edge(s))), r.info(
|
|
306
306
|
"Fix",
|
|
307
307
|
d,
|
|
308
308
|
"ids:",
|
|
@@ -311,15 +311,15 @@ Parent cluster`,
|
|
|
311
311
|
"Translating: ",
|
|
312
312
|
d.get(s.v),
|
|
313
313
|
d.get(s.w)
|
|
314
|
-
), await Z(
|
|
314
|
+
), await Z(v, g);
|
|
315
315
|
});
|
|
316
316
|
await Promise.all(f);
|
|
317
|
-
}, "processEdges"))(),
|
|
317
|
+
}, "processEdges"))(), r.info("Graph before layout:", JSON.stringify(h(t))), r.info("############################################# XXX"), r.info("### Layout ### XXX"), r.info("############################################# XXX"), I(t), r.info("Graph after layout:", JSON.stringify(h(t)));
|
|
318
318
|
let O = 0, { subGraphTitleTotalMargin: S } = q(o);
|
|
319
319
|
return await Promise.all(
|
|
320
320
|
oe(t).map(async function(f) {
|
|
321
321
|
const s = t.node(f);
|
|
322
|
-
if (
|
|
322
|
+
if (r.info(
|
|
323
323
|
"Position XBX => " + f + ": (" + s.x,
|
|
324
324
|
"," + s.y,
|
|
325
325
|
") width: ",
|
|
@@ -327,7 +327,7 @@ Parent cluster`,
|
|
|
327
327
|
" height: ",
|
|
328
328
|
s.height
|
|
329
329
|
), s?.clusterNode)
|
|
330
|
-
s.y += S,
|
|
330
|
+
s.y += S, r.info(
|
|
331
331
|
"A tainted cluster node XBX1",
|
|
332
332
|
f,
|
|
333
333
|
s.id,
|
|
@@ -338,7 +338,7 @@ Parent cluster`,
|
|
|
338
338
|
t.parent(f)
|
|
339
339
|
), d.get(s.id).node = s, P(s);
|
|
340
340
|
else if (t.children(f).length > 0) {
|
|
341
|
-
|
|
341
|
+
r.info(
|
|
342
342
|
"A pure cluster node XBX1",
|
|
343
343
|
f,
|
|
344
344
|
s.id,
|
|
@@ -349,10 +349,10 @@ Parent cluster`,
|
|
|
349
349
|
t.parent(f)
|
|
350
350
|
), s.height += S, t.node(s.parentId);
|
|
351
351
|
const g = s?.padding / 2 || 0, E = s?.labelBBox?.height || 0, N = E - g || 0;
|
|
352
|
-
|
|
352
|
+
r.debug("OffsetY", N, "labelHeight", E, "halfPadding", g), await K(c, s), d.get(s.id).node = s;
|
|
353
353
|
} else {
|
|
354
354
|
const g = t.node(s.parentId);
|
|
355
|
-
s.y += S / 2,
|
|
355
|
+
s.y += S / 2, r.info(
|
|
356
356
|
"A regular node XBX1 - using the padding",
|
|
357
357
|
s.id,
|
|
358
358
|
"parent",
|
|
@@ -372,15 +372,15 @@ Parent cluster`,
|
|
|
372
372
|
})
|
|
373
373
|
), t.edges().forEach(function(f) {
|
|
374
374
|
const s = t.edge(f);
|
|
375
|
-
|
|
375
|
+
r.info("Edge " + f.v + " -> " + f.w + ": " + JSON.stringify(s), s), s.points.forEach((x) => x.y += S / 2);
|
|
376
376
|
const g = t.node(f.v);
|
|
377
377
|
var E = t.node(f.w);
|
|
378
378
|
const N = Q(m, s, d, n, g, E, a);
|
|
379
379
|
W(s, N);
|
|
380
380
|
}), t.nodes().forEach(function(f) {
|
|
381
381
|
const s = t.node(f);
|
|
382
|
-
|
|
383
|
-
}),
|
|
382
|
+
r.info(f, s.type, s.diff), s.isGroup && (O = s.diff);
|
|
383
|
+
}), r.warn("Returning from recursive render XAX", u, O), { elem: u, diff: O };
|
|
384
384
|
}, "recursiveRender"), ge = /* @__PURE__ */ w(async (e, t) => {
|
|
385
385
|
const n = new B({
|
|
386
386
|
multigraph: !0,
|
|
@@ -396,7 +396,7 @@ Parent cluster`,
|
|
|
396
396
|
}), a = t.select("g");
|
|
397
397
|
F(a, e.markers, e.type, e.diagramId), Y(), _(), H(), te(), e.nodes.forEach((o) => {
|
|
398
398
|
n.setNode(o.id, { ...o }), o.parentId && n.setParent(o.id, o.parentId);
|
|
399
|
-
}),
|
|
399
|
+
}), r.debug("Edges:", e.edges), e.edges.forEach((o) => {
|
|
400
400
|
if (o.start === o.end) {
|
|
401
401
|
const l = o.start, u = l + "---" + l + "---1", c = l + "---" + l + "---2", m = n.node(l);
|
|
402
402
|
n.setNode(u, {
|
|
@@ -424,19 +424,19 @@ Parent cluster`,
|
|
|
424
424
|
width: 10,
|
|
425
425
|
height: 10
|
|
426
426
|
}), n.setParent(c, m.parentId);
|
|
427
|
-
const
|
|
428
|
-
|
|
427
|
+
const v = structuredClone(o), X = structuredClone(o), p = structuredClone(o);
|
|
428
|
+
v.label = "", v.arrowTypeEnd = "none", v.id = l + "-cyclic-special-1", X.arrowTypeStart = "none", X.arrowTypeEnd = "none", X.id = l + "-cyclic-special-mid", p.label = "", m.isGroup && (v.fromCluster = l, p.toCluster = l), p.id = l + "-cyclic-special-2", p.arrowTypeStart = "none", n.setEdge(l, u, v, l + "-cyclic-special-0"), n.setEdge(u, c, X, l + "-cyclic-special-1"), n.setEdge(c, l, p, l + "-cyc<lic-special-2");
|
|
429
429
|
} else
|
|
430
430
|
n.setEdge(o.start, o.end, { ...o }, o.id);
|
|
431
|
-
}),
|
|
432
|
-
const
|
|
431
|
+
}), r.warn("Graph at first:", JSON.stringify(h(n))), ie(n), r.warn("Graph after XAX:", JSON.stringify(h(n)));
|
|
432
|
+
const i = V();
|
|
433
433
|
await j(
|
|
434
434
|
a,
|
|
435
435
|
n,
|
|
436
436
|
e.type,
|
|
437
437
|
e.diagramId,
|
|
438
438
|
void 0,
|
|
439
|
-
|
|
439
|
+
i
|
|
440
440
|
);
|
|
441
441
|
}, "render");
|
|
442
442
|
export {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./viewer-3haLPWOp.cjs"),se=require("./chunk-QN33PNHL-BVzK2uit.cjs"),ie=require("./chunk-4BX2VUAB-DN9_7iVV.cjs"),oe=require("./mermaid-parser.core-BGNM1z13.cjs"),I=require("./defaultLocale-DIVzfLaQ.cjs"),U=require("./ordinal-CagbB1m8.cjs");function ce(a){var t=0,l=a.children,n=l&&l.length;if(!n)t=1;else for(;--n>=0;)t+=l[n].value;a.value=t}function de(){return this.eachAfter(ce)}function ue(a,t){let l=-1;for(const n of this)a.call(t,n,++l,this);return this}function he(a,t){for(var l=this,n=[l],o,s,d=-1;l=n.pop();)if(a.call(t,l,++d,this),o=l.children)for(s=o.length-1;s>=0;--s)n.push(o[s]);return this}function pe(a,t){for(var l=this,n=[l],o=[],s,d,h,m=-1;l=n.pop();)if(o.push(l),s=l.children)for(d=0,h=s.length;d<h;++d)n.push(s[d]);for(;l=o.pop();)a.call(t,l,++m,this);return this}function fe(a,t){let l=-1;for(const n of this)if(a.call(t,n,++l,this))return n}function ge(a){return this.eachAfter(function(t){for(var l=+a(t.data)||0,n=t.children,o=n&&n.length;--o>=0;)l+=n[o].value;t.value=l})}function me(a){return this.eachBefore(function(t){t.children&&t.children.sort(a)})}function ye(a){for(var t=this,l=Se(t,a),n=[t];t!==l;)t=t.parent,n.push(t);for(var o=n.length;a!==l;)n.splice(o,0,a),a=a.parent;return n}function Se(a,t){if(a===t)return a;var l=a.ancestors(),n=t.ancestors(),o=null;for(a=l.pop(),t=n.pop();a===t;)o=a,a=l.pop(),t=n.pop();return o}function ve(){for(var a=this,t=[a];a=a.parent;)t.push(a);return t}function xe(){return Array.from(this)}function be(){var a=[];return this.eachBefore(function(t){t.children||a.push(t)}),a}function we(){var a=this,t=[];return a.each(function(l){l!==a&&t.push({source:l.parent,target:l})}),t}function*Ce(){var a=this,t,l=[a],n,o,s;do for(t=l.reverse(),l=[];a=t.pop();)if(yield a,n=a.children)for(o=0,s=n.length;o<s;++o)l.push(n[o]);while(l.length)}function Q(a,t){a instanceof Map?(a=[void 0,a],t===void 0&&(t=Le)):t===void 0&&(t=Te);for(var l=new j(a),n,o=[l],s,d,h,m;n=o.pop();)if((d=t(n.data))&&(m=(d=Array.from(d)).length))for(n.children=d,h=m-1;h>=0;--h)o.push(s=d[h]=new j(d[h])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(Ae)}function _e(){return Q(this).eachBefore($e)}function Te(a){return a.children}function Le(a){return Array.isArray(a)?a[1]:null}function $e(a){a.data.value!==void 0&&(a.value=a.data.value),a.data=a.data.data}function Ae(a){var t=0;do a.height=t;while((a=a.parent)&&a.height<++t)}function j(a){this.data=a,this.depth=this.height=0,this.parent=null}j.prototype=Q.prototype={constructor:j,count:de,each:ue,eachAfter:pe,eachBefore:he,find:fe,sum:ge,sort:me,path:ye,ancestors:ve,descendants:xe,leaves:be,links:we,copy:_e,[Symbol.iterator]:Ce};function ke(a){if(typeof a!="function")throw new Error;return a}function q(){return 0}function O(a){return function(){return a}}function Ne(a){a.x0=Math.round(a.x0),a.y0=Math.round(a.y0),a.x1=Math.round(a.x1),a.y1=Math.round(a.y1)}function Me(a,t,l,n,o){for(var s=a.children,d,h=-1,m=s.length,c=a.value&&(n-t)/a.value;++h<m;)d=s[h],d.y0=l,d.y1=o,d.x0=t,d.x1=t+=d.value*c}function Fe(a,t,l,n,o){for(var s=a.children,d,h=-1,m=s.length,c=a.value&&(o-l)/a.value;++h<m;)d=s[h],d.x0=t,d.x1=n,d.y0=l,d.y1=l+=d.value*c}var ze=(1+Math.sqrt(5))/2;function Ve(a,t,l,n,o,s){for(var d=[],h=t.children,m,c,p=0,w=0,r=h.length,b,v,x=t.value,f,y,N,k,V,R,M;p<r;){b=o-l,v=s-n;do f=h[w++].value;while(!f&&w<r);for(y=N=f,R=Math.max(v/b,b/v)/(x*a),M=f*f*R,V=Math.max(N/M,M/y);w<r;++w){if(f+=c=h[w].value,c<y&&(y=c),c>N&&(N=c),M=f*f*R,k=Math.max(N/M,M/y),k>V){f-=c;break}V=k}d.push(m={value:f,dice:b<v,children:h.slice(p,w)}),m.dice?Me(m,l,n,o,x?n+=v*f/x:s):Fe(m,l,n,x?l+=b*f/x:o,s),x-=f,p=w}return d}const Pe=(function a(t){function l(n,o,s,d,h){Ve(t,n,o,s,d,h)}return l.ratio=function(n){return a((n=+n)>1?n:1)},l})(ze);function Be(){var a=Pe,t=!1,l=1,n=1,o=[0],s=q,d=q,h=q,m=q,c=q;function p(r){return r.x0=r.y0=0,r.x1=l,r.y1=n,r.eachBefore(w),o=[0],t&&r.eachBefore(Ne),r}function w(r){var b=o[r.depth],v=r.x0+b,x=r.y0+b,f=r.x1-b,y=r.y1-b;f<v&&(v=f=(v+f)/2),y<x&&(x=y=(x+y)/2),r.x0=v,r.y0=x,r.x1=f,r.y1=y,r.children&&(b=o[r.depth+1]=s(r)/2,v+=c(r)-b,x+=d(r)-b,f-=h(r)-b,y-=m(r)-b,f<v&&(v=f=(v+f)/2),y<x&&(x=y=(x+y)/2),a(r,v,x,f,y))}return p.round=function(r){return arguments.length?(t=!!r,p):t},p.size=function(r){return arguments.length?(l=+r[0],n=+r[1],p):[l,n]},p.tile=function(r){return arguments.length?(a=ke(r),p):a},p.padding=function(r){return arguments.length?p.paddingInner(r).paddingOuter(r):p.paddingInner()},p.paddingInner=function(r){return arguments.length?(s=typeof r=="function"?r:O(+r),p):s},p.paddingOuter=function(r){return arguments.length?p.paddingTop(r).paddingRight(r).paddingBottom(r).paddingLeft(r):p.paddingTop()},p.paddingTop=function(r){return arguments.length?(d=typeof r=="function"?r:O(+r),p):d},p.paddingRight=function(r){return arguments.length?(h=typeof r=="function"?r:O(+r),p):h},p.paddingBottom=function(r){return arguments.length?(m=typeof r=="function"?r:O(+r),p):m},p.paddingLeft=function(r){return arguments.length?(c=typeof r=="function"?r:O(+r),p):c},p}var D,J=(D=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=u.setAccTitle,this.getAccTitle=u.getAccTitle,this.setDiagramTitle=u.setDiagramTitle,this.getDiagramTitle=u.getDiagramTitle,this.getAccDescription=u.getAccDescription,this.setAccDescription=u.setAccDescription}getNodes(){return this.nodes}getConfig(){const t=u.defaultConfig_default,l=u.getConfig();return u.cleanAndMerge({...t.treemap,...l.treemap??{}})}addNode(t,l){this.nodes.push(t),this.levels.set(t,l),l===0&&(this.outerNodes.push(t),this.root??=t)}getRoot(){return{name:"",children:this.outerNodes}}addClass(t,l){const n=this.classes.get(t)??{id:t,styles:[],textStyles:[]},o=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");o&&o.forEach(s=>{u.isLabelStyle(s)&&(n?.textStyles?n.textStyles.push(s):n.textStyles=[s]),n?.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(t,n)}getClasses(){return this.classes}getStylesForClass(t){return this.classes.get(t)?.styles??[]}clear(){u.clear(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},u.__name(D,"TreeMapDB"),D);function K(a){if(!a.length)return[];const t=[],l=[];return a.forEach(n=>{const o={name:n.name,children:n.type==="Leaf"?void 0:[]};for(o.classSelector=n?.classSelector,n?.cssCompiledStyles&&(o.cssCompiledStyles=[n.cssCompiledStyles]),n.type==="Leaf"&&n.value!==void 0&&(o.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)t.push(o);else{const s=l[l.length-1].node;s.children?s.children.push(o):s.children=[o]}n.type!=="Leaf"&&l.push({node:o,level:n.level})}),t}u.__name(K,"buildHierarchy");var De=u.__name((a,t)=>{ie.populateCommonDb(a,t);const l=[];for(const s of a.TreemapRows??[])s.$type==="ClassDefStatement"&&t.addClass(s.className??"",s.styleText??"");for(const s of a.TreemapRows??[]){const d=s.item;if(!d)continue;const h=s.indent?parseInt(s.indent):0,m=Re(d),c=d.classSelector?t.getStylesForClass(d.classSelector):[],p=c.length>0?c.join(";"):void 0,w={level:h,name:m,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:p};l.push(w)}const n=K(l),o=u.__name((s,d)=>{for(const h of s)t.addNode(h,d),h.children&&h.children.length>0&&o(h.children,d+1)},"addNodesRecursively");o(n,0)},"populate"),Re=u.__name(a=>a.name?String(a.name):"","getItemName"),ee={parser:{yy:void 0},parse:u.__name(async a=>{try{const t=oe.parse,l=await t("treemap",a);u.log.debug("Treemap AST:",l);const n=ee.parser?.yy;if(!(n instanceof J))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");De(l,n)}catch(t){throw u.log.error("Error parsing treemap:",t),t}},"parse")},Ee=10,B=10,G=25,We=u.__name((a,t,l,n)=>{const o=n.db,s=o.getConfig(),d=s.padding??Ee,h=o.getDiagramTitle(),m=o.getRoot(),{themeVariables:c}=u.getConfig();if(!m)return;const p=h?30:0,w=u.selectSvgElement(t),r=s.nodeWidth?s.nodeWidth*B:960,b=s.nodeHeight?s.nodeHeight*B:500,v=r,x=b+p;w.attr("viewBox",`0 0 ${v} ${x}`),u.configureSvgSize(w,x,v,s.useMaxWidth);let f;try{const e=s.valueFormat||",";if(e==="$0,0")f=u.__name(i=>"$"+I.format(",")(i),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const i=/\.\d+/.exec(e),g=i?i[0]:"";f=u.__name(C=>"$"+I.format(","+g)(C),"valueFormat")}else if(e.startsWith("$")){const i=e.substring(1);f=u.__name(g=>"$"+I.format(i||"")(g),"valueFormat")}else f=I.format(e)}catch(e){u.log.error("Error creating format function:",e),f=I.format(",")}const y=U.ordinal().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=U.ordinal().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),k=U.ordinal().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);h&&w.append("text").attr("x",v/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const V=w.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=Q(m).sum(e=>e.value??0).sort((e,i)=>(i.value??0)-(e.value??0)),Z=Be().size([r,b]).paddingTop(e=>e.children&&e.children.length>0?G+B:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?B:0).paddingRight(e=>e.children&&e.children.length>0?B:0).paddingBottom(e=>e.children&&e.children.length>0?B:0).round(!0)(R),te=Z.descendants().filter(e=>e.children&&e.children.length>0),E=V.selectAll(".treemapSection").data(te).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);E.append("rect").attr("width",e=>e.x1-e.x0).attr("height",G).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),E.append("clipPath").attr("id",(e,i)=>`clip-section-${t}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",G),E.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,i)=>`treemapSection section${i}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>N(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const i=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),E.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",G/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("style",e=>{if(e.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i+g.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const i=u.select(this),g=e.data.name;i.text(g);const C=e.x1-e.x0,T=6;let L;s.showValues!==!1&&e.value?L=C-10-30-10-T:L=C-T-6;const $=Math.max(15,L),S=i.node();if(S.getComputedTextLength()>$){let _=g;for(;_.length>0;){if(_=g.substring(0,_.length-1),_.length===0){i.text("..."),S.getComputedTextLength()>$&&i.text("");break}if(i.text(_+"..."),S.getComputedTextLength()<=$)break}}}),s.showValues!==!1&&E.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",G/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?f(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i+g.labelStyles.replace("color:","fill:")});const ae=Z.leaves(),X=V.selectAll(".treemapLeafGroup").data(ae).enter().append("g").attr("class",(e,i)=>`treemapNode treemapLeafGroup leaf${i}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);X.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),X.append("clipPath").attr("id",(e,i)=>`clip-${t}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),X.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const i="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+k(e.data.name)+";",g=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i+g.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,i)=>`url(#clip-${t}-${i})`).text(e=>e.data.name).each(function(e){const i=u.select(this),g=e.x1-e.x0,C=e.y1-e.y0,T=i.node(),L=4,P=g-2*L,$=C-2*L;if(P<10||$<10){i.style("display","none");return}let S=parseInt(i.style("font-size"),10);const F=8,A=28,_=.6,z=6,W=2;for(;T.getComputedTextLength()>P&&S>F;)S--,i.style("font-size",`${S}px`);let H=Math.max(z,Math.min(A,Math.round(S*_))),Y=S+W+H;for(;Y>$&&S>F&&(S--,H=Math.max(z,Math.min(A,Math.round(S*_))),!(H<z&&S===F));)i.style("font-size",`${S}px`),Y=S+W+H;i.style("font-size",`${S}px`),(T.getComputedTextLength()>P||S<F||$<S)&&i.style("display","none")}),s.showValues!==!1&&X.append("text").attr("class","treemapValue").attr("x",i=>(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const g="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+k(i.data.name)+";",C=u.styles2String({cssCompiledStyles:i.data.cssCompiledStyles});return g+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,g)=>`url(#clip-${t}-${g})`).text(i=>i.value?f(i.value):"").each(function(i){const g=u.select(this),C=this.parentNode;if(!C){g.style("display","none");return}const T=u.select(C).select(".treemapLabel");if(T.empty()||T.style("display")==="none"){g.style("display","none");return}const L=parseFloat(T.style("font-size")),P=28,$=.6,S=6,F=2,A=Math.max(S,Math.min(P,Math.round(L*$)));g.style("font-size",`${A}px`);const z=(i.y1-i.y0)/2+L/2+F;g.attr("y",z);const W=i.x1-i.x0,le=i.y1-i.y0-4,re=W-8;g.node().getComputedTextLength()>re||z+A>le||A<S?g.style("display","none"):g.style("display",null)});const ne=s.diagramPadding??8;se.setupViewPortForSVG(w,ne,"flowchart",s?.useMaxWidth||!1)},"draw"),He=u.__name(function(a,t){return t.db.getClasses()},"getClasses"),Ie={draw:We,getClasses:He},qe={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},Oe=u.__name(({treemap:a}={})=>{const t=u.cleanAndMerge(qe,a);return`
|
|
2
|
+
.treemapNode.section {
|
|
3
|
+
stroke: ${t.sectionStrokeColor};
|
|
4
|
+
stroke-width: ${t.sectionStrokeWidth};
|
|
5
|
+
fill: ${t.sectionFillColor};
|
|
6
|
+
}
|
|
7
|
+
.treemapNode.leaf {
|
|
8
|
+
stroke: ${t.leafStrokeColor};
|
|
9
|
+
stroke-width: ${t.leafStrokeWidth};
|
|
10
|
+
fill: ${t.leafFillColor};
|
|
11
|
+
}
|
|
12
|
+
.treemapLabel {
|
|
13
|
+
fill: ${t.labelColor};
|
|
14
|
+
font-size: ${t.labelFontSize};
|
|
15
|
+
}
|
|
16
|
+
.treemapValue {
|
|
17
|
+
fill: ${t.valueColor};
|
|
18
|
+
font-size: ${t.valueFontSize};
|
|
19
|
+
}
|
|
20
|
+
.treemapTitle {
|
|
21
|
+
fill: ${t.titleColor};
|
|
22
|
+
font-size: ${t.titleFontSize};
|
|
23
|
+
}
|
|
24
|
+
`},"getStyles"),Ge=Oe,Xe={parser:ee,get db(){return new J},renderer:Ie,styles:Ge};exports.diagram=Xe;
|