gradio-leaderboard 0.0.12rc0__py3-none-any.whl → 0.0.14__py3-none-any.whl

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.
Files changed (59) hide show
  1. gradio_leaderboard/leaderboard.pyi +102 -72
  2. gradio_leaderboard/templates/component/Index-CzS_eGV6.js +34210 -0
  3. gradio_leaderboard/templates/component/_basePickBy-CPQEc5fh.js +151 -0
  4. gradio_leaderboard/templates/component/_baseUniq-DlEwemC3.js +615 -0
  5. gradio_leaderboard/templates/component/arc-4UNMf6Jv.js +83 -0
  6. gradio_leaderboard/templates/component/architectureDiagram-NQ2NVSRB-ClVp_eQQ.js +4629 -0
  7. gradio_leaderboard/templates/component/blockDiagram-PHRCVELO-CBZHEIQE.js +2255 -0
  8. gradio_leaderboard/templates/component/c4Diagram-6F6E4RAY-BcEP_NdH.js +1586 -0
  9. gradio_leaderboard/templates/component/channel-BK2Jce3b.js +5 -0
  10. gradio_leaderboard/templates/component/chunk-353BL4L5-D4dVjjbU.js +8 -0
  11. gradio_leaderboard/templates/component/chunk-67H74DCK-Dd9cOxfN.js +64 -0
  12. gradio_leaderboard/templates/component/chunk-6OLS64BW-CfumlcA2.js +1376 -0
  13. gradio_leaderboard/templates/component/chunk-AACKK3MU-4CpiDhxa.js +18 -0
  14. gradio_leaderboard/templates/component/chunk-BFAMUDN2-C6YyJRb4.js +8 -0
  15. gradio_leaderboard/templates/component/chunk-E2GYISFI-CbYUJnri.js +19 -0
  16. gradio_leaderboard/templates/component/chunk-QEP2MXWD-BYLoFCys.js +1380 -0
  17. gradio_leaderboard/templates/component/chunk-SKB7J2MH-DNiBnZKZ.js +19 -0
  18. gradio_leaderboard/templates/component/classDiagram-BGRH5UQR-BrG1RRX8.js +16 -0
  19. gradio_leaderboard/templates/component/classDiagram-v2-O24JOBDK-BrG1RRX8.js +16 -0
  20. gradio_leaderboard/templates/component/clone-BA6MvtJ3.js +8 -0
  21. gradio_leaderboard/templates/component/cytoscape.esm-Bdz5CrXX.js +18629 -0
  22. gradio_leaderboard/templates/component/dagre-FFZHY6LT-6RahWHGr.js +444 -0
  23. gradio_leaderboard/templates/component/defaultLocale-D7EN2tov.js +171 -0
  24. gradio_leaderboard/templates/component/diagram-3EMPZRKU-DtoOVTDy.js +526 -0
  25. gradio_leaderboard/templates/component/diagram-5UYTHUR4-MEp0H-U7.js +137 -0
  26. gradio_leaderboard/templates/component/diagram-ZTM2IBQH-22c5YuUh.js +217 -0
  27. gradio_leaderboard/templates/component/erDiagram-R3QVA2FD-DZp2MeDc.js +844 -0
  28. gradio_leaderboard/templates/component/flowDiagram-PKI6S5ZS-CfK9UZi3.js +1623 -0
  29. gradio_leaderboard/templates/component/ganttDiagram-EK5VF46D-waaD2Kup.js +2502 -0
  30. gradio_leaderboard/templates/component/gitGraphDiagram-GW3U2K7C-DJCAxNvz.js +699 -0
  31. gradio_leaderboard/templates/component/graph-CXm5uxKj.js +247 -0
  32. gradio_leaderboard/templates/component/index.js +2 -29469
  33. gradio_leaderboard/templates/component/infoDiagram-RLU2ROGC-_Rx9wF6U.js +24 -0
  34. gradio_leaderboard/templates/component/init-DjUOC4st.js +16 -0
  35. gradio_leaderboard/templates/component/journeyDiagram-EWQZEKCU-G-tt0noJ.js +836 -0
  36. gradio_leaderboard/templates/component/kanban-definition-ILFWEQ3N-2aHifLFR.js +718 -0
  37. gradio_leaderboard/templates/component/layout-DiZ88ySr.js +1324 -0
  38. gradio_leaderboard/templates/component/linear-D4M9Dm-w.js +259 -0
  39. gradio_leaderboard/templates/component/mermaid.core-D36e06XD.js +14941 -0
  40. gradio_leaderboard/templates/component/mindmap-definition-CZNETY7S-1Jow2c7r.js +3215 -0
  41. gradio_leaderboard/templates/component/ordinal-DfAQgscy.js +61 -0
  42. gradio_leaderboard/templates/component/pieDiagram-NIOCPIFQ-DU7jHSoi.js +162 -0
  43. gradio_leaderboard/templates/component/quadrantDiagram-2OG54O6I-GcojS_If.js +1028 -0
  44. gradio_leaderboard/templates/component/requirementDiagram-SO3GGRV7-CBRyajan.js +853 -0
  45. gradio_leaderboard/templates/component/sankeyDiagram-4UZDY2LN-CeZji6oR.js +820 -0
  46. gradio_leaderboard/templates/component/sequenceDiagram-ZIKVLSP4-DMygkr3Y.js +2284 -0
  47. gradio_leaderboard/templates/component/stateDiagram-XX37X6EN-DK2vsx2r.js +263 -0
  48. gradio_leaderboard/templates/component/stateDiagram-v2-GD6S3NHB-BoIkPrjk.js +16 -0
  49. gradio_leaderboard/templates/component/style.css +1 -1
  50. gradio_leaderboard/templates/component/timeline-definition-RI47OAVP-BQ_Jr8hZ.js +797 -0
  51. gradio_leaderboard/templates/component/treemap-FKARHQ26-2Ty0RcZX.js +12981 -0
  52. gradio_leaderboard/templates/component/xychartDiagram-H2YORKM3--C9dwTwV.js +1368 -0
  53. gradio_leaderboard/templates/example/index.js +201 -139
  54. {gradio_leaderboard-0.0.12rc0.dist-info → gradio_leaderboard-0.0.14.dist-info}/METADATA +3 -3
  55. gradio_leaderboard-0.0.14.dist-info/RECORD +59 -0
  56. {gradio_leaderboard-0.0.12rc0.dist-info → gradio_leaderboard-0.0.14.dist-info}/WHEEL +1 -1
  57. gradio_leaderboard/templates/component/__vite-browser-external-2447137e.js +0 -4
  58. gradio_leaderboard/templates/component/wrapper-6f348d45-19fa94bf.js +0 -2453
  59. gradio_leaderboard-0.0.12rc0.dist-info/RECORD +0 -12
