@nxgt/material 1.13.0 → 1.16.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 +4 -0
- package/dist/abnfDiagram-O67JEVCF-mm89LXw2.js +89 -0
- package/dist/architecture-7GRP2DOG-DDr0RGVC.js +3 -0
- package/dist/architectureDiagram-NJMV4G6O-CGoA5SIv.js +4146 -0
- package/dist/array-CApNbSU9.js +6 -0
- package/dist/blockDiagram-BEXU5L5S-Dq8gitB4.js +1946 -0
- package/dist/c4Diagram-YGBWAQC7-DO_alqIu.js +2990 -0
- package/dist/channel-1fT-W0NS.js +5 -0
- package/dist/chunk-2Q5K7J3B-kzxEEeTu.js +15 -0
- package/dist/chunk-3FUC2YCW-C3yD2fMw.js +364 -0
- package/dist/chunk-5DYCD2WN-Dn2jrYde.js +37 -0
- package/dist/chunk-5VM5RSS4-Cr17nBXp.js +5 -0
- package/dist/chunk-6AEJRKK7-JyfUnUEu.js +10 -0
- package/dist/chunk-742MDFTN-BbWkrtj2.js +275 -0
- package/dist/chunk-7INBJB4K-C3x7JNTG.js +4487 -0
- package/dist/chunk-7M6MHVWA-Cc7UTu4b.js +4256 -0
- package/dist/chunk-7PRAP22T-C8rsGRvH.js +67 -0
- package/dist/chunk-DUW6YSOI-BdOla2G8.js +10 -0
- package/dist/chunk-FOHPRMQF-Crq0JMf2.js +21388 -0
- package/dist/chunk-GNY47TPC-d-Bi8r0p.js +75 -0
- package/dist/chunk-GTNCS2PH-CTS015lZ.js +490 -0
- package/dist/chunk-GWA4HPMP-B4pgM-E1.js +61 -0
- package/dist/chunk-J5ZVWO5B-CYzz6Pq8.js +12 -0
- package/dist/chunk-JWPE2WC7-Ccb0QaC8.js +8 -0
- package/dist/chunk-LNGE3PJU-CiGrDO_F.js +1513 -0
- package/dist/chunk-MBY4JIJT-Dg6AeftH.js +1847 -0
- package/dist/chunk-NETBCI7D-TXZM0vKz.js +236 -0
- package/dist/chunk-O7XYJQB3-md6vjVm4.js +3922 -0
- package/dist/chunk-UA2S7LBM-DQTYPe9y.js +363 -0
- package/dist/chunk-WEXAMYUT-DmKWJz6y.js +26 -0
- package/dist/chunk-XXDRQBXY-C9XIYQdM.js +9 -0
- package/dist/chunk-Y2CYZVJY-i11wjrBe.js +12 -0
- package/dist/chunk-Z7XXMR3K-BoDf6lxl.js +677 -0
- package/dist/chunk-ZIGJFQKS-CP5430fN.js +663 -0
- package/dist/classDiagram-v2-NBCMYWYE-6KoTmufe.js +3397 -0
- package/dist/components.js +3 -3
- package/dist/cose-bilkent-JH36ORCC-CejnZl_t.js +2251 -0
- package/dist/cynefin-OW5HDTMX-B8HVdZhp.js +3 -0
- package/dist/cynefinDiagram-VND7K2PF-DZnc0dlm.js +349 -0
- package/dist/cytoscape.esm-_jXi1N4y.js +18151 -0
- package/dist/dagre-6A5THRUB-cuS57NO5.js +2192 -0
- package/dist/diagram-22UHCM2B-zQSFmH0t.js +5084 -0
- package/dist/diagram-3UASUU5V-D45Fgu1j.js +724 -0
- package/dist/diagram-ATOU4E4O-YMtQnlqd.js +432 -0
- package/dist/diagram-CDSNMT55-DP7UmEW1.js +301 -0
- package/dist/diagram-MLGK6HIB-WvSqrTRC.js +134 -0
- package/dist/diagram-MPIPVDR6-C2F3__mt.js +214 -0
- package/dist/dist-1DdJvBEt.js +50 -0
- package/dist/{dist-BGGDEbJ3.js → dist-DppLdkXt.js} +2 -2
- package/dist/dnd.js +2 -2
- package/dist/ebnfDiagram-ZINNZB2B-BZC6cSiy.js +100 -0
- package/dist/elk-276RUBZZ-7DJf1MEV.js +47598 -0
- package/dist/erDiagram-OPXOYQCR-YKlEVEF0.js +1970 -0
- package/dist/eventmodeling-NTZA5JFV-C1CEo-26.js +3 -0
- package/dist/flowDiagram-KWPJA3E3-DyLvzIlg.js +17 -0
- package/dist/ganttDiagram-FUAMR5RP-KIaOrYOF.js +2928 -0
- package/dist/gitGraph-4MIJSDKK-BTeCS_5q.js +3 -0
- package/dist/gitGraphDiagram-X574FWY7-DpFW-7JE.js +729 -0
- package/dist/graphlib-DFaO_iIU.js +372 -0
- package/dist/{hooks-DReKyuyc.js → hooks-C5xy0u03.js} +1 -1
- package/dist/hooks.js +1 -1
- package/dist/{i18n-DtDrodl8.js → i18n-Cech9IAc.js} +314 -841
- package/dist/i18n.js +1 -1
- package/dist/info-A6RAGUB7-BvtuPd9C.js +3 -0
- package/dist/infoDiagram-VRGFBTTK-H3F-BCnu.js +20 -0
- package/dist/init-Buj1GKRa.js +27 -0
- package/dist/isArrayLikeObject-VG1KOJ3m.js +539 -0
- package/dist/ishikawaDiagram-OU5B5YK6-DgQDmcF3.js +719 -0
- package/dist/journeyDiagram-ZHPQQLJL-CanDOlfn.js +884 -0
- package/dist/kanban-definition-PNTS6WVX-DmnUgxgb.js +976 -0
- package/dist/katex-BMQ6LGsM.js +21962 -0
- package/dist/lib/components/index.d.ts +4 -0
- package/dist/lib/components/ui/chat/chat-composer-mentions.d.ts +8 -0
- package/dist/lib/components/ui/chat/chat-composer.d.ts +5 -1
- package/dist/lib/components/ui/chat/chat-markdown.d.ts +2 -2
- package/dist/lib/components/ui/emoji/emoji-list.d.ts +5 -0
- package/dist/lib/components/ui/emoji/emoji-picker.d.ts +7 -0
- package/dist/lib/components/ui/emoji/emoji.utils.d.ts +2 -0
- package/dist/lib/components/ui/emoji/emoji.utils.test.d.ts +1 -0
- package/dist/lib/components/ui/emoji/index.d.ts +4 -0
- package/dist/lib/components/ui/emoji/types.d.ts +6 -0
- package/dist/lib/components/ui/entity-header.stories.d.ts +1 -0
- package/dist/lib/components/ui/kanban/kanban.stories.d.ts +1 -0
- package/dist/lib/components/ui/markdown/index.d.ts +3 -0
- package/dist/lib/components/ui/markdown/markdown.d.ts +7 -0
- package/dist/lib/components/ui/markdown/markdown.stories.d.ts +14 -0
- package/dist/lib/components/ui/markdown/markdown.test.d.ts +1 -0
- package/dist/lib/components/ui/markdown/markdown.utils.d.ts +1 -0
- package/dist/lib/components/ui/markdown/mermaid.lazy.d.ts +12 -0
- package/dist/lib/components/ui/markdown/partials/markdown-code.d.ts +2 -0
- package/dist/lib/components/ui/markdown/partials/mermaid-diagram.d.ts +4 -0
- package/dist/lib/components/ui/mentions/index.d.ts +3 -0
- package/dist/lib/components/ui/mentions/mention-list.d.ts +8 -0
- package/dist/lib/components/ui/mentions/mentions.utils.d.ts +7 -0
- package/dist/lib/components/ui/mentions/mentions.utils.test.d.ts +1 -0
- package/dist/lib/components/ui/mentions/types.d.ts +7 -0
- package/dist/lib/components/ui/rich-text-editor/extensions/mention/mention-list.d.ts +12 -1
- package/dist/lib/components/ui/terminal/index.d.ts +2 -0
- package/dist/lib/components/ui/terminal/terminal.d.ts +11 -0
- package/dist/lib/components/ui/terminal/terminal.stories.d.ts +14 -0
- package/dist/lib/components/ui/terminal/terminal.utils.d.ts +5 -0
- package/dist/lib/components/ui/terminal/terminal.utils.test.d.ts +1 -0
- package/dist/lib/i18n/resources/en/index.d.ts +7 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +7 -0
- package/dist/lib/i18n/resources/fr/index.d.ts +7 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +7 -0
- package/dist/lib/i18n/resources/index.d.ts +14 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/{lib-CD3tyuc8.js → lib-Bbw5QPoj.js} +472 -471
- package/dist/lib.js +2 -2
- package/dist/{main-r84Yresa.js → main-BjDU9FDM.js} +59393 -30376
- package/dist/main.js +6 -6
- package/dist/material.css +1 -1
- package/dist/math-C5EhTgJw.js +10 -0
- package/dist/mermaid-parser.core-Cz-MfB4Z.js +638 -0
- package/dist/mermaid.core-BI1sunfX.js +1096 -0
- package/dist/mindmap-definition-NLK3R4M7-DW0BIU_q.js +1008 -0
- package/dist/ordinal-DuP05kVQ.js +65 -0
- package/dist/packet-AYTQ26CC-CshIswP8.js +3 -0
- package/dist/path-Cjou0lUh.js +85 -0
- package/dist/pegDiagram-GJSIUBJH-CJIx0u4M.js +94 -0
- package/dist/pie-WAS4IAKB-CYs22y4X.js +3 -0
- package/dist/pieDiagram-5QR66LMP-zAhv5fKz.js +157 -0
- package/dist/quadrantDiagram-O4NWA36T-CO4n_yQo.js +2001 -0
- package/dist/radar-RG4KPBEZ-BOJKjbGv.js +3 -0
- package/dist/railroad-74A4TZTK-Dt1BmUkI.js +3 -0
- package/dist/railroad-abnf-HS5TGJTU-Cs9GMUMY.js +3 -0
- package/dist/railroad-ebnf-LZEXJU2U-D4y0fXoW.js +3 -0
- package/dist/railroad-peg-WCYAUIDC-D2f_ZNR5.js +3 -0
- package/dist/railroadDiagram-XR7U4H2S-B8iV7mfe.js +76 -0
- package/dist/requirementDiagram-PLB6GJNP-CGoX1NrW.js +2228 -0
- package/dist/rough.esm-rcMoXTJj.js +1352 -0
- package/dist/sankeyDiagram-IPEJSGJF-DdSM2wiI.js +962 -0
- package/dist/sequenceDiagram-PO4LG4MO-CCRqF5XO.js +4200 -0
- package/dist/sizeCapture-INFHLROL-CHXIsPO_.js +46 -0
- package/dist/src-B4npqWNl.js +1775 -0
- package/dist/stateDiagram-v2-GCMORJYK-CQTX5ks8.js +2143 -0
- package/dist/step-B6KjpKgN.js +706 -0
- package/dist/string-B-ZWXCs2.js +392 -0
- package/dist/swimlanes-2SLR337P-C2NNOb5n.js +4763 -0
- package/dist/swimlanesDiagram-TC7HE7FX-CPsqPrbP.js +28 -0
- package/dist/timeline-definition-EJHVYXUP-DuxGHv-N.js +1073 -0
- package/dist/treeView-Q6P3EWNA-BrJylG9N.js +3 -0
- package/dist/treemap-WGGIJYW6-DpIZuqbj.js +3 -0
- package/dist/usecaseDiagram-POWQR4AR-cuAeIBW3.js +9932 -0
- package/dist/vennDiagram-UO4OBE2U-DLwBSAnC.js +1880 -0
- package/dist/wardley-WFR3VGLG-CbwdAAbH.js +3 -0
- package/dist/wardleyDiagram-VNRHLVJA-D7IZU6vu.js +645 -0
- package/dist/xychartDiagram-PMCCYNJV-BDOFv_xK.js +2167 -0
- package/package.json +7 -1
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { n as e } from "./src-B4npqWNl.js";
|
|
2
|
+
import { i as t } from "./chunk-ZIGJFQKS-CP5430fN.js";
|
|
3
|
+
import { n } from "./mermaid-parser.core-Cz-MfB4Z.js";
|
|
4
|
+
import { n as r } from "./chunk-Y2CYZVJY-i11wjrBe.js";
|
|
5
|
+
import { H as i, U as a, a as o, b as s, c, f as l, q as u, v as d, w as f, y as p, z as m } from "./chunk-O7XYJQB3-md6vjVm4.js";
|
|
6
|
+
import { t as h } from "./chunk-6AEJRKK7-JyfUnUEu.js";
|
|
7
|
+
import { t as g } from "./chunk-JWPE2WC7-Ccb0QaC8.js";
|
|
8
|
+
import { r as _, t as v } from "./chunk-742MDFTN-BbWkrtj2.js";
|
|
9
|
+
import { t as y } from "./chunk-2Q5K7J3B-kzxEEeTu.js";
|
|
10
|
+
//#region node_modules/mermaid/dist/chunks/mermaid.core/diagram-CDSNMT55.mjs
|
|
11
|
+
var b = /[─━│┃└┗├┣]/, x = /[└┗├┣]/, S = /[─━]/, C = /^[\s│┃]+$/, w = /^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/, T = /^\s*%%/, E = " ";
|
|
12
|
+
function D(e) {
|
|
13
|
+
return e.some((e) => b.test(e));
|
|
14
|
+
}
|
|
15
|
+
r(D, "isBoxDrawingFormat");
|
|
16
|
+
function O(e) {
|
|
17
|
+
for (let t of e) {
|
|
18
|
+
let e = x.exec(t);
|
|
19
|
+
if (e?.index && e.index > 0) return e.index;
|
|
20
|
+
}
|
|
21
|
+
return 4;
|
|
22
|
+
}
|
|
23
|
+
r(O, "inferSegmentWidth");
|
|
24
|
+
function k(e, t) {
|
|
25
|
+
return e.replace(/\bline\s+(\d+)\b/gi, (e, n) => {
|
|
26
|
+
let r = parseInt(n, 10), i = t.get(r);
|
|
27
|
+
return i ? `line ${i}` : e;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
r(k, "remapErrorLines");
|
|
31
|
+
function A(e) {
|
|
32
|
+
let t = e.split("\n"), n = /* @__PURE__ */ new Map(), r = -1;
|
|
33
|
+
for (let [e, n] of t.entries()) if (n.trim() === "treeView-beta") {
|
|
34
|
+
r = e;
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
if (r === -1) return {
|
|
38
|
+
text: e,
|
|
39
|
+
lineMap: n
|
|
40
|
+
};
|
|
41
|
+
let i = [];
|
|
42
|
+
for (let e = r + 1; e < t.length; e++) {
|
|
43
|
+
let n = t[e];
|
|
44
|
+
n.trim() === "" || T.test(n) || w.test(n) || C.test(n) || i.push(n.replace(/\t/g, " "));
|
|
45
|
+
}
|
|
46
|
+
if (!D(i)) return {
|
|
47
|
+
text: e,
|
|
48
|
+
lineMap: n
|
|
49
|
+
};
|
|
50
|
+
let a = O(i), o = [], s = 0;
|
|
51
|
+
for (let e = 0; e <= r; e++) o.push(t[e]), s++, n.set(s, e + 1);
|
|
52
|
+
for (let e = r + 1; e < t.length; e++) {
|
|
53
|
+
let r = t[e], i = r.trim(), c = e + 1;
|
|
54
|
+
if (i === "") {
|
|
55
|
+
o.push(r), s++, n.set(s, c);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (T.test(r)) {
|
|
59
|
+
o.push(r), s++, n.set(s, c);
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (w.test(r)) {
|
|
63
|
+
o.push(r), s++, n.set(s, c);
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (C.test(r)) continue;
|
|
67
|
+
let l = r.replace(/\t/g, " "), u = x.exec(l);
|
|
68
|
+
if (u?.index !== void 0) {
|
|
69
|
+
let e = u.index, t = Math.round(e / a) + 1, r = e + 1;
|
|
70
|
+
for (; r < l.length && S.test(l[r]);) r++;
|
|
71
|
+
for (; r < l.length && l[r] === " ";) r++;
|
|
72
|
+
let i = l.slice(r).trimEnd();
|
|
73
|
+
if (!i) throw Error(`Line ${c}: Empty node \u2014 expected a filename or directory name after the box-drawing prefix`);
|
|
74
|
+
let d = E.repeat(t);
|
|
75
|
+
o.push(d + i), s++, n.set(s, c);
|
|
76
|
+
} else if (/^[\s─━│┃└┗├┣]+$/.test(l)) continue;
|
|
77
|
+
else if (b.test(l)) o.push(r), s++, n.set(s, c);
|
|
78
|
+
else if (/^\s+/.test(l)) throw Error(`Line ${c}: Unexpected indentation without box-drawing characters. In box-drawing format, use \u251C\u2500\u2500 or \u2514\u2500\u2500 prefixes for indented nodes.`);
|
|
79
|
+
else o.push(r), s++, n.set(s, c);
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
text: o.join("\n"),
|
|
83
|
+
lineMap: n
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
r(A, "preprocessBoxDrawing");
|
|
87
|
+
var j = new y(() => ({
|
|
88
|
+
cnt: 1,
|
|
89
|
+
stack: [{
|
|
90
|
+
id: 0,
|
|
91
|
+
level: -1,
|
|
92
|
+
name: "/",
|
|
93
|
+
nodeType: "directory",
|
|
94
|
+
children: []
|
|
95
|
+
}]
|
|
96
|
+
})), M = /* @__PURE__ */ r(() => {
|
|
97
|
+
j.reset(), o();
|
|
98
|
+
}, "clear"), N = /* @__PURE__ */ r(() => j.records.stack[0], "getRoot"), P = /* @__PURE__ */ r(() => j.records.cnt, "getCount"), F = l.treeView, I = {
|
|
99
|
+
clear: M,
|
|
100
|
+
addNode: /* @__PURE__ */ r((e, t, n, r, i, a) => {
|
|
101
|
+
for (; e <= j.records.stack[j.records.stack.length - 1].level;) j.records.stack.pop();
|
|
102
|
+
let o = {
|
|
103
|
+
id: j.records.cnt++,
|
|
104
|
+
level: e,
|
|
105
|
+
name: t,
|
|
106
|
+
nodeType: n,
|
|
107
|
+
icon: i,
|
|
108
|
+
cssClass: r,
|
|
109
|
+
description: a,
|
|
110
|
+
children: []
|
|
111
|
+
};
|
|
112
|
+
j.records.stack[j.records.stack.length - 1].children.push(o), j.records.stack.push(o);
|
|
113
|
+
}, "addNode"),
|
|
114
|
+
getRoot: N,
|
|
115
|
+
getCount: P,
|
|
116
|
+
getConfig: /* @__PURE__ */ r(() => t(F, s().treeView), "getConfig"),
|
|
117
|
+
getAccTitle: p,
|
|
118
|
+
getAccDescription: d,
|
|
119
|
+
getDiagramTitle: f,
|
|
120
|
+
setAccDescription: i,
|
|
121
|
+
setAccTitle: a,
|
|
122
|
+
setDiagramTitle: u
|
|
123
|
+
}, L = /* @__PURE__ */ r((e) => {
|
|
124
|
+
g(e, I);
|
|
125
|
+
for (let t of e.nodes) {
|
|
126
|
+
let e = typeof t.indent == "number" ? t.indent : 0, n = t.name, r = n.endsWith("/");
|
|
127
|
+
r && (n = n.slice(0, -1));
|
|
128
|
+
let i = r ? "directory" : "file", a = t.classAnnotation || void 0, o = t.iconAnnotation, c = o === void 0 ? void 0 : o || "none", l = t.descAnnotation || void 0, u = l ? m(l, s()) : void 0;
|
|
129
|
+
I.addNode(e, n, i, a, c, u);
|
|
130
|
+
}
|
|
131
|
+
}, "populate"), R = { parse: /* @__PURE__ */ r(async (t) => {
|
|
132
|
+
let { text: r, lineMap: i } = A(t);
|
|
133
|
+
try {
|
|
134
|
+
let t = await n("treeView", r);
|
|
135
|
+
e.debug(t), L(t);
|
|
136
|
+
} catch (e) {
|
|
137
|
+
throw i.size > 0 && e instanceof Error && (e.message = k(e.message, i)), e;
|
|
138
|
+
}
|
|
139
|
+
}, "parse") }, z = {
|
|
140
|
+
prefix: "mermaid-treeview",
|
|
141
|
+
height: 24,
|
|
142
|
+
width: 24,
|
|
143
|
+
icons: {
|
|
144
|
+
folder: { body: "<path fill=\"currentColor\" d=\"M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z\"/>" },
|
|
145
|
+
file: { body: "<path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z\" clip-rule=\"evenodd\"/>" }
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
function B(e, t) {
|
|
149
|
+
let n = t?.filenameIcons?.[e];
|
|
150
|
+
if (n) return n;
|
|
151
|
+
let r = e.lastIndexOf(".");
|
|
152
|
+
if (r > 0) {
|
|
153
|
+
let n = e.substring(r).toLowerCase(), i = t?.extensionIcons;
|
|
154
|
+
return i?.[n] ?? i?.[n.slice(1)];
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
r(B, "detectIcon");
|
|
158
|
+
function V(e, t) {
|
|
159
|
+
return e.includes(":") ? e : e in z.icons || !t ? `${z.prefix}:${e}` : `${t}:${e}`;
|
|
160
|
+
}
|
|
161
|
+
r(V, "qualifyIcon");
|
|
162
|
+
function H(e, t) {
|
|
163
|
+
if (e.icon !== "none") {
|
|
164
|
+
if (e.icon) return V(e.icon, t.defaultIconPack);
|
|
165
|
+
if (t.showIcons) {
|
|
166
|
+
if (e.nodeType === "file") {
|
|
167
|
+
let n = B(e.name, t);
|
|
168
|
+
if (n === "none") return;
|
|
169
|
+
if (n) return V(n, t.defaultIconPack);
|
|
170
|
+
}
|
|
171
|
+
return `${z.prefix}:${e.nodeType === "directory" ? "folder" : "file"}`;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
r(H, "getNodeIcon"), _([{
|
|
176
|
+
name: z.prefix,
|
|
177
|
+
icons: z
|
|
178
|
+
}]);
|
|
179
|
+
var U = 14, W = 4, G = 16, K = /* @__PURE__ */ r(async (e, t) => {
|
|
180
|
+
let n = [], i = /* @__PURE__ */ r((e) => {
|
|
181
|
+
let r = H(e, t);
|
|
182
|
+
r && n.push({
|
|
183
|
+
icon: r,
|
|
184
|
+
node: e
|
|
185
|
+
}), e.children.forEach(i);
|
|
186
|
+
}, "collect");
|
|
187
|
+
i(e);
|
|
188
|
+
let a = await Promise.all(n.map(async ({ icon: e, node: t }) => ({
|
|
189
|
+
id: t.id,
|
|
190
|
+
svg: await v(e, {
|
|
191
|
+
height: U,
|
|
192
|
+
width: U
|
|
193
|
+
})
|
|
194
|
+
})));
|
|
195
|
+
return new Map(a.map(({ id: e, svg: t }) => [e, t]));
|
|
196
|
+
}, "resolveNodeIcons"), q = /* @__PURE__ */ r((e, t, n, r, i, a) => {
|
|
197
|
+
let o = r.append("g"), s = "treeView-node-label";
|
|
198
|
+
n.nodeType === "directory" && (s += " treeView-node-dir"), n.cssClass && (s += ` ${n.cssClass}`);
|
|
199
|
+
let c = U + W, l = H(n, i), u = l !== void 0;
|
|
200
|
+
l && o.append("g").attr("class", "treeView-node-icon").attr("transform", `translate(${e + i.paddingX}, ${t + i.paddingY})`).html(a.get(n.id) ?? "");
|
|
201
|
+
let d = o.append("text").text(n.name).attr("dominant-baseline", "middle").attr("class", s), { height: f, width: p } = d.node().getBBox(), m = f + i.paddingY * 2, h = e + i.paddingX + (u ? c : 0);
|
|
202
|
+
d.attr("x", h), d.attr("y", t + m / 2);
|
|
203
|
+
let g = h + p;
|
|
204
|
+
return n.BBox = {
|
|
205
|
+
x: e,
|
|
206
|
+
y: t,
|
|
207
|
+
width: p + i.paddingX * 2 + (u ? c : 0),
|
|
208
|
+
height: m
|
|
209
|
+
}, n.cssClass?.split(/\s+/).includes("highlight") && o.insert("rect", ":first-child").attr("x", e).attr("y", t + 1).attr("width", 0).attr("height", m - 2).attr("rx", 3).attr("class", "treeView-highlight-bg"), {
|
|
210
|
+
node: n,
|
|
211
|
+
nodeGroup: o,
|
|
212
|
+
labelRightEdge: g,
|
|
213
|
+
centerY: t + m / 2
|
|
214
|
+
};
|
|
215
|
+
}, "positionLabel"), J = /* @__PURE__ */ r((e, t, n, r, i, a) => e.append("line").attr("x1", t).attr("y1", n).attr("x2", r).attr("y2", i).attr("stroke-width", a).attr("class", "treeView-node-line"), "positionLine"), Y = /* @__PURE__ */ r((e, t, n, i) => {
|
|
216
|
+
let a = 0, o = 0, s = [], c = /* @__PURE__ */ r((e, t, n, r) => {
|
|
217
|
+
let c = r * (n.rowIndent + n.paddingX), l = q(c, a, t, e, n, i);
|
|
218
|
+
s.push(l);
|
|
219
|
+
let { height: u, width: d } = t.BBox;
|
|
220
|
+
J(e, c - n.rowIndent, a + u / 2, c, a + u / 2, n.lineThickness), o = Math.max(o, c + d), a += u;
|
|
221
|
+
}, "drawNode"), l = /* @__PURE__ */ r((t, r = 0) => {
|
|
222
|
+
c(e, t, n, r), t.children.forEach((e) => {
|
|
223
|
+
l(e, r + 1);
|
|
224
|
+
});
|
|
225
|
+
let { x: i, y: a, height: o } = t.BBox;
|
|
226
|
+
if (t.children.length) {
|
|
227
|
+
let { y: r, height: s } = t.children[t.children.length - 1].BBox;
|
|
228
|
+
J(e, i + n.paddingX, a + o, i + n.paddingX, r + s / 2 + n.lineThickness / 2, n.lineThickness);
|
|
229
|
+
}
|
|
230
|
+
}, "processNode");
|
|
231
|
+
l(t);
|
|
232
|
+
let u = s.filter((e) => e.node.description);
|
|
233
|
+
if (u.length > 0) {
|
|
234
|
+
let e = Math.max(...s.map((e) => e.labelRightEdge)) + G;
|
|
235
|
+
for (let t of u) {
|
|
236
|
+
let r = t.nodeGroup.append("text").text(t.node.description).attr("dominant-baseline", "middle").attr("class", "treeView-node-description").attr("x", e).attr("y", t.centerY).node().getBBox();
|
|
237
|
+
o = Math.max(o, e + r.width + n.paddingX);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
for (let e of s) if (e.node.cssClass?.split(/\s+/).includes("highlight")) {
|
|
241
|
+
let t = e.nodeGroup.select(".treeView-highlight-bg");
|
|
242
|
+
if (!t.empty()) {
|
|
243
|
+
let n = o - e.node.BBox.x + 8;
|
|
244
|
+
t.attr("width", n), o = Math.max(o, e.node.BBox.x + n + 2);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return {
|
|
248
|
+
totalHeight: a,
|
|
249
|
+
totalWidth: o
|
|
250
|
+
};
|
|
251
|
+
}, "drawTree"), X = { draw: /* @__PURE__ */ r(async (t, n, r, i) => {
|
|
252
|
+
e.debug("Rendering treeView diagram\n" + t);
|
|
253
|
+
let a = i.db, o = a.getRoot(), s = a.getConfig(), l = h(n), u = l.append("g");
|
|
254
|
+
u.attr("class", "tree-view");
|
|
255
|
+
let { totalHeight: d, totalWidth: f } = Y(u, o, s, await K(o, s));
|
|
256
|
+
l.attr("viewBox", `-${s.lineThickness / 2} 0 ${f} ${d}`), c(l, d, f, s.useMaxWidth);
|
|
257
|
+
}, "draw") }, Z = {
|
|
258
|
+
labelFontSize: "16px",
|
|
259
|
+
labelColor: "black",
|
|
260
|
+
lineColor: "black",
|
|
261
|
+
iconColor: "#546e7a",
|
|
262
|
+
descriptionColor: "#6a9955",
|
|
263
|
+
highlightBg: "rgba(255, 193, 7, 0.15)",
|
|
264
|
+
highlightStroke: "#ffc107"
|
|
265
|
+
}, Q = {
|
|
266
|
+
db: I,
|
|
267
|
+
renderer: X,
|
|
268
|
+
parser: R,
|
|
269
|
+
styles: /* @__PURE__ */ r(({ treeView: e }) => {
|
|
270
|
+
let { labelFontSize: n, labelColor: r, lineColor: i, iconColor: a, descriptionColor: o, highlightBg: s, highlightStroke: c } = t(Z, e);
|
|
271
|
+
return `
|
|
272
|
+
.treeView-node-label {
|
|
273
|
+
font-size: ${n};
|
|
274
|
+
fill: ${r};
|
|
275
|
+
white-space: pre;
|
|
276
|
+
}
|
|
277
|
+
.treeView-node-dir {
|
|
278
|
+
font-weight: bold;
|
|
279
|
+
}
|
|
280
|
+
.treeView-node-line {
|
|
281
|
+
stroke: ${i};
|
|
282
|
+
}
|
|
283
|
+
.treeView-node-icon {
|
|
284
|
+
color: ${a};
|
|
285
|
+
}
|
|
286
|
+
.treeView-node-description {
|
|
287
|
+
font-size: ${n};
|
|
288
|
+
fill: ${o};
|
|
289
|
+
font-style: italic;
|
|
290
|
+
white-space: pre;
|
|
291
|
+
}
|
|
292
|
+
.treeView-highlight-bg {
|
|
293
|
+
fill: ${s};
|
|
294
|
+
stroke: ${c};
|
|
295
|
+
stroke-width: 1;
|
|
296
|
+
}
|
|
297
|
+
`;
|
|
298
|
+
}, "styles")
|
|
299
|
+
};
|
|
300
|
+
//#endregion
|
|
301
|
+
export { Q as diagram };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { n as e } from "./src-B4npqWNl.js";
|
|
2
|
+
import { i as t } from "./chunk-ZIGJFQKS-CP5430fN.js";
|
|
3
|
+
import { n } from "./mermaid-parser.core-Cz-MfB4Z.js";
|
|
4
|
+
import { n as r } from "./chunk-Y2CYZVJY-i11wjrBe.js";
|
|
5
|
+
import { H as i, U as a, a as o, b as s, c, f as l, q as u, v as d, w as f, y as p } from "./chunk-O7XYJQB3-md6vjVm4.js";
|
|
6
|
+
import { t as m } from "./chunk-6AEJRKK7-JyfUnUEu.js";
|
|
7
|
+
import { t as h } from "./chunk-JWPE2WC7-Ccb0QaC8.js";
|
|
8
|
+
//#region node_modules/mermaid/dist/chunks/mermaid.core/diagram-MLGK6HIB.mjs
|
|
9
|
+
var g = l.packet, _ = class {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.packet = [], this.setAccTitle = a, this.getAccTitle = p, this.setDiagramTitle = u, this.getDiagramTitle = f, this.getAccDescription = d, this.setAccDescription = i;
|
|
12
|
+
}
|
|
13
|
+
static {
|
|
14
|
+
r(this, "PacketDB");
|
|
15
|
+
}
|
|
16
|
+
getConfig() {
|
|
17
|
+
let e = t({
|
|
18
|
+
...g,
|
|
19
|
+
...s().packet
|
|
20
|
+
});
|
|
21
|
+
return e.showBits && (e.paddingY += 10), e;
|
|
22
|
+
}
|
|
23
|
+
getPacket() {
|
|
24
|
+
return this.packet;
|
|
25
|
+
}
|
|
26
|
+
pushWord(e) {
|
|
27
|
+
e.length > 0 && this.packet.push(e);
|
|
28
|
+
}
|
|
29
|
+
clear() {
|
|
30
|
+
o(), this.packet = [];
|
|
31
|
+
}
|
|
32
|
+
}, v = 1e4, y = /* @__PURE__ */ r((t, n) => {
|
|
33
|
+
h(t, n);
|
|
34
|
+
let r = -1, i = [], a = 1, { bitsPerRow: o } = n.getConfig();
|
|
35
|
+
for (let { start: s, end: c, bits: l, label: u } of t.blocks) {
|
|
36
|
+
if (s !== void 0 && c !== void 0 && c < s) throw Error(`Packet block ${s} - ${c} is invalid. End must be greater than start.`);
|
|
37
|
+
if (s ??= r + 1, s !== r + 1) throw Error(`Packet block ${s} - ${c ?? s} is not contiguous. It should start from ${r + 1}.`);
|
|
38
|
+
if (l === 0) throw Error(`Packet block ${s} is invalid. Cannot have a zero bit field.`);
|
|
39
|
+
for (c ??= s + (l ?? 1) - 1, l ??= c - s + 1, r = c, e.debug(`Packet block ${s} - ${r} with label ${u}`); i.length <= o + 1 && n.getPacket().length < v;) {
|
|
40
|
+
let [e, t] = b({
|
|
41
|
+
start: s,
|
|
42
|
+
end: c,
|
|
43
|
+
bits: l,
|
|
44
|
+
label: u
|
|
45
|
+
}, a, o);
|
|
46
|
+
if (i.push(e), e.end + 1 === a * o && (n.pushWord(i), i = [], a++), !t) break;
|
|
47
|
+
({start: s, end: c, bits: l, label: u} = t);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
n.pushWord(i);
|
|
51
|
+
}, "populate"), b = /* @__PURE__ */ r((e, t, n) => {
|
|
52
|
+
if (e.start === void 0) throw Error("start should have been set during first phase");
|
|
53
|
+
if (e.end === void 0) throw Error("end should have been set during first phase");
|
|
54
|
+
if (e.start > e.end) throw Error(`Block start ${e.start} is greater than block end ${e.end}.`);
|
|
55
|
+
if (e.end + 1 <= t * n) return [e, void 0];
|
|
56
|
+
let r = t * n - 1, i = t * n;
|
|
57
|
+
return [{
|
|
58
|
+
start: e.start,
|
|
59
|
+
end: r,
|
|
60
|
+
label: e.label,
|
|
61
|
+
bits: r - e.start
|
|
62
|
+
}, {
|
|
63
|
+
start: i,
|
|
64
|
+
end: e.end,
|
|
65
|
+
label: e.label,
|
|
66
|
+
bits: e.end - i
|
|
67
|
+
}];
|
|
68
|
+
}, "getNextFittingBlock"), x = {
|
|
69
|
+
parser: { yy: void 0 },
|
|
70
|
+
parse: /* @__PURE__ */ r(async (t) => {
|
|
71
|
+
let r = await n("packet", t), i = x.parser?.yy;
|
|
72
|
+
if (!(i instanceof _)) throw Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");
|
|
73
|
+
e.debug(r), y(r, i);
|
|
74
|
+
}, "parse")
|
|
75
|
+
}, S = /* @__PURE__ */ r((e, t, n, r) => {
|
|
76
|
+
let i = r.db, a = i.getConfig(), { rowHeight: o, paddingY: s, bitWidth: l, bitsPerRow: u } = a, d = i.getPacket(), f = i.getDiagramTitle(), p = o + s, h = p * (d.length + 1) - (f ? 0 : o), g = l * u + 2, _ = m(t);
|
|
77
|
+
_.attr("viewBox", `0 0 ${g} ${h}`), c(_, h, g, a.useMaxWidth);
|
|
78
|
+
for (let [e, t] of d.entries()) C(_, t, e, a);
|
|
79
|
+
_.append("text").text(f).attr("x", g / 2).attr("y", h - p / 2).attr("dominant-baseline", "middle").attr("text-anchor", "middle").attr("class", "packetTitle");
|
|
80
|
+
}, "draw"), C = /* @__PURE__ */ r((e, t, n, { rowHeight: r, paddingX: i, paddingY: a, bitWidth: o, bitsPerRow: s, showBits: c }) => {
|
|
81
|
+
let l = e.append("g"), u = n * (r + a) + a;
|
|
82
|
+
for (let e of t) {
|
|
83
|
+
let t = e.start % s * o + 1, n = (e.end - e.start + 1) * o - i;
|
|
84
|
+
if (l.append("rect").attr("x", t).attr("y", u).attr("width", n).attr("height", r).attr("class", "packetBlock"), l.append("text").attr("x", t + n / 2).attr("y", u + r / 2).attr("class", "packetLabel").attr("dominant-baseline", "middle").attr("text-anchor", "middle").text(e.label), !c) continue;
|
|
85
|
+
let a = e.end === e.start, d = u - 2;
|
|
86
|
+
l.append("text").attr("x", t + (a ? n / 2 : 0)).attr("y", d).attr("class", "packetByte start").attr("dominant-baseline", "auto").attr("text-anchor", a ? "middle" : "start").text(e.start), a || l.append("text").attr("x", t + n).attr("y", d).attr("class", "packetByte end").attr("dominant-baseline", "auto").attr("text-anchor", "end").text(e.end);
|
|
87
|
+
}
|
|
88
|
+
}, "drawWord"), w = { draw: S }, T = {
|
|
89
|
+
byteFontSize: "10px",
|
|
90
|
+
startByteColor: "black",
|
|
91
|
+
endByteColor: "black",
|
|
92
|
+
labelColor: "black",
|
|
93
|
+
labelFontSize: "12px",
|
|
94
|
+
titleColor: "black",
|
|
95
|
+
titleFontSize: "14px",
|
|
96
|
+
blockStrokeColor: "black",
|
|
97
|
+
blockStrokeWidth: "1",
|
|
98
|
+
blockFillColor: "#efefef"
|
|
99
|
+
}, E = {
|
|
100
|
+
parser: x,
|
|
101
|
+
get db() {
|
|
102
|
+
return new _();
|
|
103
|
+
},
|
|
104
|
+
renderer: w,
|
|
105
|
+
styles: /* @__PURE__ */ r(({ packet: e } = {}) => {
|
|
106
|
+
let n = t(T, e);
|
|
107
|
+
return `
|
|
108
|
+
.packetByte {
|
|
109
|
+
font-size: ${n.byteFontSize};
|
|
110
|
+
}
|
|
111
|
+
.packetByte.start {
|
|
112
|
+
fill: ${n.startByteColor};
|
|
113
|
+
}
|
|
114
|
+
.packetByte.end {
|
|
115
|
+
fill: ${n.endByteColor};
|
|
116
|
+
}
|
|
117
|
+
.packetLabel {
|
|
118
|
+
fill: ${n.labelColor};
|
|
119
|
+
font-size: ${n.labelFontSize};
|
|
120
|
+
}
|
|
121
|
+
.packetTitle {
|
|
122
|
+
fill: ${n.titleColor};
|
|
123
|
+
font-size: ${n.titleFontSize};
|
|
124
|
+
}
|
|
125
|
+
.packetBlock {
|
|
126
|
+
stroke: ${n.blockStrokeColor};
|
|
127
|
+
stroke-width: ${n.blockStrokeWidth};
|
|
128
|
+
fill: ${n.blockFillColor};
|
|
129
|
+
}
|
|
130
|
+
`;
|
|
131
|
+
}, "styles")
|
|
132
|
+
};
|
|
133
|
+
//#endregion
|
|
134
|
+
export { E as diagram };
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { n as e } from "./src-B4npqWNl.js";
|
|
2
|
+
import { i as t } from "./chunk-ZIGJFQKS-CP5430fN.js";
|
|
3
|
+
import { n } from "./mermaid-parser.core-Cz-MfB4Z.js";
|
|
4
|
+
import { n as r } from "./chunk-Y2CYZVJY-i11wjrBe.js";
|
|
5
|
+
import { D as i, H as a, U as o, a as s, b as c, c as l, f as u, q as d, v as f, w as p, y as m } from "./chunk-O7XYJQB3-md6vjVm4.js";
|
|
6
|
+
import { t as h } from "./chunk-6AEJRKK7-JyfUnUEu.js";
|
|
7
|
+
import { t as g } from "./chunk-JWPE2WC7-Ccb0QaC8.js";
|
|
8
|
+
//#region node_modules/mermaid/dist/chunks/mermaid.core/diagram-MPIPVDR6.mjs
|
|
9
|
+
var _ = {
|
|
10
|
+
showLegend: !0,
|
|
11
|
+
ticks: 5,
|
|
12
|
+
max: null,
|
|
13
|
+
min: 0,
|
|
14
|
+
graticule: "circle"
|
|
15
|
+
}, v = 32, y = {
|
|
16
|
+
axes: [],
|
|
17
|
+
curves: [],
|
|
18
|
+
options: _
|
|
19
|
+
}, b = structuredClone(y), x = u.radar, S = /* @__PURE__ */ r(() => t({
|
|
20
|
+
...x,
|
|
21
|
+
...c().radar
|
|
22
|
+
}), "getConfig"), C = /* @__PURE__ */ r(() => b.axes, "getAxes"), w = /* @__PURE__ */ r(() => b.curves, "getCurves"), T = /* @__PURE__ */ r(() => b.options, "getOptions"), E = /* @__PURE__ */ r((e) => {
|
|
23
|
+
b.axes = e.map((e) => ({
|
|
24
|
+
name: e.name,
|
|
25
|
+
label: e.label ?? e.name
|
|
26
|
+
}));
|
|
27
|
+
}, "setAxes"), D = /* @__PURE__ */ r((e) => {
|
|
28
|
+
b.curves = e.map((e) => ({
|
|
29
|
+
name: e.name,
|
|
30
|
+
label: e.label ?? e.name,
|
|
31
|
+
entries: O(e.entries)
|
|
32
|
+
}));
|
|
33
|
+
}, "setCurves"), O = /* @__PURE__ */ r((e) => {
|
|
34
|
+
if (e[0].axis == null) return e.map((e) => e.value);
|
|
35
|
+
let t = C();
|
|
36
|
+
if (t.length === 0) throw Error("Axes must be populated before curves for reference entries");
|
|
37
|
+
return t.map((t) => {
|
|
38
|
+
let n = e.find((e) => e.axis?.$refText === t.name);
|
|
39
|
+
if (n === void 0) throw Error("Missing entry for axis " + t.label);
|
|
40
|
+
return n.value;
|
|
41
|
+
});
|
|
42
|
+
}, "computeCurveEntries"), k = {
|
|
43
|
+
getAxes: C,
|
|
44
|
+
getCurves: w,
|
|
45
|
+
getOptions: T,
|
|
46
|
+
setAxes: E,
|
|
47
|
+
setCurves: D,
|
|
48
|
+
setOptions: /* @__PURE__ */ r((t) => {
|
|
49
|
+
let n = t.reduce((e, t) => (e[t.name] = t, e), {});
|
|
50
|
+
b.options = {
|
|
51
|
+
showLegend: n.showLegend?.value ?? _.showLegend,
|
|
52
|
+
ticks: n.ticks?.value ?? _.ticks,
|
|
53
|
+
max: n.max?.value ?? _.max,
|
|
54
|
+
min: n.min?.value ?? _.min,
|
|
55
|
+
graticule: n.graticule?.value ?? _.graticule
|
|
56
|
+
}, b.options.ticks > v && (e.warn(`Radar diagram ticks (${b.options.ticks}) exceeds maximum allowed (${v}). Using ${v} instead.`), b.options.ticks = v);
|
|
57
|
+
}, "setOptions"),
|
|
58
|
+
getConfig: S,
|
|
59
|
+
clear: /* @__PURE__ */ r(() => {
|
|
60
|
+
s(), b = structuredClone(y);
|
|
61
|
+
}, "clear"),
|
|
62
|
+
setAccTitle: o,
|
|
63
|
+
getAccTitle: m,
|
|
64
|
+
setDiagramTitle: d,
|
|
65
|
+
getDiagramTitle: p,
|
|
66
|
+
getAccDescription: f,
|
|
67
|
+
setAccDescription: a
|
|
68
|
+
}, A = /* @__PURE__ */ r((e) => {
|
|
69
|
+
g(e, k);
|
|
70
|
+
let { axes: t, curves: n, options: r } = e;
|
|
71
|
+
k.setAxes(t), k.setCurves(n), k.setOptions(r);
|
|
72
|
+
}, "populate"), j = { parse: /* @__PURE__ */ r(async (t) => {
|
|
73
|
+
let r = await n("radar", t);
|
|
74
|
+
e.debug(r), A(r);
|
|
75
|
+
}, "parse") }, M = /* @__PURE__ */ r((e, t, n, r) => {
|
|
76
|
+
let i = r.db, a = i.getAxes(), o = i.getCurves(), s = i.getOptions(), c = i.getConfig(), l = i.getDiagramTitle(), u = N(h(t), c), d = s.max ?? Math.max(...o.map((e) => Math.max(...e.entries))), f = s.min, p = Math.min(c.width, c.height) / 2;
|
|
77
|
+
P(u, a, p, s.ticks, s.graticule), F(u, a, p, c), I(u, a, o, f, d, s.graticule, c), z(u, o, s.showLegend, c), u.append("text").attr("class", "radarTitle").text(l).attr("x", 0).attr("y", -c.height / 2 - c.marginTop);
|
|
78
|
+
}, "draw"), N = /* @__PURE__ */ r((e, t) => {
|
|
79
|
+
let n = t.width + t.marginLeft + t.marginRight, r = t.height + t.marginTop + t.marginBottom, i = {
|
|
80
|
+
x: t.marginLeft + t.width / 2,
|
|
81
|
+
y: t.marginTop + t.height / 2
|
|
82
|
+
};
|
|
83
|
+
return l(e, r, n, t.useMaxWidth ?? !0), e.attr("viewBox", `0 0 ${n} ${r}`).attr("overflow", "visible"), e.append("g").attr("transform", `translate(${i.x}, ${i.y})`);
|
|
84
|
+
}, "drawFrame"), P = /* @__PURE__ */ r((e, t, n, r, i) => {
|
|
85
|
+
if (i === "circle") for (let t = 0; t < r; t++) {
|
|
86
|
+
let i = n * (t + 1) / r;
|
|
87
|
+
e.append("circle").attr("r", i).attr("class", "radarGraticule");
|
|
88
|
+
}
|
|
89
|
+
else if (i === "polygon") {
|
|
90
|
+
let i = t.length;
|
|
91
|
+
for (let a = 0; a < r; a++) {
|
|
92
|
+
let o = n * (a + 1) / r, s = t.map((e, t) => {
|
|
93
|
+
let n = 2 * t * Math.PI / i - Math.PI / 2;
|
|
94
|
+
return `${o * Math.cos(n)},${o * Math.sin(n)}`;
|
|
95
|
+
}).join(" ");
|
|
96
|
+
e.append("polygon").attr("points", s).attr("class", "radarGraticule");
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}, "drawGraticule"), F = /* @__PURE__ */ r((e, t, n, r) => {
|
|
100
|
+
let i = t.length;
|
|
101
|
+
for (let a = 0; a < i; a++) {
|
|
102
|
+
let o = t[a].label, s = 2 * a * Math.PI / i - Math.PI / 2, c = Math.cos(s), l = Math.sin(s);
|
|
103
|
+
e.append("line").attr("x1", 0).attr("y1", 0).attr("x2", n * r.axisScaleFactor * c).attr("y2", n * r.axisScaleFactor * l).attr("class", "radarAxisLine");
|
|
104
|
+
let u = c > .01 ? "start" : c < -.01 ? "end" : "middle", d = l > .01 ? "hanging" : l < -.01 ? "auto" : "central";
|
|
105
|
+
e.append("text").text(o).attr("x", n * r.axisLabelFactor * c + 4 * c).attr("y", n * r.axisLabelFactor * l + 4 * l).attr("text-anchor", u).attr("dominant-baseline", d).attr("class", "radarAxisLabel");
|
|
106
|
+
}
|
|
107
|
+
}, "drawAxes");
|
|
108
|
+
function I(e, t, n, r, i, a, o) {
|
|
109
|
+
let s = t.length, c = Math.min(o.width, o.height) / 2;
|
|
110
|
+
n.forEach((t, n) => {
|
|
111
|
+
if (t.entries.length !== s) return;
|
|
112
|
+
let l = t.entries.map((e, t) => {
|
|
113
|
+
let n = 2 * Math.PI * t / s - Math.PI / 2, a = L(e, r, i, c);
|
|
114
|
+
return {
|
|
115
|
+
x: a * Math.cos(n),
|
|
116
|
+
y: a * Math.sin(n)
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
a === "circle" ? e.append("path").attr("d", R(l, o.curveTension)).attr("class", `radarCurve-${n}`) : a === "polygon" && e.append("polygon").attr("points", l.map((e) => `${e.x},${e.y}`).join(" ")).attr("class", `radarCurve-${n}`);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
r(I, "drawCurves");
|
|
123
|
+
function L(e, t, n, r) {
|
|
124
|
+
return r * (Math.min(Math.max(e, t), n) - t) / (n - t);
|
|
125
|
+
}
|
|
126
|
+
r(L, "relativeRadius");
|
|
127
|
+
function R(e, t) {
|
|
128
|
+
let n = e.length, r = `M${e[0].x},${e[0].y}`;
|
|
129
|
+
for (let i = 0; i < n; i++) {
|
|
130
|
+
let a = e[(i - 1 + n) % n], o = e[i], s = e[(i + 1) % n], c = e[(i + 2) % n], l = {
|
|
131
|
+
x: o.x + (s.x - a.x) * t,
|
|
132
|
+
y: o.y + (s.y - a.y) * t
|
|
133
|
+
}, u = {
|
|
134
|
+
x: s.x - (c.x - o.x) * t,
|
|
135
|
+
y: s.y - (c.y - o.y) * t
|
|
136
|
+
};
|
|
137
|
+
r += ` C${l.x},${l.y} ${u.x},${u.y} ${s.x},${s.y}`;
|
|
138
|
+
}
|
|
139
|
+
return `${r} Z`;
|
|
140
|
+
}
|
|
141
|
+
r(R, "closedRoundCurve");
|
|
142
|
+
function z(e, t, n, r) {
|
|
143
|
+
if (!n) return;
|
|
144
|
+
let i = (r.width / 2 + r.marginRight) * 3 / 4, a = -(r.height / 2 + r.marginTop) * 3 / 4;
|
|
145
|
+
t.forEach((t, n) => {
|
|
146
|
+
let r = e.append("g").attr("transform", `translate(${i}, ${a + n * 20})`);
|
|
147
|
+
r.append("rect").attr("width", 12).attr("height", 12).attr("class", `radarLegendBox-${n}`), r.append("text").attr("x", 16).attr("y", 0).attr("class", "radarLegendText").text(t.label);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
r(z, "drawLegend");
|
|
151
|
+
var B = { draw: M }, V = /* @__PURE__ */ r((e, t) => {
|
|
152
|
+
let n = "";
|
|
153
|
+
for (let r = 0; r < e.THEME_COLOR_LIMIT; r++) {
|
|
154
|
+
let i = e[`cScale${r}`];
|
|
155
|
+
n += `
|
|
156
|
+
.radarCurve-${r} {
|
|
157
|
+
color: ${i};
|
|
158
|
+
fill: ${i};
|
|
159
|
+
fill-opacity: ${t.curveOpacity};
|
|
160
|
+
stroke: ${i};
|
|
161
|
+
stroke-width: ${t.curveStrokeWidth};
|
|
162
|
+
}
|
|
163
|
+
.radarLegendBox-${r} {
|
|
164
|
+
fill: ${i};
|
|
165
|
+
fill-opacity: ${t.curveOpacity};
|
|
166
|
+
stroke: ${i};
|
|
167
|
+
}
|
|
168
|
+
`;
|
|
169
|
+
}
|
|
170
|
+
return n;
|
|
171
|
+
}, "genIndexStyles"), H = /* @__PURE__ */ r((e) => {
|
|
172
|
+
let n = t(i(), c().themeVariables);
|
|
173
|
+
return {
|
|
174
|
+
themeVariables: n,
|
|
175
|
+
radarOptions: t(n.radar, e)
|
|
176
|
+
};
|
|
177
|
+
}, "buildRadarStyleOptions"), U = {
|
|
178
|
+
parser: j,
|
|
179
|
+
db: k,
|
|
180
|
+
renderer: B,
|
|
181
|
+
styles: /* @__PURE__ */ r(({ radar: e } = {}) => {
|
|
182
|
+
let { themeVariables: t, radarOptions: n } = H(e);
|
|
183
|
+
return `
|
|
184
|
+
.radarTitle {
|
|
185
|
+
font-size: ${t.fontSize};
|
|
186
|
+
color: ${t.titleColor};
|
|
187
|
+
dominant-baseline: hanging;
|
|
188
|
+
text-anchor: middle;
|
|
189
|
+
}
|
|
190
|
+
.radarAxisLine {
|
|
191
|
+
stroke: ${n.axisColor};
|
|
192
|
+
stroke-width: ${n.axisStrokeWidth};
|
|
193
|
+
}
|
|
194
|
+
.radarAxisLabel {
|
|
195
|
+
font-size: ${n.axisLabelFontSize}px;
|
|
196
|
+
color: ${n.axisColor};
|
|
197
|
+
}
|
|
198
|
+
.radarGraticule {
|
|
199
|
+
fill: ${n.graticuleColor};
|
|
200
|
+
fill-opacity: ${n.graticuleOpacity};
|
|
201
|
+
stroke: ${n.graticuleColor};
|
|
202
|
+
stroke-width: ${n.graticuleStrokeWidth};
|
|
203
|
+
}
|
|
204
|
+
.radarLegendText {
|
|
205
|
+
text-anchor: start;
|
|
206
|
+
font-size: ${n.legendFontSize}px;
|
|
207
|
+
dominant-baseline: hanging;
|
|
208
|
+
}
|
|
209
|
+
${V(t, n)}
|
|
210
|
+
`;
|
|
211
|
+
}, "styles")
|
|
212
|
+
};
|
|
213
|
+
//#endregion
|
|
214
|
+
export { U as diagram };
|