@layers-app/editor 0.5.0 → 0.5.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 (240) hide show
  1. package/package.json +5 -4
  2. package/dist/index.cjs +0 -2
  3. package/dist/index.d.ts +0 -315
  4. package/dist/index.js +0 -13
  5. package/dist/layers.0GV8bqI4.js +0 -186
  6. package/dist/layers.2-v72gXD.js +0 -1
  7. package/dist/layers.271NUg7u.js +0 -39
  8. package/dist/layers.2YgiancJ.js +0 -116
  9. package/dist/layers.3DEO2eFX.js +0 -38
  10. package/dist/layers.3PKeLS62.js +0 -48146
  11. package/dist/layers.52famHy6.js +0 -1
  12. package/dist/layers.6M02Y2O6.js +0 -6
  13. package/dist/layers.7DTJccah.js +0 -10
  14. package/dist/layers.7JqFgE4-.js +0 -15
  15. package/dist/layers.7geZ_Z3x.js +0 -36
  16. package/dist/layers.88aO_Zsd.js +0 -14
  17. package/dist/layers.8hFVbiPY.js +0 -59
  18. package/dist/layers.9KaBpXFA.js +0 -1283
  19. package/dist/layers.9pNaFvaX.js +0 -1
  20. package/dist/layers.AIKsYMqL.js +0 -8
  21. package/dist/layers.B-0J3b5U.js +0 -40
  22. package/dist/layers.B19hGmey.js +0 -1
  23. package/dist/layers.B3D4g2HH.js +0 -1
  24. package/dist/layers.B4yEsxVs.js +0 -10
  25. package/dist/layers.B5Xhxhbr.js +0 -39
  26. package/dist/layers.B6jgTP72.js +0 -1
  27. package/dist/layers.B8a2ydDI.js +0 -1265
  28. package/dist/layers.B9EoV4pJ.js +0 -1
  29. package/dist/layers.BAI7Z-Wd.js +0 -40
  30. package/dist/layers.BAtv1CM7.js +0 -1
  31. package/dist/layers.BB24KMYM.js +0 -19
  32. package/dist/layers.BBWAKePM.js +0 -7
  33. package/dist/layers.BBWcXYuR.js +0 -5
  34. package/dist/layers.BC3JkNtz.js +0 -21938
  35. package/dist/layers.BFKY-mk1.js +0 -8
  36. package/dist/layers.BGnHNrIw.js +0 -38
  37. package/dist/layers.BIF7gnlw.js +0 -6
  38. package/dist/layers.BIeVwYKL.js +0 -1
  39. package/dist/layers.BJDrjORS.js +0 -244
  40. package/dist/layers.BJtqK_fc.js +0 -40
  41. package/dist/layers.BLMsv5-v.js +0 -295
  42. package/dist/layers.BLd2spTm.js +0 -1
  43. package/dist/layers.BLj5XN2k.js +0 -802
  44. package/dist/layers.BMzZVoyQ.js +0 -5
  45. package/dist/layers.BN0X-mKK.js +0 -41
  46. package/dist/layers.BNP0J0MG.js +0 -4
  47. package/dist/layers.BQgrfzZU.js +0 -7
  48. package/dist/layers.BRFujA4d.js +0 -8
  49. package/dist/layers.BSTBZrFn.js +0 -1
  50. package/dist/layers.BSXvhEG5.js +0 -5
  51. package/dist/layers.BSzdascH.js +0 -42
  52. package/dist/layers.BTsJAbTY.js +0 -37
  53. package/dist/layers.BUpmCmqT.js +0 -36
  54. package/dist/layers.BVAnEpZl.js +0 -10
  55. package/dist/layers.BW84v3Ox.js +0 -2
  56. package/dist/layers.B_Lan92M.js +0 -1
  57. package/dist/layers.BaW-t_Zc.js +0 -8
  58. package/dist/layers.BapT0txt.js +0 -425
  59. package/dist/layers.BbCfEXyj.js +0 -55
  60. package/dist/layers.BdqQLuaK.js +0 -40
  61. package/dist/layers.Bdwk_Ggl.js +0 -33
  62. package/dist/layers.Bg7-KHZC.js +0 -2235
  63. package/dist/layers.BgOa2ZQq.js +0 -7
  64. package/dist/layers.BiJ8hfRt.js +0 -1510
  65. package/dist/layers.BkFD_pHb.js +0 -40
  66. package/dist/layers.BlN6GnRT.js +0 -7
  67. package/dist/layers.Bm84E1I5.js +0 -39
  68. package/dist/layers.Bo3tMbEB.js +0 -42
  69. package/dist/layers.BoOcWXFs.js +0 -10
  70. package/dist/layers.BpilXLfW.js +0 -6
  71. package/dist/layers.BrHN_kMd.js +0 -41
  72. package/dist/layers.BruMG2wy.js +0 -160
  73. package/dist/layers.BsWPnWD1.js +0 -40
  74. package/dist/layers.Bu9ZoRYM.js +0 -40
  75. package/dist/layers.BvjpCDHj.js +0 -9
  76. package/dist/layers.Bwb7QBBL.js +0 -10
  77. package/dist/layers.Bx0DgrIz.js +0 -84
  78. package/dist/layers.By8wynAO.js +0 -40
  79. package/dist/layers.C0Lgw_Sx.js +0 -11688
  80. package/dist/layers.C3me1AOA.js +0 -904
  81. package/dist/layers.C5XL_KJW.js +0 -44
  82. package/dist/layers.C65tYhLf.js +0 -5
  83. package/dist/layers.C67fBVg3.js +0 -3
  84. package/dist/layers.C6HmVi2T.js +0 -39
  85. package/dist/layers.C8_lu5UH.js +0 -23
  86. package/dist/layers.C8oO_BiQ.js +0 -40
  87. package/dist/layers.C9AvvTRV.js +0 -32
  88. package/dist/layers.CA3DQGmO.js +0 -11
  89. package/dist/layers.CCoWlQxf.js +0 -70
  90. package/dist/layers.CCy49ah1.js +0 -37
  91. package/dist/layers.CDftR5Kg.js +0 -320
  92. package/dist/layers.CDw-iNbj.js +0 -9
  93. package/dist/layers.CEDfv2oj.js +0 -423
  94. package/dist/layers.CGeTu6ph.js +0 -1
  95. package/dist/layers.CHZsXQcr.js +0 -1
  96. package/dist/layers.CJlWYRtk.js +0 -41
  97. package/dist/layers.CKy_DRKv.js +0 -42
  98. package/dist/layers.COEorZbZ.js +0 -257
  99. package/dist/layers.CP2_7vUR.js +0 -32
  100. package/dist/layers.CPEzOey-.js +0 -84
  101. package/dist/layers.CSY_lOK0.js +0 -268
  102. package/dist/layers.CT_bvOgC.js +0 -1
  103. package/dist/layers.CUWVPrVU.js +0 -40
  104. package/dist/layers.CVCC2rNb.js +0 -139
  105. package/dist/layers.CXbK6Z0C.js +0 -8
  106. package/dist/layers.CXzpm8-U.js +0 -41
  107. package/dist/layers.CYwLZCUi.js +0 -1088
  108. package/dist/layers.CZ6FLSh1.js +0 -1
  109. package/dist/layers.CZzvHupu.js +0 -36
  110. package/dist/layers.CaZJgSbm.js +0 -4
  111. package/dist/layers.CcX1e4Cb.js +0 -6
  112. package/dist/layers.CgHCxAKJ.js +0 -35
  113. package/dist/layers.CgyRf-4B.js +0 -41
  114. package/dist/layers.ChtNiFGR.js +0 -11
  115. package/dist/layers.CiYt11kd.js +0 -7
  116. package/dist/layers.Cik9ty7R.js +0 -34
  117. package/dist/layers.Cizp88rb.js +0 -32
  118. package/dist/layers.Cjxg13wd.js +0 -47029
  119. package/dist/layers.Cl6-9OBf.js +0 -39
  120. package/dist/layers.ClExSsZJ.js +0 -36
  121. package/dist/layers.CqE1nYk3.js +0 -8
  122. package/dist/layers.CqVTtuYm.js +0 -6
  123. package/dist/layers.CsNI3f74.js +0 -7
  124. package/dist/layers.CuAECIsO.js +0 -39
  125. package/dist/layers.CuVNrIcW.js +0 -52
  126. package/dist/layers.Cv-z4RwC.js +0 -1089
  127. package/dist/layers.CvPdAUZN.js +0 -37
  128. package/dist/layers.CvQiknH6.js +0 -1
  129. package/dist/layers.Cwn1D7F6.js +0 -1619
  130. package/dist/layers.CyOP0v_-.js +0 -8
  131. package/dist/layers.CyvQNQUj.js +0 -139
  132. package/dist/layers.Cyzu9PKQ.js +0 -1
  133. package/dist/layers.Cz4E3Gls.js +0 -21763
  134. package/dist/layers.D-rCo5dz.js +0 -207
  135. package/dist/layers.D0zn4_Mx.js +0 -1
  136. package/dist/layers.D11yimAp.js +0 -230
  137. package/dist/layers.D1sBwAcX.js +0 -1
  138. package/dist/layers.D22AIgry.js +0 -1
  139. package/dist/layers.D2Y56Lcj.js +0 -1
  140. package/dist/layers.D2sjiqI3.js +0 -41
  141. package/dist/layers.D3OtVkCp.js +0 -38
  142. package/dist/layers.D3pymTps.js +0 -6
  143. package/dist/layers.D44d_6CD.js +0 -437
  144. package/dist/layers.D4T8fTcj.js +0 -1223
  145. package/dist/layers.D7jGxypv.js +0 -8
  146. package/dist/layers.D9umovmT.js +0 -10
  147. package/dist/layers.DE-6jvOp.js +0 -10
  148. package/dist/layers.DFWypiYS.js +0 -4
  149. package/dist/layers.DFZcoBfL.js +0 -42
  150. package/dist/layers.DGHPyPPP.js +0 -37
  151. package/dist/layers.DL_hhIIR.js +0 -793
  152. package/dist/layers.DLwuMfdd.js +0 -84
  153. package/dist/layers.DMkBISW1.js +0 -1
  154. package/dist/layers.DMkqdBNu.js +0 -1
  155. package/dist/layers.DN9HoVxI.js +0 -18
  156. package/dist/layers.DNpGJLyQ.js +0 -65
  157. package/dist/layers.DOrgOHBr.js +0 -1
  158. package/dist/layers.DPumOFMF.js +0 -51
  159. package/dist/layers.DQ9duwtV.js +0 -1359
  160. package/dist/layers.DQSx2qqb.js +0 -11
  161. package/dist/layers.DRj2t11p.js +0 -9
  162. package/dist/layers.DWvD3vql.js +0 -220
  163. package/dist/layers.DXVNKM5t.js +0 -33
  164. package/dist/layers.DXg_yjAg.js +0 -10
  165. package/dist/layers.DYXNu8ur.js +0 -6
  166. package/dist/layers.Da3-MQaS.js +0 -315
  167. package/dist/layers.DbEYtfVc.js +0 -9166
  168. package/dist/layers.DbaKVP5e.js +0 -1
  169. package/dist/layers.Dc79Ci3K.js +0 -501
  170. package/dist/layers.DdaAmsdK.js +0 -1
  171. package/dist/layers.DeGb7buU.js +0 -9
  172. package/dist/layers.DeUrAJLR.js +0 -2479
  173. package/dist/layers.DfLG2r9J.js +0 -1
  174. package/dist/layers.DfVTedYs.js +0 -1
  175. package/dist/layers.DgM9vwax.js +0 -1
  176. package/dist/layers.Dhzc98B1.js +0 -1
  177. package/dist/layers.Dit1Y-a1.js +0 -9
  178. package/dist/layers.Dj4g5Vb5.js +0 -10
  179. package/dist/layers.DjUOC4st.js +0 -16
  180. package/dist/layers.DkOYepgq.js +0 -10
  181. package/dist/layers.Dld8CjhI.js +0 -8
  182. package/dist/layers.Dlp-dPD8.js +0 -96
  183. package/dist/layers.DlrAk6DA.js +0 -9
  184. package/dist/layers.Dm5fcqXE.js +0 -5
  185. package/dist/layers.DpuQVg48.js +0 -2966
  186. package/dist/layers.DqT5Jouj.js +0 -11
  187. package/dist/layers.DrlOZ3DT.js +0 -9
  188. package/dist/layers.DsSMSFyE.js +0 -9
  189. package/dist/layers.DtcuZ6vs.js +0 -187
  190. package/dist/layers.DuGoIpLS.js +0 -769
  191. package/dist/layers.DxA6ocdw.js +0 -70
  192. package/dist/layers.DxS_nrN5.js +0 -32
  193. package/dist/layers.DxhSwb8B.js +0 -791
  194. package/dist/layers.DxwOJMY_.js +0 -2
  195. package/dist/layers.Dy1naDTQ.js +0 -14
  196. package/dist/layers.DyPFKCS6.js +0 -1580
  197. package/dist/layers.DyydDZDU.js +0 -41
  198. package/dist/layers.GaSOetZx.js +0 -7
  199. package/dist/layers.IAZiYFRK.js +0 -35
  200. package/dist/layers.JWCLFILJ.js +0 -1
  201. package/dist/layers.JgqeK3h7.js +0 -1
  202. package/dist/layers.K2rcpzhY.js +0 -4
  203. package/dist/layers.KIWs25tZ.js +0 -1
  204. package/dist/layers.LLke4z7b.js +0 -13
  205. package/dist/layers.Marfmnqs.js +0 -61
  206. package/dist/layers.OFho5MbN.js +0 -118
  207. package/dist/layers.R8QN7W65.js +0 -1
  208. package/dist/layers.RT_eBoD-.js +0 -35
  209. package/dist/layers.SbloXQp4.js +0 -9
  210. package/dist/layers.SvUN62A9.js +0 -11
  211. package/dist/layers.TGEy1wS6.js +0 -32
  212. package/dist/layers.TdE-jeZL.js +0 -7
  213. package/dist/layers.UWRNxgT8.js +0 -8
  214. package/dist/layers.VA5efHzM.js +0 -39
  215. package/dist/layers._2_sfSMa.js +0 -1
  216. package/dist/layers.ajIRcGd4.js +0 -1126
  217. package/dist/layers.b0h5ZBmD.js +0 -61
  218. package/dist/layers.cjE12qw2.js +0 -9
  219. package/dist/layers.dJvyCZ1b.js +0 -2
  220. package/dist/layers.da887to_.js +0 -8
  221. package/dist/layers.dhxVHEDE.js +0 -1
  222. package/dist/layers.ejvu1U9t.js +0 -122
  223. package/dist/layers.epvyXTdV.js +0 -373
  224. package/dist/layers.fm_nJlxH.js +0 -6
  225. package/dist/layers.guGfRsPS.js +0 -39
  226. package/dist/layers.hweLqW3I.js +0 -261
  227. package/dist/layers.j04tfCKj.js +0 -39
  228. package/dist/layers.kzDq9Q-l.js +0 -1
  229. package/dist/layers.lCpg7dOn.js +0 -21
  230. package/dist/layers.ldz4asX5.js +0 -202
  231. package/dist/layers.ov1rbOW3.js +0 -1
  232. package/dist/layers.pHVqEwm3.js +0 -32
  233. package/dist/layers.rgYI6gus.js +0 -803
  234. package/dist/layers.sTUiyAuM.js +0 -41
  235. package/dist/layers.uMaAjCOP.js +0 -931
  236. package/dist/layers.vJ0fdhPp.js +0 -282
  237. package/dist/layers.vqKLXMfn.js +0 -1034
  238. package/dist/layers.wSBHMHgW.js +0 -42
  239. package/dist/layers.yquOOwF7.js +0 -7
  240. package/dist/layers.zJTwyIu5.js +0 -960