@@ -0,0 +1,526 @@
1
+ import { s as de } from "./chunk-SKB7J2MH-DNiBnZKZ.js";
2
+ import { _ as x, s as ue, g as pe, n as he, o as fe, b as ge, c as me, l as Q, E as ae, D as ne, aY as ye, t as Se, H as ve, k as xe, aZ as B, j as Z, C as be } from "./mermaid.core-D36e06XD.js";
3
+ import { p as Ce } from "./chunk-353BL4L5-D4dVjjbU.js";
4
+ import { I as we } from "./chunk-AACKK3MU-4CpiDhxa.js";
5
+ import { p as Le } from "./treemap-FKARHQ26-2Ty0RcZX.js";
6
+ import { b as O } from "./defaultLocale-D7EN2tov.js";
7
+ import { o as K } from "./ordinal-DfAQgscy.js";
8
+ function Te(e) {
9
+ var a = 0, n = e.children, l = n && n.length;
10
+ if (!l) a = 1;
11
+ else for (; --l >= 0; ) a += n[l].value;
12
+ e.value = a;
13
+ }
14
+ function $e() {
15
+ return this.eachAfter(Te);
16
+ }
17
+ function Fe(e, a) {
18
+ let n = -1;
19
+ for (const l of this)
20
+ e.call(a, l, ++n, this);
21
+ return this;
22
+ }
23
+ function ke(e, a) {
24
+ for (var n = this, l = [n], i, s, d = -1; n = l.pop(); )
25
+ if (e.call(a, n, ++d, this), i = n.children)
26
+ for (s = i.length - 1; s >= 0; --s)
27
+ l.push(i[s]);
28
+ return this;
29
+ }
30
+ function Ne(e, a) {
31
+ for (var n = this, l = [n], i = [], s, d, p, g = -1; n = l.pop(); )
32
+ if (i.push(n), s = n.children)
33
+ for (d = 0, p = s.length; d < p; ++d)
34
+ l.push(s[d]);
35
+ for (; n = i.pop(); )
36
+ e.call(a, n, ++g, this);
37
+ return this;
38
+ }
39
+ function Ae(e, a) {
40
+ let n = -1;
41
+ for (const l of this)
42
+ if (e.call(a, l, ++n, this))
43
+ return l;
44
+ }
45
+ function _e(e) {
46
+ return this.eachAfter(function(a) {
47
+ for (var n = +e(a.data) || 0, l = a.children, i = l && l.length; --i >= 0; ) n += l[i].value;
48
+ a.value = n;
49
+ });
50
+ }
51
+ function ze(e) {
52
+ return this.eachBefore(function(a) {
53
+ a.children && a.children.sort(e);
54
+ });
55
+ }
56
+ function Me(e) {
57
+ for (var a = this, n = Ve(a, e), l = [a]; a !== n; )
58
+ a = a.parent, l.push(a);
59
+ for (var i = l.length; e !== n; )
60
+ l.splice(i, 0, e), e = e.parent;
61
+ return l;
62
+ }
63
+ function Ve(e, a) {
64
+ if (e === a) return e;
65
+ var n = e.ancestors(), l = a.ancestors(), i = null;
66
+ for (e = n.pop(), a = l.pop(); e === a; )
67
+ i = e, e = n.pop(), a = l.pop();
68
+ return i;
69
+ }
70
+ function Pe() {
71
+ for (var e = this, a = [e]; e = e.parent; )
72
+ a.push(e);
73
+ return a;
74
+ }
75
+ function Re() {
76
+ return Array.from(this);
77
+ }
78
+ function Be() {
79
+ var e = [];
80
+ return this.eachBefore(function(a) {
81
+ a.children || e.push(a);
82
+ }), e;
83
+ }
84
+ function De() {
85
+ var e = this, a = [];
86
+ return e.each(function(n) {
87
+ n !== e && a.push({ source: n.parent, target: n });
88
+ }), a;
89
+ }
90
+ function* Ee() {
91
+ var e = this, a, n = [e], l, i, s;
92
+ do
93
+ for (a = n.reverse(), n = []; e = a.pop(); )
94
+ if (yield e, l = e.children)
95
+ for (i = 0, s = l.length; i < s; ++i)
96
+ n.push(l[i]);
97
+ while (n.length);
98
+ }
99
+ function ee(e, a) {
100
+ e instanceof Map ? (e = [void 0, e], a === void 0 && (a = He)) : a === void 0 && (a = Ie);
101
+ for (var n = new U(e), l, i = [n], s, d, p, g; l = i.pop(); )
102
+ if ((d = a(l.data)) && (g = (d = Array.from(d)).length))
103
+ for (l.children = d, p = g - 1; p >= 0; --p)
104
+ i.push(s = d[p] = new U(d[p])), s.parent = l, s.depth = l.depth + 1;
105
+ return n.eachBefore(Ge);
106
+ }
107
+ function We() {
108
+ return ee(this).eachBefore(Oe);
109
+ }
110
+ function Ie(e) {
111
+ return e.children;
112
+ }
113
+ function He(e) {
114
+ return Array.isArray(e) ? e[1] : null;
115
+ }
116
+ function Oe(e) {
117
+ e.data.value !== void 0 && (e.value = e.data.value), e.data = e.data.data;
118
+ }
119
+ function Ge(e) {
120
+ var a = 0;
121
+ do
122
+ e.height = a;
123
+ while ((e = e.parent) && e.height < ++a);
124
+ }
125
+ function U(e) {
126
+ this.data = e, this.depth = this.height = 0, this.parent = null;
127
+ }
128
+ U.prototype = ee.prototype = {
129
+ constructor: U,
130
+ count: $e,
131
+ each: Fe,
132
+ eachAfter: Ne,
133
+ eachBefore: ke,
134
+ find: Ae,
135
+ sum: _e,
136
+ sort: ze,
137
+ path: Me,
138
+ ancestors: Pe,
139
+ descendants: Re,
140
+ leaves: Be,
141
+ links: De,
142
+ copy: We,
143
+ [Symbol.iterator]: Ee
144
+ };
145
+ function qe(e) {
146
+ if (typeof e != "function") throw new Error();
147
+ return e;
148
+ }
149
+ function G() {
150
+ return 0;
151
+ }
152
+ function q(e) {
153
+ return function() {
154
+ return e;
155
+ };
156
+ }
157
+ function Xe(e) {
158
+ e.x0 = Math.round(e.x0), e.y0 = Math.round(e.y0), e.x1 = Math.round(e.x1), e.y1 = Math.round(e.y1);
159
+ }
160
+ function Ye(e, a, n, l, i) {
161
+ for (var s = e.children, d, p = -1, g = s.length, c = e.value && (l - a) / e.value; ++p < g; )
162
+ d = s[p], d.y0 = n, d.y1 = i, d.x0 = a, d.x1 = a += d.value * c;
163
+ }
164
+ function je(e, a, n, l, i) {
165
+ for (var s = e.children, d, p = -1, g = s.length, c = e.value && (i - n) / e.value; ++p < g; )
166
+ d = s[p], d.x0 = a, d.x1 = l, d.y0 = n, d.y1 = n += d.value * c;
167
+ }
168
+ var Ze = (1 + Math.sqrt(5)) / 2;
169
+ function Ue(e, a, n, l, i, s) {
170
+ for (var d = [], p = a.children, g, c, u = 0, C = 0, r = p.length, b, S, v = a.value, h, m, A, N, P, E, _; u < r; ) {
171
+ b = i - n, S = s - l;
172
+ do
173
+ h = p[C++].value;
174
+ while (!h && C < r);
175
+ for (m = A = h, E = Math.max(S / b, b / S) / (v * e), _ = h * h * E, P = Math.max(A / _, _ / m); C < r; ++C) {
176
+ if (h += c = p[C].value, c < m && (m = c), c > A && (A = c), _ = h * h * E, N = Math.max(A / _, _ / m), N > P) {
177
+ h -= c;
178
+ break;
179
+ }
180
+ P = N;
181
+ }
182
+ d.push(g = { value: h, dice: b < S, children: p.slice(u, C) }), g.dice ? Ye(g, n, l, i, v ? l += S * h / v : s) : je(g, n, l, v ? n += b * h / v : i, s), v -= h, u = C;
183
+ }
184
+ return d;
185
+ }
186
+ const Je = function e(a) {
187
+ function n(l, i, s, d, p) {
188
+ Ue(a, l, i, s, d, p);
189
+ }
190
+ return n.ratio = function(l) {
191
+ return e((l = +l) > 1 ? l : 1);
192
+ }, n;
193
+ }(Ze);
194
+ function Ke() {
195
+ var e = Je, a = !1, n = 1, l = 1, i = [0], s = G, d = G, p = G, g = G, c = G;
196
+ function u(r) {
197
+ return r.x0 = r.y0 = 0, r.x1 = n, r.y1 = l, r.eachBefore(C), i = [0], a && r.eachBefore(Xe), r;
198
+ }
199
+ function C(r) {
200
+ var b = i[r.depth], S = r.x0 + b, v = r.y0 + b, h = r.x1 - b, m = r.y1 - b;
201
+ h < S && (S = h = (S + h) / 2), m < v && (v = m = (v + m) / 2), r.x0 = S, r.y0 = v, r.x1 = h, r.y1 = m, r.children && (b = i[r.depth + 1] = s(r) / 2, S += c(r) - b, v += d(r) - b, h -= p(r) - b, m -= g(r) - b, h < S && (S = h = (S + h) / 2), m < v && (v = m = (v + m) / 2), e(r, S, v, h, m));
202
+ }
203
+ return u.round = function(r) {
204
+ return arguments.length ? (a = !!r, u) : a;
205
+ }, u.size = function(r) {
206
+ return arguments.length ? (n = +r[0], l = +r[1], u) : [n, l];
207
+ }, u.tile = function(r) {
208
+ return arguments.length ? (e = qe(r), u) : e;
209
+ }, u.padding = function(r) {
210
+ return arguments.length ? u.paddingInner(r).paddingOuter(r) : u.paddingInner();
211
+ }, u.paddingInner = function(r) {
212
+ return arguments.length ? (s = typeof r == "function" ? r : q(+r), u) : s;
213
+ }, u.paddingOuter = function(r) {
214
+ return arguments.length ? u.paddingTop(r).paddingRight(r).paddingBottom(r).paddingLeft(r) : u.paddingTop();
215
+ }, u.paddingTop = function(r) {
216
+ return arguments.length ? (d = typeof r == "function" ? r : q(+r), u) : d;
217
+ }, u.paddingRight = function(r) {
218
+ return arguments.length ? (p = typeof r == "function" ? r : q(+r), u) : p;
219
+ }, u.paddingBottom = function(r) {
220
+ return arguments.length ? (g = typeof r == "function" ? r : q(+r), u) : g;
221
+ }, u.paddingLeft = function(r) {
222
+ return arguments.length ? (c = typeof r == "function" ? r : q(+r), u) : c;
223
+ }, u;
224
+ }
225
+ var Qe = {
226
+ nodes: [],
227
+ levels: /* @__PURE__ */ new Map(),
228
+ outerNodes: [],
229
+ classes: /* @__PURE__ */ new Map()
230
+ }, V = new we(() => structuredClone(Qe)), et = /* @__PURE__ */ x(() => {
231
+ const e = be, a = ae();
232
+ return ne({
233
+ ...e.treemap,
234
+ ...a.treemap ?? {}
235
+ });
236
+ }, "getConfig"), tt = /* @__PURE__ */ x(() => V.records.nodes, "getNodes"), at = /* @__PURE__ */ x((e, a) => {
237
+ const n = V.records;
238
+ n.nodes.push(e), n.levels.set(e, a), a === 0 && n.outerNodes.push(e), a === 0 && !n.root && (n.root = e);
239
+ }, "addNode"), nt = /* @__PURE__ */ x(() => ({ name: "", children: V.records.outerNodes }), "getRoot"), lt = /* @__PURE__ */ x((e, a) => {
240
+ const n = V.records.classes, l = n.get(e) ?? { id: e, styles: [], textStyles: [] };
241
+ n.set(e, l);
242
+ const i = a.replace(/\\,/g, "§§§").replace(/,/g, ";").replace(/§§§/g, ",").split(";");
243
+ i && i.forEach((s) => {
244
+ ye(s) && (l?.textStyles ? l.textStyles.push(s) : l.textStyles = [s]), l?.styles ? l.styles.push(s) : l.styles = [s];
245
+ }), n.set(e, l);
246
+ }, "addClass"), rt = /* @__PURE__ */ x(() => V.records.classes, "getClasses"), st = /* @__PURE__ */ x((e) => V.records.classes.get(e)?.styles ?? [], "getStylesForClass"), ot = /* @__PURE__ */ x(() => {
247
+ Se(), V.reset();
248
+ }, "clear"), Y = {
249
+ getNodes: tt,
250
+ addNode: at,
251
+ getRoot: nt,
252
+ getConfig: et,
253
+ clear: ot,
254
+ setAccTitle: ue,
255
+ getAccTitle: pe,
256
+ setDiagramTitle: he,
257
+ getDiagramTitle: fe,
258
+ getAccDescription: ge,
259
+ setAccDescription: me,
260
+ addClass: lt,
261
+ getClasses: rt,
262
+ getStylesForClass: st
263
+ };
264
+ function le(e) {
265
+ if (!e.length)
266
+ return [];
267
+ const a = [], n = [];
268
+ return e.forEach((l) => {
269
+ const i = {
270
+ name: l.name,
271
+ children: l.type === "Leaf" ? void 0 : []
272
+ };
273
+ for (i.classSelector = l?.classSelector, l?.cssCompiledStyles && (i.cssCompiledStyles = [l.cssCompiledStyles]), l.type === "Leaf" && l.value !== void 0 && (i.value = l.value); n.length > 0 && n[n.length - 1].level >= l.level; )
274
+ n.pop();
275
+ if (n.length === 0)
276
+ a.push(i);
277
+ else {
278
+ const s = n[n.length - 1].node;
279
+ s.children ? s.children.push(i) : s.children = [i];
280
+ }
281
+ l.type !== "Leaf" && n.push({ node: i, level: l.level });
282
+ }), a;
283
+ }
284
+ x(le, "buildHierarchy");
285
+ var it = /* @__PURE__ */ x((e) => {
286
+ Ce(e, Y);
287
+ const a = [];
288
+ for (const i of e.TreemapRows ?? [])
289
+ i.$type === "ClassDefStatement" && Y.addClass(i.className ?? "", i.styleText ?? "");
290
+ for (const i of e.TreemapRows ?? []) {
291
+ const s = i.item;
292
+ if (!s)
293
+ continue;
294
+ const d = i.indent ? parseInt(i.indent) : 0, p = ct(s), g = s.classSelector ? Y.getStylesForClass(s.classSelector) : [], c = g.length > 0 ? g.join(";") : void 0, u = {
295
+ level: d,
296
+ name: p,
297
+ type: s.$type,
298
+ value: s.value,
299
+ classSelector: s.classSelector,
300
+ cssCompiledStyles: c
301
+ };
302
+ a.push(u);
303
+ }
304
+ const n = le(a), l = /* @__PURE__ */ x((i, s) => {
305
+ for (const d of i)
306
+ Y.addNode(d, s), d.children && d.children.length > 0 && l(d.children, s + 1);
307
+ }, "addNodesRecursively");
308
+ l(n, 0);
309
+ }, "populate"), ct = /* @__PURE__ */ x((e) => e.name ? String(e.name) : "", "getItemName"), dt = {
310
+ parse: /* @__PURE__ */ x(async (e) => {
311
+ try {
312
+ const n = await Le("treemap", e);
313
+ Q.debug("Treemap AST:", n), it(n);
314
+ } catch (a) {
315
+ throw Q.error("Error parsing treemap:", a), a;
316
+ }
317
+ }, "parse")
318
+ }, ut = 10, D = 10, X = 25, pt = /* @__PURE__ */ x((e, a, n, l) => {
319
+ const i = l.db, s = i.getConfig(), d = s.padding ?? ut, p = i.getDiagramTitle(), g = i.getRoot(), { themeVariables: c } = ae();
320
+ if (!g)
321
+ return;
322
+ const u = p ? 30 : 0, C = ve(a), r = s.nodeWidth ? s.nodeWidth * D : 960, b = s.nodeHeight ? s.nodeHeight * D : 500, S = r, v = b + u;
323
+ C.attr("viewBox", `0 0 ${S} ${v}`), xe(C, v, S, s.useMaxWidth);
324
+ let h;
325
+ try {
326
+ const t = s.valueFormat || ",";
327
+ if (t === "$0,0")
328
+ h = /* @__PURE__ */ x((o) => "$" + O(",")(o), "valueFormat");
329
+ else if (t.startsWith("$") && t.includes(",")) {
330
+ const o = /\.\d+/.exec(t), f = o ? o[0] : "";
331
+ h = /* @__PURE__ */ x((w) => "$" + O("," + f)(w), "valueFormat");
332
+ } else if (t.startsWith("$")) {
333
+ const o = t.substring(1);
334
+ h = /* @__PURE__ */ x((f) => "$" + O(o || "")(f), "valueFormat");
335
+ } else
336
+ h = O(t);
337
+ } catch (t) {
338
+ Q.error("Error creating format function:", t), h = O(",");
339
+ }
340
+ const m = K().range([
341
+ "transparent",
342
+ c.cScale0,
343
+ c.cScale1,
344
+ c.cScale2,
345
+ c.cScale3,
346
+ c.cScale4,
347
+ c.cScale5,
348
+ c.cScale6,
349
+ c.cScale7,
350
+ c.cScale8,
351
+ c.cScale9,
352
+ c.cScale10,
353
+ c.cScale11
354
+ ]), A = K().range([
355
+ "transparent",
356
+ c.cScalePeer0,
357
+ c.cScalePeer1,
358
+ c.cScalePeer2,
359
+ c.cScalePeer3,
360
+ c.cScalePeer4,
361
+ c.cScalePeer5,
362
+ c.cScalePeer6,
363
+ c.cScalePeer7,
364
+ c.cScalePeer8,
365
+ c.cScalePeer9,
366
+ c.cScalePeer10,
367
+ c.cScalePeer11
368
+ ]), N = K().range([
369
+ c.cScaleLabel0,
370
+ c.cScaleLabel1,
371
+ c.cScaleLabel2,
372
+ c.cScaleLabel3,
373
+ c.cScaleLabel4,
374
+ c.cScaleLabel5,
375
+ c.cScaleLabel6,
376
+ c.cScaleLabel7,
377
+ c.cScaleLabel8,
378
+ c.cScaleLabel9,
379
+ c.cScaleLabel10,
380
+ c.cScaleLabel11
381
+ ]);
382
+ p && C.append("text").attr("x", S / 2).attr("y", u / 2).attr("class", "treemapTitle").attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(p);
383
+ const P = C.append("g").attr("transform", `translate(0, ${u})`).attr("class", "treemapContainer"), E = ee(g).sum((t) => t.value ?? 0).sort((t, o) => (o.value ?? 0) - (t.value ?? 0)), te = Ke().size([r, b]).paddingTop(
384
+ (t) => t.children && t.children.length > 0 ? X + D : 0
385
+ ).paddingInner(d).paddingLeft((t) => t.children && t.children.length > 0 ? D : 0).paddingRight((t) => t.children && t.children.length > 0 ? D : 0).paddingBottom((t) => t.children && t.children.length > 0 ? D : 0).round(!0)(E), re = te.descendants().filter((t) => t.children && t.children.length > 0), W = P.selectAll(".treemapSection").data(re).enter().append("g").attr("class", "treemapSection").attr("transform", (t) => `translate(${t.x0},${t.y0})`);
386
+ W.append("rect").attr("width", (t) => t.x1 - t.x0).attr("height", X).attr("class", "treemapSectionHeader").attr("fill", "none").attr("fill-opacity", 0.6).attr("stroke-width", 0.6).attr("style", (t) => t.depth === 0 ? "display: none;" : ""), W.append("clipPath").attr("id", (t, o) => `clip-section-${a}-${o}`).append("rect").attr("width", (t) => Math.max(0, t.x1 - t.x0 - 12)).attr("height", X), W.append("rect").attr("width", (t) => t.x1 - t.x0).attr("height", (t) => t.y1 - t.y0).attr("class", (t, o) => `treemapSection section${o}`).attr("fill", (t) => m(t.data.name)).attr("fill-opacity", 0.6).attr("stroke", (t) => A(t.data.name)).attr("stroke-width", 2).attr("stroke-opacity", 0.4).attr("style", (t) => {
387
+ if (t.depth === 0)
388
+ return "display: none;";
389
+ const o = B({ cssCompiledStyles: t.data.cssCompiledStyles });
390
+ return o.nodeStyles + ";" + o.borderStyles.join(";");
391
+ }), W.append("text").attr("class", "treemapSectionLabel").attr("x", 6).attr("y", X / 2).attr("dominant-baseline", "middle").text((t) => t.depth === 0 ? "" : t.data.name).attr("font-weight", "bold").attr("style", (t) => {
392
+ if (t.depth === 0)
393
+ return "display: none;";
394
+ const o = "dominant-baseline: middle; font-size: 12px; fill:" + N(t.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;", f = B({ cssCompiledStyles: t.data.cssCompiledStyles });
395
+ return o + f.labelStyles.replace("color:", "fill:");
396
+ }).each(function(t) {
397
+ if (t.depth === 0)
398
+ return;
399
+ const o = Z(this), f = t.data.name;
400
+ o.text(f);
401
+ const w = t.x1 - t.x0, $ = 6;
402
+ let F;
403
+ s.showValues !== !1 && t.value ? F = w - 10 - 30 - 10 - $ : F = w - $ - 6;
404
+ const k = Math.max(15, F), y = o.node();
405
+ if (y.getComputedTextLength() > k) {
406
+ const L = "...";
407
+ let T = f;
408
+ for (; T.length > 0; ) {
409
+ if (T = f.substring(0, T.length - 1), T.length === 0) {
410
+ o.text(L), y.getComputedTextLength() > k && o.text("");
411
+ break;
412
+ }
413
+ if (o.text(T + L), y.getComputedTextLength() <= k)
414
+ break;
415
+ }
416
+ }
417
+ }), s.showValues !== !1 && W.append("text").attr("class", "treemapSectionValue").attr("x", (t) => t.x1 - t.x0 - 10).attr("y", X / 2).attr("text-anchor", "end").attr("dominant-baseline", "middle").text((t) => t.value ? h(t.value) : "").attr("font-style", "italic").attr("style", (t) => {
418
+ if (t.depth === 0)
419
+ return "display: none;";
420
+ const o = "text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:" + N(t.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;", f = B({ cssCompiledStyles: t.data.cssCompiledStyles });
421
+ return o + f.labelStyles.replace("color:", "fill:");
422
+ });
423
+ const se = te.leaves(), j = P.selectAll(".treemapLeafGroup").data(se).enter().append("g").attr("class", (t, o) => `treemapNode treemapLeafGroup leaf${o}${t.data.classSelector ? ` ${t.data.classSelector}` : ""}x`).attr("transform", (t) => `translate(${t.x0},${t.y0})`);
424
+ j.append("rect").attr("width", (t) => t.x1 - t.x0).attr("height", (t) => t.y1 - t.y0).attr("class", "treemapLeaf").attr("fill", (t) => t.parent ? m(t.parent.data.name) : m(t.data.name)).attr("style", (t) => B({ cssCompiledStyles: t.data.cssCompiledStyles }).nodeStyles).attr("fill-opacity", 0.3).attr("stroke", (t) => t.parent ? m(t.parent.data.name) : m(t.data.name)).attr("stroke-width", 3), j.append("clipPath").attr("id", (t, o) => `clip-${a}-${o}`).append("rect").attr("width", (t) => Math.max(0, t.x1 - t.x0 - 4)).attr("height", (t) => Math.max(0, t.y1 - t.y0 - 4)), j.append("text").attr("class", "treemapLabel").attr("x", (t) => (t.x1 - t.x0) / 2).attr("y", (t) => (t.y1 - t.y0) / 2).attr("style", (t) => {
425
+ const o = "text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:" + N(t.data.name) + ";", f = B({ cssCompiledStyles: t.data.cssCompiledStyles });
426
+ return o + f.labelStyles.replace("color:", "fill:");
427
+ }).attr("clip-path", (t, o) => `url(#clip-${a}-${o})`).text((t) => t.data.name).each(function(t) {
428
+ const o = Z(this), f = t.x1 - t.x0, w = t.y1 - t.y0, $ = o.node(), F = 4, R = f - 2 * F, k = w - 2 * F;
429
+ if (R < 10 || k < 10) {
430
+ o.style("display", "none");
431
+ return;
432
+ }
433
+ let y = parseInt(o.style("font-size"), 10);
434
+ const z = 8, L = 28, T = 0.6, M = 6, I = 2;
435
+ for (; $.getComputedTextLength() > R && y > z; )
436
+ y--, o.style("font-size", `${y}px`);
437
+ let H = Math.max(
438
+ M,
439
+ Math.min(L, Math.round(y * T))
440
+ ), J = y + I + H;
441
+ for (; J > k && y > z && (y--, H = Math.max(
442
+ M,
443
+ Math.min(L, Math.round(y * T))
444
+ ), !(H < M && y === z)); )
445
+ o.style("font-size", `${y}px`), J = y + I + H;
446
+ o.style("font-size", `${y}px`), ($.getComputedTextLength() > R || y < z || k < y) && o.style("display", "none");
447
+ }), s.showValues !== !1 && j.append("text").attr("class", "treemapValue").attr("x", (o) => (o.x1 - o.x0) / 2).attr("y", function(o) {
448
+ return (o.y1 - o.y0) / 2;
449
+ }).attr("style", (o) => {
450
+ const f = "text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:" + N(o.data.name) + ";", w = B({ cssCompiledStyles: o.data.cssCompiledStyles });
451
+ return f + w.labelStyles.replace("color:", "fill:");
452
+ }).attr("clip-path", (o, f) => `url(#clip-${a}-${f})`).text((o) => o.value ? h(o.value) : "").each(function(o) {
453
+ const f = Z(this), w = this.parentNode;
454
+ if (!w) {
455
+ f.style("display", "none");
456
+ return;
457
+ }
458
+ const $ = Z(w).select(".treemapLabel");
459
+ if ($.empty() || $.style("display") === "none") {
460
+ f.style("display", "none");
461
+ return;
462
+ }
463
+ const F = parseFloat($.style("font-size")), R = 28, k = 0.6, y = 6, z = 2, L = Math.max(
464
+ y,
465
+ Math.min(R, Math.round(F * k))
466
+ );
467
+ f.style("font-size", `${L}px`);
468
+ const M = (o.y1 - o.y0) / 2 + F / 2 + z;
469
+ f.attr("y", M);
470
+ const I = o.x1 - o.x0, ie = o.y1 - o.y0 - 4, ce = I - 2 * 4;
471
+ f.node().getComputedTextLength() > ce || M + L > ie || L < y ? f.style("display", "none") : f.style("display", null);
472
+ });
473
+ const oe = s.diagramPadding ?? 8;
474
+ de(C, oe, "flowchart", s?.useMaxWidth || !1);
475
+ }, "draw"), ht = /* @__PURE__ */ x(function(e, a) {
476
+ return a.db.getClasses();
477
+ }, "getClasses"), ft = { draw: pt, getClasses: ht }, gt = {
478
+ sectionStrokeColor: "black",
479
+ sectionStrokeWidth: "1",
480
+ sectionFillColor: "#efefef",
481
+ leafStrokeColor: "black",
482
+ leafStrokeWidth: "1",
483
+ leafFillColor: "#efefef",
484
+ labelColor: "black",
485
+ labelFontSize: "12px",
486
+ valueFontSize: "10px",
487
+ valueColor: "black",
488
+ titleColor: "black",
489
+ titleFontSize: "14px"
490
+ }, mt = /* @__PURE__ */ x(({
491
+ treemap: e
492
+ } = {}) => {
493
+ const a = ne(gt, e);
494
+ return `
495
+ .treemapNode.section {
496
+ stroke: ${a.sectionStrokeColor};
497
+ stroke-width: ${a.sectionStrokeWidth};
498
+ fill: ${a.sectionFillColor};
499
+ }
500
+ .treemapNode.leaf {
501
+ stroke: ${a.leafStrokeColor};
502
+ stroke-width: ${a.leafStrokeWidth};
503
+ fill: ${a.leafFillColor};
504
+ }
505
+ .treemapLabel {
506
+ fill: ${a.labelColor};
507
+ font-size: ${a.labelFontSize};
508
+ }
509
+ .treemapValue {
510
+ fill: ${a.valueColor};
511
+ font-size: ${a.valueFontSize};
512
+ }
513
+ .treemapTitle {
514
+ fill: ${a.titleColor};
515
+ font-size: ${a.titleFontSize};
516
+ }
517
+ `;
518
+ }, "getStyles"), yt = mt, $t = {
519
+ parser: dt,
520
+ db: Y,
521
+ renderer: ft,
522
+ styles: yt
523
+ };
524
+ export {
525
+ $t as diagram
526
+ };
@@ -0,0 +1,137 @@
1
+ import { p as y } from "./chunk-353BL4L5-D4dVjjbU.js";
2
+ import { C as B, s as S, g as z, n as E, o as F, b as P, c as W, _ as i, l as w, D as x, E as D, t as T, H as _, k as A } from "./mermaid.core-D36e06XD.js";
3
+ import { p as N } from "./treemap-FKARHQ26-2Ty0RcZX.js";
4
+ var m = {
5
+ packet: []
6
+ }, v = structuredClone(m), L = B.packet, Y = /* @__PURE__ */ i(() => {
7
+ const t = x({
8
+ ...L,
9
+ ...D().packet
10
+ });
11
+ return t.showBits && (t.paddingY += 10), t;
12
+ }, "getConfig"), H = /* @__PURE__ */ i(() => v.packet, "getPacket"), I = /* @__PURE__ */ i((t) => {
13
+ t.length > 0 && v.packet.push(t);
14
+ }, "pushWord"), M = /* @__PURE__ */ i(() => {
15
+ T(), v = structuredClone(m);
16
+ }, "clear"), u = {
17
+ pushWord: I,
18
+ getPacket: H,
19
+ getConfig: Y,
20
+ clear: M,
21
+ setAccTitle: S,
22
+ getAccTitle: z,
23
+ setDiagramTitle: E,
24
+ getDiagramTitle: F,
25
+ getAccDescription: P,
26
+ setAccDescription: W
27
+ }, O = 1e4, G = /* @__PURE__ */ i((t) => {
28
+ y(t, u);
29
+ let e = -1, o = [], n = 1;
30
+ const { bitsPerRow: s } = u.getConfig();
31
+ for (let { start: a, end: r, bits: c, label: f } of t.blocks) {
32
+ if (a !== void 0 && r !== void 0 && r < a)
33
+ throw new Error(`Packet block ${a} - ${r} is invalid. End must be greater than start.`);
34
+ if (a ??= e + 1, a !== e + 1)
35
+ throw new Error(
36
+ `Packet block ${a} - ${r ?? a} is not contiguous. It should start from ${e + 1}.`
37
+ );
38
+ if (c === 0)
39
+ throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);
40
+ for (r ??= a + (c ?? 1) - 1, c ??= r - a + 1, e = r, w.debug(`Packet block ${a} - ${e} with label ${f}`); o.length <= s + 1 && u.getPacket().length < O; ) {
41
+ const [d, p] = K({ start: a, end: r, bits: c, label: f }, n, s);
42
+ if (o.push(d), d.end + 1 === n * s && (u.pushWord(o), o = [], n++), !p)
43
+ break;
44
+ ({ start: a, end: r, bits: c, label: f } = p);
45
+ }
46
+ }
47
+ u.pushWord(o);
48
+ }, "populate"), K = /* @__PURE__ */ i((t, e, o) => {
49
+ if (t.start === void 0)
50
+ throw new Error("start should have been set during first phase");
51
+ if (t.end === void 0)
52
+ throw new Error("end should have been set during first phase");
53
+ if (t.start > t.end)
54
+ throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);
55
+ if (t.end + 1 <= e * o)
56
+ return [t, void 0];
57
+ const n = e * o - 1, s = e * o;
58
+ return [
59
+ {
60
+ start: t.start,
61
+ end: n,
62
+ label: t.label,
63
+ bits: n - t.start
64
+ },
65
+ {
66
+ start: s,
67
+ end: t.end,
68
+ label: t.label,
69
+ bits: t.end - s
70
+ }
71
+ ];
72
+ }, "getNextFittingBlock"), R = {
73
+ parse: /* @__PURE__ */ i(async (t) => {
74
+ const e = await N("packet", t);
75
+ w.debug(e), G(e);
76
+ }, "parse")
77
+ }, U = /* @__PURE__ */ i((t, e, o, n) => {
78
+ const s = n.db, a = s.getConfig(), { rowHeight: r, paddingY: c, bitWidth: f, bitsPerRow: d } = a, p = s.getPacket(), l = s.getDiagramTitle(), k = r + c, g = k * (p.length + 1) - (l ? 0 : r), b = f * d + 2, h = _(e);
79
+ h.attr("viewbox", `0 0 ${b} ${g}`), A(h, g, b, a.useMaxWidth);
80
+ for (const [C, $] of p.entries())
81
+ X(h, $, C, a);
82
+ h.append("text").text(l).attr("x", b / 2).attr("y", g - k / 2).attr("dominant-baseline", "middle").attr("text-anchor", "middle").attr("class", "packetTitle");
83
+ }, "draw"), X = /* @__PURE__ */ i((t, e, o, { rowHeight: n, paddingX: s, paddingY: a, bitWidth: r, bitsPerRow: c, showBits: f }) => {
84
+ const d = t.append("g"), p = o * (n + a) + a;
85
+ for (const l of e) {
86
+ const k = l.start % c * r + 1, g = (l.end - l.start + 1) * r - s;
87
+ if (d.append("rect").attr("x", k).attr("y", p).attr("width", g).attr("height", n).attr("class", "packetBlock"), d.append("text").attr("x", k + g / 2).attr("y", p + n / 2).attr("class", "packetLabel").attr("dominant-baseline", "middle").attr("text-anchor", "middle").text(l.label), !f)
88
+ continue;
89
+ const b = l.end === l.start, h = p - 2;
90
+ d.append("text").attr("x", k + (b ? g / 2 : 0)).attr("y", h).attr("class", "packetByte start").attr("dominant-baseline", "auto").attr("text-anchor", b ? "middle" : "start").text(l.start), b || d.append("text").attr("x", k + g).attr("y", h).attr("class", "packetByte end").attr("dominant-baseline", "auto").attr("text-anchor", "end").text(l.end);
91
+ }
92
+ }, "drawWord"), j = { draw: U }, q = {
93
+ byteFontSize: "10px",
94
+ startByteColor: "black",
95
+ endByteColor: "black",
96
+ labelColor: "black",
97
+ labelFontSize: "12px",
98
+ titleColor: "black",
99
+ titleFontSize: "14px",
100
+ blockStrokeColor: "black",
101
+ blockStrokeWidth: "1",
102
+ blockFillColor: "#efefef"
103
+ }, J = /* @__PURE__ */ i(({ packet: t } = {}) => {
104
+ const e = x(q, t);
105
+ return `
106
+ .packetByte {
107
+ font-size: ${e.byteFontSize};
108
+ }
109
+ .packetByte.start {
110
+ fill: ${e.startByteColor};
111
+ }
112
+ .packetByte.end {
113
+ fill: ${e.endByteColor};
114
+ }
115
+ .packetLabel {
116
+ fill: ${e.labelColor};
117
+ font-size: ${e.labelFontSize};
118
+ }
119
+ .packetTitle {
120
+ fill: ${e.titleColor};
121
+ font-size: ${e.titleFontSize};
122
+ }
123
+ .packetBlock {
124
+ stroke: ${e.blockStrokeColor};
125
+ stroke-width: ${e.blockStrokeWidth};
126
+ fill: ${e.blockFillColor};
127
+ }
128
+ `;
129
+ }, "styles"), tt = {
130
+ parser: R,
131
+ db: u,
132
+ renderer: j,
133
+ styles: J
134
+ };
135
+ export {
136
+ tt as diagram
137
+ };