@layers-app/editor 0.7.45 → 0.7.46

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 (248) hide show
  1. package/dist/index.cjs +2 -2
  2. package/dist/index.d.ts +5 -4
  3. package/dist/index.js +3 -3
  4. package/dist/{layers.dO_EcGnI.js → layers.B88sQYuh.js} +1 -1
  5. package/dist/layers.BgMykHnn.js +154 -0
  6. package/dist/{layers.BNRMPVpZ.js → layers.BtvuN20E.js} +8992 -9643
  7. package/dist/{layers.D7AwxDU3.js → layers.Cfvta__C.js} +1 -1
  8. package/dist/{layers.b9B2NY7n.js → layers.CsQlovyR.js} +2191 -1950
  9. package/dist/layers.Ct1ojjl3.js +1 -0
  10. package/dist/{layers.Cqs6IYG7.js → layers.Hq0pIRX3.js} +24 -24
  11. package/dist/layers.JT_kEFH5.js +129 -0
  12. package/dist/{layers.D10qGvZV.js → layers.NW1lST7i.js} +1 -1
  13. package/dist/layers.pwc3O6Es.js +261 -0
  14. package/package.json +2 -2
  15. package/dist/layers.-kgSm_ki.js +0 -1
  16. package/dist/layers.3H8YMnha.js +0 -960
  17. package/dist/layers.52famHy6.js +0 -1
  18. package/dist/layers.5E21elPk.js +0 -11
  19. package/dist/layers.5VXqgOA9.js +0 -1
  20. package/dist/layers.5VwU1GK1.js +0 -1268
  21. package/dist/layers.7JqFgE4-.js +0 -15
  22. package/dist/layers.7RI58uNS.js +0 -189
  23. package/dist/layers.7SpesQUg.js +0 -40
  24. package/dist/layers.7T_XLunz.js +0 -7
  25. package/dist/layers.8yVEuzdp.js +0 -2238
  26. package/dist/layers.9VxE_IU7.js +0 -6
  27. package/dist/layers.9pNaFvaX.js +0 -1
  28. package/dist/layers.AfB9ZNIL.js +0 -41
  29. package/dist/layers.AwYI6tm5.js +0 -39
  30. package/dist/layers.B-gjjpRn.js +0 -4
  31. package/dist/layers.B09AFCqn.js +0 -37
  32. package/dist/layers.B19hGmey.js +0 -1
  33. package/dist/layers.B1GZzJe5.js +0 -9
  34. package/dist/layers.B1MgjnS3.js +0 -129
  35. package/dist/layers.B3D4g2HH.js +0 -1
  36. package/dist/layers.B4--F20o.js +0 -10
  37. package/dist/layers.B47Vqw3v.js +0 -8
  38. package/dist/layers.B7K7JjK6.js +0 -1510
  39. package/dist/layers.B7Ogzw_9.js +0 -8
  40. package/dist/layers.B9DV1y8l.js +0 -437
  41. package/dist/layers.BAnldxOY.js +0 -61
  42. package/dist/layers.BAtv1CM7.js +0 -1
  43. package/dist/layers.BAuuzKLZ.js +0 -8
  44. package/dist/layers.BBkLpECL.js +0 -41
  45. package/dist/layers.BCFFwcHc.js +0 -8
  46. package/dist/layers.BElVFj7p.js +0 -10
  47. package/dist/layers.BHMGJS6y.js +0 -35
  48. package/dist/layers.BI0na45P.js +0 -39
  49. package/dist/layers.BIeVwYKL.js +0 -1
  50. package/dist/layers.BJDrjORS.js +0 -244
  51. package/dist/layers.BLVqWrAY.js +0 -10
  52. package/dist/layers.BLd2spTm.js +0 -1
  53. package/dist/layers.BMdx5wVt.js +0 -1126
  54. package/dist/layers.BPxT8M1-.js +0 -1619
  55. package/dist/layers.BQ47bUTF.js +0 -207
  56. package/dist/layers.BRQk8xaN.js +0 -52
  57. package/dist/layers.BSTBZrFn.js +0 -1
  58. package/dist/layers.BSd2L4Fm.js +0 -1
  59. package/dist/layers.BT4kTHz7.js +0 -51
  60. package/dist/layers.BaqpKN-R.js +0 -4
  61. package/dist/layers.BbCfEXyj.js +0 -55
  62. package/dist/layers.Bd6ZkqZ7.js +0 -40
  63. package/dist/layers.BdSYcWLH.js +0 -373
  64. package/dist/layers.Be33AcY-.js +0 -1
  65. package/dist/layers.BiIBffqS.js +0 -6
  66. package/dist/layers.BijSGz6X.js +0 -1
  67. package/dist/layers.BioO0hx9.js +0 -10
  68. package/dist/layers.BmE6NOAc.js +0 -41
  69. package/dist/layers.BoRU6N6t.js +0 -1225
  70. package/dist/layers.Boa1dqY1.js +0 -1
  71. package/dist/layers.BpilXLfW.js +0 -6
  72. package/dist/layers.BqYphIWO.js +0 -11
  73. package/dist/layers.Bs1NMWU2.js +0 -9
  74. package/dist/layers.BsKvPJTl.js +0 -10
  75. package/dist/layers.BsZCaVRX.js +0 -22
  76. package/dist/layers.BtKfezUO.js +0 -32
  77. package/dist/layers.BuVXf7W5.js +0 -42
  78. package/dist/layers.BwuvbB4R.js +0 -39
  79. package/dist/layers.BxiXm40L.js +0 -2
  80. package/dist/layers.By8sBqwN.js +0 -116
  81. package/dist/layers.BzGZoEEl.js +0 -10
  82. package/dist/layers.BzLeOHKa.js +0 -796
  83. package/dist/layers.Bz_dhG__.js +0 -39
  84. package/dist/layers.C1KqMlKg.js +0 -1
  85. package/dist/layers.C1i1mw5H.js +0 -39
  86. package/dist/layers.C2RYi1R4.js +0 -9
  87. package/dist/layers.C3J_d41Q.js +0 -1
  88. package/dist/layers.C4I8YhJZ.js +0 -5
  89. package/dist/layers.C5qL4bIV.js +0 -205
  90. package/dist/layers.C6aCloZA.js +0 -38
  91. package/dist/layers.C7u0t-7x.js +0 -1286
  92. package/dist/layers.C8_lu5UH.js +0 -23
  93. package/dist/layers.CAAFE7RU.js +0 -139
  94. package/dist/layers.CB2mPEGO.js +0 -1
  95. package/dist/layers.CBcgiYqo.js +0 -4
  96. package/dist/layers.CCDs3V-r.js +0 -8
  97. package/dist/layers.CDLOFVyh.js +0 -38
  98. package/dist/layers.CGbUBRpT.js +0 -271
  99. package/dist/layers.CHZsXQcr.js +0 -1
  100. package/dist/layers.CIugfnNi.js +0 -3
  101. package/dist/layers.CJjG7mfo.js +0 -122
  102. package/dist/layers.CJuRWDaP.js +0 -4
  103. package/dist/layers.CJx3dksh.js +0 -160
  104. package/dist/layers.CKG-SsM4.js +0 -11
  105. package/dist/layers.CKquYTab.js +0 -1
  106. package/dist/layers.CLVteXPI.js +0 -1
  107. package/dist/layers.CMSKPoUf.js +0 -1
  108. package/dist/layers.CMi59Dge.js +0 -10
  109. package/dist/layers.CPPXzJSG.js +0 -36
  110. package/dist/layers.CQZ1lodE.js +0 -7
  111. package/dist/layers.CQzsYN9o.js +0 -35
  112. package/dist/layers.CRHVKIv6.js +0 -6
  113. package/dist/layers.CSf6dhab.js +0 -6
  114. package/dist/layers.CWNyz0df.js +0 -772
  115. package/dist/layers.CZmZZ456.js +0 -1
  116. package/dist/layers.C_-XV7nk.js +0 -84
  117. package/dist/layers.C_IvrzZ3.js +0 -7
  118. package/dist/layers.Ca9pf4pJ.js +0 -76
  119. package/dist/layers.CbY0jZsb.js +0 -32
  120. package/dist/layers.Cc2rZkMQ.js +0 -1
  121. package/dist/layers.Cd9MRGMA.js +0 -7
  122. package/dist/layers.CexInYJw.js +0 -41
  123. package/dist/layers.CfUjnxzs.js +0 -36
  124. package/dist/layers.CfiPo1zZ.js +0 -10
  125. package/dist/layers.CftSz0vc.js +0 -1
  126. package/dist/layers.Cfv_lKzM.js +0 -10
  127. package/dist/layers.CgV5Zdgg.js +0 -41
  128. package/dist/layers.Cho0M3o5.js +0 -9
  129. package/dist/layers.CiGopRcm.js +0 -1
  130. package/dist/layers.Ck8FKMZm.js +0 -1
  131. package/dist/layers.ClN7_yK6.js +0 -5
  132. package/dist/layers.CmzeQrqF.js +0 -1
  133. package/dist/layers.Cnf9xVrU.js +0 -37
  134. package/dist/layers.Cq1FOBBz.js +0 -1089
  135. package/dist/layers.CqVTtuYm.js +0 -6
  136. package/dist/layers.CtVzpEDj.js +0 -6
  137. package/dist/layers.CvxLmsUR.js +0 -794
  138. package/dist/layers.Cx0MLYpT.js +0 -8
  139. package/dist/layers.CxBPsaPO.js +0 -39
  140. package/dist/layers.Cxm8b7tr.js +0 -39
  141. package/dist/layers.CyodKjZl.js +0 -8
  142. package/dist/layers.Cyzu9PKQ.js +0 -1
  143. package/dist/layers.Cz-fKIJ9.js +0 -36
  144. package/dist/layers.CzhydN8y.js +0 -1
  145. package/dist/layers.D-An1dnI.js +0 -14
  146. package/dist/layers.D-gA0YP7.js +0 -323
  147. package/dist/layers.D0q1Ima3.js +0 -8
  148. package/dist/layers.D0zn4_Mx.js +0 -1
  149. package/dist/layers.D2BUdbOP.js +0 -42
  150. package/dist/layers.D3R9NG6l.js +0 -36
  151. package/dist/layers.D4CL9IrO.js +0 -40
  152. package/dist/layers.D4T8fTcj.js +0 -1223
  153. package/dist/layers.D5rUZxAZ.js +0 -7
  154. package/dist/layers.D6_pquAg.js +0 -5
  155. package/dist/layers.D7jGxypv.js +0 -8
  156. package/dist/layers.D8mu5H7D.js +0 -40
  157. package/dist/layers.D9hwmTsT.js +0 -40
  158. package/dist/layers.DD85x_gL.js +0 -70
  159. package/dist/layers.DEafoGBP.js +0 -276
  160. package/dist/layers.DHntpDKc.js +0 -7
  161. package/dist/layers.DLMNg96A.js +0 -38
  162. package/dist/layers.DLofN-Lu.js +0 -8583
  163. package/dist/layers.DLwuMfdd.js +0 -84
  164. package/dist/layers.DMJTlnQs.js +0 -805
  165. package/dist/layers.DMkBISW1.js +0 -1
  166. package/dist/layers.DN9HoVxI.js +0 -18
  167. package/dist/layers.DN_7Oas1.js +0 -1034
  168. package/dist/layers.DO0LV8uH.js +0 -9
  169. package/dist/layers.DOGjj8Tb.js +0 -9
  170. package/dist/layers.DOU0CUz1.js +0 -9
  171. package/dist/layers.DOrgOHBr.js +0 -1
  172. package/dist/layers.DQ9XoPxf.js +0 -35
  173. package/dist/layers.DRJ1C2cQ.js +0 -907
  174. package/dist/layers.DW4YSj_5.js +0 -425
  175. package/dist/layers.DWZOB_8o.js +0 -48149
  176. package/dist/layers.DXraj6Ay.js +0 -806
  177. package/dist/layers.DZ1kwAKl.js +0 -41
  178. package/dist/layers.DZkyZJBC.js +0 -2966
  179. package/dist/layers.DasUia_A.js +0 -96
  180. package/dist/layers.DbLpb0GU.js +0 -5
  181. package/dist/layers.DbaKVP5e.js +0 -1
  182. package/dist/layers.Des3K8ZW.js +0 -257
  183. package/dist/layers.DfNV-1tq.js +0 -1
  184. package/dist/layers.Dg4R4jUk.js +0 -39
  185. package/dist/layers.DiMecbBf.js +0 -213
  186. package/dist/layers.DjUOC4st.js +0 -16
  187. package/dist/layers.Djrk43ut.js +0 -7
  188. package/dist/layers.DkU_CdUC.js +0 -1
  189. package/dist/layers.DmGGgMLi.js +0 -32
  190. package/dist/layers.DmWCogHY.js +0 -9
  191. package/dist/layers.DmrEOz9f.js +0 -40
  192. package/dist/layers.DoRJikzG.js +0 -33
  193. package/dist/layers.DoUFJmIZ.js +0 -2482
  194. package/dist/layers.DpOQ0SWe.js +0 -41
  195. package/dist/layers.DpTLOdAf.js +0 -2
  196. package/dist/layers.Dpx73nZ5.js +0 -37
  197. package/dist/layers.DrjRMlMd.js +0 -504
  198. package/dist/layers.DsfTLYHN.js +0 -295
  199. package/dist/layers.DtKC3G6H.js +0 -40
  200. package/dist/layers.DtOyZMno.js +0 -42
  201. package/dist/layers.Dv9gkxbE.js +0 -8
  202. package/dist/layers.DvK2O2ur.js +0 -21941
  203. package/dist/layers.DxA6ocdw.js +0 -70
  204. package/dist/layers.Dxw5Sd8s.js +0 -223
  205. package/dist/layers.Dy1naDTQ.js +0 -14
  206. package/dist/layers.Dy44TnYE.js +0 -32
  207. package/dist/layers.DyypgoWd.js +0 -39
  208. package/dist/layers.Dzcm8AcP.js +0 -1583
  209. package/dist/layers.F0RyUduP.js +0 -65
  210. package/dist/layers.F544mK7B.js +0 -41
  211. package/dist/layers.GAckqh_M.js +0 -40
  212. package/dist/layers.HUIM9HzL.js +0 -9
  213. package/dist/layers.HfEMdS1b.js +0 -10
  214. package/dist/layers.JWCLFILJ.js +0 -1
  215. package/dist/layers.MIHL5IVH.js +0 -7
  216. package/dist/layers.N0yl3_Na.js +0 -44
  217. package/dist/layers.NWhpAYeJ.js +0 -198
  218. package/dist/layers.Q2Aadwn9.js +0 -42
  219. package/dist/layers.R8mPlCA0.js +0 -261
  220. package/dist/layers.Vof2qGdM.js +0 -1088
  221. package/dist/layers.W_ErWU4y.js +0 -139
  222. package/dist/layers.WlID94Nt.js +0 -6
  223. package/dist/layers.YY1k0HSU.js +0 -1
  224. package/dist/layers.YjzlfOSN.js +0 -84
  225. package/dist/layers.ZX3I648e.js +0 -934
  226. package/dist/layers.b0h5ZBmD.js +0 -61
  227. package/dist/layers.bPp4y4tJ.js +0 -423
  228. package/dist/layers.bXo5QOKy.js +0 -5
  229. package/dist/layers.bkVgdJRL.js +0 -2
  230. package/dist/layers.d6r5nQuW.js +0 -11
  231. package/dist/layers.dl89lGbj.js +0 -33
  232. package/dist/layers.dswX3xs9.js +0 -1
  233. package/dist/layers.efcYaHoV.js +0 -32
  234. package/dist/layers.fLsBww_F.js +0 -1
  235. package/dist/layers.i1FJeF3y.js +0 -37
  236. package/dist/layers.jU6Z3i2q.js +0 -40
  237. package/dist/layers.k6Lqzy4i.js +0 -8
  238. package/dist/layers.lCpg7dOn.js +0 -21
  239. package/dist/layers.nVP4QDpX.js +0 -118
  240. package/dist/layers.obbaq0Iy.js +0 -42
  241. package/dist/layers.ooKeArD_.js +0 -34
  242. package/dist/layers.pXaWfCQn.js +0 -40
  243. package/dist/layers.pYlF8GU4.js +0 -32
  244. package/dist/layers.qhRg6f--.js +0 -11
  245. package/dist/layers.rNCWSOcA.js +0 -7
  246. package/dist/layers.t1lmm4vP.js +0 -13
  247. package/dist/layers.wEFFSFio.js +0 -21620
  248. package/dist/layers.zAXb9NBT.js +0 -9
