@ucap-llm/ai-ui 1.1.13 → 1.1.15

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