@@ -1,1283 +0,0 @@
1
- import { s as zt, a as Ft, n as wt, o as Nt, b as Xt, c as Yt, l as St, A as Ht, e as $t, q as Ut, W as ot, a6 as Ct, P as qt, Q as jt, i as Gt } from "./layers.DbEYtfVc.js";
2
- import { a as Qt } from "./layers.DpuQVg48.js";
3
- import "./layers.Cz4E3Gls.js";
4
- import { i as Kt } from "./layers.DjUOC4st.js";
5
- import { o as Zt } from "./layers.b0h5ZBmD.js";
6
- import { l as ft } from "./layers.CEDfv2oj.js";
7
- import { l as pt } from "./layers.Bdwk_Ggl.js";
8
- function Jt(e, t, i) {
9
- e = +e, t = +t, i = (n = arguments.length) < 2 ? (t = e, e = 0, 1) : n < 3 ? 1 : +i;
10
- for (var s = -1, n = Math.max(0, Math.ceil((t - e) / i)) | 0, o = new Array(n); ++s < n; )
11
- o[s] = e + s * i;
12
- return o;
13
- }
14
- function st() {
15
- var e = Zt().unknown(void 0), t = e.domain, i = e.range, s = 0, n = 1, o, c, f = !1, d = 0, R = 0, _ = 0.5;
16
- delete e.unknown;
17
- function A() {
18
- var m = t().length, T = n < s, S = T ? n : s, P = T ? s : n;
19
- o = (P - S) / Math.max(1, m - d + R * 2), f && (o = Math.floor(o)), S += (P - S - o * (m - d)) * _, c = o * (1 - d), f && (S = Math.round(S), c = Math.round(c));
20
- var p = Jt(m).map(function(C) {
21
- return S + o * C;
22
- });
23
- return i(T ? p.reverse() : p);
24
- }
25
- return e.domain = function(m) {
26
- return arguments.length ? (t(m), A()) : t();
27
- }, e.range = function(m) {
28
- return arguments.length ? ([s, n] = m, s = +s, n = +n, A()) : [s, n];
29
- }, e.rangeRound = function(m) {
30
- return [s, n] = m, s = +s, n = +n, f = !0, A();
31
- }, e.bandwidth = function() {
32
- return c;
33
- }, e.step = function() {
34
- return o;
35
- }, e.round = function(m) {
36
- return arguments.length ? (f = !!m, A()) : f;
37
- }, e.padding = function(m) {
38
- return arguments.length ? (d = Math.min(1, R = +m), A()) : d;
39
- }, e.paddingInner = function(m) {
40
- return arguments.length ? (d = Math.min(1, m), A()) : d;
41
- }, e.paddingOuter = function(m) {
42
- return arguments.length ? (R = +m, A()) : R;
43
- }, e.align = function(m) {
44
- return arguments.length ? (_ = Math.max(0, Math.min(1, m)), A()) : _;
45
- }, e.copy = function() {
46
- return st(t(), [s, n]).round(f).paddingInner(d).paddingOuter(R).align(_);
47
- }, Kt.apply(A(), arguments);
48
- }
49
- var nt = (function() {
50
- var e = function(V, r, l, u) {
51
- for (l = l || {}, u = V.length; u--; l[V[u]] = r)
52
- ;
53
- return l;
54
- }, t = [1, 10, 12, 14, 16, 18, 19, 21, 23], i = [2, 6], s = [1, 3], n = [1, 5], o = [1, 6], c = [1, 7], f = [1, 5, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], d = [1, 25], R = [1, 26], _ = [1, 28], A = [1, 29], m = [1, 30], T = [1, 31], S = [1, 32], P = [1, 33], p = [1, 34], C = [1, 35], h = [1, 36], L = [1, 37], z = [1, 43], lt = [1, 42], ct = [1, 47], $ = [1, 50], w = [1, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], Q = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36], E = [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], ut = [1, 64], K = {
55
- trace: function() {
56
- },
57
- yy: {},
58
- 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 },
59
- 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" },
60
- 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]],
61
- performAction: function(r, l, u, g, b, a, F) {
62
- var x = a.length - 1;
63
- switch (b) {
64
- case 5:
65
- g.setOrientation(a[x]);
66
- break;
67
- case 9:
68
- g.setDiagramTitle(a[x].text.trim());
69
- break;
70
- case 12:
71
- g.setLineData({ text: "", type: "text" }, a[x]);
72
- break;
73
- case 13:
74
- g.setLineData(a[x - 1], a[x]);
75
- break;
76
- case 14:
77
- g.setBarData({ text: "", type: "text" }, a[x]);
78
- break;
79
- case 15:
80
- g.setBarData(a[x - 1], a[x]);
81
- break;
82
- case 16:
83
- this.$ = a[x].trim(), g.setAccTitle(this.$);
84
- break;
85
- case 17:
86
- case 18:
87
- this.$ = a[x].trim(), g.setAccDescription(this.$);
88
- break;
89
- case 19:
90
- this.$ = a[x - 1];
91
- break;
92
- case 20:
93
- this.$ = [Number(a[x - 2]), ...a[x]];
94
- break;
95
- case 21:
96
- this.$ = [Number(a[x])];
97
- break;
98
- case 22:
99
- g.setXAxisTitle(a[x]);
100
- break;
101
- case 23:
102
- g.setXAxisTitle(a[x - 1]);
103
- break;
104
- case 24:
105
- g.setXAxisTitle({ type: "text", text: "" });
106
- break;
107
- case 25:
108
- g.setXAxisBand(a[x]);
109
- break;
110
- case 26:
111
- g.setXAxisRangeData(Number(a[x - 2]), Number(a[x]));
112
- break;
113
- case 27:
114
- this.$ = a[x - 1];
115
- break;
116
- case 28:
117
- this.$ = [a[x - 2], ...a[x]];
118
- break;
119
- case 29:
120
- this.$ = [a[x]];
121
- break;
122
- case 30:
123
- g.setYAxisTitle(a[x]);
124
- break;
125
- case 31:
126
- g.setYAxisTitle(a[x - 1]);
127
- break;
128
- case 32:
129
- g.setYAxisTitle({ type: "text", text: "" });
130
- break;
131
- case 33:
132
- g.setYAxisRangeData(Number(a[x - 2]), Number(a[x]));
133
- break;
134
- case 37:
135
- this.$ = { text: a[x], type: "text" };
136
- break;
137
- case 38:
138
- this.$ = { text: a[x], type: "text" };
139
- break;
140
- case 39:
141
- this.$ = { text: a[x], type: "markdown" };
142
- break;
143
- case 40:
144
- this.$ = a[x];
145
- break;
146
- case 41:
147
- this.$ = a[x - 1] + "" + a[x];
148
- break;
149
- }
150
- },
151
- table: [e(t, i, { 3: 1, 4: 2, 7: 4, 5: s, 34: n, 35: o, 36: c }), { 1: [3] }, e(t, i, { 4: 2, 7: 4, 3: 8, 5: s, 34: n, 35: o, 36: c }), e(t, i, { 4: 2, 7: 4, 6: 9, 3: 10, 5: s, 8: [1, 11], 34: n, 35: o, 36: c }), { 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: c }), { 1: [2, 3] }, e(f, [2, 5]), e(t, [2, 7], { 4: 22, 34: n, 35: o, 36: c }), { 11: 23, 37: 24, 38: d, 39: R, 40: 27, 41: _, 42: A, 43: m, 44: T, 45: S, 46: P, 47: p, 48: C, 49: h, 50: L }, { 11: 39, 13: 38, 24: z, 27: lt, 29: 40, 30: 41, 37: 24, 38: d, 39: R, 40: 27, 41: _, 42: A, 43: m, 44: T, 45: S, 46: P, 47: p, 48: C, 49: h, 50: L }, { 11: 45, 15: 44, 27: ct, 33: 46, 37: 24, 38: d, 39: R, 40: 27, 41: _, 42: A, 43: m, 44: T, 45: S, 46: P, 47: p, 48: C, 49: h, 50: L }, { 11: 49, 17: 48, 24: $, 37: 24, 38: d, 39: R, 40: 27, 41: _, 42: A, 43: m, 44: T, 45: S, 46: P, 47: p, 48: C, 49: h, 50: L }, { 11: 52, 17: 51, 24: $, 37: 24, 38: d, 39: R, 40: 27, 41: _, 42: A, 43: m, 44: T, 45: S, 46: P, 47: p, 48: C, 49: h, 50: L }, { 20: [1, 53] }, { 22: [1, 54] }, e(w, [2, 18]), { 1: [2, 2] }, e(w, [2, 8]), e(w, [2, 9]), e(Q, [2, 37], { 40: 55, 41: _, 42: A, 43: m, 44: T, 45: S, 46: P, 47: p, 48: C, 49: h, 50: L }), e(Q, [2, 38]), e(Q, [2, 39]), e(E, [2, 40]), e(E, [2, 42]), e(E, [2, 43]), e(E, [2, 44]), e(E, [2, 45]), e(E, [2, 46]), e(E, [2, 47]), e(E, [2, 48]), e(E, [2, 49]), e(E, [2, 50]), e(E, [2, 51]), e(w, [2, 10]), e(w, [2, 22], { 30: 41, 29: 56, 24: z, 27: lt }), e(w, [2, 24]), e(w, [2, 25]), { 31: [1, 57] }, { 11: 59, 32: 58, 37: 24, 38: d, 39: R, 40: 27, 41: _, 42: A, 43: m, 44: T, 45: S, 46: P, 47: p, 48: C, 49: h, 50: L }, e(w, [2, 11]), e(w, [2, 30], { 33: 60, 27: ct }), e(w, [2, 32]), { 31: [1, 61] }, e(w, [2, 12]), { 17: 62, 24: $ }, { 25: 63, 27: ut }, e(w, [2, 14]), { 17: 65, 24: $ }, e(w, [2, 16]), e(w, [2, 17]), e(E, [2, 41]), e(w, [2, 23]), { 27: [1, 66] }, { 26: [1, 67] }, { 26: [2, 29], 28: [1, 68] }, e(w, [2, 31]), { 27: [1, 69] }, e(w, [2, 13]), { 26: [1, 70] }, { 26: [2, 21], 28: [1, 71] }, e(w, [2, 15]), e(w, [2, 26]), e(w, [2, 27]), { 11: 59, 32: 72, 37: 24, 38: d, 39: R, 40: 27, 41: _, 42: A, 43: m, 44: T, 45: S, 46: P, 47: p, 48: C, 49: h, 50: L }, e(w, [2, 33]), e(w, [2, 19]), { 25: 73, 27: ut }, { 26: [2, 28] }, { 26: [2, 20] }],
152
- defaultActions: { 8: [2, 1], 10: [2, 3], 21: [2, 2], 72: [2, 28], 73: [2, 20] },
153
- parseError: function(r, l) {
154
- if (l.recoverable)
155
- this.trace(r);
156
- else {
157
- var u = new Error(r);
158
- throw u.hash = l, u;
159
- }
160
- },
161
- parse: function(r) {
162
- var l = this, u = [0], g = [], b = [null], a = [], F = this.table, x = "", U = 0, gt = 0, Vt = 2, xt = 1, Wt = a.slice.call(arguments, 1), k = Object.create(this.lexer), W = { yy: {} };
163
- for (var J in this.yy)
164
- Object.prototype.hasOwnProperty.call(this.yy, J) && (W.yy[J] = this.yy[J]);
165
- k.setInput(r, W.yy), W.yy.lexer = k, W.yy.parser = this, typeof k.yylloc > "u" && (k.yylloc = {});
166
- var tt = k.yylloc;
167
- a.push(tt);
168
- var Bt = k.options && k.options.ranges;
169
- typeof W.yy.parseError == "function" ? this.parseError = W.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
170
- function Ot() {
171
- var I;
172
- return I = g.pop() || k.lex() || xt, typeof I != "number" && (I instanceof Array && (g = I, I = g.pop()), I = l.symbols_[I] || I), I;
173
- }
174
- for (var D, B, v, it, O = {}, q, M, dt, j; ; ) {
175
- if (B = u[u.length - 1], this.defaultActions[B] ? v = this.defaultActions[B] : ((D === null || typeof D > "u") && (D = Ot()), v = F[B] && F[B][D]), typeof v > "u" || !v.length || !v[0]) {
176
- var et = "";
177
- j = [];
178
- for (q in F[B])
179
- this.terminals_[q] && q > Vt && j.push("'" + this.terminals_[q] + "'");
180
- k.showPosition ? et = "Parse error on line " + (U + 1) + `:
181
- ` + k.showPosition() + `
182
- Expecting ` + j.join(", ") + ", got '" + (this.terminals_[D] || D) + "'" : et = "Parse error on line " + (U + 1) + ": Unexpected " + (D == xt ? "end of input" : "'" + (this.terminals_[D] || D) + "'"), this.parseError(et, {
183
- text: k.match,
184
- token: this.terminals_[D] || D,
185
- line: k.yylineno,
186
- loc: tt,
187
- expected: j
188
- });
189
- }
190
- if (v[0] instanceof Array && v.length > 1)
191
- throw new Error("Parse Error: multiple actions possible at state: " + B + ", token: " + D);
192
- switch (v[0]) {
193
- case 1:
194
- u.push(D), b.push(k.yytext), a.push(k.yylloc), u.push(v[1]), D = null, gt = k.yyleng, x = k.yytext, U = k.yylineno, tt = k.yylloc;
195
- break;
196
- case 2:
197
- if (M = this.productions_[v[1]][1], O.$ = b[b.length - M], O._$ = {
198
- first_line: a[a.length - (M || 1)].first_line,
199
- last_line: a[a.length - 1].last_line,
200
- first_column: a[a.length - (M || 1)].first_column,
201
- last_column: a[a.length - 1].last_column
202
- }, Bt && (O._$.range = [
203
- a[a.length - (M || 1)].range[0],
204
- a[a.length - 1].range[1]
205
- ]), it = this.performAction.apply(O, [
206
- x,
207
- gt,
208
- U,
209
- W.yy,
210
- v[1],
211
- b,
212
- a
213
- ].concat(Wt)), typeof it < "u")
214
- return it;
215
- M && (u = u.slice(0, -1 * M * 2), b = b.slice(0, -1 * M), a = a.slice(0, -1 * M)), u.push(this.productions_[v[1]][0]), b.push(O.$), a.push(O._$), dt = F[u[u.length - 2]][u[u.length - 1]], u.push(dt);
216
- break;
217
- case 3:
218
- return !0;
219
- }
220
- }
221
- return !0;
222
- }
223
- }, It = /* @__PURE__ */ (function() {
224
- var V = {
225
- EOF: 1,
226
- parseError: function(l, u) {
227
- if (this.yy.parser)
228
- this.yy.parser.parseError(l, u);
229
- else
230
- throw new Error(l);
231
- },
232
- // resets the lexer, sets new input
233
- setInput: function(r, l) {
234
- return this.yy = l || this.yy || {}, this._input = r, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
235
- first_line: 1,
236
- first_column: 0,
237
- last_line: 1,
238
- last_column: 0
239
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
240
- },
241
- // consumes and returns one char from the input
242
- input: function() {
243
- var r = this._input[0];
244
- this.yytext += r, this.yyleng++, this.offset++, this.match += r, this.matched += r;
245
- var l = r.match(/(?:\r\n?|\n).*/g);
246
- 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), r;
247
- },
248
- // unshifts one char (or a string) into the input
249
- unput: function(r) {
250
- var l = r.length, u = r.split(/(?:\r\n?|\n)/g);
251
- this._input = r + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - l), this.offset -= l;
252
- var g = this.match.split(/(?:\r\n?|\n)/g);
253
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), u.length - 1 && (this.yylineno -= u.length - 1);
254
- var b = this.yylloc.range;
255
- return this.yylloc = {
256
- first_line: this.yylloc.first_line,
257
- last_line: this.yylineno + 1,
258
- first_column: this.yylloc.first_column,
259
- last_column: u ? (u.length === g.length ? this.yylloc.first_column : 0) + g[g.length - u.length].length - u[0].length : this.yylloc.first_column - l
260
- }, this.options.ranges && (this.yylloc.range = [b[0], b[0] + this.yyleng - l]), this.yyleng = this.yytext.length, this;
261
- },
262
- // When called from action, caches matched text and appends it on next action
263
- more: function() {
264
- return this._more = !0, this;
265
- },
266
- // 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.
267
- reject: function() {
268
- if (this.options.backtrack_lexer)
269
- this._backtrack = !0;
270
- else
271
- 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).
272
- ` + this.showPosition(), {
273
- text: "",
274
- token: null,
275
- line: this.yylineno
276
- });
277
- return this;
278
- },
279
- // retain first n characters of the match
280
- less: function(r) {
281
- this.unput(this.match.slice(r));
282
- },
283
- // displays already matched input, i.e. for error messages
284
- pastInput: function() {
285
- var r = this.matched.substr(0, this.matched.length - this.match.length);
286
- return (r.length > 20 ? "..." : "") + r.substr(-20).replace(/\n/g, "");
287
- },
288
- // displays upcoming input, i.e. for error messages
289
- upcomingInput: function() {
290
- var r = this.match;
291
- return r.length < 20 && (r += this._input.substr(0, 20 - r.length)), (r.substr(0, 20) + (r.length > 20 ? "..." : "")).replace(/\n/g, "");
292
- },
293
- // displays the character position where the lexing error occurred, i.e. for error messages
294
- showPosition: function() {
295
- var r = this.pastInput(), l = new Array(r.length + 1).join("-");
296
- return r + this.upcomingInput() + `
297
- ` + l + "^";
298
- },
299
- // test the lexed token: return FALSE when not a match, otherwise return token
300
- test_match: function(r, l) {
301
- var u, g, b;
302
- if (this.options.backtrack_lexer && (b = {
303
- yylineno: this.yylineno,
304
- yylloc: {
305
- first_line: this.yylloc.first_line,
306
- last_line: this.last_line,
307
- first_column: this.yylloc.first_column,
308
- last_column: this.yylloc.last_column
309
- },
310
- yytext: this.yytext,
311
- match: this.match,
312
- matches: this.matches,
313
- matched: this.matched,
314
- yyleng: this.yyleng,
315
- offset: this.offset,
316
- _more: this._more,
317
- _input: this._input,
318
- yy: this.yy,
319
- conditionStack: this.conditionStack.slice(0),
320
- done: this.done
321
- }, this.options.ranges && (b.yylloc.range = this.yylloc.range.slice(0))), g = r[0].match(/(?:\r\n?|\n).*/g), g && (this.yylineno += g.length), this.yylloc = {
322
- first_line: this.yylloc.last_line,
323
- last_line: this.yylineno + 1,
324
- first_column: this.yylloc.last_column,
325
- last_column: g ? g[g.length - 1].length - g[g.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + r[0].length
326
- }, this.yytext += r[0], this.match += r[0], this.matches = r, 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(r[0].length), this.matched += r[0], u = this.performAction.call(this, this.yy, this, l, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), u)
327
- return u;
328
- if (this._backtrack) {
329
- for (var a in b)
330
- this[a] = b[a];
331
- return !1;
332
- }
333
- return !1;
334
- },
335
- // return next match in input
336
- next: function() {
337
- if (this.done)
338
- return this.EOF;
339
- this._input || (this.done = !0);
340
- var r, l, u, g;
341
- this._more || (this.yytext = "", this.match = "");
342
- for (var b = this._currentRules(), a = 0; a < b.length; a++)
343
- if (u = this._input.match(this.rules[b[a]]), u && (!l || u[0].length > l[0].length)) {
344
- if (l = u, g = a, this.options.backtrack_lexer) {
345
- if (r = this.test_match(u, b[a]), r !== !1)
346
- return r;
347
- if (this._backtrack) {
348
- l = !1;
349
- continue;
350
- } else
351
- return !1;
352
- } else if (!this.options.flex)
353
- break;
354
- }
355
- return l ? (r = this.test_match(l, b[g]), r !== !1 ? r : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
356
- ` + this.showPosition(), {
357
- text: "",
358
- token: null,
359
- line: this.yylineno
360
- });
361
- },
362
- // return next match that has a token
363
- lex: function() {
364
- var l = this.next();
365
- return l || this.lex();
366
- },
367
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
368
- begin: function(l) {
369
- this.conditionStack.push(l);
370
- },
371
- // pop the previously active lexer condition state off the condition stack
372
- popState: function() {
373
- var l = this.conditionStack.length - 1;
374
- return l > 0 ? this.conditionStack.pop() : this.conditionStack[0];
375
- },
376
- // produce the lexer rule set which is active for the currently active lexer condition state
377
- _currentRules: function() {
378
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
379
- },
380
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
381
- topState: function(l) {
382
- return l = this.conditionStack.length - 1 - Math.abs(l || 0), l >= 0 ? this.conditionStack[l] : "INITIAL";
383
- },
384
- // alias for begin(condition)
385
- pushState: function(l) {
386
- this.begin(l);
387
- },
388
- // return the number of states currently on the stack
389
- stateStackSize: function() {
390
- return this.conditionStack.length;
391
- },
392
- options: { "case-insensitive": !0 },
393
- performAction: function(l, u, g, b) {
394
- switch (g) {
395
- case 0:
396
- break;
397
- case 1:
398
- break;
399
- case 2:
400
- return this.popState(), 34;
401
- case 3:
402
- return this.popState(), 34;
403
- case 4:
404
- return 34;
405
- case 5:
406
- break;
407
- case 6:
408
- return 10;
409
- case 7:
410
- return this.pushState("acc_title"), 19;
411
- case 8:
412
- return this.popState(), "acc_title_value";
413
- case 9:
414
- return this.pushState("acc_descr"), 21;
415
- case 10:
416
- return this.popState(), "acc_descr_value";
417
- case 11:
418
- this.pushState("acc_descr_multiline");
419
- break;
420
- case 12:
421
- this.popState();
422
- break;
423
- case 13:
424
- return "acc_descr_multiline_value";
425
- case 14:
426
- return 5;
427
- case 15:
428
- return 8;
429
- case 16:
430
- return this.pushState("axis_data"), "X_AXIS";
431
- case 17:
432
- return this.pushState("axis_data"), "Y_AXIS";
433
- case 18:
434
- return this.pushState("axis_band_data"), 24;
435
- case 19:
436
- return 31;
437
- case 20:
438
- return this.pushState("data"), 16;
439
- case 21:
440
- return this.pushState("data"), 18;
441
- case 22:
442
- return this.pushState("data_inner"), 24;
443
- case 23:
444
- return 27;
445
- case 24:
446
- return this.popState(), 26;
447
- case 25:
448
- this.popState();
449
- break;
450
- case 26:
451
- this.pushState("string");
452
- break;
453
- case 27:
454
- this.popState();
455
- break;
456
- case 28:
457
- return "STR";
458
- case 29:
459
- return 24;
460
- case 30:
461
- return 26;
462
- case 31:
463
- return 43;
464
- case 32:
465
- return "COLON";
466
- case 33:
467
- return 44;
468
- case 34:
469
- return 28;
470
- case 35:
471
- return 45;
472
- case 36:
473
- return 46;
474
- case 37:
475
- return 48;
476
- case 38:
477
- return 50;
478
- case 39:
479
- return 47;
480
- case 40:
481
- return 41;
482
- case 41:
483
- return 49;
484
- case 42:
485
- return 42;
486
- case 43:
487
- break;
488
- case 44:
489
- return 35;
490
- case 45:
491
- return 36;
492
- }
493
- },
494
- 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],
495
- 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 } }
496
- };
497
- return V;
498
- })();
499
- K.lexer = It;
500
- function Z() {
501
- this.yy = {};
502
- }
503
- return Z.prototype = K, K.Parser = Z, new Z();
504
- })();
505
- nt.parser = nt;
506
- const ti = nt;
507
- function mt(e) {
508
- return e.type === "bar";
509
- }
510
- function _t(e) {
511
- return e.type === "band";
512
- }
513
- function N(e) {
514
- return e.type === "linear";
515
- }
516
- class kt {
517
- constructor(t) {
518
- this.parentGroup = t;
519
- }
520
- getMaxDimension(t, i) {
521
- if (!this.parentGroup)
522
- return {
523
- width: t.reduce((o, c) => Math.max(c.length, o), 0) * i,
524
- height: i
525
- };
526
- const s = {
527
- width: 0,
528
- height: 0
529
- }, n = this.parentGroup.append("g").attr("visibility", "hidden").attr("font-size", i);
530
- for (const o of t) {
531
- const c = Qt(n, 1, o), f = c ? c.width : o.length * i, d = c ? c.height : i;
532
- s.width = Math.max(s.width, f), s.height = Math.max(s.height, d);
533
- }
534
- return n.remove(), s;
535
- }
536
- }
537
- const yt = 0.7, bt = 0.2;
538
- class Rt {
539
- constructor(t, i, s, n) {
540
- 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";
541
- }
542
- setRange(t) {
543
- 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();
544
- }
545
- getRange() {
546
- return [this.range[0] + this.outerPadding, this.range[1] - this.outerPadding];
547
- }
548
- setAxisPosition(t) {
549
- this.axisPosition = t, this.setRange(this.range);
550
- }
551
- getTickDistance() {
552
- const t = this.getRange();
553
- return Math.abs(t[0] - t[1]) / this.getTickValues().length;
554
- }
555
- getAxisOuterPadding() {
556
- return this.outerPadding;
557
- }
558
- getLabelDimension() {
559
- return this.textDimensionCalculator.getMaxDimension(
560
- this.getTickValues().map((t) => t.toString()),
561
- this.axisConfig.labelFontSize
562
- );
563
- }
564
- recalculateOuterPaddingToDrawBar() {
565
- yt * this.getTickDistance() > this.outerPadding * 2 && (this.outerPadding = Math.floor(yt * this.getTickDistance() / 2)), this.recalculateScale();
566
- }
567
- calculateSpaceIfDrawnHorizontally(t) {
568
- let i = t.height;
569
- if (this.axisConfig.showAxisLine && i > this.axisConfig.axisLineWidth && (i -= this.axisConfig.axisLineWidth, this.showAxisLine = !0), this.axisConfig.showLabel) {
570
- const s = this.getLabelDimension(), n = bt * t.width;
571
- this.outerPadding = Math.min(s.width / 2, n);
572
- const o = s.height + this.axisConfig.labelPadding * 2;
573
- this.labelTextHeight = s.height, o <= i && (i -= o, this.showLabel = !0);
574
- }
575
- if (this.axisConfig.showTick && i >= this.axisConfig.tickLength && (this.showTick = !0, i -= this.axisConfig.tickLength), this.axisConfig.showTitle && this.title) {
576
- const s = this.textDimensionCalculator.getMaxDimension(
577
- [this.title],
578
- this.axisConfig.titleFontSize
579
- ), n = s.height + this.axisConfig.titlePadding * 2;
580
- this.titleTextHeight = s.height, n <= i && (i -= n, this.showTitle = !0);
581
- }
582
- this.boundingRect.width = t.width, this.boundingRect.height = t.height - i;
583
- }
584
- calculateSpaceIfDrawnVertical(t) {
585
- let i = t.width;
586
- if (this.axisConfig.showAxisLine && i > this.axisConfig.axisLineWidth && (i -= this.axisConfig.axisLineWidth, this.showAxisLine = !0), this.axisConfig.showLabel) {
587
- const s = this.getLabelDimension(), n = bt * t.height;
588
- this.outerPadding = Math.min(s.height / 2, n);
589
- const o = s.width + this.axisConfig.labelPadding * 2;
590
- o <= i && (i -= o, this.showLabel = !0);
591
- }
592
- if (this.axisConfig.showTick && i >= this.axisConfig.tickLength && (this.showTick = !0, i -= this.axisConfig.tickLength), this.axisConfig.showTitle && this.title) {
593
- const s = this.textDimensionCalculator.getMaxDimension(
594
- [this.title],
595
- this.axisConfig.titleFontSize
596
- ), n = s.height + this.axisConfig.titlePadding * 2;
597
- this.titleTextHeight = s.height, n <= i && (i -= n, this.showTitle = !0);
598
- }
599
- this.boundingRect.width = t.width - i, this.boundingRect.height = t.height;
600
- }
601
- calculateSpace(t) {
602
- return this.axisPosition === "left" || this.axisPosition === "right" ? this.calculateSpaceIfDrawnVertical(t) : this.calculateSpaceIfDrawnHorizontally(t), this.recalculateScale(), {
603
- width: this.boundingRect.width,
604
- height: this.boundingRect.height
605
- };
606
- }
607
- setBoundingBoxXY(t) {
608
- this.boundingRect.x = t.x, this.boundingRect.y = t.y;
609
- }
610
- getDrawableElementsForLeftAxis() {
611
- const t = [];
612
- if (this.showAxisLine) {
613
- const i = this.boundingRect.x + this.boundingRect.width - this.axisConfig.axisLineWidth / 2;
614
- t.push({
615
- type: "path",
616
- groupTexts: ["left-axis", "axisl-line"],
617
- data: [
618
- {
619
- path: `M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y + this.boundingRect.height} `,
620
- strokeFill: this.axisThemeConfig.axisLineColor,
621
- strokeWidth: this.axisConfig.axisLineWidth
622
- }
623
- ]
624
- });
625
- }
626
- if (this.showLabel && t.push({
627
- type: "text",
628
- groupTexts: ["left-axis", "label"],
629
- data: this.getTickValues().map((i) => ({
630
- text: i.toString(),
631
- 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),
632
- y: this.getScaleValue(i),
633
- fill: this.axisThemeConfig.labelColor,
634
- fontSize: this.axisConfig.labelFontSize,
635
- rotation: 0,
636
- verticalPos: "middle",
637
- horizontalPos: "right"
638
- }))
639
- }), this.showTick) {
640
- const i = this.boundingRect.x + this.boundingRect.width - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
641
- t.push({
642
- type: "path",
643
- groupTexts: ["left-axis", "ticks"],
644
- data: this.getTickValues().map((s) => ({
645
- path: `M ${i},${this.getScaleValue(s)} L ${i - this.axisConfig.tickLength},${this.getScaleValue(s)}`,
646
- strokeFill: this.axisThemeConfig.tickColor,
647
- strokeWidth: this.axisConfig.tickWidth
648
- }))
649
- });
650
- }
651
- return this.showTitle && t.push({
652
- type: "text",
653
- groupTexts: ["left-axis", "title"],
654
- data: [
655
- {
656
- text: this.title,
657
- x: this.boundingRect.x + this.axisConfig.titlePadding,
658
- y: this.boundingRect.y + this.boundingRect.height / 2,
659
- fill: this.axisThemeConfig.titleColor,
660
- fontSize: this.axisConfig.titleFontSize,
661
- rotation: 270,
662
- verticalPos: "top",
663
- horizontalPos: "center"
664
- }
665
- ]
666
- }), t;
667
- }
668
- getDrawableElementsForBottomAxis() {
669
- const t = [];
670
- if (this.showAxisLine) {
671
- const i = this.boundingRect.y + this.axisConfig.axisLineWidth / 2;
672
- t.push({
673
- type: "path",
674
- groupTexts: ["bottom-axis", "axis-line"],
675
- data: [
676
- {
677
- path: `M ${this.boundingRect.x},${i} L ${this.boundingRect.x + this.boundingRect.width},${i}`,
678
- strokeFill: this.axisThemeConfig.axisLineColor,
679
- strokeWidth: this.axisConfig.axisLineWidth
680
- }
681
- ]
682
- });
683
- }
684
- if (this.showLabel && t.push({
685
- type: "text",
686
- groupTexts: ["bottom-axis", "label"],
687
- data: this.getTickValues().map((i) => ({
688
- text: i.toString(),
689
- x: this.getScaleValue(i),
690
- y: this.boundingRect.y + this.axisConfig.labelPadding + (this.showTick ? this.axisConfig.tickLength : 0) + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0),
691
- fill: this.axisThemeConfig.labelColor,
692
- fontSize: this.axisConfig.labelFontSize,
693
- rotation: 0,
694
- verticalPos: "top",
695
- horizontalPos: "center"
696
- }))
697
- }), this.showTick) {
698
- const i = this.boundingRect.y + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
699
- t.push({
700
- type: "path",
701
- groupTexts: ["bottom-axis", "ticks"],
702
- data: this.getTickValues().map((s) => ({
703
- path: `M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i + this.axisConfig.tickLength}`,
704
- strokeFill: this.axisThemeConfig.tickColor,
705
- strokeWidth: this.axisConfig.tickWidth
706
- }))
707
- });
708
- }
709
- return this.showTitle && t.push({
710
- type: "text",
711
- groupTexts: ["bottom-axis", "title"],
712
- data: [
713
- {
714
- text: this.title,
715
- x: this.range[0] + (this.range[1] - this.range[0]) / 2,
716
- y: this.boundingRect.y + this.boundingRect.height - this.axisConfig.titlePadding - this.titleTextHeight,
717
- fill: this.axisThemeConfig.titleColor,
718
- fontSize: this.axisConfig.titleFontSize,
719
- rotation: 0,
720
- verticalPos: "top",
721
- horizontalPos: "center"
722
- }
723
- ]
724
- }), t;
725
- }
726
- getDrawableElementsForTopAxis() {
727
- const t = [];
728
- if (this.showAxisLine) {
729
- const i = this.boundingRect.y + this.boundingRect.height - this.axisConfig.axisLineWidth / 2;
730
- t.push({
731
- type: "path",
732
- groupTexts: ["top-axis", "axis-line"],
733
- data: [
734
- {
735
- path: `M ${this.boundingRect.x},${i} L ${this.boundingRect.x + this.boundingRect.width},${i}`,
736
- strokeFill: this.axisThemeConfig.axisLineColor,
737
- strokeWidth: this.axisConfig.axisLineWidth
738
- }
739
- ]
740
- });
741
- }
742
- if (this.showLabel && t.push({
743
- type: "text",
744
- groupTexts: ["top-axis", "label"],
745
- data: this.getTickValues().map((i) => ({
746
- text: i.toString(),
747
- x: this.getScaleValue(i),
748
- y: this.boundingRect.y + (this.showTitle ? this.titleTextHeight + this.axisConfig.titlePadding * 2 : 0) + this.axisConfig.labelPadding,
749
- fill: this.axisThemeConfig.labelColor,
750
- fontSize: this.axisConfig.labelFontSize,
751
- rotation: 0,
752
- verticalPos: "top",
753
- horizontalPos: "center"
754
- }))
755
- }), this.showTick) {
756
- const i = this.boundingRect.y;
757
- t.push({
758
- type: "path",
759
- groupTexts: ["top-axis", "ticks"],
760
- data: this.getTickValues().map((s) => ({
761
- 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)}`,
762
- strokeFill: this.axisThemeConfig.tickColor,
763
- strokeWidth: this.axisConfig.tickWidth
764
- }))
765
- });
766
- }
767
- return this.showTitle && t.push({
768
- type: "text",
769
- groupTexts: ["top-axis", "title"],
770
- data: [
771
- {
772
- text: this.title,
773
- x: this.boundingRect.x + this.boundingRect.width / 2,
774
- y: this.boundingRect.y + this.axisConfig.titlePadding,
775
- fill: this.axisThemeConfig.titleColor,
776
- fontSize: this.axisConfig.titleFontSize,
777
- rotation: 0,
778
- verticalPos: "top",
779
- horizontalPos: "center"
780
- }
781
- ]
782
- }), t;
783
- }
784
- getDrawableElements() {
785
- if (this.axisPosition === "left")
786
- return this.getDrawableElementsForLeftAxis();
787
- if (this.axisPosition === "right")
788
- throw Error("Drawing of right axis is not implemented");
789
- return this.axisPosition === "bottom" ? this.getDrawableElementsForBottomAxis() : this.axisPosition === "top" ? this.getDrawableElementsForTopAxis() : [];
790
- }
791
- }
792
- class ii extends Rt {
793
- constructor(t, i, s, n, o) {
794
- super(t, n, o, i), this.categories = s, this.scale = st().domain(this.categories).range(this.getRange());
795
- }
796
- setRange(t) {
797
- super.setRange(t);
798
- }
799
- recalculateScale() {
800
- this.scale = st().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5), St.trace("BandAxis axis final categories, range: ", this.categories, this.getRange());
801
- }
802
- getTickValues() {
803
- return this.categories;
804
- }
805
- getScaleValue(t) {
806
- return this.scale(t) || this.getRange()[0];
807
- }
808
- }
809
- class ei extends Rt {
810
- constructor(t, i, s, n, o) {
811
- super(t, n, o, i), this.domain = s, this.scale = ft().domain(this.domain).range(this.getRange());
812
- }
813
- getTickValues() {
814
- return this.scale.ticks();
815
- }
816
- recalculateScale() {
817
- const t = [...this.domain];
818
- this.axisPosition === "left" && t.reverse(), this.scale = ft().domain(t).range(this.getRange());
819
- }
820
- getScaleValue(t) {
821
- return this.scale(t);
822
- }
823
- }
824
- function At(e, t, i, s) {
825
- const n = new kt(s);
826
- return _t(e) ? new ii(
827
- t,
828
- i,
829
- e.categories,
830
- e.title,
831
- n
832
- ) : new ei(
833
- t,
834
- i,
835
- [e.min, e.max],
836
- e.title,
837
- n
838
- );
839
- }
840
- class si {
841
- constructor(t, i, s, n) {
842
- this.textDimensionCalculator = t, this.chartConfig = i, this.chartData = s, this.chartThemeConfig = n, this.boundingRect = {
843
- x: 0,
844
- y: 0,
845
- width: 0,
846
- height: 0
847
- }, this.showChartTitle = !1;
848
- }
849
- setBoundingBoxXY(t) {
850
- this.boundingRect.x = t.x, this.boundingRect.y = t.y;
851
- }
852
- calculateSpace(t) {
853
- const i = this.textDimensionCalculator.getMaxDimension(
854
- [this.chartData.title],
855
- this.chartConfig.titleFontSize
856
- ), s = Math.max(i.width, t.width), n = i.height + 2 * this.chartConfig.titlePadding;
857
- return i.width <= s && i.height <= n && this.chartConfig.showTitle && this.chartData.title && (this.boundingRect.width = s, this.boundingRect.height = n, this.showChartTitle = !0), {
858
- width: this.boundingRect.width,
859
- height: this.boundingRect.height
860
- };
861
- }
862
- getDrawableElements() {
863
- const t = [];
864
- return this.showChartTitle && t.push({
865
- groupTexts: ["chart-title"],
866
- type: "text",
867
- data: [
868
- {
869
- fontSize: this.chartConfig.titleFontSize,
870
- text: this.chartData.title,
871
- verticalPos: "middle",
872
- horizontalPos: "center",
873
- x: this.boundingRect.x + this.boundingRect.width / 2,
874
- y: this.boundingRect.y + this.boundingRect.height / 2,
875
- fill: this.chartThemeConfig.titleColor,
876
- rotation: 0
877
- }
878
- ]
879
- }), t;
880
- }
881
- }
882
- function ni(e, t, i, s) {
883
- const n = new kt(s);
884
- return new si(n, e, t, i);
885
- }
886
- class ai {
887
- constructor(t, i, s, n, o) {
888
- this.plotData = t, this.xAxis = i, this.yAxis = s, this.orientation = n, this.plotIndex = o;
889
- }
890
- getDrawableElement() {
891
- const t = this.plotData.data.map((s) => [
892
- this.xAxis.getScaleValue(s[0]),
893
- this.yAxis.getScaleValue(s[1])
894
- ]);
895
- let i;
896
- return this.orientation === "horizontal" ? i = pt().y((s) => s[0]).x((s) => s[1])(t) : i = pt().x((s) => s[0]).y((s) => s[1])(t), i ? [
897
- {
898
- groupTexts: ["plot", `line-plot-${this.plotIndex}`],
899
- type: "path",
900
- data: [
901
- {
902
- path: i,
903
- strokeFill: this.plotData.strokeFill,
904
- strokeWidth: this.plotData.strokeWidth
905
- }
906
- ]
907
- }
908
- ] : [];
909
- }
910
- }
911
- class oi {
912
- constructor(t, i, s, n, o, c) {
913
- this.barData = t, this.boundingRect = i, this.xAxis = s, this.yAxis = n, this.orientation = o, this.plotIndex = c;
914
- }
915
- getDrawableElement() {
916
- const t = this.barData.data.map((o) => [
917
- this.xAxis.getScaleValue(o[0]),
918
- this.yAxis.getScaleValue(o[1])
919
- ]), s = Math.min(this.xAxis.getAxisOuterPadding() * 2, this.xAxis.getTickDistance()) * (1 - 0.05), n = s / 2;
920
- return this.orientation === "horizontal" ? [
921
- {
922
- groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
923
- type: "rect",
924
- data: t.map((o) => ({
925
- x: this.boundingRect.x,
926
- y: o[0] - n,
927
- height: s,
928
- width: o[1] - this.boundingRect.x,
929
- fill: this.barData.fill,
930
- strokeWidth: 0,
931
- strokeFill: this.barData.fill
932
- }))
933
- }
934
- ] : [
935
- {
936
- groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
937
- type: "rect",
938
- data: t.map((o) => ({
939
- x: o[0] - n,
940
- y: o[1],
941
- width: s,
942
- height: this.boundingRect.y + this.boundingRect.height - o[1],
943
- fill: this.barData.fill,
944
- strokeWidth: 0,
945
- strokeFill: this.barData.fill
946
- }))
947
- }
948
- ];
949
- }
950
- }
951
- class ri {
952
- constructor(t, i, s) {
953
- this.chartConfig = t, this.chartData = i, this.chartThemeConfig = s, this.boundingRect = {
954
- x: 0,
955
- y: 0,
956
- width: 0,
957
- height: 0
958
- };
959
- }
960
- setAxes(t, i) {
961
- this.xAxis = t, this.yAxis = i;
962
- }
963
- setBoundingBoxXY(t) {
964
- this.boundingRect.x = t.x, this.boundingRect.y = t.y;
965
- }
966
- calculateSpace(t) {
967
- return this.boundingRect.width = t.width, this.boundingRect.height = t.height, {
968
- width: this.boundingRect.width,
969
- height: this.boundingRect.height
970
- };
971
- }
972
- getDrawableElements() {
973
- if (!(this.xAxis && this.yAxis))
974
- throw Error("Axes must be passed to render Plots");
975
- const t = [];
976
- for (const [i, s] of this.chartData.plots.entries())
977
- switch (s.type) {
978
- case "line":
979
- {
980
- const n = new ai(
981
- s,
982
- this.xAxis,
983
- this.yAxis,
984
- this.chartConfig.chartOrientation,
985
- i
986
- );
987
- t.push(...n.getDrawableElement());
988
- }
989
- break;
990
- case "bar":
991
- {
992
- const n = new oi(
993
- s,
994
- this.boundingRect,
995
- this.xAxis,
996
- this.yAxis,
997
- this.chartConfig.chartOrientation,
998
- i
999
- );
1000
- t.push(...n.getDrawableElement());
1001
- }
1002
- break;
1003
- }
1004
- return t;
1005
- }
1006
- }
1007
- function hi(e, t, i) {
1008
- return new ri(e, t, i);
1009
- }
1010
- class li {
1011
- constructor(t, i, s, n) {
1012
- this.chartConfig = t, this.chartData = i, this.componentStore = {
1013
- title: ni(t, i, s, n),
1014
- plot: hi(t, i, s),
1015
- xAxis: At(
1016
- i.xAxis,
1017
- t.xAxis,
1018
- {
1019
- titleColor: s.xAxisTitleColor,
1020
- labelColor: s.xAxisLabelColor,
1021
- tickColor: s.xAxisTickColor,
1022
- axisLineColor: s.xAxisLineColor
1023
- },
1024
- n
1025
- ),
1026
- yAxis: At(
1027
- i.yAxis,
1028
- t.yAxis,
1029
- {
1030
- titleColor: s.yAxisTitleColor,
1031
- labelColor: s.yAxisLabelColor,
1032
- tickColor: s.yAxisTickColor,
1033
- axisLineColor: s.yAxisLineColor
1034
- },
1035
- n
1036
- )
1037
- };
1038
- }
1039
- calculateVerticalSpace() {
1040
- let t = this.chartConfig.width, i = this.chartConfig.height, s = 0, n = 0, o = Math.floor(t * this.chartConfig.plotReservedSpacePercent / 100), c = Math.floor(
1041
- i * this.chartConfig.plotReservedSpacePercent / 100
1042
- ), f = this.componentStore.plot.calculateSpace({
1043
- width: o,
1044
- height: c
1045
- });
1046
- t -= f.width, i -= f.height, f = this.componentStore.title.calculateSpace({
1047
- width: this.chartConfig.width,
1048
- height: i
1049
- }), n = f.height, i -= f.height, this.componentStore.xAxis.setAxisPosition("bottom"), f = this.componentStore.xAxis.calculateSpace({
1050
- width: t,
1051
- height: i
1052
- }), i -= f.height, this.componentStore.yAxis.setAxisPosition("left"), f = this.componentStore.yAxis.calculateSpace({
1053
- width: t,
1054
- height: i
1055
- }), s = f.width, t -= f.width, t > 0 && (o += t, t = 0), i > 0 && (c += i, i = 0), this.componentStore.plot.calculateSpace({
1056
- width: o,
1057
- height: c
1058
- }), this.componentStore.plot.setBoundingBoxXY({ x: s, y: n }), this.componentStore.xAxis.setRange([s, s + o]), this.componentStore.xAxis.setBoundingBoxXY({ x: s, y: n + c }), this.componentStore.yAxis.setRange([n, n + c]), this.componentStore.yAxis.setBoundingBoxXY({ x: 0, y: n }), this.chartData.plots.some((d) => mt(d)) && this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
1059
- }
1060
- calculateHorizontalSpace() {
1061
- let t = this.chartConfig.width, i = this.chartConfig.height, s = 0, n = 0, o = 0, c = Math.floor(t * this.chartConfig.plotReservedSpacePercent / 100), f = Math.floor(
1062
- i * this.chartConfig.plotReservedSpacePercent / 100
1063
- ), d = this.componentStore.plot.calculateSpace({
1064
- width: c,
1065
- height: f
1066
- });
1067
- t -= d.width, i -= d.height, d = this.componentStore.title.calculateSpace({
1068
- width: this.chartConfig.width,
1069
- height: i
1070
- }), s = d.height, i -= d.height, this.componentStore.xAxis.setAxisPosition("left"), d = this.componentStore.xAxis.calculateSpace({
1071
- width: t,
1072
- height: i
1073
- }), t -= d.width, n = d.width, this.componentStore.yAxis.setAxisPosition("top"), d = this.componentStore.yAxis.calculateSpace({
1074
- width: t,
1075
- height: i
1076
- }), i -= d.height, o = s + d.height, t > 0 && (c += t, t = 0), i > 0 && (f += i, i = 0), this.componentStore.plot.calculateSpace({
1077
- width: c,
1078
- height: f
1079
- }), this.componentStore.plot.setBoundingBoxXY({ x: n, y: o }), this.componentStore.yAxis.setRange([n, n + c]), 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((R) => mt(R)) && this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
1080
- }
1081
- calculateSpace() {
1082
- this.chartConfig.chartOrientation === "horizontal" ? this.calculateHorizontalSpace() : this.calculateVerticalSpace();
1083
- }
1084
- getDrawableElement() {
1085
- this.calculateSpace();
1086
- const t = [];
1087
- this.componentStore.plot.setAxes(this.componentStore.xAxis, this.componentStore.yAxis);
1088
- for (const i of Object.values(this.componentStore))
1089
- t.push(...i.getDrawableElements());
1090
- return t;
1091
- }
1092
- }
1093
- class ci {
1094
- static build(t, i, s, n) {
1095
- return new li(t, i, s, n).getDrawableElement();
1096
- }
1097
- }
1098
- let X = 0, Tt, Y = Pt(), H = Dt(), y = Lt(), at = H.plotColorPalette.split(",").map((e) => e.trim()), G = !1, rt = !1;
1099
- function Dt() {
1100
- const e = jt(), t = ot();
1101
- return Ct(e.xyChart, t.themeVariables.xyChart);
1102
- }
1103
- function Pt() {
1104
- const e = ot();
1105
- return Ct(
1106
- qt.xyChart,
1107
- e.xyChart
1108
- );
1109
- }
1110
- function Lt() {
1111
- return {
1112
- yAxis: {
1113
- type: "linear",
1114
- title: "",
1115
- min: 1 / 0,
1116
- max: -1 / 0
1117
- },
1118
- xAxis: {
1119
- type: "band",
1120
- title: "",
1121
- categories: []
1122
- },
1123
- title: "",
1124
- plots: []
1125
- };
1126
- }
1127
- function ht(e) {
1128
- const t = ot();
1129
- return Gt(e.trim(), t);
1130
- }
1131
- function ui(e) {
1132
- Tt = e;
1133
- }
1134
- function gi(e) {
1135
- e === "horizontal" ? Y.chartOrientation = "horizontal" : Y.chartOrientation = "vertical";
1136
- }
1137
- function xi(e) {
1138
- y.xAxis.title = ht(e.text);
1139
- }
1140
- function Et(e, t) {
1141
- y.xAxis = { type: "linear", title: y.xAxis.title, min: e, max: t }, G = !0;
1142
- }
1143
- function di(e) {
1144
- y.xAxis = {
1145
- type: "band",
1146
- title: y.xAxis.title,
1147
- categories: e.map((t) => ht(t.text))
1148
- }, G = !0;
1149
- }
1150
- function fi(e) {
1151
- y.yAxis.title = ht(e.text);
1152
- }
1153
- function pi(e, t) {
1154
- y.yAxis = { type: "linear", title: y.yAxis.title, min: e, max: t }, rt = !0;
1155
- }
1156
- function mi(e) {
1157
- const t = Math.min(...e), i = Math.max(...e), s = N(y.yAxis) ? y.yAxis.min : 1 / 0, n = N(y.yAxis) ? y.yAxis.max : -1 / 0;
1158
- y.yAxis = {
1159
- type: "linear",
1160
- title: y.yAxis.title,
1161
- min: Math.min(s, t),
1162
- max: Math.max(n, i)
1163
- };
1164
- }
1165
- function vt(e) {
1166
- let t = [];
1167
- if (e.length === 0)
1168
- return t;
1169
- if (!G) {
1170
- const i = N(y.xAxis) ? y.xAxis.min : 1 / 0, s = N(y.xAxis) ? y.xAxis.max : -1 / 0;
1171
- Et(Math.min(i, 1), Math.max(s, e.length));
1172
- }
1173
- if (rt || mi(e), _t(y.xAxis) && (t = y.xAxis.categories.map((i, s) => [i, e[s]])), N(y.xAxis)) {
1174
- const i = y.xAxis.min, s = y.xAxis.max, n = (s - i + 1) / e.length, o = [];
1175
- for (let c = i; c <= s; c += n)
1176
- o.push(`${c}`);
1177
- t = o.map((c, f) => [c, e[f]]);
1178
- }
1179
- return t;
1180
- }
1181
- function Mt(e) {
1182
- return at[e === 0 ? 0 : e % at.length];
1183
- }
1184
- function yi(e, t) {
1185
- const i = vt(t);
1186
- y.plots.push({
1187
- type: "line",
1188
- strokeFill: Mt(X),
1189
- strokeWidth: 2,
1190
- data: i
1191
- }), X++;
1192
- }
1193
- function bi(e, t) {
1194
- const i = vt(t);
1195
- y.plots.push({
1196
- type: "bar",
1197
- fill: Mt(X),
1198
- data: i
1199
- }), X++;
1200
- }
1201
- function Ai() {
1202
- if (y.plots.length === 0)
1203
- throw Error("No Plot to render, please provide a plot with some data");
1204
- return y.title = wt(), ci.build(Y, y, H, Tt);
1205
- }
1206
- function wi() {
1207
- return H;
1208
- }
1209
- function Si() {
1210
- return Y;
1211
- }
1212
- const Ci = function() {
1213
- Ut(), X = 0, Y = Pt(), y = Lt(), H = Dt(), at = H.plotColorPalette.split(",").map((e) => e.trim()), G = !1, rt = !1;
1214
- }, _i = {
1215
- getDrawableElem: Ai,
1216
- clear: Ci,
1217
- setAccTitle: Yt,
1218
- getAccTitle: Xt,
1219
- setDiagramTitle: Nt,
1220
- getDiagramTitle: wt,
1221
- getAccDescription: Ft,
1222
- setAccDescription: zt,
1223
- setOrientation: gi,
1224
- setXAxisTitle: xi,
1225
- setXAxisRangeData: Et,
1226
- setXAxisBand: di,
1227
- setYAxisTitle: fi,
1228
- setYAxisRangeData: pi,
1229
- setLineData: yi,
1230
- setBarData: bi,
1231
- setTmpSVGG: ui,
1232
- getChartThemeConfig: wi,
1233
- getChartConfig: Si
1234
- }, ki = (e, t, i, s) => {
1235
- const n = s.db, o = n.getChartThemeConfig(), c = n.getChartConfig();
1236
- function f(p) {
1237
- return p === "top" ? "text-before-edge" : "middle";
1238
- }
1239
- function d(p) {
1240
- return p === "left" ? "start" : p === "right" ? "end" : "middle";
1241
- }
1242
- function R(p) {
1243
- return `translate(${p.x}, ${p.y}) rotate(${p.rotation || 0})`;
1244
- }
1245
- St.debug(`Rendering xychart chart
1246
- ` + e);
1247
- const _ = Ht(t), A = _.append("g").attr("class", "main"), m = A.append("rect").attr("width", c.width).attr("height", c.height).attr("class", "background");
1248
- $t(_, c.height, c.width, !0), _.attr("viewBox", `0 0 ${c.width} ${c.height}`), m.attr("fill", o.backgroundColor), n.setTmpSVGG(_.append("g").attr("class", "mermaid-tmp-group"));
1249
- const T = n.getDrawableElem(), S = {};
1250
- function P(p) {
1251
- let C = A, h = "";
1252
- for (const [L] of p.entries()) {
1253
- let z = A;
1254
- L > 0 && S[h] && (z = S[h]), h += p[L], C = S[h], C || (C = S[h] = z.append("g").attr("class", p[L]));
1255
- }
1256
- return C;
1257
- }
1258
- for (const p of T) {
1259
- if (p.data.length === 0)
1260
- continue;
1261
- const C = P(p.groupTexts);
1262
- switch (p.type) {
1263
- case "rect":
1264
- C.selectAll("rect").data(p.data).enter().append("rect").attr("x", (h) => h.x).attr("y", (h) => h.y).attr("width", (h) => h.width).attr("height", (h) => h.height).attr("fill", (h) => h.fill).attr("stroke", (h) => h.strokeFill).attr("stroke-width", (h) => h.strokeWidth);
1265
- break;
1266
- case "text":
1267
- C.selectAll("text").data(p.data).enter().append("text").attr("x", 0).attr("y", 0).attr("fill", (h) => h.fill).attr("font-size", (h) => h.fontSize).attr("dominant-baseline", (h) => f(h.verticalPos)).attr("text-anchor", (h) => d(h.horizontalPos)).attr("transform", (h) => R(h)).text((h) => h.text);
1268
- break;
1269
- case "path":
1270
- C.selectAll("path").data(p.data).enter().append("path").attr("d", (h) => h.path).attr("fill", (h) => h.fill ? h.fill : "none").attr("stroke", (h) => h.strokeFill).attr("stroke-width", (h) => h.strokeWidth);
1271
- break;
1272
- }
1273
- }
1274
- }, Ri = {
1275
- draw: ki
1276
- }, Ii = {
1277
- parser: ti,
1278
- db: _i,
1279
- renderer: Ri
1280
- };
1281
- export {
1282
- Ii as diagram
1283
- };