@@ -1,1286 +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, a7 as Ct, P as qt, Q as jt, i as Gt } from "./layers.DLofN-Lu.js";
2
- import { a as Qt } from "./layers.DZkyZJBC.js";
3
- import "./layers.wEFFSFio.js";
4
- import "lodash-es/memoize.js";
5
- import "lodash-es/merge.js";
6
- import "lodash-es/isEmpty.js";
7
- import { i as Kt } from "./layers.DjUOC4st.js";
8
- import { o as Zt } from "./layers.b0h5ZBmD.js";
9
- import { l as ft } from "./layers.bPp4y4tJ.js";
10
- import { l as pt } from "./layers.dl89lGbj.js";
11
- function Jt(e, t, i) {
12
- e = +e, t = +t, i = (n = arguments.length) < 2 ? (t = e, e = 0, 1) : n < 3 ? 1 : +i;
13
- for (var s = -1, n = Math.max(0, Math.ceil((t - e) / i)) | 0, o = new Array(n); ++s < n; )
14
- o[s] = e + s * i;
15
- return o;
16
- }
17
- function st() {
18
- 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;
19
- delete e.unknown;
20
- function A() {
21
- var m = t().length, T = n < s, S = T ? n : s, P = T ? s : n;
22
- 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));
23
- var p = Jt(m).map(function(C) {
24
- return S + o * C;
25
- });
26
- return i(T ? p.reverse() : p);
27
- }
28
- return e.domain = function(m) {
29
- return arguments.length ? (t(m), A()) : t();
30
- }, e.range = function(m) {
31
- return arguments.length ? ([s, n] = m, s = +s, n = +n, A()) : [s, n];
32
- }, e.rangeRound = function(m) {
33
- return [s, n] = m, s = +s, n = +n, f = !0, A();
34
- }, e.bandwidth = function() {
35
- return c;
36
- }, e.step = function() {
37
- return o;
38
- }, e.round = function(m) {
39
- return arguments.length ? (f = !!m, A()) : f;
40
- }, e.padding = function(m) {
41
- return arguments.length ? (d = Math.min(1, R = +m), A()) : d;
42
- }, e.paddingInner = function(m) {
43
- return arguments.length ? (d = Math.min(1, m), A()) : d;
44
- }, e.paddingOuter = function(m) {
45
- return arguments.length ? (R = +m, A()) : R;
46
- }, e.align = function(m) {
47
- return arguments.length ? (_ = Math.max(0, Math.min(1, m)), A()) : _;
48
- }, e.copy = function() {
49
- return st(t(), [s, n]).round(f).paddingInner(d).paddingOuter(R).align(_);
50
- }, Kt.apply(A(), arguments);
51
- }
52
- var nt = (function() {
53
- var e = function(V, r, l, u) {
54
- for (l = l || {}, u = V.length; u--; l[V[u]] = r)
55
- ;
56
- return l;
57
- }, 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 = {
58
- trace: function() {
59
- },
60
- yy: {},
61
- 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 },
62
- 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" },
63
- 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]],
64
- performAction: function(r, l, u, g, b, a, F) {
65
- var x = a.length - 1;
66
- switch (b) {
67
- case 5:
68
- g.setOrientation(a[x]);
69
- break;
70
- case 9:
71
- g.setDiagramTitle(a[x].text.trim());
72
- break;
73
- case 12:
74
- g.setLineData({ text: "", type: "text" }, a[x]);
75
- break;
76
- case 13:
77
- g.setLineData(a[x - 1], a[x]);
78
- break;
79
- case 14:
80
- g.setBarData({ text: "", type: "text" }, a[x]);
81
- break;
82
- case 15:
83
- g.setBarData(a[x - 1], a[x]);
84
- break;
85
- case 16:
86
- this.$ = a[x].trim(), g.setAccTitle(this.$);
87
- break;
88
- case 17:
89
- case 18:
90
- this.$ = a[x].trim(), g.setAccDescription(this.$);
91
- break;
92
- case 19:
93
- this.$ = a[x - 1];
94
- break;
95
- case 20:
96
- this.$ = [Number(a[x - 2]), ...a[x]];
97
- break;
98
- case 21:
99
- this.$ = [Number(a[x])];
100
- break;
101
- case 22:
102
- g.setXAxisTitle(a[x]);
103
- break;
104
- case 23:
105
- g.setXAxisTitle(a[x - 1]);
106
- break;
107
- case 24:
108
- g.setXAxisTitle({ type: "text", text: "" });
109
- break;
110
- case 25:
111
- g.setXAxisBand(a[x]);
112
- break;
113
- case 26:
114
- g.setXAxisRangeData(Number(a[x - 2]), Number(a[x]));
115
- break;
116
- case 27:
117
- this.$ = a[x - 1];
118
- break;
119
- case 28:
120
- this.$ = [a[x - 2], ...a[x]];
121
- break;
122
- case 29:
123
- this.$ = [a[x]];
124
- break;
125
- case 30:
126
- g.setYAxisTitle(a[x]);
127
- break;
128
- case 31:
129
- g.setYAxisTitle(a[x - 1]);
130
- break;
131
- case 32:
132
- g.setYAxisTitle({ type: "text", text: "" });
133
- break;
134
- case 33:
135
- g.setYAxisRangeData(Number(a[x - 2]), Number(a[x]));
136
- break;
137
- case 37:
138
- this.$ = { text: a[x], type: "text" };
139
- break;
140
- case 38:
141
- this.$ = { text: a[x], type: "text" };
142
- break;
143
- case 39:
144
- this.$ = { text: a[x], type: "markdown" };
145
- break;
146
- case 40:
147
- this.$ = a[x];
148
- break;
149
- case 41:
150
- this.$ = a[x - 1] + "" + a[x];
151
- break;
152
- }
153
- },
154
- 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] }],
155
- defaultActions: { 8: [2, 1], 10: [2, 3], 21: [2, 2], 72: [2, 28], 73: [2, 20] },
156
- parseError: function(r, l) {
157
- if (l.recoverable)
158
- this.trace(r);
159
- else {
160
- var u = new Error(r);
161
- throw u.hash = l, u;
162
- }
163
- },
164
- parse: function(r) {
165
- 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: {} };
166
- for (var J in this.yy)
167
- Object.prototype.hasOwnProperty.call(this.yy, J) && (W.yy[J] = this.yy[J]);
168
- k.setInput(r, W.yy), W.yy.lexer = k, W.yy.parser = this, typeof k.yylloc > "u" && (k.yylloc = {});
169
- var tt = k.yylloc;
170
- a.push(tt);
171
- var Bt = k.options && k.options.ranges;
172
- typeof W.yy.parseError == "function" ? this.parseError = W.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
173
- function Ot() {
174
- var I;
175
- return I = g.pop() || k.lex() || xt, typeof I != "number" && (I instanceof Array && (g = I, I = g.pop()), I = l.symbols_[I] || I), I;
176
- }
177
- for (var D, B, v, it, O = {}, q, M, dt, j; ; ) {
178
- 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]) {
179
- var et = "";
180
- j = [];
181
- for (q in F[B])
182
- this.terminals_[q] && q > Vt && j.push("'" + this.terminals_[q] + "'");
183
- k.showPosition ? et = "Parse error on line " + (U + 1) + `:
184
- ` + k.showPosition() + `
185
- 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, {
186
- text: k.match,
187
- token: this.terminals_[D] || D,
188
- line: k.yylineno,
189
- loc: tt,
190
- expected: j
191
- });
192
- }
193
- if (v[0] instanceof Array && v.length > 1)
194
- throw new Error("Parse Error: multiple actions possible at state: " + B + ", token: " + D);
195
- switch (v[0]) {
196
- case 1:
197
- 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;
198
- break;
199
- case 2:
200
- if (M = this.productions_[v[1]][1], O.$ = b[b.length - M], O._$ = {
201
- first_line: a[a.length - (M || 1)].first_line,
202
- last_line: a[a.length - 1].last_line,
203
- first_column: a[a.length - (M || 1)].first_column,
204
- last_column: a[a.length - 1].last_column
205
- }, Bt && (O._$.range = [
206
- a[a.length - (M || 1)].range[0],
207
- a[a.length - 1].range[1]
208
- ]), it = this.performAction.apply(O, [
209
- x,
210
- gt,
211
- U,
212
- W.yy,
213
- v[1],
214
- b,
215
- a
216
- ].concat(Wt)), typeof it < "u")
217
- return it;
218
- 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);
219
- break;
220
- case 3:
221
- return !0;
222
- }
223
- }
224
- return !0;
225
- }
226
- }, It = /* @__PURE__ */ (function() {
227
- var V = {
228
- EOF: 1,
229
- parseError: function(l, u) {
230
- if (this.yy.parser)
231
- this.yy.parser.parseError(l, u);
232
- else
233
- throw new Error(l);
234
- },
235
- // resets the lexer, sets new input
236
- setInput: function(r, l) {
237
- 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 = {
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
- },
244
- // consumes and returns one char from the input
245
- input: function() {
246
- var r = this._input[0];
247
- this.yytext += r, this.yyleng++, this.offset++, this.match += r, this.matched += r;
248
- var l = r.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), r;
250
- },
251
- // unshifts one char (or a string) into the input
252
- unput: function(r) {
253
- var l = r.length, u = r.split(/(?:\r\n?|\n)/g);
254
- this._input = r + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - l), this.offset -= l;
255
- var g = 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), u.length - 1 && (this.yylineno -= u.length - 1);
257
- var b = 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: u ? (u.length === g.length ? this.yylloc.first_column : 0) + g[g.length - u.length].length - u[0].length : this.yylloc.first_column - l
263
- }, this.options.ranges && (this.yylloc.range = [b[0], b[0] + this.yyleng - l]), this.yyleng = this.yytext.length, this;
264
- },
265
- // When called from action, caches matched text and appends it on next action
266
- more: function() {
267
- return this._more = !0, this;
268
- },
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: 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
- },
282
- // retain first n characters of the match
283
- less: function(r) {
284
- this.unput(this.match.slice(r));
285
- },
286
- // displays already matched input, i.e. for error messages
287
- pastInput: function() {
288
- var r = this.matched.substr(0, this.matched.length - this.match.length);
289
- return (r.length > 20 ? "..." : "") + r.substr(-20).replace(/\n/g, "");
290
- },
291
- // displays upcoming input, i.e. for error messages
292
- upcomingInput: function() {
293
- var r = this.match;
294
- return r.length < 20 && (r += this._input.substr(0, 20 - r.length)), (r.substr(0, 20) + (r.length > 20 ? "..." : "")).replace(/\n/g, "");
295
- },
296
- // displays the character position where the lexing error occurred, i.e. for error messages
297
- showPosition: function() {
298
- var r = this.pastInput(), l = new Array(r.length + 1).join("-");
299
- return r + this.upcomingInput() + `
300
- ` + l + "^";
301
- },
302
- // test the lexed token: return FALSE when not a match, otherwise return token
303
- test_match: function(r, l) {
304
- var u, g, b;
305
- if (this.options.backtrack_lexer && (b = {
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 && (b.yylloc.range = this.yylloc.range.slice(0))), g = r[0].match(/(?:\r\n?|\n).*/g), g && (this.yylineno += g.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: g ? g[g.length - 1].length - g[g.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + r[0].length
329
- }, 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)
330
- return u;
331
- if (this._backtrack) {
332
- for (var a in b)
333
- this[a] = b[a];
334
- return !1;
335
- }
336
- return !1;
337
- },
338
- // return next match in input
339
- next: function() {
340
- if (this.done)
341
- return this.EOF;
342
- this._input || (this.done = !0);
343
- var r, l, u, g;
344
- this._more || (this.yytext = "", this.match = "");
345
- for (var b = this._currentRules(), a = 0; a < b.length; a++)
346
- if (u = this._input.match(this.rules[b[a]]), u && (!l || u[0].length > l[0].length)) {
347
- if (l = u, g = a, this.options.backtrack_lexer) {
348
- if (r = this.test_match(u, b[a]), r !== !1)
349
- return r;
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 ? (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.
359
- ` + this.showPosition(), {
360
- text: "",
361
- token: null,
362
- line: this.yylineno
363
- });
364
- },
365
- // return next match that has a token
366
- lex: function() {
367
- var l = this.next();
368
- return l || this.lex();
369
- },
370
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
371
- begin: function(l) {
372
- this.conditionStack.push(l);
373
- },
374
- // pop the previously active lexer condition state off the condition stack
375
- popState: function() {
376
- var l = this.conditionStack.length - 1;
377
- return l > 0 ? this.conditionStack.pop() : this.conditionStack[0];
378
- },
379
- // produce the lexer rule set which is active for the currently active lexer condition state
380
- _currentRules: 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
- },
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: function(l) {
385
- return l = this.conditionStack.length - 1 - Math.abs(l || 0), l >= 0 ? this.conditionStack[l] : "INITIAL";
386
- },
387
- // alias for begin(condition)
388
- pushState: function(l) {
389
- this.begin(l);
390
- },
391
- // return the number of states currently on the stack
392
- stateStackSize: function() {
393
- return this.conditionStack.length;
394
- },
395
- options: { "case-insensitive": !0 },
396
- performAction: function(l, u, g, b) {
397
- switch (g) {
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
- },
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 V;
501
- })();
502
- K.lexer = It;
503
- function Z() {
504
- this.yy = {};
505
- }
506
- return Z.prototype = K, K.Parser = Z, new Z();
507
- })();
508
- nt.parser = nt;
509
- const ti = nt;
510
- function mt(e) {
511
- return e.type === "bar";
512
- }
513
- function _t(e) {
514
- return e.type === "band";
515
- }
516
- function N(e) {
517
- return e.type === "linear";
518
- }
519
- class kt {
520
- constructor(t) {
521
- this.parentGroup = t;
522
- }
523
- getMaxDimension(t, i) {
524
- if (!this.parentGroup)
525
- return {
526
- width: t.reduce((o, c) => Math.max(c.length, o), 0) * i,
527
- height: i
528
- };
529
- const s = {
530
- width: 0,
531
- height: 0
532
- }, n = this.parentGroup.append("g").attr("visibility", "hidden").attr("font-size", i);
533
- for (const o of t) {
534
- const c = Qt(n, 1, o), f = c ? c.width : o.length * i, d = c ? c.height : i;
535
- s.width = Math.max(s.width, f), s.height = Math.max(s.height, d);
536
- }
537
- return n.remove(), s;
538
- }
539
- }
540
- const yt = 0.7, bt = 0.2;
541
- class Rt {
542
- constructor(t, i, s, n) {
543
- this.axisConfig = t, this.title = i, this.textDimensionCalculator = s, this.axisThemeConfig = n, this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }, this.axisPosition = "left", this.showTitle = !1, this.showLabel = !1, this.showTick = !1, this.showAxisLine = !1, this.outerPadding = 0, this.titleTextHeight = 0, this.labelTextHeight = 0, this.range = [0, 10], this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }, this.axisPosition = "left";
544
- }
545
- setRange(t) {
546
- this.range = t, this.axisPosition === "left" || this.axisPosition === "right" ? this.boundingRect.height = t[1] - t[0] : this.boundingRect.width = t[1] - t[0], this.recalculateScale();
547
- }
548
- getRange() {
549
- return [this.range[0] + this.outerPadding, this.range[1] - this.outerPadding];
550
- }
551
- setAxisPosition(t) {
552
- this.axisPosition = t, this.setRange(this.range);
553
- }
554
- getTickDistance() {
555
- const t = this.getRange();
556
- return Math.abs(t[0] - t[1]) / this.getTickValues().length;
557
- }
558
- getAxisOuterPadding() {
559
- return this.outerPadding;
560
- }
561
- getLabelDimension() {
562
- return this.textDimensionCalculator.getMaxDimension(
563
- this.getTickValues().map((t) => t.toString()),
564
- this.axisConfig.labelFontSize
565
- );
566
- }
567
- recalculateOuterPaddingToDrawBar() {
568
- yt * this.getTickDistance() > this.outerPadding * 2 && (this.outerPadding = Math.floor(yt * this.getTickDistance() / 2)), this.recalculateScale();
569
- }
570
- calculateSpaceIfDrawnHorizontally(t) {
571
- let i = t.height;
572
- if (this.axisConfig.showAxisLine && i > this.axisConfig.axisLineWidth && (i -= this.axisConfig.axisLineWidth, this.showAxisLine = !0), this.axisConfig.showLabel) {
573
- const s = this.getLabelDimension(), n = bt * t.width;
574
- this.outerPadding = Math.min(s.width / 2, n);
575
- const o = s.height + this.axisConfig.labelPadding * 2;
576
- this.labelTextHeight = s.height, o <= i && (i -= o, this.showLabel = !0);
577
- }
578
- if (this.axisConfig.showTick && i >= this.axisConfig.tickLength && (this.showTick = !0, i -= this.axisConfig.tickLength), this.axisConfig.showTitle && this.title) {
579
- const s = this.textDimensionCalculator.getMaxDimension(
580
- [this.title],
581
- this.axisConfig.titleFontSize
582
- ), n = s.height + this.axisConfig.titlePadding * 2;
583
- this.titleTextHeight = s.height, n <= i && (i -= n, this.showTitle = !0);
584
- }
585
- this.boundingRect.width = t.width, this.boundingRect.height = t.height - i;
586
- }
587
- calculateSpaceIfDrawnVertical(t) {
588
- let i = t.width;
589
- if (this.axisConfig.showAxisLine && i > this.axisConfig.axisLineWidth && (i -= this.axisConfig.axisLineWidth, this.showAxisLine = !0), this.axisConfig.showLabel) {
590
- const s = this.getLabelDimension(), n = bt * t.height;
591
- this.outerPadding = Math.min(s.height / 2, n);
592
- const o = s.width + this.axisConfig.labelPadding * 2;
593
- o <= i && (i -= o, this.showLabel = !0);
594
- }
595
- if (this.axisConfig.showTick && i >= this.axisConfig.tickLength && (this.showTick = !0, i -= this.axisConfig.tickLength), this.axisConfig.showTitle && this.title) {
596
- const s = this.textDimensionCalculator.getMaxDimension(
597
- [this.title],
598
- this.axisConfig.titleFontSize
599
- ), n = s.height + this.axisConfig.titlePadding * 2;
600
- this.titleTextHeight = s.height, n <= i && (i -= n, this.showTitle = !0);
601
- }
602
- this.boundingRect.width = t.width - i, this.boundingRect.height = t.height;
603
- }
604
- calculateSpace(t) {
605
- return this.axisPosition === "left" || this.axisPosition === "right" ? this.calculateSpaceIfDrawnVertical(t) : this.calculateSpaceIfDrawnHorizontally(t), this.recalculateScale(), {
606
- width: this.boundingRect.width,
607
- height: this.boundingRect.height
608
- };
609
- }
610
- setBoundingBoxXY(t) {
611
- this.boundingRect.x = t.x, this.boundingRect.y = t.y;
612
- }
613
- getDrawableElementsForLeftAxis() {
614
- const t = [];
615
- if (this.showAxisLine) {
616
- const i = this.boundingRect.x + this.boundingRect.width - this.axisConfig.axisLineWidth / 2;
617
- t.push({
618
- type: "path",
619
- groupTexts: ["left-axis", "axisl-line"],
620
- data: [
621
- {
622
- path: `M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y + this.boundingRect.height} `,
623
- strokeFill: this.axisThemeConfig.axisLineColor,
624
- strokeWidth: this.axisConfig.axisLineWidth
625
- }
626
- ]
627
- });
628
- }
629
- if (this.showLabel && t.push({
630
- type: "text",
631
- groupTexts: ["left-axis", "label"],
632
- data: this.getTickValues().map((i) => ({
633
- text: i.toString(),
634
- x: this.boundingRect.x + this.boundingRect.width - (this.showLabel ? this.axisConfig.labelPadding : 0) - (this.showTick ? this.axisConfig.tickLength : 0) - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0),
635
- y: this.getScaleValue(i),
636
- fill: this.axisThemeConfig.labelColor,
637
- fontSize: this.axisConfig.labelFontSize,
638
- rotation: 0,
639
- verticalPos: "middle",
640
- horizontalPos: "right"
641
- }))
642
- }), this.showTick) {
643
- const i = this.boundingRect.x + this.boundingRect.width - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
644
- t.push({
645
- type: "path",
646
- groupTexts: ["left-axis", "ticks"],
647
- data: this.getTickValues().map((s) => ({
648
- path: `M ${i},${this.getScaleValue(s)} L ${i - this.axisConfig.tickLength},${this.getScaleValue(s)}`,
649
- strokeFill: this.axisThemeConfig.tickColor,
650
- strokeWidth: this.axisConfig.tickWidth
651
- }))
652
- });
653
- }
654
- return this.showTitle && t.push({
655
- type: "text",
656
- groupTexts: ["left-axis", "title"],
657
- data: [
658
- {
659
- text: this.title,
660
- x: this.boundingRect.x + this.axisConfig.titlePadding,
661
- y: this.boundingRect.y + this.boundingRect.height / 2,
662
- fill: this.axisThemeConfig.titleColor,
663
- fontSize: this.axisConfig.titleFontSize,
664
- rotation: 270,
665
- verticalPos: "top",
666
- horizontalPos: "center"
667
- }
668
- ]
669
- }), t;
670
- }
671
- getDrawableElementsForBottomAxis() {
672
- const t = [];
673
- if (this.showAxisLine) {
674
- const i = this.boundingRect.y + this.axisConfig.axisLineWidth / 2;
675
- t.push({
676
- type: "path",
677
- groupTexts: ["bottom-axis", "axis-line"],
678
- data: [
679
- {
680
- path: `M ${this.boundingRect.x},${i} L ${this.boundingRect.x + this.boundingRect.width},${i}`,
681
- strokeFill: this.axisThemeConfig.axisLineColor,
682
- strokeWidth: this.axisConfig.axisLineWidth
683
- }
684
- ]
685
- });
686
- }
687
- if (this.showLabel && t.push({
688
- type: "text",
689
- groupTexts: ["bottom-axis", "label"],
690
- data: this.getTickValues().map((i) => ({
691
- text: i.toString(),
692
- x: this.getScaleValue(i),
693
- y: this.boundingRect.y + this.axisConfig.labelPadding + (this.showTick ? this.axisConfig.tickLength : 0) + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0),
694
- fill: this.axisThemeConfig.labelColor,
695
- fontSize: this.axisConfig.labelFontSize,
696
- rotation: 0,
697
- verticalPos: "top",
698
- horizontalPos: "center"
699
- }))
700
- }), this.showTick) {
701
- const i = this.boundingRect.y + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
702
- t.push({
703
- type: "path",
704
- groupTexts: ["bottom-axis", "ticks"],
705
- data: this.getTickValues().map((s) => ({
706
- path: `M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i + this.axisConfig.tickLength}`,
707
- strokeFill: this.axisThemeConfig.tickColor,
708
- strokeWidth: this.axisConfig.tickWidth
709
- }))
710
- });
711
- }
712
- return this.showTitle && t.push({
713
- type: "text",
714
- groupTexts: ["bottom-axis", "title"],
715
- data: [
716
- {
717
- text: this.title,
718
- x: this.range[0] + (this.range[1] - this.range[0]) / 2,
719
- y: this.boundingRect.y + this.boundingRect.height - this.axisConfig.titlePadding - this.titleTextHeight,
720
- fill: this.axisThemeConfig.titleColor,
721
- fontSize: this.axisConfig.titleFontSize,
722
- rotation: 0,
723
- verticalPos: "top",
724
- horizontalPos: "center"
725
- }
726
- ]
727
- }), t;
728
- }
729
- getDrawableElementsForTopAxis() {
730
- const t = [];
731
- if (this.showAxisLine) {
732
- const i = this.boundingRect.y + this.boundingRect.height - this.axisConfig.axisLineWidth / 2;
733
- t.push({
734
- type: "path",
735
- groupTexts: ["top-axis", "axis-line"],
736
- data: [
737
- {
738
- path: `M ${this.boundingRect.x},${i} L ${this.boundingRect.x + this.boundingRect.width},${i}`,
739
- strokeFill: this.axisThemeConfig.axisLineColor,
740
- strokeWidth: this.axisConfig.axisLineWidth
741
- }
742
- ]
743
- });
744
- }
745
- if (this.showLabel && t.push({
746
- type: "text",
747
- groupTexts: ["top-axis", "label"],
748
- data: this.getTickValues().map((i) => ({
749
- text: i.toString(),
750
- x: this.getScaleValue(i),
751
- y: this.boundingRect.y + (this.showTitle ? this.titleTextHeight + this.axisConfig.titlePadding * 2 : 0) + this.axisConfig.labelPadding,
752
- fill: this.axisThemeConfig.labelColor,
753
- fontSize: this.axisConfig.labelFontSize,
754
- rotation: 0,
755
- verticalPos: "top",
756
- horizontalPos: "center"
757
- }))
758
- }), this.showTick) {
759
- const i = this.boundingRect.y;
760
- t.push({
761
- type: "path",
762
- groupTexts: ["top-axis", "ticks"],
763
- data: this.getTickValues().map((s) => ({
764
- path: `M ${this.getScaleValue(s)},${i + this.boundingRect.height - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)} L ${this.getScaleValue(s)},${i + this.boundingRect.height - this.axisConfig.tickLength - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)}`,
765
- strokeFill: this.axisThemeConfig.tickColor,
766
- strokeWidth: this.axisConfig.tickWidth
767
- }))
768
- });
769
- }
770
- return this.showTitle && t.push({
771
- type: "text",
772
- groupTexts: ["top-axis", "title"],
773
- data: [
774
- {
775
- text: this.title,
776
- x: this.boundingRect.x + this.boundingRect.width / 2,
777
- y: this.boundingRect.y + this.axisConfig.titlePadding,
778
- fill: this.axisThemeConfig.titleColor,
779
- fontSize: this.axisConfig.titleFontSize,
780
- rotation: 0,
781
- verticalPos: "top",
782
- horizontalPos: "center"
783
- }
784
- ]
785
- }), t;
786
- }
787
- getDrawableElements() {
788
- if (this.axisPosition === "left")
789
- return this.getDrawableElementsForLeftAxis();
790
- if (this.axisPosition === "right")
791
- throw Error("Drawing of right axis is not implemented");
792
- return this.axisPosition === "bottom" ? this.getDrawableElementsForBottomAxis() : this.axisPosition === "top" ? this.getDrawableElementsForTopAxis() : [];
793
- }
794
- }
795
- class ii extends Rt {
796
- constructor(t, i, s, n, o) {
797
- super(t, n, o, i), this.categories = s, this.scale = st().domain(this.categories).range(this.getRange());
798
- }
799
- setRange(t) {
800
- super.setRange(t);
801
- }
802
- recalculateScale() {
803
- 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());
804
- }
805
- getTickValues() {
806
- return this.categories;
807
- }
808
- getScaleValue(t) {
809
- return this.scale(t) || this.getRange()[0];
810
- }
811
- }
812
- class ei extends Rt {
813
- constructor(t, i, s, n, o) {
814
- super(t, n, o, i), this.domain = s, this.scale = ft().domain(this.domain).range(this.getRange());
815
- }
816
- getTickValues() {
817
- return this.scale.ticks();
818
- }
819
- recalculateScale() {
820
- const t = [...this.domain];
821
- this.axisPosition === "left" && t.reverse(), this.scale = ft().domain(t).range(this.getRange());
822
- }
823
- getScaleValue(t) {
824
- return this.scale(t);
825
- }
826
- }
827
- function At(e, t, i, s) {
828
- const n = new kt(s);
829
- return _t(e) ? new ii(
830
- t,
831
- i,
832
- e.categories,
833
- e.title,
834
- n
835
- ) : new ei(
836
- t,
837
- i,
838
- [e.min, e.max],
839
- e.title,
840
- n
841
- );
842
- }
843
- class si {
844
- constructor(t, i, s, n) {
845
- this.textDimensionCalculator = t, this.chartConfig = i, this.chartData = s, this.chartThemeConfig = n, 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
- ), s = Math.max(i.width, t.width), n = i.height + 2 * this.chartConfig.titlePadding;
860
- return i.width <= s && i.height <= n && this.chartConfig.showTitle && this.chartData.title && (this.boundingRect.width = s, this.boundingRect.height = n, 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
- }
885
- function ni(e, t, i, s) {
886
- const n = new kt(s);
887
- return new si(n, e, t, i);
888
- }
889
- class ai {
890
- constructor(t, i, s, n, o) {
891
- this.plotData = t, this.xAxis = i, this.yAxis = s, this.orientation = n, this.plotIndex = o;
892
- }
893
- getDrawableElement() {
894
- const t = this.plotData.data.map((s) => [
895
- this.xAxis.getScaleValue(s[0]),
896
- this.yAxis.getScaleValue(s[1])
897
- ]);
898
- let i;
899
- return this.orientation === "horizontal" ? i = pt().y((s) => s[0]).x((s) => s[1])(t) : i = pt().x((s) => s[0]).y((s) => s[1])(t), i ? [
900
- {
901
- groupTexts: ["plot", `line-plot-${this.plotIndex}`],
902
- type: "path",
903
- data: [
904
- {
905
- path: i,
906
- strokeFill: this.plotData.strokeFill,
907
- strokeWidth: this.plotData.strokeWidth
908
- }
909
- ]
910
- }
911
- ] : [];
912
- }
913
- }
914
- class oi {
915
- constructor(t, i, s, n, o, c) {
916
- this.barData = t, this.boundingRect = i, this.xAxis = s, this.yAxis = n, this.orientation = o, this.plotIndex = c;
917
- }
918
- getDrawableElement() {
919
- const t = this.barData.data.map((o) => [
920
- this.xAxis.getScaleValue(o[0]),
921
- this.yAxis.getScaleValue(o[1])
922
- ]), s = Math.min(this.xAxis.getAxisOuterPadding() * 2, this.xAxis.getTickDistance()) * (1 - 0.05), n = s / 2;
923
- return this.orientation === "horizontal" ? [
924
- {
925
- groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
926
- type: "rect",
927
- data: t.map((o) => ({
928
- x: this.boundingRect.x,
929
- y: o[0] - n,
930
- height: s,
931
- width: o[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((o) => ({
942
- x: o[0] - n,
943
- y: o[1],
944
- width: s,
945
- height: this.boundingRect.y + this.boundingRect.height - o[1],
946
- fill: this.barData.fill,
947
- strokeWidth: 0,
948
- strokeFill: this.barData.fill
949
- }))
950
- }
951
- ];
952
- }
953
- }
954
- class ri {
955
- constructor(t, i, s) {
956
- this.chartConfig = t, this.chartData = i, this.chartThemeConfig = s, this.boundingRect = {
957
- x: 0,
958
- y: 0,
959
- width: 0,
960
- height: 0
961
- };
962
- }
963
- setAxes(t, i) {
964
- this.xAxis = t, this.yAxis = i;
965
- }
966
- setBoundingBoxXY(t) {
967
- this.boundingRect.x = t.x, this.boundingRect.y = t.y;
968
- }
969
- calculateSpace(t) {
970
- return this.boundingRect.width = t.width, this.boundingRect.height = t.height, {
971
- width: this.boundingRect.width,
972
- height: this.boundingRect.height
973
- };
974
- }
975
- getDrawableElements() {
976
- if (!(this.xAxis && this.yAxis))
977
- throw Error("Axes must be passed to render Plots");
978
- const t = [];
979
- for (const [i, s] of this.chartData.plots.entries())
980
- switch (s.type) {
981
- case "line":
982
- {
983
- const n = new ai(
984
- s,
985
- this.xAxis,
986
- this.yAxis,
987
- this.chartConfig.chartOrientation,
988
- i
989
- );
990
- t.push(...n.getDrawableElement());
991
- }
992
- break;
993
- case "bar":
994
- {
995
- const n = new oi(
996
- s,
997
- this.boundingRect,
998
- this.xAxis,
999
- this.yAxis,
1000
- this.chartConfig.chartOrientation,
1001
- i
1002
- );
1003
- t.push(...n.getDrawableElement());
1004
- }
1005
- break;
1006
- }
1007
- return t;
1008
- }
1009
- }
1010
- function hi(e, t, i) {
1011
- return new ri(e, t, i);
1012
- }
1013
- class li {
1014
- constructor(t, i, s, n) {
1015
- this.chartConfig = t, this.chartData = i, this.componentStore = {
1016
- title: ni(t, i, s, n),
1017
- plot: hi(t, i, s),
1018
- xAxis: At(
1019
- i.xAxis,
1020
- t.xAxis,
1021
- {
1022
- titleColor: s.xAxisTitleColor,
1023
- labelColor: s.xAxisLabelColor,
1024
- tickColor: s.xAxisTickColor,
1025
- axisLineColor: s.xAxisLineColor
1026
- },
1027
- n
1028
- ),
1029
- yAxis: At(
1030
- i.yAxis,
1031
- t.yAxis,
1032
- {
1033
- titleColor: s.yAxisTitleColor,
1034
- labelColor: s.yAxisLabelColor,
1035
- tickColor: s.yAxisTickColor,
1036
- axisLineColor: s.yAxisLineColor
1037
- },
1038
- n
1039
- )
1040
- };
1041
- }
1042
- calculateVerticalSpace() {
1043
- let t = this.chartConfig.width, i = this.chartConfig.height, s = 0, n = 0, o = Math.floor(t * this.chartConfig.plotReservedSpacePercent / 100), c = Math.floor(
1044
- i * this.chartConfig.plotReservedSpacePercent / 100
1045
- ), f = this.componentStore.plot.calculateSpace({
1046
- width: o,
1047
- height: c
1048
- });
1049
- t -= f.width, i -= f.height, f = this.componentStore.title.calculateSpace({
1050
- width: this.chartConfig.width,
1051
- height: i
1052
- }), n = f.height, i -= f.height, this.componentStore.xAxis.setAxisPosition("bottom"), f = this.componentStore.xAxis.calculateSpace({
1053
- width: t,
1054
- height: i
1055
- }), i -= f.height, this.componentStore.yAxis.setAxisPosition("left"), f = this.componentStore.yAxis.calculateSpace({
1056
- width: t,
1057
- height: i
1058
- }), s = f.width, t -= f.width, t > 0 && (o += t, t = 0), i > 0 && (c += i, i = 0), this.componentStore.plot.calculateSpace({
1059
- width: o,
1060
- height: c
1061
- }), 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();
1062
- }
1063
- calculateHorizontalSpace() {
1064
- 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(
1065
- i * this.chartConfig.plotReservedSpacePercent / 100
1066
- ), d = this.componentStore.plot.calculateSpace({
1067
- width: c,
1068
- height: f
1069
- });
1070
- t -= d.width, i -= d.height, d = this.componentStore.title.calculateSpace({
1071
- width: this.chartConfig.width,
1072
- height: i
1073
- }), s = d.height, i -= d.height, this.componentStore.xAxis.setAxisPosition("left"), d = this.componentStore.xAxis.calculateSpace({
1074
- width: t,
1075
- height: i
1076
- }), t -= d.width, n = d.width, this.componentStore.yAxis.setAxisPosition("top"), d = this.componentStore.yAxis.calculateSpace({
1077
- width: t,
1078
- height: i
1079
- }), i -= d.height, o = s + d.height, t > 0 && (c += t, t = 0), i > 0 && (f += i, i = 0), this.componentStore.plot.calculateSpace({
1080
- width: c,
1081
- height: f
1082
- }), 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();
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
- }
1096
- class ci {
1097
- static build(t, i, s, n) {
1098
- return new li(t, i, s, n).getDrawableElement();
1099
- }
1100
- }
1101
- let X = 0, Tt, Y = Pt(), H = Dt(), y = Lt(), at = H.plotColorPalette.split(",").map((e) => e.trim()), G = !1, rt = !1;
1102
- function Dt() {
1103
- const e = jt(), t = ot();
1104
- return Ct(e.xyChart, t.themeVariables.xyChart);
1105
- }
1106
- function Pt() {
1107
- const e = ot();
1108
- return Ct(
1109
- qt.xyChart,
1110
- e.xyChart
1111
- );
1112
- }
1113
- function Lt() {
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
- function ht(e) {
1131
- const t = ot();
1132
- return Gt(e.trim(), t);
1133
- }
1134
- function ui(e) {
1135
- Tt = e;
1136
- }
1137
- function gi(e) {
1138
- e === "horizontal" ? Y.chartOrientation = "horizontal" : Y.chartOrientation = "vertical";
1139
- }
1140
- function xi(e) {
1141
- y.xAxis.title = ht(e.text);
1142
- }
1143
- function Et(e, t) {
1144
- y.xAxis = { type: "linear", title: y.xAxis.title, min: e, max: t }, G = !0;
1145
- }
1146
- function di(e) {
1147
- y.xAxis = {
1148
- type: "band",
1149
- title: y.xAxis.title,
1150
- categories: e.map((t) => ht(t.text))
1151
- }, G = !0;
1152
- }
1153
- function fi(e) {
1154
- y.yAxis.title = ht(e.text);
1155
- }
1156
- function pi(e, t) {
1157
- y.yAxis = { type: "linear", title: y.yAxis.title, min: e, max: t }, rt = !0;
1158
- }
1159
- function mi(e) {
1160
- 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;
1161
- y.yAxis = {
1162
- type: "linear",
1163
- title: y.yAxis.title,
1164
- min: Math.min(s, t),
1165
- max: Math.max(n, i)
1166
- };
1167
- }
1168
- function vt(e) {
1169
- let t = [];
1170
- if (e.length === 0)
1171
- return t;
1172
- if (!G) {
1173
- const i = N(y.xAxis) ? y.xAxis.min : 1 / 0, s = N(y.xAxis) ? y.xAxis.max : -1 / 0;
1174
- Et(Math.min(i, 1), Math.max(s, e.length));
1175
- }
1176
- if (rt || mi(e), _t(y.xAxis) && (t = y.xAxis.categories.map((i, s) => [i, e[s]])), N(y.xAxis)) {
1177
- const i = y.xAxis.min, s = y.xAxis.max, n = (s - i + 1) / e.length, o = [];
1178
- for (let c = i; c <= s; c += n)
1179
- o.push(`${c}`);
1180
- t = o.map((c, f) => [c, e[f]]);
1181
- }
1182
- return t;
1183
- }
1184
- function Mt(e) {
1185
- return at[e === 0 ? 0 : e % at.length];
1186
- }
1187
- function yi(e, t) {
1188
- const i = vt(t);
1189
- y.plots.push({
1190
- type: "line",
1191
- strokeFill: Mt(X),
1192
- strokeWidth: 2,
1193
- data: i
1194
- }), X++;
1195
- }
1196
- function bi(e, t) {
1197
- const i = vt(t);
1198
- y.plots.push({
1199
- type: "bar",
1200
- fill: Mt(X),
1201
- data: i
1202
- }), X++;
1203
- }
1204
- function Ai() {
1205
- if (y.plots.length === 0)
1206
- throw Error("No Plot to render, please provide a plot with some data");
1207
- return y.title = wt(), ci.build(Y, y, H, Tt);
1208
- }
1209
- function wi() {
1210
- return H;
1211
- }
1212
- function Si() {
1213
- return Y;
1214
- }
1215
- const Ci = function() {
1216
- Ut(), X = 0, Y = Pt(), y = Lt(), H = Dt(), at = H.plotColorPalette.split(",").map((e) => e.trim()), G = !1, rt = !1;
1217
- }, _i = {
1218
- getDrawableElem: Ai,
1219
- clear: Ci,
1220
- setAccTitle: Yt,
1221
- getAccTitle: Xt,
1222
- setDiagramTitle: Nt,
1223
- getDiagramTitle: wt,
1224
- getAccDescription: Ft,
1225
- setAccDescription: zt,
1226
- setOrientation: gi,
1227
- setXAxisTitle: xi,
1228
- setXAxisRangeData: Et,
1229
- setXAxisBand: di,
1230
- setYAxisTitle: fi,
1231
- setYAxisRangeData: pi,
1232
- setLineData: yi,
1233
- setBarData: bi,
1234
- setTmpSVGG: ui,
1235
- getChartThemeConfig: wi,
1236
- getChartConfig: Si
1237
- }, ki = (e, t, i, s) => {
1238
- const n = s.db, o = n.getChartThemeConfig(), c = n.getChartConfig();
1239
- function f(p) {
1240
- return p === "top" ? "text-before-edge" : "middle";
1241
- }
1242
- function d(p) {
1243
- return p === "left" ? "start" : p === "right" ? "end" : "middle";
1244
- }
1245
- function R(p) {
1246
- return `translate(${p.x}, ${p.y}) rotate(${p.rotation || 0})`;
1247
- }
1248
- St.debug(`Rendering xychart chart
1249
- ` + e);
1250
- const _ = Ht(t), A = _.append("g").attr("class", "main"), m = A.append("rect").attr("width", c.width).attr("height", c.height).attr("class", "background");
1251
- $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"));
1252
- const T = n.getDrawableElem(), S = {};
1253
- function P(p) {
1254
- let C = A, h = "";
1255
- for (const [L] of p.entries()) {
1256
- let z = A;
1257
- L > 0 && S[h] && (z = S[h]), h += p[L], C = S[h], C || (C = S[h] = z.append("g").attr("class", p[L]));
1258
- }
1259
- return C;
1260
- }
1261
- for (const p of T) {
1262
- if (p.data.length === 0)
1263
- continue;
1264
- const C = P(p.groupTexts);
1265
- switch (p.type) {
1266
- case "rect":
1267
- 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);
1268
- break;
1269
- case "text":
1270
- 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);
1271
- break;
1272
- case "path":
1273
- 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);
1274
- break;
1275
- }
1276
- }
1277
- }, Ri = {
1278
- draw: ki
1279
- }, Bi = {
1280
- parser: ti,
1281
- db: _i,
1282
- renderer: Ri
1283
- };
1284
- export {
1285
- Bi as diagram
1286
- };