@sme.up/ketchup2 2.0.0-SNAPSHOT-20250908152453 → 2.0.0-SNAPSHOT-20250909100819
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/{_basePickBy-DNewzgl9.cjs → _basePickBy-Ca1ngxe-.cjs} +1 -1
- package/dist/{_basePickBy-Bq-OHVlJ.js → _basePickBy-CnPX6Bdb.js} +23 -23
- package/dist/{_baseUniq-DUO9awf7.js → _baseUniq-CQt2p9Xf.js} +40 -40
- package/dist/{_baseUniq-CQ7AOjch.cjs → _baseUniq-bHS4L6X9.cjs} +1 -1
- package/dist/{arc-BC6Mnh_l.js → arc-B2BtxFI4.js} +1 -1
- package/dist/{arc-H_1C-9yW.cjs → arc-Bg-chCuU.cjs} +1 -1
- package/dist/{architecture-O4VJ6CD3-Bfi1Y3W3.cjs → architecture-O4VJ6CD3-Bogzr-i1.cjs} +1 -1
- package/dist/{architecture-O4VJ6CD3-B2_zBkXA.js → architecture-O4VJ6CD3-DYTHPFXy.js} +1 -1
- package/dist/{architectureDiagram-KFL7JDKH-DOaG_WZV.cjs → architectureDiagram-W76B3OCA-BUHj3Zr2.cjs} +1 -1
- package/dist/{architectureDiagram-KFL7JDKH-Dzqraep6.js → architectureDiagram-W76B3OCA-Bj05bf6s.js} +132 -132
- package/dist/basic-components/typography/typography.d.ts.map +1 -1
- package/dist/{blockDiagram-ZYB65J3Q-0TfXbzbL.cjs → blockDiagram-QIGZ2CNN-BAiichlp.cjs} +4 -4
- package/dist/{blockDiagram-ZYB65J3Q-BF5gB3wI.js → blockDiagram-QIGZ2CNN-CwpHAq1V.js} +5 -5
- package/dist/{c4Diagram-AAMF2YG6-BUdDUCAg.cjs → c4Diagram-FPNF74CW-De8NL9Id.cjs} +4 -4
- package/dist/{c4Diagram-AAMF2YG6-CZutQWdQ.js → c4Diagram-FPNF74CW-DiSLBa6J.js} +2 -2
- package/dist/channel-C-hM23ua.cjs +1 -0
- package/dist/channel-Cn_5XvBc.js +5 -0
- package/dist/{chunk-ANTBXLJU-DqW7nBC-.cjs → chunk-4BX2VUAB-D2Fra4jo.cjs} +1 -1
- package/dist/{chunk-ANTBXLJU-BdaEgFx7.js → chunk-4BX2VUAB-Dc8D0um4.js} +1 -1
- package/dist/{chunk-WVR4S24B-Chw9GJ4r.cjs → chunk-55IACEB6-B9OyHdBl.cjs} +1 -1
- package/dist/{chunk-WVR4S24B-DkA4uS4H.js → chunk-55IACEB6-WLFUV7oZ.js} +1 -1
- package/dist/{chunk-GLLZNHP4-DiiaqYXe.js → chunk-FMBD7UC4-CB2wfBwS.js} +1 -1
- package/dist/{chunk-GLLZNHP4-BA8r1pFP.cjs → chunk-FMBD7UC4-gecPdlnv.cjs} +1 -1
- package/dist/{chunk-JBRWN2VN-BaREAv8H.js → chunk-K7UQS3LO-Ct-3gwwe.js} +176 -176
- package/dist/chunk-K7UQS3LO-DlKvL8UP.cjs +165 -0
- package/dist/{chunk-NRVI72HA-DLE8wk3-.js → chunk-QN33PNHL-D4Q8z0QK.js} +1 -1
- package/dist/{chunk-NRVI72HA-DRmCDH9L.cjs → chunk-QN33PNHL-DnwK1wh-.cjs} +1 -1
- package/dist/{chunk-FHKO5MBM-CzQq96F_.js → chunk-QZHKN3VN-BQc1ljoT.js} +1 -1
- package/dist/{chunk-FHKO5MBM-DXqhRcMm.cjs → chunk-QZHKN3VN-cx48mWRx.cjs} +1 -1
- package/dist/{chunk-LXBSTHXV-DFifdLZK.js → chunk-TVAH2DTR-C6i3nG3J.js} +3 -3
- package/dist/{chunk-LXBSTHXV-B0scQvN2.cjs → chunk-TVAH2DTR-Cln0v1mj.cjs} +3 -3
- package/dist/{chunk-OMD6QJNC-RjSGzdd8.cjs → chunk-TZMSLE5B-B512fbOf.cjs} +1 -1
- package/dist/{chunk-OMD6QJNC-BYvyUH2d.js → chunk-TZMSLE5B-Ch4jqMvo.js} +1 -1
- package/dist/{classDiagram-3BZAVTQC-BOmQDPcS.cjs → classDiagram-KNZD7YFC-BoArhhwm.cjs} +1 -1
- package/dist/{classDiagram-v2-QTMF73CY-CAtFVXFw.js → classDiagram-KNZD7YFC-CDc6SE_W.js} +2 -2
- package/dist/{classDiagram-v2-QTMF73CY-BOmQDPcS.cjs → classDiagram-v2-RKCZMP56-BoArhhwm.cjs} +1 -1
- package/dist/{classDiagram-3BZAVTQC-CAtFVXFw.js → classDiagram-v2-RKCZMP56-CDc6SE_W.js} +2 -2
- package/dist/{clone-B-bAOLls.js → clone-CP0dShvp.js} +1 -1
- package/dist/clone-DxIwbnXb.cjs +1 -0
- package/dist/cose-bilkent-S5V4N54A-Bx4ACTR3.js +2608 -0
- package/dist/cose-bilkent-S5V4N54A-DLiy4Dys.cjs +1 -0
- package/dist/{dagre-2BBEFEWP-CLTO8d-K.js → dagre-5GWH7T2D-B_9p1wnG.js} +108 -108
- package/dist/{dagre-2BBEFEWP-BCS301Dq.cjs → dagre-5GWH7T2D-XNzFQlw3.cjs} +1 -1
- package/dist/{diagram-4IRLE6MV-_WYVJBfL.cjs → diagram-N5W7TBWH-CELy5R0I.cjs} +2 -2
- package/dist/{diagram-4IRLE6MV-Cz4wPwXi.js → diagram-N5W7TBWH-DgzCbhxK.js} +23 -23
- package/dist/{diagram-RP2FKANI-C_dWK3j7.cjs → diagram-QEK2KX5R-CWUJhJRb.cjs} +4 -4
- package/dist/{diagram-RP2FKANI-CXmRNmBu.js → diagram-QEK2KX5R-DDJzGT4e.js} +15 -15
- package/dist/{diagram-GUPCWM2R-CH-4x3WD.js → diagram-S2PKOQOG-CGS6jThV.js} +10 -10
- package/dist/{diagram-GUPCWM2R-O4fOIHyx.cjs → diagram-S2PKOQOG-CxivHA5Z.cjs} +1 -1
- package/dist/{erDiagram-HZWUO2LU-uRisj4mV.cjs → erDiagram-AWTI2OKA-Bm9UKu4a.cjs} +4 -4
- package/dist/{erDiagram-HZWUO2LU-Dqt1BE2C.js → erDiagram-AWTI2OKA-uK37swgK.js} +4 -4
- package/dist/{flowDiagram-THRYKUMA-bRWo210y.cjs → flowDiagram-PVAE7QVJ-BoifHLur.cjs} +7 -7
- package/dist/{flowDiagram-THRYKUMA-C-r5MZds.js → flowDiagram-PVAE7QVJ-CseXgbf4.js} +5 -5
- package/dist/{ganttDiagram-WV7ZQ7D5-BVe9Yi12.js → ganttDiagram-OWAHRB6G-DBcQE30n.js} +57 -57
- package/dist/{ganttDiagram-WV7ZQ7D5-Dh9UR52T.cjs → ganttDiagram-OWAHRB6G-DxrVdbSN.cjs} +1 -1
- package/dist/{gitGraph-ZV4HHKMB-rHh_4sTF.cjs → gitGraph-ZV4HHKMB--W5fvjOe.cjs} +1 -1
- package/dist/{gitGraph-ZV4HHKMB-Bwp8pNLp.js → gitGraph-ZV4HHKMB-DI7K1S9a.js} +1 -1
- package/dist/{gitGraphDiagram-OJR772UL-Bq60AaCq.cjs → gitGraphDiagram-NY62KEGX-C8IAHC2w.cjs} +4 -4
- package/dist/{gitGraphDiagram-OJR772UL-BNm74Q9n.js → gitGraphDiagram-NY62KEGX-_dzUqzP_.js} +4 -4
- package/dist/{graph-CMnK4YO3.js → graph-BoeGwTWO.js} +4 -4
- package/dist/{graph-BrGj_Gfv.cjs → graph-v1PSEGdd.cjs} +1 -1
- package/dist/index-CdZgX2Ma.cjs +301 -0
- package/dist/{index-VJw3klPt.js → index-kj0EuvQM.js} +10116 -9505
- package/dist/{info-63CPKGFF-0H7FGkBP.cjs → info-63CPKGFF-DExJutq3.cjs} +1 -1
- package/dist/info-63CPKGFF-_OKf26EF.js +5 -0
- package/dist/{infoDiagram-DDUCL6P7-Cf77NdxY.js → infoDiagram-STP46IZ2-BybsRpjy.js} +2 -2
- package/dist/{infoDiagram-DDUCL6P7-DjqD8eRi.cjs → infoDiagram-STP46IZ2-ylOwUZka.cjs} +1 -1
- package/dist/{journeyDiagram-FFXJYRFH-DtxrMVYZ.cjs → journeyDiagram-BIP6EPQ6-B8QfAOqB.cjs} +4 -4
- package/dist/{journeyDiagram-FFXJYRFH-C7_bJR3c.js → journeyDiagram-BIP6EPQ6-aD-qICsN.js} +4 -4
- package/dist/{kanban-definition-KOZQBZVT-Bo9dRDl_.js → kanban-definition-6OIFK2YF-C0EFe9JN.js} +24 -24
- package/dist/{kanban-definition-KOZQBZVT-Bel-f3_i.cjs → kanban-definition-6OIFK2YF-Dxddoy_3.cjs} +5 -5
- package/dist/ketchup2.cjs.js +1 -1
- package/dist/ketchup2.es.js +9 -9
- package/dist/{layout-Bt4IJcSa.cjs → layout-CwMglWfT.cjs} +1 -1
- package/dist/{layout-kUC11kUc.js → layout-D6agY5Ds.js} +32 -32
- package/dist/{linear-BDcEY_LY.js → linear-CHZKZE-6.js} +12 -12
- package/dist/{linear-50cMYwZQ.cjs → linear-zcj9uSLT.cjs} +1 -1
- package/dist/{mermaid-parser.core-Bxkmx2-5.cjs → mermaid-parser.core-BFoNlVio.cjs} +2 -2
- package/dist/{mermaid-parser.core-BnvQOoyE.js → mermaid-parser.core-Blpz4SbD.js} +11 -11
- package/dist/mindmap-definition-Q6HEUPPD-BdQ8h5vs.js +755 -0
- package/dist/mindmap-definition-Q6HEUPPD-low7Mewd.cjs +68 -0
- package/dist/{packet-HUATNLJX-6TXP1bqK.cjs → packet-HUATNLJX-BmvldEFD.cjs} +1 -1
- package/dist/{packet-HUATNLJX-DaHhWwAU.js → packet-HUATNLJX-TyfgX3j3.js} +1 -1
- package/dist/{pie-WTHONI2E-AzeewyiY.cjs → pie-WTHONI2E-BltdTNxf.cjs} +1 -1
- package/dist/pie-WTHONI2E-Dt2hdV7w.js +5 -0
- package/dist/{pieDiagram-DBDJKBY4-W8GACAWO.cjs → pieDiagram-ADFJNKIX-CzvxfXwl.cjs} +3 -3
- package/dist/{pieDiagram-DBDJKBY4-DBzbWAu9.js → pieDiagram-ADFJNKIX-ExzVUSNO.js} +25 -25
- package/dist/{quadrantDiagram-YPSRARAO-BjYPzvUJ.cjs → quadrantDiagram-LMRXKWRM-Bi7EaXZ7.cjs} +1 -1
- package/dist/{quadrantDiagram-YPSRARAO-mnX6YljL.js → quadrantDiagram-LMRXKWRM-DqMz0iQn.js} +2 -2
- package/dist/radar-NJJJXTRR-BWXgZsQ6.js +5 -0
- package/dist/{radar-NJJJXTRR-BocemfZ8.cjs → radar-NJJJXTRR-DduW7l7R.cjs} +1 -1
- package/dist/{requirementDiagram-EGVEC5DT-B9Bwf2ay.js → requirementDiagram-4UW4RH46-DykQlAiG.js} +3 -3
- package/dist/{requirementDiagram-EGVEC5DT-Bimu3sL7.cjs → requirementDiagram-4UW4RH46-ud4W-Zp9.cjs} +4 -4
- package/dist/{sankeyDiagram-HRAUVNP4-DJiyVYTm.cjs → sankeyDiagram-GR3RE2ED-CUj9_a8o.cjs} +1 -1
- package/dist/{sankeyDiagram-HRAUVNP4-DzXnX0Ga.js → sankeyDiagram-GR3RE2ED-RK19iv1u.js} +1 -1
- package/dist/sequenceDiagram-C3RYC4MD-BuBk17RB.js +2511 -0
- package/dist/sequenceDiagram-C3RYC4MD-CcM-9wjX.cjs +145 -0
- package/dist/{stateDiagram-UUKSUZ4H-BfB7OKY5.js → stateDiagram-KXAO66HF-C_vpiwWi.js} +4 -4
- package/dist/{stateDiagram-UUKSUZ4H-DNsbUQC8.cjs → stateDiagram-KXAO66HF-leA_Ugq1.cjs} +1 -1
- package/dist/{stateDiagram-v2-EYPG3UTE-k2P5SO6h.cjs → stateDiagram-v2-UMBNRL4Z-DMn1PJJZ.cjs} +1 -1
- package/dist/{stateDiagram-v2-EYPG3UTE-CrbgZXhp.js → stateDiagram-v2-UMBNRL4Z-krzWPwwC.js} +2 -2
- package/dist/{timeline-definition-3HZDQTIS-TVmN8Z80.js → timeline-definition-XQNQX7LJ-CbPKkQDk.js} +2 -2
- package/dist/{timeline-definition-3HZDQTIS-CJz-ObCi.cjs → timeline-definition-XQNQX7LJ-DbVINiOM.cjs} +1 -1
- package/dist/{treemap-75Q7IDZK-CbpJhl6F.js → treemap-75Q7IDZK-CRSsbp2b.js} +1 -1
- package/dist/{treemap-75Q7IDZK-MVFNLG-W.cjs → treemap-75Q7IDZK-CcdS7WCH.cjs} +1 -1
- package/dist/{xychartDiagram-FDP5SA34-kb-QmiwQ.cjs → xychartDiagram-6GGTOJPD-8fzwt7BJ.cjs} +1 -1
- package/dist/{xychartDiagram-FDP5SA34-QzZvVH2o.js → xychartDiagram-6GGTOJPD-CGq5lmkW.js} +2 -2
- package/package.json +13 -13
- package/dist/channel-D7-lFnTD.js +0 -5
- package/dist/channel-DveM5GOL.cjs +0 -1
- package/dist/chunk-JBRWN2VN-4oDxplqY.cjs +0 -165
- package/dist/clone-C0dQSPFZ.cjs +0 -1
- package/dist/index-BA07EijG.cjs +0 -266
- package/dist/info-63CPKGFF-CV7HrEKO.js +0 -5
- package/dist/mindmap-definition-LNHGMQRG-CVh0vQd5.js +0 -3230
- package/dist/mindmap-definition-LNHGMQRG-qQmqPKl8.cjs +0 -95
- package/dist/pie-WTHONI2E-Cq9zrqsG.js +0 -5
- package/dist/radar-NJJJXTRR-Yz9jsEDT.js +0 -5
- package/dist/sequenceDiagram-4MX5Z3NR-DHUCnBgG.cjs +0 -122
- package/dist/sequenceDiagram-4MX5Z3NR-DuaMVfG7.js +0 -2281
|
@@ -1,9 +1,9 @@
|
|
|
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-
|
|
1
|
+
import { _ as w, at as F, au as Y, av as _, aw as H, l as i, c as V, ax as z, ay as U, ai as $, an as q, aj as P, ah as K, az as Q, aA as W, aB as Z } from "./index-kj0EuvQM.js";
|
|
2
|
+
import { G as B } from "./graph-BoeGwTWO.js";
|
|
3
|
+
import { l as I } from "./layout-D6agY5Ds.js";
|
|
4
|
+
import { i as b } from "./_baseUniq-CQt2p9Xf.js";
|
|
5
|
+
import { c as L } from "./clone-CP0dShvp.js";
|
|
6
|
+
import { m as A } from "./_basePickBy-CnPX6Bdb.js";
|
|
7
7
|
function h(e) {
|
|
8
8
|
var t = {
|
|
9
9
|
options: {
|
|
@@ -18,8 +18,8 @@ function h(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), r = { v: t };
|
|
22
|
+
return b(n) || (r.value = n), b(a) || (r.parent = a), r;
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
function ne(e) {
|
|
@@ -32,12 +32,12 @@ var d = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
32
32
|
y.clear(), J.clear(), d.clear();
|
|
33
33
|
}, "clear"), D = /* @__PURE__ */ w((e, t) => {
|
|
34
34
|
const n = y.get(t) || [];
|
|
35
|
-
return
|
|
35
|
+
return i.trace("In isDescendant", t, " ", e, " = ", n.includes(e)), n.includes(e);
|
|
36
36
|
}, "isDescendant"), se = /* @__PURE__ */ w((e, t) => {
|
|
37
37
|
const n = y.get(t) || [];
|
|
38
|
-
return
|
|
38
|
+
return i.info("Descendants of ", t, " is ", n), i.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) : (i.debug("Tilt, ", t, ",not in descendants"), !1);
|
|
39
39
|
}, "edgeInCluster"), G = /* @__PURE__ */ w((e, t, n, a) => {
|
|
40
|
-
|
|
40
|
+
i.warn(
|
|
41
41
|
"Copying children of ",
|
|
42
42
|
e,
|
|
43
43
|
"root",
|
|
@@ -46,13 +46,13 @@ var d = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
46
46
|
t.node(e),
|
|
47
47
|
a
|
|
48
48
|
);
|
|
49
|
-
const
|
|
50
|
-
e !== a &&
|
|
49
|
+
const r = t.children(e) || [];
|
|
50
|
+
e !== a && r.push(e), i.warn("Copying (nodes) clusterId", e, "nodes", r), r.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
|
+
i.info("cp ", o, " to ", a, " with parent ", e), n.setNode(o, l), a !== t.parent(o) && (i.warn("Setting parent", o, t.parent(o)), n.setParent(o, t.parent(o))), e !== a && o !== e ? (i.debug("Setting parent", o, e), n.setParent(o, e)) : (i.info("In copy ", e, "root", a, "data", t.node(e), a), i.debug(
|
|
56
56
|
"Not Setting parent for node=",
|
|
57
57
|
o,
|
|
58
58
|
"cluster!==rootId",
|
|
@@ -61,12 +61,12 @@ var d = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
61
61
|
o !== e
|
|
62
62
|
));
|
|
63
63
|
const u = t.edges(o);
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
i.debug("Copying Edges", u), u.forEach((c) => {
|
|
65
|
+
i.info("Edge", c);
|
|
66
66
|
const m = t.edge(c.v, c.w, c.name);
|
|
67
|
-
|
|
67
|
+
i.info("Edge data", m, a);
|
|
68
68
|
try {
|
|
69
|
-
se(c, a) ? (
|
|
69
|
+
se(c, a) ? (i.info("Copying as ", c.v, c.w, m, c.name), n.setEdge(c.v, c.w, m, c.name), i.info("newGraph edges ", n.edges(), n.edge(n.edges()[0]))) : i.info(
|
|
70
70
|
"Skipping copy of edge ",
|
|
71
71
|
c.v,
|
|
72
72
|
"-->",
|
|
@@ -77,64 +77,64 @@ var d = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
77
77
|
e
|
|
78
78
|
);
|
|
79
79
|
} catch (v) {
|
|
80
|
-
|
|
80
|
+
i.error(v);
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
|
|
84
|
+
i.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 r of n)
|
|
90
|
+
J.set(r, e), a = [...a, ...R(r, t)];
|
|
91
91
|
return a;
|
|
92
|
-
}, "extractDescendants"),
|
|
93
|
-
const a = e.edges().filter((c) => c.v === t || c.w === t),
|
|
92
|
+
}, "extractDescendants"), ie = /* @__PURE__ */ w((e, t, n) => {
|
|
93
|
+
const a = e.edges().filter((c) => c.v === t || c.w === t), r = 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 = r.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 (i.trace("Searching children of id ", e, a), a.length < 1)
|
|
98
98
|
return e;
|
|
99
|
-
let
|
|
99
|
+
let r;
|
|
100
100
|
for (const o of a) {
|
|
101
|
-
const l = C(o, t, n), u =
|
|
101
|
+
const l = C(o, t, n), u = ie(t, n, l);
|
|
102
102
|
if (l)
|
|
103
103
|
if (u.length > 0)
|
|
104
|
-
|
|
104
|
+
r = 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 r;
|
|
109
|
+
}, "findNonClusterChild"), k = /* @__PURE__ */ w((e) => !d.has(e) || !d.get(e).externalConnections ? e : d.has(e) ? d.get(e).id : e, "getAnchorId"), re = /* @__PURE__ */ w((e, t) => {
|
|
110
110
|
if (!e || t > 10) {
|
|
111
|
-
|
|
111
|
+
i.debug("Opting out, no graph ");
|
|
112
112
|
return;
|
|
113
113
|
} else
|
|
114
|
-
|
|
114
|
+
i.debug("Opting in, graph ");
|
|
115
115
|
e.nodes().forEach(function(n) {
|
|
116
|
-
e.children(n).length > 0 && (
|
|
116
|
+
e.children(n).length > 0 && (i.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), r = e.edges();
|
|
124
|
+
a.length > 0 ? (i.debug("Cluster identified", n, y), r.forEach((o) => {
|
|
125
125
|
const l = D(o.v, n), u = D(o.w, n);
|
|
126
|
-
l ^ u && (
|
|
127
|
-
})) :
|
|
126
|
+
l ^ u && (i.warn("Edge: ", o, " leaves cluster ", n), i.warn("Descendants of XXX ", n, ": ", y.get(n)), d.get(n).externalConnections = !0);
|
|
127
|
+
})) : i.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, r = e.parent(a);
|
|
131
|
+
r !== n && d.has(r) && !d.get(r).externalConnections && (d.get(n).id = r);
|
|
132
132
|
}
|
|
133
133
|
e.edges().forEach(function(n) {
|
|
134
134
|
const a = e.edge(n);
|
|
135
|
-
|
|
136
|
-
let
|
|
137
|
-
if (
|
|
135
|
+
i.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(n)), i.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(e.edge(n)));
|
|
136
|
+
let r = n.v, o = n.w;
|
|
137
|
+
if (i.warn(
|
|
138
138
|
"Fix XXX",
|
|
139
139
|
d,
|
|
140
140
|
"ids:",
|
|
@@ -145,53 +145,53 @@ var d = /* @__PURE__ */ new Map(), y = /* @__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 (i.warn("Fixing and trying - removing XXX", n.v, n.w, n.name), r = k(n.v), o = k(n.w), e.removeEdge(n.v, n.w, n.name), r !== n.v) {
|
|
149
|
+
const l = e.parent(r);
|
|
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
|
+
i.warn("Fix Replacing with XXX", r, o, n.name), e.setEdge(r, o, a, n.name);
|
|
157
157
|
}
|
|
158
|
-
}),
|
|
158
|
+
}), i.warn("Adjusted Graph", h(e)), T(e, 0), i.trace(d);
|
|
159
159
|
}, "adjustClustersAndEdges"), T = /* @__PURE__ */ w((e, t) => {
|
|
160
|
-
if (
|
|
161
|
-
|
|
160
|
+
if (i.warn("extractor - ", t, h(e), e.children("D")), t > 10) {
|
|
161
|
+
i.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 r of n) {
|
|
166
|
+
const o = e.children(r);
|
|
167
167
|
a = a || o.length > 0;
|
|
168
168
|
}
|
|
169
169
|
if (!a) {
|
|
170
|
-
|
|
170
|
+
i.debug("Done, no node has children", e.nodes());
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
|
-
|
|
174
|
-
for (const
|
|
175
|
-
if (
|
|
173
|
+
i.debug("Nodes = ", n, t);
|
|
174
|
+
for (const r of n)
|
|
175
|
+
if (i.debug(
|
|
176
176
|
"Extracting node",
|
|
177
|
-
|
|
177
|
+
r,
|
|
178
178
|
d,
|
|
179
|
-
d.has(
|
|
180
|
-
!e.parent(
|
|
181
|
-
e.node(
|
|
179
|
+
d.has(r) && !d.get(r).externalConnections,
|
|
180
|
+
!e.parent(r),
|
|
181
|
+
e.node(r),
|
|
182
182
|
e.children("D"),
|
|
183
183
|
" Depth ",
|
|
184
184
|
t
|
|
185
|
-
), !d.has(
|
|
186
|
-
|
|
187
|
-
else if (!d.get(
|
|
188
|
-
|
|
185
|
+
), !d.has(r))
|
|
186
|
+
i.debug("Not a cluster", r, t);
|
|
187
|
+
else if (!d.get(r).externalConnections && e.children(r) && e.children(r).length > 0) {
|
|
188
|
+
i.warn(
|
|
189
189
|
"Cluster without external connections, without a parent and with children",
|
|
190
|
-
|
|
190
|
+
r,
|
|
191
191
|
t
|
|
192
192
|
);
|
|
193
193
|
let l = e.graph().rankdir === "TB" ? "LR" : "TB";
|
|
194
|
-
d.get(
|
|
194
|
+
d.get(r)?.clusterData?.dir && (l = d.get(r).clusterData.dir, i.warn("Fixing dir", d.get(r).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(), y = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
204
204
|
}).setDefaultEdgeLabel(function() {
|
|
205
205
|
return {};
|
|
206
206
|
});
|
|
207
|
-
|
|
207
|
+
i.warn("Old graph before copy", h(e)), G(r, e, u, r), e.setNode(r, {
|
|
208
208
|
clusterNode: !0,
|
|
209
|
-
id:
|
|
210
|
-
clusterData: d.get(
|
|
211
|
-
label: d.get(
|
|
209
|
+
id: r,
|
|
210
|
+
clusterData: d.get(r).clusterData,
|
|
211
|
+
label: d.get(r).label,
|
|
212
212
|
graph: u
|
|
213
|
-
}),
|
|
213
|
+
}), i.warn("New graph after copy node: (", r, ")", h(u)), i.debug("Old graph after copy", h(e));
|
|
214
214
|
} else
|
|
215
|
-
|
|
215
|
+
i.warn(
|
|
216
216
|
"Cluster ** ",
|
|
217
|
-
|
|
217
|
+
r,
|
|
218
218
|
" **not meeting the criteria !externalConnections:",
|
|
219
|
-
!d.get(
|
|
219
|
+
!d.get(r).externalConnections,
|
|
220
220
|
" no parent: ",
|
|
221
|
-
!e.parent(
|
|
221
|
+
!e.parent(r),
|
|
222
222
|
" children ",
|
|
223
|
-
e.children(
|
|
223
|
+
e.children(r) && e.children(r).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
|
+
), i.debug(d);
|
|
227
|
+
n = e.nodes(), i.warn("New list of nodes", n);
|
|
228
|
+
for (const r of n) {
|
|
229
|
+
const o = e.node(r);
|
|
230
|
+
i.warn(" Now next level", r, 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 r = e.children(a), o = M(e, r);
|
|
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, r, o) => {
|
|
241
|
+
i.warn("Graph in recursive render:XAX", h(t), r);
|
|
242
242
|
const l = t.graph().rankdir;
|
|
243
|
-
|
|
243
|
+
i.trace("Dir in recursive render - dir:", l);
|
|
244
244
|
const u = e.insert("g").attr("class", "root");
|
|
245
|
-
t.nodes() ?
|
|
245
|
+
t.nodes() ? i.info("Recursive render XXX", t.nodes()) : i.info("No nodes found for", t), t.edges().length > 0 && i.info("Recursive edges", t.edge(t.edges()[0]));
|
|
246
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 (r !== void 0) {
|
|
251
|
+
const g = JSON.parse(JSON.stringify(r.clusterData));
|
|
252
|
+
i.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(), y = /* @__PURE__ */ new Map(), J = /* @__PURE
|
|
|
258
258
|
g.height,
|
|
259
259
|
`
|
|
260
260
|
Parent cluster`,
|
|
261
|
-
|
|
262
|
-
), t.setNode(
|
|
261
|
+
r.height
|
|
262
|
+
), t.setNode(r.id, g), t.parent(f) || (i.trace("Setting parent", f, r.id), t.setParent(f, r.id, g));
|
|
263
263
|
}
|
|
264
|
-
if (
|
|
265
|
-
|
|
264
|
+
if (i.info("(Insert) Node XXX" + f + ": " + JSON.stringify(t.node(f))), s?.clusterNode) {
|
|
265
|
+
i.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, i.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 ? (i.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
|
+
), i.trace(C(s.id, t)), d.set(s.id, { id: C(s.id, t), node: s })) : (i.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
|
+
i.info("Edge " + s.v + " -> " + s.w + ": " + JSON.stringify(s)), i.info("Edge " + s.v + " -> " + s.w + ": ", s, " ", JSON.stringify(t.edge(s))), i.info(
|
|
306
306
|
"Fix",
|
|
307
307
|
d,
|
|
308
308
|
"ids:",
|
|
@@ -314,12 +314,12 @@ Parent cluster`,
|
|
|
314
314
|
), await Z(v, g);
|
|
315
315
|
});
|
|
316
316
|
await Promise.all(f);
|
|
317
|
-
}, "processEdges"))(),
|
|
317
|
+
}, "processEdges"))(), i.info("Graph before layout:", JSON.stringify(h(t))), i.info("############################################# XXX"), i.info("### Layout ### XXX"), i.info("############################################# XXX"), I(t), i.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 (i.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, i.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
|
+
i.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
|
+
i.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, i.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
|
+
i.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
|
+
i.info(f, s.type, s.diff), s.isGroup && (O = s.diff);
|
|
383
|
+
}), i.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
|
+
}), i.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, {
|
|
@@ -428,15 +428,15 @@ Parent cluster`,
|
|
|
428
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
|
+
}), i.warn("Graph at first:", JSON.stringify(h(n))), re(n), i.warn("Graph after XAX:", JSON.stringify(h(n)));
|
|
432
|
+
const r = 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
|
+
r
|
|
440
440
|
);
|
|
441
441
|
}, "render");
|
|
442
442
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CdZgX2Ma.cjs"),P=require("./graph-v1PSEGdd.cjs"),R=require("./layout-CwMglWfT.cjs"),N=require("./_baseUniq-bHS4L6X9.cjs"),M=require("./clone-DxIwbnXb.cjs"),O=require("./_basePickBy-Ca1ngxe-.cjs");function m(e){var o={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:q(e),edges:j(e)};return N.isUndefined(e.graph())||(o.value=M.clone(e.graph())),o}function q(e){return O.map(e.nodes(),function(o){var n=e.node(o),l=e.parent(o),r={v:o};return N.isUndefined(n)||(r.value=n),N.isUndefined(l)||(r.parent=l),r})}function j(e){return O.map(e.edges(),function(o){var n=e.edge(o),l={v:o.v,w:o.w};return N.isUndefined(o.name)||(l.name=o.name),N.isUndefined(n)||(l.value=n),l})}var a=new Map,y=new Map,k=new Map,U=t.__name(()=>{y.clear(),k.clear(),a.clear()},"clear"),_=t.__name((e,o)=>{const n=y.get(o)||[];return t.log.trace("In isDescendant",o," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),F=t.__name((e,o)=>{const n=y.get(o)||[];return t.log.info("Descendants of ",o," is ",n),t.log.info("Edge is ",e),e.v===o||e.w===o?!1:n?n.includes(e.v)||_(e.v,o)||_(e.w,o)||n.includes(e.w):(t.log.debug("Tilt, ",o,",not in descendants"),!1)},"edgeInCluster"),B=t.__name((e,o,n,l)=>{t.log.warn("Copying children of ",e,"root",l,"data",o.node(e),l);const r=o.children(e)||[];e!==l&&r.push(e),t.log.warn("Copying (nodes) clusterId",e,"nodes",r),r.forEach(s=>{if(o.children(s).length>0)B(s,o,n,l);else{const d=o.node(s);t.log.info("cp ",s," to ",l," with parent ",e),n.setNode(s,d),l!==o.parent(s)&&(t.log.warn("Setting parent",s,o.parent(s)),n.setParent(s,o.parent(s))),e!==l&&s!==e?(t.log.debug("Setting parent",s,e),n.setParent(s,e)):(t.log.info("In copy ",e,"root",l,"data",o.node(e),l),t.log.debug("Not Setting parent for node=",s,"cluster!==rootId",e!==l,"node!==clusterId",s!==e));const g=o.edges(s);t.log.debug("Copying Edges",g),g.forEach(c=>{t.log.info("Edge",c);const w=o.edge(c.v,c.w,c.name);t.log.info("Edge data",w,l);try{F(c,l)?(t.log.info("Copying as ",c.v,c.w,w,c.name),n.setEdge(c.v,c.w,w,c.name),t.log.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):t.log.info("Skipping copy of edge ",c.v,"-->",c.w," rootId: ",l," clusterId:",e)}catch(h){t.log.error(h)}})}t.log.debug("Removing node",s),o.removeNode(s)})},"copy"),A=t.__name((e,o)=>{const n=o.children(e);let l=[...n];for(const r of n)k.set(r,e),l=[...l,...A(r,o)];return l},"extractDescendants"),Y=t.__name((e,o,n)=>{const l=e.edges().filter(c=>c.v===o||c.w===o),r=e.edges().filter(c=>c.v===n||c.w===n),s=l.map(c=>({v:c.v===o?n:c.v,w:c.w===o?o:c.w})),d=r.map(c=>({v:c.v,w:c.w}));return s.filter(c=>d.some(w=>c.v===w.v&&c.w===w.w))},"findCommonEdges"),b=t.__name((e,o,n)=>{const l=o.children(e);if(t.log.trace("Searching children of id ",e,l),l.length<1)return e;let r;for(const s of l){const d=b(s,o,n),g=Y(o,n,d);if(d)if(g.length>0)r=d;else return d}return r},"findNonClusterChild"),D=t.__name(e=>!a.has(e)||!a.get(e).externalConnections?e:a.has(e)?a.get(e).id:e,"getAnchorId"),H=t.__name((e,o)=>{if(!e||o>10){t.log.debug("Opting out, no graph ");return}else t.log.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(t.log.warn("Cluster identified",n," Replacement id in edges: ",b(n,e,n)),y.set(n,A(n,e)),a.set(n,{id:b(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const l=e.children(n),r=e.edges();l.length>0?(t.log.debug("Cluster identified",n,y),r.forEach(s=>{const d=_(s.v,n),g=_(s.w,n);d^g&&(t.log.warn("Edge: ",s," leaves cluster ",n),t.log.warn("Descendants of XXX ",n,": ",y.get(n)),a.get(n).externalConnections=!0)})):t.log.debug("Not a cluster ",n,y)});for(let n of a.keys()){const l=a.get(n).id,r=e.parent(l);r!==n&&a.has(r)&&!a.get(r).externalConnections&&(a.get(n).id=r)}e.edges().forEach(function(n){const l=e.edge(n);t.log.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),t.log.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let r=n.v,s=n.w;if(t.log.warn("Fix XXX",a,"ids:",n.v,n.w,"Translating: ",a.get(n.v)," --- ",a.get(n.w)),a.get(n.v)||a.get(n.w)){if(t.log.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),r=D(n.v),s=D(n.w),e.removeEdge(n.v,n.w,n.name),r!==n.v){const d=e.parent(r);a.get(d).externalConnections=!0,l.fromCluster=n.v}if(s!==n.w){const d=e.parent(s);a.get(d).externalConnections=!0,l.toCluster=n.w}t.log.warn("Fix Replacing with XXX",r,s,n.name),e.setEdge(r,s,l,n.name)}}),t.log.warn("Adjusted Graph",m(e)),J(e,0),t.log.trace(a)},"adjustClustersAndEdges"),J=t.__name((e,o)=>{if(t.log.warn("extractor - ",o,m(e),e.children("D")),o>10){t.log.error("Bailing out");return}let n=e.nodes(),l=!1;for(const r of n){const s=e.children(r);l=l||s.length>0}if(!l){t.log.debug("Done, no node has children",e.nodes());return}t.log.debug("Nodes = ",n,o);for(const r of n)if(t.log.debug("Extracting node",r,a,a.has(r)&&!a.get(r).externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",o),!a.has(r))t.log.debug("Not a cluster",r,o);else if(!a.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){t.log.warn("Cluster without external connections, without a parent and with children",r,o);let d=e.graph().rankdir==="TB"?"LR":"TB";a.get(r)?.clusterData?.dir&&(d=a.get(r).clusterData.dir,t.log.warn("Fixing dir",a.get(r).clusterData.dir,d));const g=new P.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:d,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});t.log.warn("Old graph before copy",m(e)),B(r,e,g,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:a.get(r).clusterData,label:a.get(r).label,graph:g}),t.log.warn("New graph after copy node: (",r,")",m(g)),t.log.debug("Old graph after copy",m(e))}else t.log.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!a.get(r).externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),o),t.log.debug(a);n=e.nodes(),t.log.warn("New list of nodes",n);for(const r of n){const s=e.node(r);t.log.warn(" Now next level",r,s),s?.clusterNode&&J(s.graph,o+1)}},"extractor"),T=t.__name((e,o)=>{if(o.length===0)return[];let n=Object.assign([],o);return o.forEach(l=>{const r=e.children(l),s=T(e,r);n=[...n,...s]}),n},"sorter"),V=t.__name(e=>T(e,e.children()),"sortNodesByHierarchy"),G=t.__name(async(e,o,n,l,r,s)=>{t.log.warn("Graph in recursive render:XAX",m(o),r);const d=o.graph().rankdir;t.log.trace("Dir in recursive render - dir:",d);const g=e.insert("g").attr("class","root");o.nodes()?t.log.info("Recursive render XXX",o.nodes()):t.log.info("No nodes found for",o),o.edges().length>0&&t.log.info("Recursive edges",o.edge(o.edges()[0]));const c=g.insert("g").attr("class","clusters"),w=g.insert("g").attr("class","edgePaths"),h=g.insert("g").attr("class","edgeLabels"),v=g.insert("g").attr("class","nodes");await Promise.all(o.nodes().map(async function(f){const i=o.node(f);if(r!==void 0){const u=JSON.parse(JSON.stringify(r.clusterData));t.log.trace(`Setting data for parent cluster XXX
|
|
2
2
|
Node.id = `,f,`
|
|
3
3
|
data=`,u.height,`
|
|
4
4
|
Parent cluster`,r.height),o.setNode(r.id,u),o.parent(f)||(t.log.trace("Setting parent",f,r.id),o.setParent(f,r.id,u))}if(t.log.info("(Insert) Node XXX"+f+": "+JSON.stringify(o.node(f))),i?.clusterNode){t.log.info("Cluster identified XBX",f,i.width,o.node(f));const{ranksep:u,nodesep:E}=o.graph();i.graph.setGraph({...i.graph.graph(),ranksep:u+25,nodesep:E});const p=await G(v,i.graph,n,l,o.node(f),s),S=p.elem;t.updateNodeBounds(i,S),i.diff=p.diff||0,t.log.info("New compound node after recursive render XAX",f,"width",i.width,"height",i.height),t.setNodeElem(S,i)}else o.children(f).length>0?(t.log.trace("Cluster - the non recursive path XBX",f,i.id,i,i.width,"Graph:",o),t.log.trace(b(i.id,o)),a.set(i.id,{id:b(i.id,o),node:i})):(t.log.trace("Node - the non recursive path XAX",f,v,o.node(f),d),await t.insertNode(v,o.node(f),{config:s,dir:d}))})),await t.__name(async()=>{const f=o.edges().map(async function(i){const u=o.edge(i.v,i.w,i.name);t.log.info("Edge "+i.v+" -> "+i.w+": "+JSON.stringify(i)),t.log.info("Edge "+i.v+" -> "+i.w+": ",i," ",JSON.stringify(o.edge(i))),t.log.info("Fix",a,"ids:",i.v,i.w,"Translating: ",a.get(i.v),a.get(i.w)),await t.insertEdgeLabel(h,u)});await Promise.all(f)},"processEdges")(),t.log.info("Graph before layout:",JSON.stringify(m(o))),t.log.info("############################################# XXX"),t.log.info("### Layout ### XXX"),t.log.info("############################################# XXX"),R.layout(o),t.log.info("Graph after layout:",JSON.stringify(m(o)));let x=0,{subGraphTitleTotalMargin:C}=t.getSubGraphTitleMargins(s);return await Promise.all(V(o).map(async function(f){const i=o.node(f);if(t.log.info("Position XBX => "+f+": ("+i.x,","+i.y,") width: ",i.width," height: ",i.height),i?.clusterNode)i.y+=C,t.log.info("A tainted cluster node XBX1",f,i.id,i.width,i.height,i.x,i.y,o.parent(f)),a.get(i.id).node=i,t.positionNode(i);else if(o.children(f).length>0){t.log.info("A pure cluster node XBX1",f,i.id,i.x,i.y,i.width,i.height,o.parent(f)),i.height+=C,o.node(i.parentId);const u=i?.padding/2||0,E=i?.labelBBox?.height||0,p=E-u||0;t.log.debug("OffsetY",p,"labelHeight",E,"halfPadding",u),await t.insertCluster(c,i),a.get(i.id).node=i}else{const u=o.node(i.parentId);i.y+=C/2,t.log.info("A regular node XBX1 - using the padding",i.id,"parent",i.parentId,i.width,i.height,i.x,i.y,"offsetY",i.offsetY,"parent",u,u?.offsetY,i),t.positionNode(i)}})),o.edges().forEach(function(f){const i=o.edge(f);t.log.info("Edge "+f.v+" -> "+f.w+": "+JSON.stringify(i),i),i.points.forEach(S=>S.y+=C/2);const u=o.node(f.v);var E=o.node(f.w);const p=t.insertEdge(w,i,a,n,u,E,l);t.positionEdgeLabel(i,p)}),o.nodes().forEach(function(f){const i=o.node(f);t.log.info(f,i.type,i.diff),i.isGroup&&(x=i.diff)}),t.log.warn("Returning from recursive render XAX",g,x),{elem:g,diff:x}},"recursiveRender"),z=t.__name(async(e,o)=>{const n=new P.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),l=o.select("g");t.markers_default(l,e.markers,e.type,e.diagramId),t.clear2(),t.clear$1(),t.clear$2(),U(),e.nodes.forEach(s=>{n.setNode(s.id,{...s}),s.parentId&&n.setParent(s.id,s.parentId)}),t.log.debug("Edges:",e.edges),e.edges.forEach(s=>{if(s.start===s.end){const d=s.start,g=d+"---"+d+"---1",c=d+"---"+d+"---2",w=n.node(d);n.setNode(g,{domId:g,id:g,parentId:w.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(g,w.parentId),n.setNode(c,{domId:c,id:c,parentId:w.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(c,w.parentId);const h=structuredClone(s),v=structuredClone(s),X=structuredClone(s);h.label="",h.arrowTypeEnd="none",h.id=d+"-cyclic-special-1",v.arrowTypeStart="none",v.arrowTypeEnd="none",v.id=d+"-cyclic-special-mid",X.label="",w.isGroup&&(h.fromCluster=d,X.toCluster=d),X.id=d+"-cyclic-special-2",X.arrowTypeStart="none",n.setEdge(d,g,h,d+"-cyclic-special-0"),n.setEdge(g,c,v,d+"-cyclic-special-1"),n.setEdge(c,d,X,d+"-cyc<lic-special-2")}else n.setEdge(s.start,s.end,{...s},s.id)}),t.log.warn("Graph at first:",JSON.stringify(m(n))),H(n),t.log.warn("Graph after XAX:",JSON.stringify(m(n)));const r=t.getConfig2();await G(l,n,e.type,e.diagramId,void 0,r)},"render");exports.render=z;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("./chunk-NRVI72HA-DRmCDH9L.cjs"),u=require("./index-BA07EijG.cjs"),ie=require("./chunk-ANTBXLJU-DqW7nBC-.cjs"),oe=require("./mermaid-parser.core-Bxkmx2-5.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 J(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 J(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=J.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 De(){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 B,K=(B=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(B,"TreeMapDB"),B);function Q(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(Q,"buildHierarchy");var Be=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=Q(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 K))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.");Be(l,n)}catch(t){throw u.log.error("Error parsing treemap:",t),t}},"parse")},Ee=10,D=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*D:960,b=s.nodeHeight?s.nodeHeight*D: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=J(m).sum(e=>e.value??0).sort((e,i)=>(i.value??0)-(e.value??0)),Z=De().size([r,b]).paddingTop(e=>e.children&&e.children.length>0?G+D:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?D:0).paddingRight(e=>e.children&&e.children.length>0?D:0).paddingBottom(e=>e.children&&e.children.length>0?D: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,L=6;let $;s.showValues!==!1&&e.value?$=C-10-30-10-L:$=C-L-6;const A=Math.max(15,$),S=i.node();if(S.getComputedTextLength()>A){const _="...";let T=g;for(;T.length>0;){if(T=g.substring(0,T.length-1),T.length===0){i.text(_),S.getComputedTextLength()>A&&i.text("");break}if(i.text(T+_),S.getComputedTextLength()<=A)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,L=i.node(),$=4,P=g-2*$,A=C-2*$;if(P<10||A<10){i.style("display","none");return}let S=parseInt(i.style("font-size"),10);const F=8,_=28,T=.6,z=6,W=2;for(;L.getComputedTextLength()>P&&S>F;)S--,i.style("font-size",`${S}px`);let H=Math.max(z,Math.min(_,Math.round(S*T))),Y=S+W+H;for(;Y>A&&S>F&&(S--,H=Math.max(z,Math.min(_,Math.round(S*T))),!(H<z&&S===F));)i.style("font-size",`${S}px`),Y=S+W+H;i.style("font-size",`${S}px`),(L.getComputedTextLength()>P||S<F||A<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 L=u.select(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){g.style("display","none");return}const $=parseFloat(L.style("font-size")),P=28,A=.6,S=6,F=2,_=Math.max(S,Math.min(P,Math.round($*A)));g.style("font-size",`${_}px`);const z=(i.y1-i.y0)/2+$/2+F;g.attr("y",z);const W=i.x1-i.x0,le=i.y1-i.y0-4,re=W-2*4;g.node().getComputedTextLength()>re||z+_>le||_<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`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index-CdZgX2Ma.cjs"),se=require("./chunk-QN33PNHL-DnwK1wh-.cjs"),ie=require("./chunk-4BX2VUAB-D2Fra4jo.cjs"),oe=require("./mermaid-parser.core-BFoNlVio.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,L=6;let $;s.showValues!==!1&&e.value?$=C-10-30-10-L:$=C-L-6;const A=Math.max(15,$),S=i.node();if(S.getComputedTextLength()>A){const _="...";let T=g;for(;T.length>0;){if(T=g.substring(0,T.length-1),T.length===0){i.text(_),S.getComputedTextLength()>A&&i.text("");break}if(i.text(T+_),S.getComputedTextLength()<=A)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,L=i.node(),$=4,P=g-2*$,A=C-2*$;if(P<10||A<10){i.style("display","none");return}let S=parseInt(i.style("font-size"),10);const F=8,_=28,T=.6,z=6,W=2;for(;L.getComputedTextLength()>P&&S>F;)S--,i.style("font-size",`${S}px`);let H=Math.max(z,Math.min(_,Math.round(S*T))),Y=S+W+H;for(;Y>A&&S>F&&(S--,H=Math.max(z,Math.min(_,Math.round(S*T))),!(H<z&&S===F));)i.style("font-size",`${S}px`),Y=S+W+H;i.style("font-size",`${S}px`),(L.getComputedTextLength()>P||S<F||A<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 L=u.select(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){g.style("display","none");return}const $=parseFloat(L.style("font-size")),P=28,A=.6,S=6,F=2,_=Math.max(S,Math.min(P,Math.round($*A)));g.style("font-size",`${_}px`);const z=(i.y1-i.y0)/2+$/2+F;g.attr("y",z);const W=i.x1-i.x0,le=i.y1-i.y0-4,re=W-2*4;g.node().getComputedTextLength()>re||z+_>le||_<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
2
|
.treemapNode.section {
|
|
3
3
|
stroke: ${t.sectionStrokeColor};
|
|
4
4
|
stroke-width: ${t.sectionStrokeWidth};
|
|
@@ -21,4 +21,4 @@
|
|
|
21
21
|
fill: ${t.titleColor};
|
|
22
22
|
font-size: ${t.titleFontSize};
|
|
23
23
|
}
|
|
24
|
-
`},"getStyles"),Ge=Oe,Xe={parser:ee,get db(){return new
|
|
24
|
+
`},"getStyles"),Ge=Oe,Xe={parser:ee,get db(){return new J},renderer:Ie,styles:Ge};exports.diagram=Xe;
|