hub-ui-x 0.0.1

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 (65) hide show
  1. package/README.md +5 -0
  2. package/dist/_basePickBy-C1WsytTM.js +151 -0
  3. package/dist/_baseUniq-CGQBVjq6.js +614 -0
  4. package/dist/arc-CfWEFjh8.js +84 -0
  5. package/dist/architecture-4AB2E3PP-DcT_AgQk.js +5 -0
  6. package/dist/architectureDiagram-IEHRJDOE-HOxolPJX.js +4635 -0
  7. package/dist/blockDiagram-JOT3LUYC-DOUpbN2x.js +2248 -0
  8. package/dist/c4Diagram-VJAJSXHY-BFAcC0i5.js +1582 -0
  9. package/dist/channel-Cu0z2gst.js +5 -0
  10. package/dist/chart-CJ_SRNKN.js +9241 -0
  11. package/dist/chunk-4BMEZGHF-BBaiA8MA.js +9 -0
  12. package/dist/chunk-A2AXSNBT-BWpKSYi4.js +1373 -0
  13. package/dist/chunk-AEK57VVT-doTsaHuQ.js +1415 -0
  14. package/dist/chunk-D6G4REZN-B6Iq6yid.js +64 -0
  15. package/dist/chunk-RZ5BOZE2-OspkSZtw.js +25 -0
  16. package/dist/chunk-XZIHB7SX-BTYIr8g5.js +15 -0
  17. package/dist/classDiagram-GIVACNV2-B_ES2mS7.js +17 -0
  18. package/dist/classDiagram-v2-COTLJTTW-B_ES2mS7.js +17 -0
  19. package/dist/clone-BZBtMp_G.js +8 -0
  20. package/dist/colors-BD7LS4qt.js +7 -0
  21. package/dist/cytoscape.esm-Swd9B-1A.js +18633 -0
  22. package/dist/dagre-OKDRZEBW-qXmKnSET.js +447 -0
  23. package/dist/diagram-SSKATNLV-D9zp03W0.js +221 -0
  24. package/dist/diagram-VNBRO52H-CBXg8AYQ.js +126 -0
  25. package/dist/download-B6Cbg_6N.js +39 -0
  26. package/dist/echarts-CvKQD1G1.js +44028 -0
  27. package/dist/erDiagram-Q7BY3M3F-BOJJGO7u.js +842 -0
  28. package/dist/flowDiagram-4HSFHLVR-jSArwKHg.js +1623 -0
  29. package/dist/ganttDiagram-APWFNJXF-DlkSU7D9.js +2472 -0
  30. package/dist/gitGraph-O2Q2CXLX-BKCeQqs8.js +5 -0
  31. package/dist/gitGraphDiagram-7IBYFJ6S-DUvZEq_S.js +713 -0
  32. package/dist/graph-zFu0gYaZ.js +247 -0
  33. package/dist/helper-C5NlRbA2.js +13 -0
  34. package/dist/hub-ui-x.css +1 -0
  35. package/dist/hub-ui-x.es.ts +5 -0
  36. package/dist/hub-ui-x.umd.ts +3258 -0
  37. package/dist/index-evjDGH2n.js +62533 -0
  38. package/dist/info-4N47QTOZ-BYDGL7Ae.js +5 -0
  39. package/dist/infoDiagram-PH2N3AL5-DJvDYk-t.js +22 -0
  40. package/dist/init-DjUOC4st.js +16 -0
  41. package/dist/journeyDiagram-U35MCT3I---dClVe4.js +810 -0
  42. package/dist/kanban-definition-NDS4AKOZ-DPL_aBPT.js +719 -0
  43. package/dist/katex-9tX9hjoM.js +11692 -0
  44. package/dist/layout-BqSq5ofg.js +1324 -0
  45. package/dist/linear-fJjgKrP9.js +423 -0
  46. package/dist/mermaid-CZvYCPmi.js +14243 -0
  47. package/dist/mermaid-parser.core-Bz7ADZ88.js +12835 -0
  48. package/dist/min-DLf0xQMm.js +28 -0
  49. package/dist/mindmap-definition-ALO5MXBD-CzxIzyQv.js +3222 -0
  50. package/dist/mindmap-r94UHoYv.js +21909 -0
  51. package/dist/ordinal-DfAQgscy.js +61 -0
  52. package/dist/packet-KVYON367-D4di2cz5.js +5 -0
  53. package/dist/pie-R6RNRRYF-CcxAsT3F.js +5 -0
  54. package/dist/pieDiagram-IB7DONF6-B5HBkGlO.js +162 -0
  55. package/dist/quadrantDiagram-7GDLP6J5-BS5bmqKW.js +1025 -0
  56. package/dist/radar-MK3ICKWK-CVYy5goT.js +5 -0
  57. package/dist/requirementDiagram-KVF5MWMF-Cr8GcN4Y.js +851 -0
  58. package/dist/sankeyDiagram-QLVOVGJD-Bhq9k8_q.js +806 -0
  59. package/dist/sequenceDiagram-X6HHIX6F-CCmFoYyv.js +2282 -0
  60. package/dist/stateDiagram-DGXRK772-JkIqKyGq.js +271 -0
  61. package/dist/stateDiagram-v2-YXO3MK2T-DMxAxUZ1.js +17 -0
  62. package/dist/timeline-definition-BDJGKUSR-Bi42udQn.js +805 -0
  63. package/dist/transform-Bsa6BTXX.js +1834 -0
  64. package/dist/xychartDiagram-VJFVF3MP-BI97ppBM.js +1305 -0
  65. package/package.json +55 -0
@@ -0,0 +1,1305 @@
1
+ import { _ as a, s as ui, g as gi, p as Ft, o as xi, a as di, b as pi, l as Xt, G as fi, d as mi, x as yi, D as At, C as Nt, E as bi, I as Ai, h as wi, aB as Ci, P as Bt } from "./mermaid-CZvYCPmi.js";
2
+ import "./transform-Bsa6BTXX.js";
3
+ import { i as Si } from "./init-DjUOC4st.js";
4
+ import { o as _i } from "./ordinal-DfAQgscy.js";
5
+ import { l as Wt } from "./linear-fJjgKrP9.js";
6
+ function ki(e, t, i) {
7
+ e = +e, t = +t, i = (n = arguments.length) < 2 ? (t = e, e = 0, 1) : n < 3 ? 1 : +i;
8
+ for (var s = -1, n = Math.max(0, Math.ceil((t - e) / i)) | 0, o = new Array(n); ++s < n; )
9
+ o[s] = e + s * i;
10
+ return o;
11
+ }
12
+ function pt() {
13
+ var e = _i().unknown(void 0), t = e.domain, i = e.range, s = 0, n = 1, o, u, f = !1, p = 0, k = 0, R = 0.5;
14
+ delete e.unknown;
15
+ function w() {
16
+ var y = t().length, D = n < s, S = D ? n : s, v = D ? s : n;
17
+ o = (v - S) / Math.max(1, y - p + k * 2), f && (o = Math.floor(o)), S += (v - S - o * (y - p)) * R, u = o * (1 - p), f && (S = Math.round(S), u = Math.round(u));
18
+ var m = ki(y).map(function(_) {
19
+ return S + o * _;
20
+ });
21
+ return i(D ? m.reverse() : m);
22
+ }
23
+ return e.domain = function(y) {
24
+ return arguments.length ? (t(y), w()) : t();
25
+ }, e.range = function(y) {
26
+ return arguments.length ? ([s, n] = y, s = +s, n = +n, w()) : [s, n];
27
+ }, e.rangeRound = function(y) {
28
+ return [s, n] = y, s = +s, n = +n, f = !0, w();
29
+ }, e.bandwidth = function() {
30
+ return u;
31
+ }, e.step = function() {
32
+ return o;
33
+ }, e.round = function(y) {
34
+ return arguments.length ? (f = !!y, w()) : f;
35
+ }, e.padding = function(y) {
36
+ return arguments.length ? (p = Math.min(1, k = +y), w()) : p;
37
+ }, e.paddingInner = function(y) {
38
+ return arguments.length ? (p = Math.min(1, y), w()) : p;
39
+ }, e.paddingOuter = function(y) {
40
+ return arguments.length ? (k = +y, w()) : k;
41
+ }, e.align = function(y) {
42
+ return arguments.length ? (R = Math.max(0, Math.min(1, y)), w()) : R;
43
+ }, e.copy = function() {
44
+ return pt(t(), [s, n]).round(f).paddingInner(p).paddingOuter(k).align(R);
45
+ }, Si.apply(w(), arguments);
46
+ }
47
+ var ft = function() {
48
+ var e = /* @__PURE__ */ a(function(B, h, c, g) {
49
+ for (c = c || {}, g = B.length; g--; c[B[g]] = h) ;
50
+ return c;
51
+ }, "o"), t = [1, 10, 12, 14, 16, 18, 19, 21, 23], i = [2, 6], s = [1, 3], n = [1, 5], o = [1, 6], u = [1, 7], f = [1, 5, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], p = [1, 25], k = [1, 26], R = [1, 28], w = [1, 29], y = [1, 30], D = [1, 31], S = [1, 32], v = [1, 33], m = [1, 34], _ = [1, 35], l = [1, 36], E = [1, 37], K = [1, 43], vt = [1, 42], Pt = [1, 47], et = [1, 50], C = [1, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], lt = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36], I = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], Lt = [1, 64], ct = {
52
+ trace: /* @__PURE__ */ a(function() {
53
+ }, "trace"),
54
+ yy: {},
55
+ symbols_: { error: 2, start: 3, eol: 4, XYCHART: 5, chartConfig: 6, document: 7, CHART_ORIENTATION: 8, statement: 9, title: 10, text: 11, X_AXIS: 12, parseXAxis: 13, Y_AXIS: 14, parseYAxis: 15, LINE: 16, plotData: 17, BAR: 18, acc_title: 19, acc_title_value: 20, acc_descr: 21, acc_descr_value: 22, acc_descr_multiline_value: 23, SQUARE_BRACES_START: 24, commaSeparatedNumbers: 25, SQUARE_BRACES_END: 26, NUMBER_WITH_DECIMAL: 27, COMMA: 28, xAxisData: 29, bandData: 30, ARROW_DELIMITER: 31, commaSeparatedTexts: 32, yAxisData: 33, NEWLINE: 34, SEMI: 35, EOF: 36, alphaNum: 37, STR: 38, MD_STR: 39, alphaNumToken: 40, AMP: 41, NUM: 42, ALPHA: 43, PLUS: 44, EQUALS: 45, MULT: 46, DOT: 47, BRKT: 48, MINUS: 49, UNDERSCORE: 50, $accept: 0, $end: 1 },
56
+ terminals_: { 2: "error", 5: "XYCHART", 8: "CHART_ORIENTATION", 10: "title", 12: "X_AXIS", 14: "Y_AXIS", 16: "LINE", 18: "BAR", 19: "acc_title", 20: "acc_title_value", 21: "acc_descr", 22: "acc_descr_value", 23: "acc_descr_multiline_value", 24: "SQUARE_BRACES_START", 26: "SQUARE_BRACES_END", 27: "NUMBER_WITH_DECIMAL", 28: "COMMA", 31: "ARROW_DELIMITER", 34: "NEWLINE", 35: "SEMI", 36: "EOF", 38: "STR", 39: "MD_STR", 41: "AMP", 42: "NUM", 43: "ALPHA", 44: "PLUS", 45: "EQUALS", 46: "MULT", 47: "DOT", 48: "BRKT", 49: "MINUS", 50: "UNDERSCORE" },
57
+ productions_: [0, [3, 2], [3, 3], [3, 2], [3, 1], [6, 1], [7, 0], [7, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 3], [9, 2], [9, 3], [9, 2], [9, 2], [9, 1], [17, 3], [25, 3], [25, 1], [13, 1], [13, 2], [13, 1], [29, 1], [29, 3], [30, 3], [32, 3], [32, 1], [15, 1], [15, 2], [15, 1], [33, 3], [4, 1], [4, 1], [4, 1], [11, 1], [11, 1], [11, 1], [37, 1], [37, 2], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1]],
58
+ performAction: /* @__PURE__ */ a(function(h, c, g, x, A, r, Z) {
59
+ var d = r.length - 1;
60
+ switch (A) {
61
+ case 5:
62
+ x.setOrientation(r[d]);
63
+ break;
64
+ case 9:
65
+ x.setDiagramTitle(r[d].text.trim());
66
+ break;
67
+ case 12:
68
+ x.setLineData({ text: "", type: "text" }, r[d]);
69
+ break;
70
+ case 13:
71
+ x.setLineData(r[d - 1], r[d]);
72
+ break;
73
+ case 14:
74
+ x.setBarData({ text: "", type: "text" }, r[d]);
75
+ break;
76
+ case 15:
77
+ x.setBarData(r[d - 1], r[d]);
78
+ break;
79
+ case 16:
80
+ this.$ = r[d].trim(), x.setAccTitle(this.$);
81
+ break;
82
+ case 17:
83
+ case 18:
84
+ this.$ = r[d].trim(), x.setAccDescription(this.$);
85
+ break;
86
+ case 19:
87
+ this.$ = r[d - 1];
88
+ break;
89
+ case 20:
90
+ this.$ = [Number(r[d - 2]), ...r[d]];
91
+ break;
92
+ case 21:
93
+ this.$ = [Number(r[d])];
94
+ break;
95
+ case 22:
96
+ x.setXAxisTitle(r[d]);
97
+ break;
98
+ case 23:
99
+ x.setXAxisTitle(r[d - 1]);
100
+ break;
101
+ case 24:
102
+ x.setXAxisTitle({ type: "text", text: "" });
103
+ break;
104
+ case 25:
105
+ x.setXAxisBand(r[d]);
106
+ break;
107
+ case 26:
108
+ x.setXAxisRangeData(Number(r[d - 2]), Number(r[d]));
109
+ break;
110
+ case 27:
111
+ this.$ = r[d - 1];
112
+ break;
113
+ case 28:
114
+ this.$ = [r[d - 2], ...r[d]];
115
+ break;
116
+ case 29:
117
+ this.$ = [r[d]];
118
+ break;
119
+ case 30:
120
+ x.setYAxisTitle(r[d]);
121
+ break;
122
+ case 31:
123
+ x.setYAxisTitle(r[d - 1]);
124
+ break;
125
+ case 32:
126
+ x.setYAxisTitle({ type: "text", text: "" });
127
+ break;
128
+ case 33:
129
+ x.setYAxisRangeData(Number(r[d - 2]), Number(r[d]));
130
+ break;
131
+ case 37:
132
+ this.$ = { text: r[d], type: "text" };
133
+ break;
134
+ case 38:
135
+ this.$ = { text: r[d], type: "text" };
136
+ break;
137
+ case 39:
138
+ this.$ = { text: r[d], type: "markdown" };
139
+ break;
140
+ case 40:
141
+ this.$ = r[d];
142
+ break;
143
+ case 41:
144
+ this.$ = r[d - 1] + "" + r[d];
145
+ break;
146
+ }
147
+ }, "anonymous"),
148
+ table: [e(t, i, { 3: 1, 4: 2, 7: 4, 5: s, 34: n, 35: o, 36: u }), { 1: [3] }, e(t, i, { 4: 2, 7: 4, 3: 8, 5: s, 34: n, 35: o, 36: u }), e(t, i, { 4: 2, 7: 4, 6: 9, 3: 10, 5: s, 8: [1, 11], 34: n, 35: o, 36: u }), { 1: [2, 4], 9: 12, 10: [1, 13], 12: [1, 14], 14: [1, 15], 16: [1, 16], 18: [1, 17], 19: [1, 18], 21: [1, 19], 23: [1, 20] }, e(f, [2, 34]), e(f, [2, 35]), e(f, [2, 36]), { 1: [2, 1] }, e(t, i, { 4: 2, 7: 4, 3: 21, 5: s, 34: n, 35: o, 36: u }), { 1: [2, 3] }, e(f, [2, 5]), e(t, [2, 7], { 4: 22, 34: n, 35: o, 36: u }), { 11: 23, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, { 11: 39, 13: 38, 24: K, 27: vt, 29: 40, 30: 41, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, { 11: 45, 15: 44, 27: Pt, 33: 46, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, { 11: 49, 17: 48, 24: et, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, { 11: 52, 17: 51, 24: et, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, { 20: [1, 53] }, { 22: [1, 54] }, e(C, [2, 18]), { 1: [2, 2] }, e(C, [2, 8]), e(C, [2, 9]), e(lt, [2, 37], { 40: 55, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }), e(lt, [2, 38]), e(lt, [2, 39]), e(I, [2, 40]), e(I, [2, 42]), e(I, [2, 43]), e(I, [2, 44]), e(I, [2, 45]), e(I, [2, 46]), e(I, [2, 47]), e(I, [2, 48]), e(I, [2, 49]), e(I, [2, 50]), e(I, [2, 51]), e(C, [2, 10]), e(C, [2, 22], { 30: 41, 29: 56, 24: K, 27: vt }), e(C, [2, 24]), e(C, [2, 25]), { 31: [1, 57] }, { 11: 59, 32: 58, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, e(C, [2, 11]), e(C, [2, 30], { 33: 60, 27: Pt }), e(C, [2, 32]), { 31: [1, 61] }, e(C, [2, 12]), { 17: 62, 24: et }, { 25: 63, 27: Lt }, e(C, [2, 14]), { 17: 65, 24: et }, e(C, [2, 16]), e(C, [2, 17]), e(I, [2, 41]), e(C, [2, 23]), { 27: [1, 66] }, { 26: [1, 67] }, { 26: [2, 29], 28: [1, 68] }, e(C, [2, 31]), { 27: [1, 69] }, e(C, [2, 13]), { 26: [1, 70] }, { 26: [2, 21], 28: [1, 71] }, e(C, [2, 15]), e(C, [2, 26]), e(C, [2, 27]), { 11: 59, 32: 72, 37: 24, 38: p, 39: k, 40: 27, 41: R, 42: w, 43: y, 44: D, 45: S, 46: v, 47: m, 48: _, 49: l, 50: E }, e(C, [2, 33]), e(C, [2, 19]), { 25: 73, 27: Lt }, { 26: [2, 28] }, { 26: [2, 20] }],
149
+ defaultActions: { 8: [2, 1], 10: [2, 3], 21: [2, 2], 72: [2, 28], 73: [2, 20] },
150
+ parseError: /* @__PURE__ */ a(function(h, c) {
151
+ if (c.recoverable)
152
+ this.trace(h);
153
+ else {
154
+ var g = new Error(h);
155
+ throw g.hash = c, g;
156
+ }
157
+ }, "parseError"),
158
+ parse: /* @__PURE__ */ a(function(h) {
159
+ var c = this, g = [0], x = [], A = [null], r = [], Z = this.table, d = "", nt = 0, Et = 0, oi = 2, It = 1, hi = r.slice.call(arguments, 1), T = Object.create(this.lexer), W = { yy: {} };
160
+ for (var ut in this.yy)
161
+ Object.prototype.hasOwnProperty.call(this.yy, ut) && (W.yy[ut] = this.yy[ut]);
162
+ T.setInput(h, W.yy), W.yy.lexer = T, W.yy.parser = this, typeof T.yylloc > "u" && (T.yylloc = {});
163
+ var gt = T.yylloc;
164
+ r.push(gt);
165
+ var li = T.options && T.options.ranges;
166
+ typeof W.yy.parseError == "function" ? this.parseError = W.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
167
+ function ci(L) {
168
+ g.length = g.length - 2 * L, A.length = A.length - L, r.length = r.length - L;
169
+ }
170
+ a(ci, "popStack");
171
+ function Mt() {
172
+ var L;
173
+ return L = x.pop() || T.lex() || It, typeof L != "number" && (L instanceof Array && (x = L, L = x.pop()), L = c.symbols_[L] || L), L;
174
+ }
175
+ a(Mt, "lex");
176
+ for (var P, O, M, xt, z = {}, at, V, Vt, rt; ; ) {
177
+ if (O = g[g.length - 1], this.defaultActions[O] ? M = this.defaultActions[O] : ((P === null || typeof P > "u") && (P = Mt()), M = Z[O] && Z[O][P]), typeof M > "u" || !M.length || !M[0]) {
178
+ var dt = "";
179
+ rt = [];
180
+ for (at in Z[O])
181
+ this.terminals_[at] && at > oi && rt.push("'" + this.terminals_[at] + "'");
182
+ T.showPosition ? dt = "Parse error on line " + (nt + 1) + `:
183
+ ` + T.showPosition() + `
184
+ Expecting ` + rt.join(", ") + ", got '" + (this.terminals_[P] || P) + "'" : dt = "Parse error on line " + (nt + 1) + ": Unexpected " + (P == It ? "end of input" : "'" + (this.terminals_[P] || P) + "'"), this.parseError(dt, {
185
+ text: T.match,
186
+ token: this.terminals_[P] || P,
187
+ line: T.yylineno,
188
+ loc: gt,
189
+ expected: rt
190
+ });
191
+ }
192
+ if (M[0] instanceof Array && M.length > 1)
193
+ throw new Error("Parse Error: multiple actions possible at state: " + O + ", token: " + P);
194
+ switch (M[0]) {
195
+ case 1:
196
+ g.push(P), A.push(T.yytext), r.push(T.yylloc), g.push(M[1]), P = null, Et = T.yyleng, d = T.yytext, nt = T.yylineno, gt = T.yylloc;
197
+ break;
198
+ case 2:
199
+ if (V = this.productions_[M[1]][1], z.$ = A[A.length - V], z._$ = {
200
+ first_line: r[r.length - (V || 1)].first_line,
201
+ last_line: r[r.length - 1].last_line,
202
+ first_column: r[r.length - (V || 1)].first_column,
203
+ last_column: r[r.length - 1].last_column
204
+ }, li && (z._$.range = [
205
+ r[r.length - (V || 1)].range[0],
206
+ r[r.length - 1].range[1]
207
+ ]), xt = this.performAction.apply(z, [
208
+ d,
209
+ Et,
210
+ nt,
211
+ W.yy,
212
+ M[1],
213
+ A,
214
+ r
215
+ ].concat(hi)), typeof xt < "u")
216
+ return xt;
217
+ V && (g = g.slice(0, -1 * V * 2), A = A.slice(0, -1 * V), r = r.slice(0, -1 * V)), g.push(this.productions_[M[1]][0]), A.push(z.$), r.push(z._$), Vt = Z[g[g.length - 2]][g[g.length - 1]], g.push(Vt);
218
+ break;
219
+ case 3:
220
+ return !0;
221
+ }
222
+ }
223
+ return !0;
224
+ }, "parse")
225
+ }, ri = /* @__PURE__ */ function() {
226
+ var B = {
227
+ EOF: 1,
228
+ parseError: /* @__PURE__ */ a(function(c, g) {
229
+ if (this.yy.parser)
230
+ this.yy.parser.parseError(c, g);
231
+ else
232
+ throw new Error(c);
233
+ }, "parseError"),
234
+ // resets the lexer, sets new input
235
+ setInput: /* @__PURE__ */ a(function(h, c) {
236
+ return this.yy = c || this.yy || {}, this._input = h, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
237
+ first_line: 1,
238
+ first_column: 0,
239
+ last_line: 1,
240
+ last_column: 0
241
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
242
+ }, "setInput"),
243
+ // consumes and returns one char from the input
244
+ input: /* @__PURE__ */ a(function() {
245
+ var h = this._input[0];
246
+ this.yytext += h, this.yyleng++, this.offset++, this.match += h, this.matched += h;
247
+ var c = h.match(/(?:\r\n?|\n).*/g);
248
+ return c ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), h;
249
+ }, "input"),
250
+ // unshifts one char (or a string) into the input
251
+ unput: /* @__PURE__ */ a(function(h) {
252
+ var c = h.length, g = h.split(/(?:\r\n?|\n)/g);
253
+ this._input = h + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - c), this.offset -= c;
254
+ var x = this.match.split(/(?:\r\n?|\n)/g);
255
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), g.length - 1 && (this.yylineno -= g.length - 1);
256
+ var A = this.yylloc.range;
257
+ return this.yylloc = {
258
+ first_line: this.yylloc.first_line,
259
+ last_line: this.yylineno + 1,
260
+ first_column: this.yylloc.first_column,
261
+ last_column: g ? (g.length === x.length ? this.yylloc.first_column : 0) + x[x.length - g.length].length - g[0].length : this.yylloc.first_column - c
262
+ }, this.options.ranges && (this.yylloc.range = [A[0], A[0] + this.yyleng - c]), this.yyleng = this.yytext.length, this;
263
+ }, "unput"),
264
+ // When called from action, caches matched text and appends it on next action
265
+ more: /* @__PURE__ */ a(function() {
266
+ return this._more = !0, this;
267
+ }, "more"),
268
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
269
+ reject: /* @__PURE__ */ a(function() {
270
+ if (this.options.backtrack_lexer)
271
+ this._backtrack = !0;
272
+ else
273
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
274
+ ` + this.showPosition(), {
275
+ text: "",
276
+ token: null,
277
+ line: this.yylineno
278
+ });
279
+ return this;
280
+ }, "reject"),
281
+ // retain first n characters of the match
282
+ less: /* @__PURE__ */ a(function(h) {
283
+ this.unput(this.match.slice(h));
284
+ }, "less"),
285
+ // displays already matched input, i.e. for error messages
286
+ pastInput: /* @__PURE__ */ a(function() {
287
+ var h = this.matched.substr(0, this.matched.length - this.match.length);
288
+ return (h.length > 20 ? "..." : "") + h.substr(-20).replace(/\n/g, "");
289
+ }, "pastInput"),
290
+ // displays upcoming input, i.e. for error messages
291
+ upcomingInput: /* @__PURE__ */ a(function() {
292
+ var h = this.match;
293
+ return h.length < 20 && (h += this._input.substr(0, 20 - h.length)), (h.substr(0, 20) + (h.length > 20 ? "..." : "")).replace(/\n/g, "");
294
+ }, "upcomingInput"),
295
+ // displays the character position where the lexing error occurred, i.e. for error messages
296
+ showPosition: /* @__PURE__ */ a(function() {
297
+ var h = this.pastInput(), c = new Array(h.length + 1).join("-");
298
+ return h + this.upcomingInput() + `
299
+ ` + c + "^";
300
+ }, "showPosition"),
301
+ // test the lexed token: return FALSE when not a match, otherwise return token
302
+ test_match: /* @__PURE__ */ a(function(h, c) {
303
+ var g, x, A;
304
+ if (this.options.backtrack_lexer && (A = {
305
+ yylineno: this.yylineno,
306
+ yylloc: {
307
+ first_line: this.yylloc.first_line,
308
+ last_line: this.last_line,
309
+ first_column: this.yylloc.first_column,
310
+ last_column: this.yylloc.last_column
311
+ },
312
+ yytext: this.yytext,
313
+ match: this.match,
314
+ matches: this.matches,
315
+ matched: this.matched,
316
+ yyleng: this.yyleng,
317
+ offset: this.offset,
318
+ _more: this._more,
319
+ _input: this._input,
320
+ yy: this.yy,
321
+ conditionStack: this.conditionStack.slice(0),
322
+ done: this.done
323
+ }, this.options.ranges && (A.yylloc.range = this.yylloc.range.slice(0))), x = h[0].match(/(?:\r\n?|\n).*/g), x && (this.yylineno += x.length), this.yylloc = {
324
+ first_line: this.yylloc.last_line,
325
+ last_line: this.yylineno + 1,
326
+ first_column: this.yylloc.last_column,
327
+ last_column: x ? x[x.length - 1].length - x[x.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + h[0].length
328
+ }, this.yytext += h[0], this.match += h[0], this.matches = h, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(h[0].length), this.matched += h[0], g = this.performAction.call(this, this.yy, this, c, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), g)
329
+ return g;
330
+ if (this._backtrack) {
331
+ for (var r in A)
332
+ this[r] = A[r];
333
+ return !1;
334
+ }
335
+ return !1;
336
+ }, "test_match"),
337
+ // return next match in input
338
+ next: /* @__PURE__ */ a(function() {
339
+ if (this.done)
340
+ return this.EOF;
341
+ this._input || (this.done = !0);
342
+ var h, c, g, x;
343
+ this._more || (this.yytext = "", this.match = "");
344
+ for (var A = this._currentRules(), r = 0; r < A.length; r++)
345
+ if (g = this._input.match(this.rules[A[r]]), g && (!c || g[0].length > c[0].length)) {
346
+ if (c = g, x = r, this.options.backtrack_lexer) {
347
+ if (h = this.test_match(g, A[r]), h !== !1)
348
+ return h;
349
+ if (this._backtrack) {
350
+ c = !1;
351
+ continue;
352
+ } else
353
+ return !1;
354
+ } else if (!this.options.flex)
355
+ break;
356
+ }
357
+ return c ? (h = this.test_match(c, A[x]), h !== !1 ? h : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
358
+ ` + this.showPosition(), {
359
+ text: "",
360
+ token: null,
361
+ line: this.yylineno
362
+ });
363
+ }, "next"),
364
+ // return next match that has a token
365
+ lex: /* @__PURE__ */ a(function() {
366
+ var c = this.next();
367
+ return c || this.lex();
368
+ }, "lex"),
369
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
370
+ begin: /* @__PURE__ */ a(function(c) {
371
+ this.conditionStack.push(c);
372
+ }, "begin"),
373
+ // pop the previously active lexer condition state off the condition stack
374
+ popState: /* @__PURE__ */ a(function() {
375
+ var c = this.conditionStack.length - 1;
376
+ return c > 0 ? this.conditionStack.pop() : this.conditionStack[0];
377
+ }, "popState"),
378
+ // produce the lexer rule set which is active for the currently active lexer condition state
379
+ _currentRules: /* @__PURE__ */ a(function() {
380
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
381
+ }, "_currentRules"),
382
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
383
+ topState: /* @__PURE__ */ a(function(c) {
384
+ return c = this.conditionStack.length - 1 - Math.abs(c || 0), c >= 0 ? this.conditionStack[c] : "INITIAL";
385
+ }, "topState"),
386
+ // alias for begin(condition)
387
+ pushState: /* @__PURE__ */ a(function(c) {
388
+ this.begin(c);
389
+ }, "pushState"),
390
+ // return the number of states currently on the stack
391
+ stateStackSize: /* @__PURE__ */ a(function() {
392
+ return this.conditionStack.length;
393
+ }, "stateStackSize"),
394
+ options: { "case-insensitive": !0 },
395
+ performAction: /* @__PURE__ */ a(function(c, g, x, A) {
396
+ switch (x) {
397
+ case 0:
398
+ break;
399
+ case 1:
400
+ break;
401
+ case 2:
402
+ return this.popState(), 34;
403
+ case 3:
404
+ return this.popState(), 34;
405
+ case 4:
406
+ return 34;
407
+ case 5:
408
+ break;
409
+ case 6:
410
+ return 10;
411
+ case 7:
412
+ return this.pushState("acc_title"), 19;
413
+ case 8:
414
+ return this.popState(), "acc_title_value";
415
+ case 9:
416
+ return this.pushState("acc_descr"), 21;
417
+ case 10:
418
+ return this.popState(), "acc_descr_value";
419
+ case 11:
420
+ this.pushState("acc_descr_multiline");
421
+ break;
422
+ case 12:
423
+ this.popState();
424
+ break;
425
+ case 13:
426
+ return "acc_descr_multiline_value";
427
+ case 14:
428
+ return 5;
429
+ case 15:
430
+ return 8;
431
+ case 16:
432
+ return this.pushState("axis_data"), "X_AXIS";
433
+ case 17:
434
+ return this.pushState("axis_data"), "Y_AXIS";
435
+ case 18:
436
+ return this.pushState("axis_band_data"), 24;
437
+ case 19:
438
+ return 31;
439
+ case 20:
440
+ return this.pushState("data"), 16;
441
+ case 21:
442
+ return this.pushState("data"), 18;
443
+ case 22:
444
+ return this.pushState("data_inner"), 24;
445
+ case 23:
446
+ return 27;
447
+ case 24:
448
+ return this.popState(), 26;
449
+ case 25:
450
+ this.popState();
451
+ break;
452
+ case 26:
453
+ this.pushState("string");
454
+ break;
455
+ case 27:
456
+ this.popState();
457
+ break;
458
+ case 28:
459
+ return "STR";
460
+ case 29:
461
+ return 24;
462
+ case 30:
463
+ return 26;
464
+ case 31:
465
+ return 43;
466
+ case 32:
467
+ return "COLON";
468
+ case 33:
469
+ return 44;
470
+ case 34:
471
+ return 28;
472
+ case 35:
473
+ return 45;
474
+ case 36:
475
+ return 46;
476
+ case 37:
477
+ return 48;
478
+ case 38:
479
+ return 50;
480
+ case 39:
481
+ return 47;
482
+ case 40:
483
+ return 41;
484
+ case 41:
485
+ return 49;
486
+ case 42:
487
+ return 42;
488
+ case 43:
489
+ break;
490
+ case 44:
491
+ return 35;
492
+ case 45:
493
+ return 36;
494
+ }
495
+ }, "anonymous"),
496
+ rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:(\r?\n))/i, /^(?:(\r?\n))/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:title\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:\{)/i, /^(?:[^\}]*)/i, /^(?:xychart-beta\b)/i, /^(?:(?:vertical|horizontal))/i, /^(?:x-axis\b)/i, /^(?:y-axis\b)/i, /^(?:\[)/i, /^(?:-->)/i, /^(?:line\b)/i, /^(?:bar\b)/i, /^(?:\[)/i, /^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i, /^(?:\])/i, /^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:[A-Za-z]+)/i, /^(?::)/i, /^(?:\+)/i, /^(?:,)/i, /^(?:=)/i, /^(?:\*)/i, /^(?:#)/i, /^(?:[\_])/i, /^(?:\.)/i, /^(?:&)/i, /^(?:-)/i, /^(?:[0-9]+)/i, /^(?:\s+)/i, /^(?:;)/i, /^(?:$)/i],
497
+ conditions: { data_inner: { rules: [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, data: { rules: [0, 1, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 22, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, axis_band_data: { rules: [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, axis_data: { rules: [0, 1, 2, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 19, 20, 21, 23, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, acc_descr_multiline: { rules: [12, 13], inclusive: !1 }, acc_descr: { rules: [10], inclusive: !1 }, acc_title: { rules: [8], inclusive: !1 }, title: { rules: [], inclusive: !1 }, md_string: { rules: [], inclusive: !1 }, string: { rules: [27, 28], inclusive: !1 }, INITIAL: { rules: [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 } }
498
+ };
499
+ return B;
500
+ }();
501
+ ct.lexer = ri;
502
+ function st() {
503
+ this.yy = {};
504
+ }
505
+ return a(st, "Parser"), st.prototype = ct, ct.Parser = st, new st();
506
+ }();
507
+ ft.parser = ft;
508
+ var Ri = ft;
509
+ function mt(e) {
510
+ return e.type === "bar";
511
+ }
512
+ a(mt, "isBarPlot");
513
+ function wt(e) {
514
+ return e.type === "band";
515
+ }
516
+ a(wt, "isBandAxisData");
517
+ function F(e) {
518
+ return e.type === "linear";
519
+ }
520
+ a(F, "isLinearAxisData");
521
+ var X, Yt = (X = class {
522
+ constructor(t) {
523
+ this.parentGroup = t;
524
+ }
525
+ getMaxDimension(t, i) {
526
+ if (!this.parentGroup)
527
+ return {
528
+ width: t.reduce((o, u) => Math.max(u.length, o), 0) * i,
529
+ height: i
530
+ };
531
+ const s = {
532
+ width: 0,
533
+ height: 0
534
+ }, n = this.parentGroup.append("g").attr("visibility", "hidden").attr("font-size", i);
535
+ for (const o of t) {
536
+ const u = Ci(n, 1, o), f = u ? u.width : o.length * i, p = u ? u.height : i;
537
+ s.width = Math.max(s.width, f), s.height = Math.max(s.height, p);
538
+ }
539
+ return n.remove(), s;
540
+ }
541
+ }, a(X, "TextDimensionCalculatorWithFont"), X), Ot = 0.7, zt = 0.2, N, Ht = (N = class {
542
+ constructor(t, i, s, n) {
543
+ this.axisConfig = t, this.title = i, this.textDimensionCalculator = s, this.axisThemeConfig = n, this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }, this.axisPosition = "left", this.showTitle = !1, this.showLabel = !1, this.showTick = !1, this.showAxisLine = !1, this.outerPadding = 0, this.titleTextHeight = 0, this.labelTextHeight = 0, this.range = [0, 10], this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }, this.axisPosition = "left";
544
+ }
545
+ setRange(t) {
546
+ this.range = t, this.axisPosition === "left" || this.axisPosition === "right" ? this.boundingRect.height = t[1] - t[0] : this.boundingRect.width = t[1] - t[0], this.recalculateScale();
547
+ }
548
+ getRange() {
549
+ return [this.range[0] + this.outerPadding, this.range[1] - this.outerPadding];
550
+ }
551
+ setAxisPosition(t) {
552
+ this.axisPosition = t, this.setRange(this.range);
553
+ }
554
+ getTickDistance() {
555
+ const t = this.getRange();
556
+ return Math.abs(t[0] - t[1]) / this.getTickValues().length;
557
+ }
558
+ getAxisOuterPadding() {
559
+ return this.outerPadding;
560
+ }
561
+ getLabelDimension() {
562
+ return this.textDimensionCalculator.getMaxDimension(
563
+ this.getTickValues().map((t) => t.toString()),
564
+ this.axisConfig.labelFontSize
565
+ );
566
+ }
567
+ recalculateOuterPaddingToDrawBar() {
568
+ Ot * this.getTickDistance() > this.outerPadding * 2 && (this.outerPadding = Math.floor(Ot * this.getTickDistance() / 2)), this.recalculateScale();
569
+ }
570
+ calculateSpaceIfDrawnHorizontally(t) {
571
+ let i = t.height;
572
+ if (this.axisConfig.showAxisLine && i > this.axisConfig.axisLineWidth && (i -= this.axisConfig.axisLineWidth, this.showAxisLine = !0), this.axisConfig.showLabel) {
573
+ const s = this.getLabelDimension(), n = zt * t.width;
574
+ this.outerPadding = Math.min(s.width / 2, n);
575
+ const o = s.height + this.axisConfig.labelPadding * 2;
576
+ this.labelTextHeight = s.height, o <= i && (i -= o, this.showLabel = !0);
577
+ }
578
+ if (this.axisConfig.showTick && i >= this.axisConfig.tickLength && (this.showTick = !0, i -= this.axisConfig.tickLength), this.axisConfig.showTitle && this.title) {
579
+ const s = this.textDimensionCalculator.getMaxDimension(
580
+ [this.title],
581
+ this.axisConfig.titleFontSize
582
+ ), n = s.height + this.axisConfig.titlePadding * 2;
583
+ this.titleTextHeight = s.height, n <= i && (i -= n, this.showTitle = !0);
584
+ }
585
+ this.boundingRect.width = t.width, this.boundingRect.height = t.height - i;
586
+ }
587
+ calculateSpaceIfDrawnVertical(t) {
588
+ let i = t.width;
589
+ if (this.axisConfig.showAxisLine && i > this.axisConfig.axisLineWidth && (i -= this.axisConfig.axisLineWidth, this.showAxisLine = !0), this.axisConfig.showLabel) {
590
+ const s = this.getLabelDimension(), n = zt * t.height;
591
+ this.outerPadding = Math.min(s.height / 2, n);
592
+ const o = s.width + this.axisConfig.labelPadding * 2;
593
+ o <= i && (i -= o, this.showLabel = !0);
594
+ }
595
+ if (this.axisConfig.showTick && i >= this.axisConfig.tickLength && (this.showTick = !0, i -= this.axisConfig.tickLength), this.axisConfig.showTitle && this.title) {
596
+ const s = this.textDimensionCalculator.getMaxDimension(
597
+ [this.title],
598
+ this.axisConfig.titleFontSize
599
+ ), n = s.height + this.axisConfig.titlePadding * 2;
600
+ this.titleTextHeight = s.height, n <= i && (i -= n, this.showTitle = !0);
601
+ }
602
+ this.boundingRect.width = t.width - i, this.boundingRect.height = t.height;
603
+ }
604
+ calculateSpace(t) {
605
+ return this.axisPosition === "left" || this.axisPosition === "right" ? this.calculateSpaceIfDrawnVertical(t) : this.calculateSpaceIfDrawnHorizontally(t), this.recalculateScale(), {
606
+ width: this.boundingRect.width,
607
+ height: this.boundingRect.height
608
+ };
609
+ }
610
+ setBoundingBoxXY(t) {
611
+ this.boundingRect.x = t.x, this.boundingRect.y = t.y;
612
+ }
613
+ getDrawableElementsForLeftAxis() {
614
+ const t = [];
615
+ if (this.showAxisLine) {
616
+ const i = this.boundingRect.x + this.boundingRect.width - this.axisConfig.axisLineWidth / 2;
617
+ t.push({
618
+ type: "path",
619
+ groupTexts: ["left-axis", "axisl-line"],
620
+ data: [
621
+ {
622
+ path: `M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y + this.boundingRect.height} `,
623
+ strokeFill: this.axisThemeConfig.axisLineColor,
624
+ strokeWidth: this.axisConfig.axisLineWidth
625
+ }
626
+ ]
627
+ });
628
+ }
629
+ if (this.showLabel && t.push({
630
+ type: "text",
631
+ groupTexts: ["left-axis", "label"],
632
+ data: this.getTickValues().map((i) => ({
633
+ text: i.toString(),
634
+ x: this.boundingRect.x + this.boundingRect.width - (this.showLabel ? this.axisConfig.labelPadding : 0) - (this.showTick ? this.axisConfig.tickLength : 0) - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0),
635
+ y: this.getScaleValue(i),
636
+ fill: this.axisThemeConfig.labelColor,
637
+ fontSize: this.axisConfig.labelFontSize,
638
+ rotation: 0,
639
+ verticalPos: "middle",
640
+ horizontalPos: "right"
641
+ }))
642
+ }), this.showTick) {
643
+ const i = this.boundingRect.x + this.boundingRect.width - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
644
+ t.push({
645
+ type: "path",
646
+ groupTexts: ["left-axis", "ticks"],
647
+ data: this.getTickValues().map((s) => ({
648
+ path: `M ${i},${this.getScaleValue(s)} L ${i - this.axisConfig.tickLength},${this.getScaleValue(s)}`,
649
+ strokeFill: this.axisThemeConfig.tickColor,
650
+ strokeWidth: this.axisConfig.tickWidth
651
+ }))
652
+ });
653
+ }
654
+ return this.showTitle && t.push({
655
+ type: "text",
656
+ groupTexts: ["left-axis", "title"],
657
+ data: [
658
+ {
659
+ text: this.title,
660
+ x: this.boundingRect.x + this.axisConfig.titlePadding,
661
+ y: this.boundingRect.y + this.boundingRect.height / 2,
662
+ fill: this.axisThemeConfig.titleColor,
663
+ fontSize: this.axisConfig.titleFontSize,
664
+ rotation: 270,
665
+ verticalPos: "top",
666
+ horizontalPos: "center"
667
+ }
668
+ ]
669
+ }), t;
670
+ }
671
+ getDrawableElementsForBottomAxis() {
672
+ const t = [];
673
+ if (this.showAxisLine) {
674
+ const i = this.boundingRect.y + this.axisConfig.axisLineWidth / 2;
675
+ t.push({
676
+ type: "path",
677
+ groupTexts: ["bottom-axis", "axis-line"],
678
+ data: [
679
+ {
680
+ path: `M ${this.boundingRect.x},${i} L ${this.boundingRect.x + this.boundingRect.width},${i}`,
681
+ strokeFill: this.axisThemeConfig.axisLineColor,
682
+ strokeWidth: this.axisConfig.axisLineWidth
683
+ }
684
+ ]
685
+ });
686
+ }
687
+ if (this.showLabel && t.push({
688
+ type: "text",
689
+ groupTexts: ["bottom-axis", "label"],
690
+ data: this.getTickValues().map((i) => ({
691
+ text: i.toString(),
692
+ x: this.getScaleValue(i),
693
+ y: this.boundingRect.y + this.axisConfig.labelPadding + (this.showTick ? this.axisConfig.tickLength : 0) + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0),
694
+ fill: this.axisThemeConfig.labelColor,
695
+ fontSize: this.axisConfig.labelFontSize,
696
+ rotation: 0,
697
+ verticalPos: "top",
698
+ horizontalPos: "center"
699
+ }))
700
+ }), this.showTick) {
701
+ const i = this.boundingRect.y + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
702
+ t.push({
703
+ type: "path",
704
+ groupTexts: ["bottom-axis", "ticks"],
705
+ data: this.getTickValues().map((s) => ({
706
+ path: `M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i + this.axisConfig.tickLength}`,
707
+ strokeFill: this.axisThemeConfig.tickColor,
708
+ strokeWidth: this.axisConfig.tickWidth
709
+ }))
710
+ });
711
+ }
712
+ return this.showTitle && t.push({
713
+ type: "text",
714
+ groupTexts: ["bottom-axis", "title"],
715
+ data: [
716
+ {
717
+ text: this.title,
718
+ x: this.range[0] + (this.range[1] - this.range[0]) / 2,
719
+ y: this.boundingRect.y + this.boundingRect.height - this.axisConfig.titlePadding - this.titleTextHeight,
720
+ fill: this.axisThemeConfig.titleColor,
721
+ fontSize: this.axisConfig.titleFontSize,
722
+ rotation: 0,
723
+ verticalPos: "top",
724
+ horizontalPos: "center"
725
+ }
726
+ ]
727
+ }), t;
728
+ }
729
+ getDrawableElementsForTopAxis() {
730
+ const t = [];
731
+ if (this.showAxisLine) {
732
+ const i = this.boundingRect.y + this.boundingRect.height - this.axisConfig.axisLineWidth / 2;
733
+ t.push({
734
+ type: "path",
735
+ groupTexts: ["top-axis", "axis-line"],
736
+ data: [
737
+ {
738
+ path: `M ${this.boundingRect.x},${i} L ${this.boundingRect.x + this.boundingRect.width},${i}`,
739
+ strokeFill: this.axisThemeConfig.axisLineColor,
740
+ strokeWidth: this.axisConfig.axisLineWidth
741
+ }
742
+ ]
743
+ });
744
+ }
745
+ if (this.showLabel && t.push({
746
+ type: "text",
747
+ groupTexts: ["top-axis", "label"],
748
+ data: this.getTickValues().map((i) => ({
749
+ text: i.toString(),
750
+ x: this.getScaleValue(i),
751
+ y: this.boundingRect.y + (this.showTitle ? this.titleTextHeight + this.axisConfig.titlePadding * 2 : 0) + this.axisConfig.labelPadding,
752
+ fill: this.axisThemeConfig.labelColor,
753
+ fontSize: this.axisConfig.labelFontSize,
754
+ rotation: 0,
755
+ verticalPos: "top",
756
+ horizontalPos: "center"
757
+ }))
758
+ }), this.showTick) {
759
+ const i = this.boundingRect.y;
760
+ t.push({
761
+ type: "path",
762
+ groupTexts: ["top-axis", "ticks"],
763
+ data: this.getTickValues().map((s) => ({
764
+ path: `M ${this.getScaleValue(s)},${i + this.boundingRect.height - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)} L ${this.getScaleValue(s)},${i + this.boundingRect.height - this.axisConfig.tickLength - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)}`,
765
+ strokeFill: this.axisThemeConfig.tickColor,
766
+ strokeWidth: this.axisConfig.tickWidth
767
+ }))
768
+ });
769
+ }
770
+ return this.showTitle && t.push({
771
+ type: "text",
772
+ groupTexts: ["top-axis", "title"],
773
+ data: [
774
+ {
775
+ text: this.title,
776
+ x: this.boundingRect.x + this.boundingRect.width / 2,
777
+ y: this.boundingRect.y + this.axisConfig.titlePadding,
778
+ fill: this.axisThemeConfig.titleColor,
779
+ fontSize: this.axisConfig.titleFontSize,
780
+ rotation: 0,
781
+ verticalPos: "top",
782
+ horizontalPos: "center"
783
+ }
784
+ ]
785
+ }), t;
786
+ }
787
+ getDrawableElements() {
788
+ if (this.axisPosition === "left")
789
+ return this.getDrawableElementsForLeftAxis();
790
+ if (this.axisPosition === "right")
791
+ throw Error("Drawing of right axis is not implemented");
792
+ return this.axisPosition === "bottom" ? this.getDrawableElementsForBottomAxis() : this.axisPosition === "top" ? this.getDrawableElementsForTopAxis() : [];
793
+ }
794
+ }, a(N, "BaseAxis"), N), Y, Ti = (Y = class extends Ht {
795
+ constructor(t, i, s, n, o) {
796
+ super(t, n, o, i), this.categories = s, this.scale = pt().domain(this.categories).range(this.getRange());
797
+ }
798
+ setRange(t) {
799
+ super.setRange(t);
800
+ }
801
+ recalculateScale() {
802
+ this.scale = pt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5), Xt.trace("BandAxis axis final categories, range: ", this.categories, this.getRange());
803
+ }
804
+ getTickValues() {
805
+ return this.categories;
806
+ }
807
+ getScaleValue(t) {
808
+ return this.scale(t) ?? this.getRange()[0];
809
+ }
810
+ }, a(Y, "BandAxis"), Y), H, Di = (H = class extends Ht {
811
+ constructor(t, i, s, n, o) {
812
+ super(t, n, o, i), this.domain = s, this.scale = Wt().domain(this.domain).range(this.getRange());
813
+ }
814
+ getTickValues() {
815
+ return this.scale.ticks();
816
+ }
817
+ recalculateScale() {
818
+ const t = [...this.domain];
819
+ this.axisPosition === "left" && t.reverse(), this.scale = Wt().domain(t).range(this.getRange());
820
+ }
821
+ getScaleValue(t) {
822
+ return this.scale(t);
823
+ }
824
+ }, a(H, "LinearAxis"), H);
825
+ function yt(e, t, i, s) {
826
+ const n = new Yt(s);
827
+ return wt(e) ? new Ti(
828
+ t,
829
+ i,
830
+ e.categories,
831
+ e.title,
832
+ n
833
+ ) : new Di(
834
+ t,
835
+ i,
836
+ [e.min, e.max],
837
+ e.title,
838
+ n
839
+ );
840
+ }
841
+ a(yt, "getAxis");
842
+ var U, vi = (U = class {
843
+ constructor(t, i, s, n) {
844
+ this.textDimensionCalculator = t, this.chartConfig = i, this.chartData = s, this.chartThemeConfig = n, this.boundingRect = {
845
+ x: 0,
846
+ y: 0,
847
+ width: 0,
848
+ height: 0
849
+ }, this.showChartTitle = !1;
850
+ }
851
+ setBoundingBoxXY(t) {
852
+ this.boundingRect.x = t.x, this.boundingRect.y = t.y;
853
+ }
854
+ calculateSpace(t) {
855
+ const i = this.textDimensionCalculator.getMaxDimension(
856
+ [this.chartData.title],
857
+ this.chartConfig.titleFontSize
858
+ ), s = Math.max(i.width, t.width), n = i.height + 2 * this.chartConfig.titlePadding;
859
+ return i.width <= s && i.height <= n && this.chartConfig.showTitle && this.chartData.title && (this.boundingRect.width = s, this.boundingRect.height = n, this.showChartTitle = !0), {
860
+ width: this.boundingRect.width,
861
+ height: this.boundingRect.height
862
+ };
863
+ }
864
+ getDrawableElements() {
865
+ const t = [];
866
+ return this.showChartTitle && t.push({
867
+ groupTexts: ["chart-title"],
868
+ type: "text",
869
+ data: [
870
+ {
871
+ fontSize: this.chartConfig.titleFontSize,
872
+ text: this.chartData.title,
873
+ verticalPos: "middle",
874
+ horizontalPos: "center",
875
+ x: this.boundingRect.x + this.boundingRect.width / 2,
876
+ y: this.boundingRect.y + this.boundingRect.height / 2,
877
+ fill: this.chartThemeConfig.titleColor,
878
+ rotation: 0
879
+ }
880
+ ]
881
+ }), t;
882
+ }
883
+ }, a(U, "ChartTitle"), U);
884
+ function Ut(e, t, i, s) {
885
+ const n = new Yt(s);
886
+ return new vi(n, e, t, i);
887
+ }
888
+ a(Ut, "getChartTitleComponent");
889
+ var $, Pi = ($ = class {
890
+ constructor(t, i, s, n, o) {
891
+ this.plotData = t, this.xAxis = i, this.yAxis = s, this.orientation = n, this.plotIndex = o;
892
+ }
893
+ getDrawableElement() {
894
+ const t = this.plotData.data.map((s) => [
895
+ this.xAxis.getScaleValue(s[0]),
896
+ this.yAxis.getScaleValue(s[1])
897
+ ]);
898
+ let i;
899
+ return this.orientation === "horizontal" ? i = Bt().y((s) => s[0]).x((s) => s[1])(t) : i = Bt().x((s) => s[0]).y((s) => s[1])(t), i ? [
900
+ {
901
+ groupTexts: ["plot", `line-plot-${this.plotIndex}`],
902
+ type: "path",
903
+ data: [
904
+ {
905
+ path: i,
906
+ strokeFill: this.plotData.strokeFill,
907
+ strokeWidth: this.plotData.strokeWidth
908
+ }
909
+ ]
910
+ }
911
+ ] : [];
912
+ }
913
+ }, a($, "LinePlot"), $), G, Li = (G = class {
914
+ constructor(t, i, s, n, o, u) {
915
+ this.barData = t, this.boundingRect = i, this.xAxis = s, this.yAxis = n, this.orientation = o, this.plotIndex = u;
916
+ }
917
+ getDrawableElement() {
918
+ const t = this.barData.data.map((o) => [
919
+ this.xAxis.getScaleValue(o[0]),
920
+ this.yAxis.getScaleValue(o[1])
921
+ ]), s = Math.min(this.xAxis.getAxisOuterPadding() * 2, this.xAxis.getTickDistance()) * (1 - 0.05), n = s / 2;
922
+ return this.orientation === "horizontal" ? [
923
+ {
924
+ groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
925
+ type: "rect",
926
+ data: t.map((o) => ({
927
+ x: this.boundingRect.x,
928
+ y: o[0] - n,
929
+ height: s,
930
+ width: o[1] - this.boundingRect.x,
931
+ fill: this.barData.fill,
932
+ strokeWidth: 0,
933
+ strokeFill: this.barData.fill
934
+ }))
935
+ }
936
+ ] : [
937
+ {
938
+ groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
939
+ type: "rect",
940
+ data: t.map((o) => ({
941
+ x: o[0] - n,
942
+ y: o[1],
943
+ width: s,
944
+ height: this.boundingRect.y + this.boundingRect.height - o[1],
945
+ fill: this.barData.fill,
946
+ strokeWidth: 0,
947
+ strokeFill: this.barData.fill
948
+ }))
949
+ }
950
+ ];
951
+ }
952
+ }, a(G, "BarPlot"), G), q, Ei = (q = class {
953
+ constructor(t, i, s) {
954
+ this.chartConfig = t, this.chartData = i, this.chartThemeConfig = s, this.boundingRect = {
955
+ x: 0,
956
+ y: 0,
957
+ width: 0,
958
+ height: 0
959
+ };
960
+ }
961
+ setAxes(t, i) {
962
+ this.xAxis = t, this.yAxis = i;
963
+ }
964
+ setBoundingBoxXY(t) {
965
+ this.boundingRect.x = t.x, this.boundingRect.y = t.y;
966
+ }
967
+ calculateSpace(t) {
968
+ return this.boundingRect.width = t.width, this.boundingRect.height = t.height, {
969
+ width: this.boundingRect.width,
970
+ height: this.boundingRect.height
971
+ };
972
+ }
973
+ getDrawableElements() {
974
+ if (!(this.xAxis && this.yAxis))
975
+ throw Error("Axes must be passed to render Plots");
976
+ const t = [];
977
+ for (const [i, s] of this.chartData.plots.entries())
978
+ switch (s.type) {
979
+ case "line":
980
+ {
981
+ const n = new Pi(
982
+ s,
983
+ this.xAxis,
984
+ this.yAxis,
985
+ this.chartConfig.chartOrientation,
986
+ i
987
+ );
988
+ t.push(...n.getDrawableElement());
989
+ }
990
+ break;
991
+ case "bar":
992
+ {
993
+ const n = new Li(
994
+ s,
995
+ this.boundingRect,
996
+ this.xAxis,
997
+ this.yAxis,
998
+ this.chartConfig.chartOrientation,
999
+ i
1000
+ );
1001
+ t.push(...n.getDrawableElement());
1002
+ }
1003
+ break;
1004
+ }
1005
+ return t;
1006
+ }
1007
+ }, a(q, "BasePlot"), q);
1008
+ function $t(e, t, i) {
1009
+ return new Ei(e, t, i);
1010
+ }
1011
+ a($t, "getPlotComponent");
1012
+ var j, Ii = (j = class {
1013
+ constructor(t, i, s, n) {
1014
+ this.chartConfig = t, this.chartData = i, this.componentStore = {
1015
+ title: Ut(t, i, s, n),
1016
+ plot: $t(t, i, s),
1017
+ xAxis: yt(
1018
+ i.xAxis,
1019
+ t.xAxis,
1020
+ {
1021
+ titleColor: s.xAxisTitleColor,
1022
+ labelColor: s.xAxisLabelColor,
1023
+ tickColor: s.xAxisTickColor,
1024
+ axisLineColor: s.xAxisLineColor
1025
+ },
1026
+ n
1027
+ ),
1028
+ yAxis: yt(
1029
+ i.yAxis,
1030
+ t.yAxis,
1031
+ {
1032
+ titleColor: s.yAxisTitleColor,
1033
+ labelColor: s.yAxisLabelColor,
1034
+ tickColor: s.yAxisTickColor,
1035
+ axisLineColor: s.yAxisLineColor
1036
+ },
1037
+ n
1038
+ )
1039
+ };
1040
+ }
1041
+ calculateVerticalSpace() {
1042
+ let t = this.chartConfig.width, i = this.chartConfig.height, s = 0, n = 0, o = Math.floor(t * this.chartConfig.plotReservedSpacePercent / 100), u = Math.floor(
1043
+ i * this.chartConfig.plotReservedSpacePercent / 100
1044
+ ), f = this.componentStore.plot.calculateSpace({
1045
+ width: o,
1046
+ height: u
1047
+ });
1048
+ t -= f.width, i -= f.height, f = this.componentStore.title.calculateSpace({
1049
+ width: this.chartConfig.width,
1050
+ height: i
1051
+ }), n = f.height, i -= f.height, this.componentStore.xAxis.setAxisPosition("bottom"), f = this.componentStore.xAxis.calculateSpace({
1052
+ width: t,
1053
+ height: i
1054
+ }), i -= f.height, this.componentStore.yAxis.setAxisPosition("left"), f = this.componentStore.yAxis.calculateSpace({
1055
+ width: t,
1056
+ height: i
1057
+ }), s = f.width, t -= f.width, t > 0 && (o += t, t = 0), i > 0 && (u += i, i = 0), this.componentStore.plot.calculateSpace({
1058
+ width: o,
1059
+ height: u
1060
+ }), this.componentStore.plot.setBoundingBoxXY({ x: s, y: n }), this.componentStore.xAxis.setRange([s, s + o]), this.componentStore.xAxis.setBoundingBoxXY({ x: s, y: n + u }), this.componentStore.yAxis.setRange([n, n + u]), this.componentStore.yAxis.setBoundingBoxXY({ x: 0, y: n }), this.chartData.plots.some((p) => mt(p)) && this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
1061
+ }
1062
+ calculateHorizontalSpace() {
1063
+ let t = this.chartConfig.width, i = this.chartConfig.height, s = 0, n = 0, o = 0, u = Math.floor(t * this.chartConfig.plotReservedSpacePercent / 100), f = Math.floor(
1064
+ i * this.chartConfig.plotReservedSpacePercent / 100
1065
+ ), p = this.componentStore.plot.calculateSpace({
1066
+ width: u,
1067
+ height: f
1068
+ });
1069
+ t -= p.width, i -= p.height, p = this.componentStore.title.calculateSpace({
1070
+ width: this.chartConfig.width,
1071
+ height: i
1072
+ }), s = p.height, i -= p.height, this.componentStore.xAxis.setAxisPosition("left"), p = this.componentStore.xAxis.calculateSpace({
1073
+ width: t,
1074
+ height: i
1075
+ }), t -= p.width, n = p.width, this.componentStore.yAxis.setAxisPosition("top"), p = this.componentStore.yAxis.calculateSpace({
1076
+ width: t,
1077
+ height: i
1078
+ }), i -= p.height, o = s + p.height, t > 0 && (u += t, t = 0), i > 0 && (f += i, i = 0), this.componentStore.plot.calculateSpace({
1079
+ width: u,
1080
+ height: f
1081
+ }), this.componentStore.plot.setBoundingBoxXY({ x: n, y: o }), this.componentStore.yAxis.setRange([n, n + u]), this.componentStore.yAxis.setBoundingBoxXY({ x: n, y: s }), this.componentStore.xAxis.setRange([o, o + f]), this.componentStore.xAxis.setBoundingBoxXY({ x: 0, y: o }), this.chartData.plots.some((k) => mt(k)) && this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
1082
+ }
1083
+ calculateSpace() {
1084
+ this.chartConfig.chartOrientation === "horizontal" ? this.calculateHorizontalSpace() : this.calculateVerticalSpace();
1085
+ }
1086
+ getDrawableElement() {
1087
+ this.calculateSpace();
1088
+ const t = [];
1089
+ this.componentStore.plot.setAxes(this.componentStore.xAxis, this.componentStore.yAxis);
1090
+ for (const i of Object.values(this.componentStore))
1091
+ t.push(...i.getDrawableElements());
1092
+ return t;
1093
+ }
1094
+ }, a(j, "Orchestrator"), j), Q, Mi = (Q = class {
1095
+ static build(t, i, s, n) {
1096
+ return new Ii(t, i, s, n).getDrawableElement();
1097
+ }
1098
+ }, a(Q, "XYChartBuilder"), Q), J = 0, Gt, tt = _t(), it = St(), b = kt(), bt = it.plotColorPalette.split(",").map((e) => e.trim()), ot = !1, Ct = !1;
1099
+ function St() {
1100
+ const e = Ai(), t = At();
1101
+ return Nt(e.xyChart, t.themeVariables.xyChart);
1102
+ }
1103
+ a(St, "getChartDefaultThemeConfig");
1104
+ function _t() {
1105
+ const e = At();
1106
+ return Nt(
1107
+ bi.xyChart,
1108
+ e.xyChart
1109
+ );
1110
+ }
1111
+ a(_t, "getChartDefaultConfig");
1112
+ function kt() {
1113
+ return {
1114
+ yAxis: {
1115
+ type: "linear",
1116
+ title: "",
1117
+ min: 1 / 0,
1118
+ max: -1 / 0
1119
+ },
1120
+ xAxis: {
1121
+ type: "band",
1122
+ title: "",
1123
+ categories: []
1124
+ },
1125
+ title: "",
1126
+ plots: []
1127
+ };
1128
+ }
1129
+ a(kt, "getChartDefaultData");
1130
+ function ht(e) {
1131
+ const t = At();
1132
+ return wi(e.trim(), t);
1133
+ }
1134
+ a(ht, "textSanitizer");
1135
+ function qt(e) {
1136
+ Gt = e;
1137
+ }
1138
+ a(qt, "setTmpSVGG");
1139
+ function jt(e) {
1140
+ e === "horizontal" ? tt.chartOrientation = "horizontal" : tt.chartOrientation = "vertical";
1141
+ }
1142
+ a(jt, "setOrientation");
1143
+ function Qt(e) {
1144
+ b.xAxis.title = ht(e.text);
1145
+ }
1146
+ a(Qt, "setXAxisTitle");
1147
+ function Rt(e, t) {
1148
+ b.xAxis = { type: "linear", title: b.xAxis.title, min: e, max: t }, ot = !0;
1149
+ }
1150
+ a(Rt, "setXAxisRangeData");
1151
+ function Kt(e) {
1152
+ b.xAxis = {
1153
+ type: "band",
1154
+ title: b.xAxis.title,
1155
+ categories: e.map((t) => ht(t.text))
1156
+ }, ot = !0;
1157
+ }
1158
+ a(Kt, "setXAxisBand");
1159
+ function Zt(e) {
1160
+ b.yAxis.title = ht(e.text);
1161
+ }
1162
+ a(Zt, "setYAxisTitle");
1163
+ function Jt(e, t) {
1164
+ b.yAxis = { type: "linear", title: b.yAxis.title, min: e, max: t }, Ct = !0;
1165
+ }
1166
+ a(Jt, "setYAxisRangeData");
1167
+ function ti(e) {
1168
+ const t = Math.min(...e), i = Math.max(...e), s = F(b.yAxis) ? b.yAxis.min : 1 / 0, n = F(b.yAxis) ? b.yAxis.max : -1 / 0;
1169
+ b.yAxis = {
1170
+ type: "linear",
1171
+ title: b.yAxis.title,
1172
+ min: Math.min(s, t),
1173
+ max: Math.max(n, i)
1174
+ };
1175
+ }
1176
+ a(ti, "setYAxisRangeFromPlotData");
1177
+ function Tt(e) {
1178
+ let t = [];
1179
+ if (e.length === 0)
1180
+ return t;
1181
+ if (!ot) {
1182
+ const i = F(b.xAxis) ? b.xAxis.min : 1 / 0, s = F(b.xAxis) ? b.xAxis.max : -1 / 0;
1183
+ Rt(Math.min(i, 1), Math.max(s, e.length));
1184
+ }
1185
+ if (Ct || ti(e), wt(b.xAxis) && (t = b.xAxis.categories.map((i, s) => [i, e[s]])), F(b.xAxis)) {
1186
+ const i = b.xAxis.min, s = b.xAxis.max, n = (s - i) / (e.length - 1), o = [];
1187
+ for (let u = i; u <= s; u += n)
1188
+ o.push(`${u}`);
1189
+ t = o.map((u, f) => [u, e[f]]);
1190
+ }
1191
+ return t;
1192
+ }
1193
+ a(Tt, "transformDataWithoutCategory");
1194
+ function Dt(e) {
1195
+ return bt[e === 0 ? 0 : e % bt.length];
1196
+ }
1197
+ a(Dt, "getPlotColorFromPalette");
1198
+ function ii(e, t) {
1199
+ const i = Tt(t);
1200
+ b.plots.push({
1201
+ type: "line",
1202
+ strokeFill: Dt(J),
1203
+ strokeWidth: 2,
1204
+ data: i
1205
+ }), J++;
1206
+ }
1207
+ a(ii, "setLineData");
1208
+ function ei(e, t) {
1209
+ const i = Tt(t);
1210
+ b.plots.push({
1211
+ type: "bar",
1212
+ fill: Dt(J),
1213
+ data: i
1214
+ }), J++;
1215
+ }
1216
+ a(ei, "setBarData");
1217
+ function si() {
1218
+ if (b.plots.length === 0)
1219
+ throw Error("No Plot to render, please provide a plot with some data");
1220
+ return b.title = Ft(), Mi.build(tt, b, it, Gt);
1221
+ }
1222
+ a(si, "getDrawableElem");
1223
+ function ni() {
1224
+ return it;
1225
+ }
1226
+ a(ni, "getChartThemeConfig");
1227
+ function ai() {
1228
+ return tt;
1229
+ }
1230
+ a(ai, "getChartConfig");
1231
+ var Vi = /* @__PURE__ */ a(function() {
1232
+ yi(), J = 0, tt = _t(), b = kt(), it = St(), bt = it.plotColorPalette.split(",").map((e) => e.trim()), ot = !1, Ct = !1;
1233
+ }, "clear"), Bi = {
1234
+ getDrawableElem: si,
1235
+ clear: Vi,
1236
+ setAccTitle: pi,
1237
+ getAccTitle: di,
1238
+ setDiagramTitle: xi,
1239
+ getDiagramTitle: Ft,
1240
+ getAccDescription: gi,
1241
+ setAccDescription: ui,
1242
+ setOrientation: jt,
1243
+ setXAxisTitle: Qt,
1244
+ setXAxisRangeData: Rt,
1245
+ setXAxisBand: Kt,
1246
+ setYAxisTitle: Zt,
1247
+ setYAxisRangeData: Jt,
1248
+ setLineData: ii,
1249
+ setBarData: ei,
1250
+ setTmpSVGG: qt,
1251
+ getChartThemeConfig: ni,
1252
+ getChartConfig: ai
1253
+ }, Wi = /* @__PURE__ */ a((e, t, i, s) => {
1254
+ const n = s.db, o = n.getChartThemeConfig(), u = n.getChartConfig();
1255
+ function f(m) {
1256
+ return m === "top" ? "text-before-edge" : "middle";
1257
+ }
1258
+ a(f, "getDominantBaseLine");
1259
+ function p(m) {
1260
+ return m === "left" ? "start" : m === "right" ? "end" : "middle";
1261
+ }
1262
+ a(p, "getTextAnchor");
1263
+ function k(m) {
1264
+ return `translate(${m.x}, ${m.y}) rotate(${m.rotation || 0})`;
1265
+ }
1266
+ a(k, "getTextTransformation"), Xt.debug(`Rendering xychart chart
1267
+ ` + e);
1268
+ const R = fi(t), w = R.append("g").attr("class", "main"), y = w.append("rect").attr("width", u.width).attr("height", u.height).attr("class", "background");
1269
+ mi(R, u.height, u.width, !0), R.attr("viewBox", `0 0 ${u.width} ${u.height}`), y.attr("fill", o.backgroundColor), n.setTmpSVGG(R.append("g").attr("class", "mermaid-tmp-group"));
1270
+ const D = n.getDrawableElem(), S = {};
1271
+ function v(m) {
1272
+ let _ = w, l = "";
1273
+ for (const [E] of m.entries()) {
1274
+ let K = w;
1275
+ E > 0 && S[l] && (K = S[l]), l += m[E], _ = S[l], _ || (_ = S[l] = K.append("g").attr("class", m[E]));
1276
+ }
1277
+ return _;
1278
+ }
1279
+ a(v, "getGroup");
1280
+ for (const m of D) {
1281
+ if (m.data.length === 0)
1282
+ continue;
1283
+ const _ = v(m.groupTexts);
1284
+ switch (m.type) {
1285
+ case "rect":
1286
+ _.selectAll("rect").data(m.data).enter().append("rect").attr("x", (l) => l.x).attr("y", (l) => l.y).attr("width", (l) => l.width).attr("height", (l) => l.height).attr("fill", (l) => l.fill).attr("stroke", (l) => l.strokeFill).attr("stroke-width", (l) => l.strokeWidth);
1287
+ break;
1288
+ case "text":
1289
+ _.selectAll("text").data(m.data).enter().append("text").attr("x", 0).attr("y", 0).attr("fill", (l) => l.fill).attr("font-size", (l) => l.fontSize).attr("dominant-baseline", (l) => f(l.verticalPos)).attr("text-anchor", (l) => p(l.horizontalPos)).attr("transform", (l) => k(l)).text((l) => l.text);
1290
+ break;
1291
+ case "path":
1292
+ _.selectAll("path").data(m.data).enter().append("path").attr("d", (l) => l.path).attr("fill", (l) => l.fill ? l.fill : "none").attr("stroke", (l) => l.strokeFill).attr("stroke-width", (l) => l.strokeWidth);
1293
+ break;
1294
+ }
1295
+ }
1296
+ }, "draw"), Oi = {
1297
+ draw: Wi
1298
+ }, Hi = {
1299
+ parser: Ri,
1300
+ db: Bi,
1301
+ renderer: Oi
1302
+ };
1303
+ export {
1304
+ Hi as diagram
1305
+ };