vue-data-ui 3.22.13 → 3.23.0

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 (224) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +13 -1
  3. package/dist/{Arrow-DKx74WtM.js → Arrow-o2qHNvrC.js} +1 -1
  4. package/dist/{BaseDraggableDialog-3n8udWmh.js → BaseDraggableDialog-qTnfhLBz.js} +2 -2
  5. package/dist/{BaseIcon-CP5RWnqt.js → BaseIcon-91MZoczJ.js} +4 -3
  6. package/dist/{BaseLegendToggle-DsWphmIb.js → BaseLegendToggle-CtAPwzr2.js} +1 -1
  7. package/dist/{BaseZoomControls-C9_ygNN4.js → BaseZoomControls-rdzlicuz.js} +2 -2
  8. package/dist/{ColorPicker-3N_HVgXs.js → ColorPicker-CIAkdPrj.js} +2 -2
  9. package/dist/{DataTable-DzPEVvSo.js → DataTable-D4tM9s5Y.js} +2 -2
  10. package/dist/HillActions-BWhxHlrj.js +187 -0
  11. package/dist/{Legend-C0xAnJdO.js → Legend-CQTRlzK-.js} +2 -2
  12. package/dist/{NonSvgPenAndPaper-B_mE5UbR.js → NonSvgPenAndPaper-Cawacw1W.js} +19 -19
  13. package/dist/{PackageVersion-B6Hokxw9.js → PackageVersion--QCMh5k_.js} +1 -1
  14. package/dist/{PenAndPaper-CSMVXpg2.js → PenAndPaper-cE4J8-rA.js} +11 -11
  15. package/dist/{Shape-BfnXr1nJ.js → Shape-BPMV94Ij.js} +3 -3
  16. package/dist/{Slicer-C6qNUmZ4.js → Slicer-5yIrdoJv.js} +15 -15
  17. package/dist/SlicerPreview-DvjLV2TW.js +1689 -0
  18. package/dist/{SparkTooltip-uoUiL_P8.js → SparkTooltip-BaYtEKS6.js} +6 -6
  19. package/dist/Title-BODtwViI.js +87 -0
  20. package/dist/{Tooltip-CA1rtSyl.js → Tooltip-CMTGxeYO.js} +1 -1
  21. package/dist/{UserOptions-DzAFK9cY.js → UserOptions-3ujTo3LD.js} +2 -2
  22. package/dist/components/arrow.js +1 -1
  23. package/dist/components/vue-ui-3d-bar.js +1 -1
  24. package/dist/components/vue-ui-accordion.js +1 -1
  25. package/dist/components/vue-ui-age-pyramid.js +1 -1
  26. package/dist/components/vue-ui-annotator.js +1 -1
  27. package/dist/components/vue-ui-bullet.js +1 -1
  28. package/dist/components/vue-ui-bump.js +1 -1
  29. package/dist/components/vue-ui-candlestick.js +1 -1
  30. package/dist/components/vue-ui-carousel-table.js +1 -1
  31. package/dist/components/vue-ui-chestnut.js +1 -1
  32. package/dist/components/vue-ui-chord.js +1 -1
  33. package/dist/components/vue-ui-circle-pack.js +1 -1
  34. package/dist/components/vue-ui-cursor.js +1 -1
  35. package/dist/components/vue-ui-dag.js +1 -1
  36. package/dist/components/vue-ui-dashboard.js +1 -1
  37. package/dist/components/vue-ui-digits.js +1 -1
  38. package/dist/components/vue-ui-donut-evolution.js +1 -1
  39. package/dist/components/vue-ui-donut.js +1 -1
  40. package/dist/components/vue-ui-dumbbell.js +1 -1
  41. package/dist/components/vue-ui-flow.js +1 -1
  42. package/dist/components/vue-ui-funnel.js +1 -1
  43. package/dist/components/vue-ui-galaxy.js +1 -1
  44. package/dist/components/vue-ui-gauge.js +1 -1
  45. package/dist/components/vue-ui-geo.js +1 -1
  46. package/dist/components/vue-ui-gizmo.js +1 -1
  47. package/dist/components/vue-ui-heatmap.js +1 -1
  48. package/dist/components/vue-ui-hill.js +2 -0
  49. package/dist/components/vue-ui-history-plot.js +1 -1
  50. package/dist/components/vue-ui-horizontal-bar.js +1 -1
  51. package/dist/components/vue-ui-icon.js +1 -1
  52. package/dist/components/vue-ui-kpi.js +1 -1
  53. package/dist/components/vue-ui-mini-loader.js +1 -1
  54. package/dist/components/vue-ui-molecule.js +1 -1
  55. package/dist/components/vue-ui-mood-radar.js +1 -1
  56. package/dist/components/vue-ui-nested-donuts.js +1 -1
  57. package/dist/components/vue-ui-onion.js +1 -1
  58. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  59. package/dist/components/vue-ui-quadrant.js +1 -1
  60. package/dist/components/vue-ui-quick-chart.js +1 -1
  61. package/dist/components/vue-ui-radar.js +1 -1
  62. package/dist/components/vue-ui-rating.js +1 -1
  63. package/dist/components/vue-ui-relation-circle.js +1 -1
  64. package/dist/components/vue-ui-ridgeline.js +1 -1
  65. package/dist/components/vue-ui-rings.js +1 -1
  66. package/dist/components/vue-ui-scatter.js +1 -1
  67. package/dist/components/vue-ui-skeleton.js +1 -1
  68. package/dist/components/vue-ui-smiley.js +1 -1
  69. package/dist/components/vue-ui-spark-trend.js +1 -1
  70. package/dist/components/vue-ui-sparkbar.js +1 -1
  71. package/dist/components/vue-ui-sparkgauge.js +1 -1
  72. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  73. package/dist/components/vue-ui-sparkline.js +1 -1
  74. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  75. package/dist/components/vue-ui-stackbar.js +1 -1
  76. package/dist/components/vue-ui-stackline.js +1 -1
  77. package/dist/components/vue-ui-strip-plot.js +1 -1
  78. package/dist/components/vue-ui-table-heatmap.js +1 -1
  79. package/dist/components/vue-ui-table-sparkline.js +1 -1
  80. package/dist/components/vue-ui-table.js +1 -1
  81. package/dist/components/vue-ui-thermometer.js +1 -1
  82. package/dist/components/vue-ui-timer.js +1 -1
  83. package/dist/components/vue-ui-tiremarks.js +1 -1
  84. package/dist/components/vue-ui-treemap.js +1 -1
  85. package/dist/components/vue-ui-vertical-bar.js +1 -1
  86. package/dist/components/vue-ui-waffle.js +1 -1
  87. package/dist/components/vue-ui-wheel.js +1 -1
  88. package/dist/components/vue-ui-word-cloud.js +1 -1
  89. package/dist/components/vue-ui-world.js +1 -1
  90. package/dist/components/vue-ui-xy-canvas.js +1 -1
  91. package/dist/components/vue-ui-xy.js +1 -1
  92. package/dist/{dom-to-png-BdAFKZQg.js → dom-to-png-4tdMNGPX.js} +1 -1
  93. package/dist/exposedLib-DWLRqRhv.js +25 -0
  94. package/dist/{img-Bikk1dGb.js → img-DIQG5q8T.js} +1 -1
  95. package/dist/{labelUtils-BUhssos9.js → labelUtils-C5lnc_xc.js} +1 -1
  96. package/dist/{lib-CFm_J26b.js → lib-BuMGJ_a0.js} +216 -173
  97. package/dist/{package-DmDydylu.js → package-BMc_ZieJ.js} +1 -1
  98. package/dist/{pdf-zmz3l2uy.js → pdf-Cnz4NKM9.js} +1 -1
  99. package/dist/{render-common-BIG8JYGK.js → render-common-Ktg2LZFG.js} +21 -21
  100. package/dist/ssr/vue-ui-donut.js +1 -1
  101. package/dist/ssr/vue-ui-xy.js +1 -1
  102. package/dist/ssr.js +2 -2
  103. package/dist/style.css +1 -1
  104. package/dist/types/vue-data-ui.d.ts +493 -0
  105. package/dist/types/vue-ui-hill.d.ts +90 -0
  106. package/dist/useAutoSizeLabelsInsideViewbox-DvDwcwi_.js +122 -0
  107. package/dist/{useConfig-C0V0eG7L.js → useConfig-BilxnBNr.js} +767 -476
  108. package/dist/useHints-Dq_w2E8B.js +66 -0
  109. package/dist/{useNestedProp-BY6DNN3i.js → useNestedProp--NSEmhOH.js} +1 -1
  110. package/dist/{useObjectBindings-Djwpii4d.js → useObjectBindings-Cwq7NcQz.js} +3 -2
  111. package/dist/{usePrinter-BH-xle1O.js → usePrinter-BFvi4jVy.js} +2 -2
  112. package/dist/useTransitions-g_zBREk2.js +39 -0
  113. package/dist/utils.js +14 -14
  114. package/dist/{vue-data-ui-rkzh6EkO.js → vue-data-ui-EsawKe_W.js} +85 -81
  115. package/dist/vue-data-ui.js +77 -76
  116. package/dist/vue-ui-3d-bar-RSUS2xpL.js +1849 -0
  117. package/dist/{vue-ui-accordion-UA88lv4d.js → vue-ui-accordion-61MlW-Ge.js} +4 -4
  118. package/dist/vue-ui-age-pyramid-CgnPWA93.js +1263 -0
  119. package/dist/vue-ui-annotator-DBRT85HG.js +2913 -0
  120. package/dist/vue-ui-bullet-Bc3-WaN1.js +724 -0
  121. package/dist/{vue-ui-bump-BS7RCf0Z.js → vue-ui-bump-Dvv3iSKr.js} +332 -295
  122. package/dist/{vue-ui-candlestick-BZSGDKrM.js → vue-ui-candlestick-DvvsrIdp.js} +464 -440
  123. package/dist/vue-ui-carousel-table-DtsNVim8.js +463 -0
  124. package/dist/vue-ui-chestnut-ArloORzP.js +2068 -0
  125. package/dist/{vue-ui-chord-D6G7ceE-.js → vue-ui-chord-xX5gWZy8.js} +430 -424
  126. package/dist/vue-ui-circle-pack-D8wykmqg.js +1638 -0
  127. package/dist/{vue-ui-cursor-BpN5MsXM.js → vue-ui-cursor-CxgE6Phh.js} +61 -61
  128. package/dist/{vue-ui-dag-BzgOgXzU.js → vue-ui-dag-C9Sf9vH7.js} +924 -916
  129. package/dist/vue-ui-dashboard-bGmaglAj.js +520 -0
  130. package/dist/{vue-ui-digits-OMPrn8fb.js → vue-ui-digits-DgDE-_Fn.js} +58 -50
  131. package/dist/vue-ui-donut-B_n6wF6B.js +2440 -0
  132. package/dist/{vue-ui-donut-Cp5NbZ1r.js → vue-ui-donut-Bmo149AR.js} +113 -113
  133. package/dist/{vue-ui-donut-evolution-DHVi5rOn.js → vue-ui-donut-evolution-D6vH_hfx.js} +528 -447
  134. package/dist/vue-ui-dumbbell-BX4Ao_wR.js +1582 -0
  135. package/dist/{vue-ui-flow-BusUK3H0.js → vue-ui-flow-Bshw8pT_.js} +415 -407
  136. package/dist/vue-ui-funnel-CjYosIik.js +797 -0
  137. package/dist/vue-ui-galaxy-CvXgy-dy.js +1111 -0
  138. package/dist/vue-ui-gauge-CByT0_vF.js +953 -0
  139. package/dist/{vue-ui-geo-CyFgFKlh.js → vue-ui-geo-C-gSZL2q.js} +378 -363
  140. package/dist/{vue-ui-gizmo-DdeXwCQp.js → vue-ui-gizmo-CJdxyPID.js} +57 -49
  141. package/dist/{vue-ui-heatmap-D8-qJ7fg.js → vue-ui-heatmap-DEEKv8ip.js} +498 -490
  142. package/dist/vue-ui-hill-D7LYAgAL.js +1768 -0
  143. package/dist/{vue-ui-history-plot-C2Aqk2ON.js → vue-ui-history-plot-BhcU94Pt.js} +553 -556
  144. package/dist/vue-ui-horizontal-bar-CfFye5tL.js +1733 -0
  145. package/dist/vue-ui-kpi-DCBnNfTb.js +104 -0
  146. package/dist/vue-ui-mini-loader-CtWpqnLW.js +133 -0
  147. package/dist/vue-ui-molecule-D3igGyOy.js +958 -0
  148. package/dist/{vue-ui-mood-radar-BiOjxFEN.js → vue-ui-mood-radar-sl6DMxqR.js} +349 -341
  149. package/dist/{vue-ui-nested-donuts-Cl1HVvDp.js → vue-ui-nested-donuts-aS4YzaB3.js} +449 -413
  150. package/dist/vue-ui-onion-EhPTZpW_.js +1258 -0
  151. package/dist/vue-ui-parallel-coordinate-plot-DE9wTmQQ.js +1455 -0
  152. package/dist/{vue-ui-quadrant-B21LkUc8.js → vue-ui-quadrant-SaY_RPSE.js} +625 -617
  153. package/dist/vue-ui-quick-chart-CJ9rejnj.js +2389 -0
  154. package/dist/{vue-ui-radar-CyzAyVos.js → vue-ui-radar-CaNen5Fj.js} +356 -310
  155. package/dist/vue-ui-rating--K7rX2an.js +360 -0
  156. package/dist/vue-ui-relation-circle-FLs8vOxQ.js +925 -0
  157. package/dist/vue-ui-ridgeline-Beg5hshN.js +1663 -0
  158. package/dist/{vue-ui-rings-FtcdX8xl.js → vue-ui-rings-BevKD8P-.js} +449 -423
  159. package/dist/{vue-ui-scatter-Cp_-2ahf.js → vue-ui-scatter-CNA7jF-o.js} +721 -702
  160. package/dist/{vue-ui-skeleton-COytVrfN.js → vue-ui-skeleton-B9ZP1w-i.js} +395 -387
  161. package/dist/{vue-ui-smiley-Da2jgkb7.js → vue-ui-smiley-DYnqqk6u.js} +128 -120
  162. package/dist/{vue-ui-spark-trend-DC2KUlEY.js → vue-ui-spark-trend-R0ebpg-G.js} +132 -117
  163. package/dist/{vue-ui-sparkbar-DdxQOFIF.js → vue-ui-sparkbar-DYC3By0v.js} +119 -111
  164. package/dist/{vue-ui-sparkgauge-DTA-fORH.js → vue-ui-sparkgauge-Bw6no-In.js} +76 -68
  165. package/dist/vue-ui-sparkhistogram-DvRKy8rq.js +590 -0
  166. package/dist/{vue-ui-sparkline-DcR_N-zT.js → vue-ui-sparkline-Dz1uzBos.js} +389 -364
  167. package/dist/vue-ui-sparkstackbar-DlnPdZih.js +692 -0
  168. package/dist/vue-ui-stackbar-B-THcavY.js +2350 -0
  169. package/dist/vue-ui-stackline-3dBPoI0h.js +2464 -0
  170. package/dist/{vue-ui-strip-plot-NLCwYvyw.js → vue-ui-strip-plot-ACeYOoHj.js} +505 -484
  171. package/dist/vue-ui-table-heatmap-DVwMqzje.js +364 -0
  172. package/dist/{vue-ui-table-AM9brdwU.js → vue-ui-table-rFy16bp0.js} +512 -504
  173. package/dist/{vue-ui-table-sparkline-BE6DAvur.js → vue-ui-table-sparkline-CABJzK8p.js} +207 -181
  174. package/dist/vue-ui-thermometer-CVQ-H69Q.js +777 -0
  175. package/dist/{vue-ui-timer-BZM5ITG9.js → vue-ui-timer-Bm8LpsnI.js} +66 -58
  176. package/dist/{vue-ui-tiremarks-BCncDpHX.js → vue-ui-tiremarks-DB3f5qiz.js} +127 -119
  177. package/dist/vue-ui-treemap-DP0Sx8Y8.js +1760 -0
  178. package/dist/vue-ui-waffle-iPpdk1Bm.js +1412 -0
  179. package/dist/vue-ui-wheel-BJkEYfLj.js +892 -0
  180. package/dist/{vue-ui-word-cloud-D7R7nhk1.js → vue-ui-word-cloud-B2sxtel9.js} +440 -432
  181. package/dist/{vue-ui-world-DZBt-07p.js → vue-ui-world-BBQZLnzm.js} +343 -335
  182. package/dist/vue-ui-xy-ChZg7AtI.js +1364 -0
  183. package/dist/{vue-ui-xy-CluEZ7lS.js → vue-ui-xy-DZj5DT-q.js} +1633 -1587
  184. package/dist/{vue-ui-xy-canvas-7YSYRdwr.js → vue-ui-xy-canvas-BN2u0bOJ.js} +456 -430
  185. package/dist/vue_ui_hill-dnltu0L-.js +368 -0
  186. package/package.json +2 -2
  187. package/dist/SlicerPreview-Cw6WMVhG.js +0 -1689
  188. package/dist/Title-BuPs74IB.js +0 -87
  189. package/dist/exposedLib-Ciw6TGtP.js +0 -25
  190. package/dist/useAutoSizeLabelsInsideViewbox-C9RNjsGv.js +0 -50
  191. package/dist/useMountedDelay-BAjrhRJb.js +0 -14
  192. package/dist/vue-ui-3d-bar-D5xHEWr1.js +0 -1824
  193. package/dist/vue-ui-age-pyramid-CAJg01c7.js +0 -1246
  194. package/dist/vue-ui-annotator-q3ZKx6ua.js +0 -2905
  195. package/dist/vue-ui-bullet-ByeaWGfI.js +0 -709
  196. package/dist/vue-ui-carousel-table-DO5NRXvX.js +0 -455
  197. package/dist/vue-ui-chestnut-BfeSPeEh.js +0 -2042
  198. package/dist/vue-ui-circle-pack-Cqmlw7AV.js +0 -1610
  199. package/dist/vue-ui-dashboard-DLvGJXJY.js +0 -512
  200. package/dist/vue-ui-donut-ZIRebAWc.js +0 -2418
  201. package/dist/vue-ui-dumbbell-gDYjU2oF.js +0 -1564
  202. package/dist/vue-ui-funnel-BtaYaU0r.js +0 -781
  203. package/dist/vue-ui-galaxy-BMp-HzDh.js +0 -1076
  204. package/dist/vue-ui-gauge-CBou0cFE.js +0 -925
  205. package/dist/vue-ui-horizontal-bar-BuwxI7d1.js +0 -1689
  206. package/dist/vue-ui-kpi-ByxoO01r.js +0 -96
  207. package/dist/vue-ui-mini-loader-D9pprk2c.js +0 -125
  208. package/dist/vue-ui-molecule-BqJJq49_.js +0 -932
  209. package/dist/vue-ui-onion-CRQOxurS.js +0 -1199
  210. package/dist/vue-ui-parallel-coordinate-plot-Dhn18RtR.js +0 -1412
  211. package/dist/vue-ui-quick-chart-DAhSXYnp.js +0 -2443
  212. package/dist/vue-ui-rating-DbxK-ftN.js +0 -352
  213. package/dist/vue-ui-relation-circle-Cb33DMZo.js +0 -917
  214. package/dist/vue-ui-ridgeline-D7aArzQk.js +0 -1627
  215. package/dist/vue-ui-sparkhistogram-D1oFTrvt.js +0 -575
  216. package/dist/vue-ui-sparkstackbar-BlFio0lP.js +0 -674
  217. package/dist/vue-ui-stackbar-Cu13EdVa.js +0 -2322
  218. package/dist/vue-ui-stackline-DKL0o_-3.js +0 -2427
  219. package/dist/vue-ui-table-heatmap-CSI482KG.js +0 -338
  220. package/dist/vue-ui-thermometer-D6Czx7Fb.js +0 -769
  221. package/dist/vue-ui-treemap-BOEYCOdk.js +0 -1727
  222. package/dist/vue-ui-waffle-BrM8IHdG.js +0 -1367
  223. package/dist/vue-ui-wheel-BNsajigQ.js +0 -884
  224. package/dist/vue-ui-xy-Dt_1bSBT.js +0 -1364
@@ -1,1364 +0,0 @@
1
- import { B as e, Bt as t, F as n, Gt as r, H as i, I as a, K as o, M as s, N as c, Nt as l, O as u, Rt as d, V as f, W as p, Y as m, _ as h, _t as g, a as _, c as v, g as y, i as b, k as x, qt as S, s as ee, t as C, tt as te, x as w, z as T, zt as E } from "./lib-CFm_J26b.js";
2
- import { t as D } from "./useTimeLabels-B9CEuiLZ.js";
3
- import { t as O } from "./useConfig-C0V0eG7L.js";
4
- import { t as ne } from "./vue_ui_xy-BA3-_LCx.js";
5
- import { _ as k, d as A, f as j, g as M, h as N, l as P, m as F, p as I, u as L, v as R } from "./render-common-BIG8JYGK.js";
6
- //#region src/svg/vue-ui-xy/create.js
7
- var { vue_ui_xy: z } = O();
8
- function re({ config: e = {}, dataset: t = [] } = {}) {
9
- let n = e ?? {}, i = S({
10
- userConfig: n,
11
- defaultConfig: z
12
- });
13
- g(n, "chart.highlightArea") && (Array.isArray(n.chart.highlightArea) ? i.chart.highlightArea = n.chart.highlightArea.map((e) => S({
14
- defaultConfig: z.chart.highlightArea,
15
- userConfig: e
16
- })) : i.chart.highlightArea = [S({
17
- defaultConfig: z.chart.highlightArea,
18
- userConfig: n.chart.highlightArea
19
- })]), g(n, "chart.annotations") && Array.isArray(n.chart.annotations) && n.chart.annotations.length ? i.chart.annotations = n.chart.annotations.map((e) => S({
20
- defaultConfig: z.chart.annotations[0],
21
- userConfig: e
22
- })) : i.chart.annotations = [], g(n, "chart.grid.position") && n.chart.grid.position === "start" && t.some((e) => e.type === "bar") && (i.chart.grid.position = "middle");
23
- let a = i.theme;
24
- if (!a) return {
25
- ...i,
26
- customPalette: i.customPalette?.length ? i.customPalette : l
27
- };
28
- let o = S({
29
- userConfig: n,
30
- defaultConfig: S({
31
- userConfig: ne[a] || {},
32
- defaultConfig: i
33
- })
34
- });
35
- return {
36
- ...o,
37
- customPalette: o.customPalette?.length ? o.customPalette : r[a] || l
38
- };
39
- }
40
- function B(e) {
41
- return e && typeof e == "object" && Number.isFinite(Number(e.x)) && Number.isFinite(Number(e.y));
42
- }
43
- function ie(e) {
44
- return e != null && Number.isFinite(Number(e));
45
- }
46
- function ae(e) {
47
- return e.flatMap((e) => Array.isArray(e.series) ? e.series : []).filter(B).map((e) => Number(e.x));
48
- }
49
- function oe({ dataset: e, config: t }) {
50
- let n = ae(e);
51
- if (!n.length) return {
52
- min: 0,
53
- max: 1,
54
- ticks: [0, 1]
55
- };
56
- let r = t?.chart?.grid?.labels?.xAxis?.scaleMin, i = t?.chart?.grid?.labels?.xAxis?.scaleMax, a = ie(r) ? Number(r) : Math.min(...n), o = ie(i) ? Number(i) : Math.max(...n);
57
- return y(a === o ? a - 1 : a, a === o ? o + 1 : o, Number.isFinite(Number(t?.chart?.grid?.labels?.xAxis?.scaleSteps)) ? Number(t.chart.grid.labels.xAxis.scaleSteps) : 6);
58
- }
59
- function se({ xValue: e, xScale: t, drawingArea: n, config: r }) {
60
- let i = (Number(e) - t.min) / (t.max - t.min || 1), a = r?.chart?.grid?.labels?.xAxis?.reverse ? 1 - i : i;
61
- return n.left + n.width * a;
62
- }
63
- function ce({ dataset: e = [], config: t = {}, width: n = 1e3, height: r = 600, selectedXIndex: i, additionalSvgContent: a = "", svgTitle: o = "" } = {}) {
64
- let s = re({
65
- config: t,
66
- dataset: e
67
- }), c = {
68
- top: s.chart.padding.top,
69
- left: s.chart.padding.left,
70
- right: n - s.chart.padding.right,
71
- bottom: r - s.chart.padding.bottom
72
- };
73
- c.width = c.right - c.left, c.height = c.bottom - c.top;
74
- let u = e.flatMap((e) => Array.isArray(e.series) ? e.series.map((e) => Number(typeof e == "object" && e ? e.y : e)) : []).filter(Number.isFinite), d = y(Math.min(0, ...u), Math.max(1, ...u), 6), f = e.some((e) => Array.isArray(e.series) ? e.series.some(B) : !1), p = f ? oe({
75
- dataset: e,
76
- config: s
77
- }) : null, m = Math.max(0, ...e.map((e) => e.series?.length || 0)), h = (e) => m <= 1 ? c.left + c.width / 2 : c.left + e / (m - 1) * c.width, g = (e, t) => f ? B(e) ? se({
78
- xValue: e.x,
79
- xScale: p,
80
- drawingArea: c,
81
- config: s
82
- }) : null : h(t), _ = (e) => {
83
- let t = (Number(e) - d.min) / (d.max - d.min || 1);
84
- return c.bottom - t * c.height;
85
- }, v = Array.isArray(s.customPalette) ? s.customPalette : [], b = v.length ? v : l;
86
- return {
87
- width: n,
88
- height: r,
89
- selectedXIndex: i,
90
- dataset: e,
91
- config: s,
92
- drawingArea: c,
93
- scale: d,
94
- xScale: p,
95
- isContinuous: f,
96
- series: e.map((e, t) => {
97
- let n = (e.color ? w(e.color) : "") || b[t % b.length], r = (e.series || []).map((e, t) => {
98
- let n = e == null ? null : typeof e == "object" ? e.y ?? null : Number(e);
99
- return {
100
- x: g(e, t),
101
- y: n === null || !Number.isFinite(Number(n)) ? null : _(n),
102
- value: n,
103
- index: t,
104
- rawX: B(e) ? Number(e.x) : null,
105
- label: e?.name ?? e?.x ?? String(t)
106
- };
107
- });
108
- return {
109
- ...e,
110
- color: n,
111
- type: e.type || "line",
112
- plots: r
113
- };
114
- }),
115
- additionalSvgContent: a,
116
- svgTitle: o
117
- };
118
- }
119
- //#endregion
120
- //#region src/svg/vue-ui-xy/render.js
121
- function V(e) {
122
- return !!I(e, "chart.grid.labels.yAxis.useIndividualScale", !1);
123
- }
124
- function le(e) {
125
- return String(e.scaleLabel ?? e.id ?? e.name ?? "");
126
- }
127
- function ue(e) {
128
- return k(I(e, "chart.grid.labels.yAxis.labelWidth", 40), 40) + 36;
129
- }
130
- function de(e) {
131
- return M(e).flatMap((e) => M(e.plots)).map((e) => e?.value === null || e?.value === void 0 ? null : Number(e.value)).filter(Number.isFinite);
132
- }
133
- function fe(e, t, n) {
134
- let r = de(n), i = I(e, "chart.grid.labels.yAxis.scaleMin", null), a = I(e, "chart.grid.labels.yAxis.scaleMax", null), o = X(i) ? Number(i) : Math.min(0, ...r), s = X(a) ? Number(a) : Math.max(1, ...r), c = k(I(e, "chart.grid.labels.yAxis.commonScaleSteps", 6), 6);
135
- return !r.length && !X(i) && !X(a) ? t : Oe(e, o, s === o ? o + 1 : s, c);
136
- }
137
- function pe(e, t) {
138
- let { drawingArea: n } = e, r = k(t.__yOffset, 0), i = k(t.__individualHeight, n.height);
139
- return {
140
- top: n.bottom - r - i,
141
- bottom: n.bottom - r
142
- };
143
- }
144
- function H(e, t, n, r) {
145
- let i = pe(e, t), a = Math.min(n.y, r), o = Math.max(n.y, r), s = Math.max(i.top, a), c = Math.min(i.bottom, o);
146
- return {
147
- y: s,
148
- height: Math.max(1e-5, c - s)
149
- };
150
- }
151
- function me(e, t) {
152
- let n = {};
153
- return M(t).forEach((t, r) => {
154
- let i = le(t) || `serie_${r}`, a = M(t.plots).map((e) => Number(e.value)).filter(Number.isFinite);
155
- n[i] || (n[i] = {
156
- scaleLabel: i,
157
- name: t.name ?? i,
158
- color: I(e, "chart.grid.labels.yAxis.groupColor", null) || t.color,
159
- series: [],
160
- values: []
161
- }), n[i].series.push(t), n[i].values.push(...a);
162
- }), Object.values(n).forEach((t) => {
163
- t.scale = ke(e, {
164
- ...t.series[0],
165
- plots: t.series.flatMap((e) => M(e.plots))
166
- });
167
- }), n;
168
- }
169
- function he(e, t, n, r, i, a) {
170
- return !i && !a ? r : n[le(t)]?.scale ?? ke(e, t);
171
- }
172
- function ge(e) {
173
- return e === "bar" || e === "line" || e === "plot" ? e : "line";
174
- }
175
- function _e(e) {
176
- return M(e.series).map((e) => ({
177
- ...e,
178
- type: ge(e.type),
179
- plots: M(e.plots).filter((e) => e && F(e.x))
180
- }));
181
- }
182
- function U(e) {
183
- let { drawingArea: t, scale: n } = e, r = (0 - n.min) / (n.max - n.min || 1);
184
- return t.bottom - r * t.height;
185
- }
186
- var ve = o();
187
- function W(e) {
188
- return ve;
189
- }
190
- function G(e, t, n) {
191
- return `rectGradient_${n}_${t}_${W(e)}`;
192
- }
193
- function ye(e, t) {
194
- return `lineGradient_${t}_${W(e)}`;
195
- }
196
- function be(e, t) {
197
- return `temperature_grad_line_${t}_${W(e)}`;
198
- }
199
- function xe(e, t, n) {
200
- return t.temperatureColors && !t.isFlatTemperatureLine ? `url(#${be(e, n)})` : t.color;
201
- }
202
- function Se(e, t) {
203
- return `plotGradient_${t}_${W(e)}`;
204
- }
205
- function Ce(e, t, n) {
206
- let { config: r } = e;
207
- return I(r, "line.useGradient", !1) ? `url(#${ye(e, n)})` : I(r, "line.dot.useSerieColor", !0) ? t.color : I(r, "line.dot.fill", "#FFFFFF");
208
- }
209
- function we(e, t, n) {
210
- let { config: r } = e;
211
- return I(r, "line.area.useGradient", !1) ? `url(#${rt(e, n)})` : E(t.color, k(I(r, "line.area.opacity", 30), 30));
212
- }
213
- function K(e, t, n, r) {
214
- return I(e.config, "bar.useGradient", !1) ? r >= 0 ? `url(#${G(e, n, "pos")})` : `url(#${G(e, n, "neg")})` : t.color;
215
- }
216
- function Te(e, n) {
217
- let { config: r } = e, i = [];
218
- return I(r, "bar.useGradient", !1) && n.filter((e) => e.type === "bar").forEach((n, r) => {
219
- i.push(L("linearGradient", {
220
- id: G(e, r, "pos"),
221
- x2: "0%",
222
- y2: "100%"
223
- }, [
224
- A("stop", {
225
- offset: "0%",
226
- "stop-color": w(n.color)
227
- }),
228
- A("stop", {
229
- offset: "62%",
230
- "stop-color": t(w(n.color), .02)
231
- }),
232
- A("stop", {
233
- offset: "100%",
234
- "stop-color": t(w(n.color), .05)
235
- })
236
- ].join(""))), i.push(L("linearGradient", {
237
- id: G(e, r, "neg"),
238
- x2: "0%",
239
- y2: "100%"
240
- }, [
241
- A("stop", {
242
- offset: "0%",
243
- "stop-color": t(w(n.color), .05)
244
- }),
245
- A("stop", {
246
- offset: "38%",
247
- "stop-color": t(w(n.color), .02)
248
- }),
249
- A("stop", {
250
- offset: "100%",
251
- "stop-color": w(n.color)
252
- })
253
- ].join("")));
254
- }), n.filter((e) => e.type === "line").forEach((n, a) => {
255
- I(r, "line.useGradient", !1) && i.push(L("radialGradient", {
256
- id: ye(e, a),
257
- cx: "50%",
258
- cy: "50%",
259
- r: "50%",
260
- fx: "50%",
261
- fy: "50%"
262
- }, [A("stop", {
263
- offset: "0%",
264
- "stop-color": t(w(n.color), .05)
265
- }), A("stop", {
266
- offset: "100%",
267
- "stop-color": w(n.color)
268
- })].join(""))), n.temperatureColors && !n.isFlatTemperatureLine && i.push(L("linearGradient", {
269
- id: be(e, a),
270
- gradientTransform: "rotate(90)"
271
- }, n.temperatureColors.map((e, t) => A("stop", {
272
- offset: d(t, n.temperatureColors.length),
273
- "stop-color": w(e)
274
- })).join("")));
275
- }), n.filter((e) => e.type === "plot").forEach((n, a) => {
276
- I(r, "plot.useGradient", !1) && i.push(L("radialGradient", {
277
- id: Se(e, a),
278
- cx: "50%",
279
- cy: "50%",
280
- r: "50%",
281
- fx: "50%",
282
- fy: "50%"
283
- }, [A("stop", {
284
- offset: "0%",
285
- "stop-color": t(w(n.color), .05)
286
- }), A("stop", {
287
- offset: "100%",
288
- "stop-color": w(n.color)
289
- })].join("")));
290
- }), i.length ? L("defs", { "data-layer": "gradients" }, i.join("")) : "";
291
- }
292
- function Ee(e) {
293
- let t = I(e.config, "chart.backgroundColor", "#FFFFFF");
294
- return A("rect", {
295
- width: e.width,
296
- height: e.height,
297
- fill: t
298
- });
299
- }
300
- function q(e) {
301
- return {
302
- dataLabels: k(I(e, "chart.grid.labels.fontSize", 12), 12),
303
- xAxis: k(I(e, "chart.grid.labels.xAxisLabels.fontSize", 12), 12),
304
- yAxis: k(I(e, "chart.grid.labels.axis.fontSize", 12), 12)
305
- };
306
- }
307
- function J(e) {
308
- return I(e, "chart.grid.labels.yAxis.position", "left") === "right";
309
- }
310
- function De(e, t) {
311
- let n = m({
312
- p: I(t, "chart.labels.prefix", ""),
313
- v: e,
314
- s: I(t, "chart.labels.suffix", ""),
315
- r: I(t, "chart.grid.labels.yAxis.rounding", 0)
316
- });
317
- return b(I(t, "chart.grid.labels.yAxis.formatter", null), e, n, t);
318
- }
319
- function Y(e) {
320
- return !!I(e, "chart.grid.labels.yAxis.stacked", !1);
321
- }
322
- function X(e) {
323
- return e != null && Number.isFinite(Number(e));
324
- }
325
- function Oe(e, t, n, r) {
326
- return I(e, "chart.grid.labels.yAxis.useNiceScale", !0) ? y(t, n, r) : h(t, n, r);
327
- }
328
- function ke(e, t) {
329
- let n = M(t.plots).map((e) => Number(e.value)).filter(Number.isFinite), r = I(e, "chart.grid.labels.yAxis.scaleMin", null), i = I(e, "chart.grid.labels.yAxis.scaleMax", null), a = X(r) ? Number(r) : X(t.scaleMin) ? Number(t.scaleMin) : Math.min(0, ...n), o = X(i) ? Number(i) : X(t.scaleMax) ? Number(t.scaleMax) : Math.max(1, ...n);
330
- return Oe(e, a, o === a ? a + 1 : o, k(t.scaleSteps ?? I(e, "chart.grid.labels.yAxis.commonScaleSteps", 6), 6));
331
- }
332
- function Ae(e, t, n = []) {
333
- let r = q(e), i = Y(e), a = V(e), o = ue(e);
334
- if (a && !i) {
335
- let t = Object.keys(me(e, n)).length;
336
- return {
337
- left: J(e) ? 0 : t * o,
338
- right: J(e) ? t * o : 0,
339
- scaleLabelsOffset: t * o,
340
- yAxisLabelWidth: 0
341
- };
342
- }
343
- if (a && i) return {
344
- left: J(e) ? 0 : o,
345
- right: J(e) ? o : 0,
346
- scaleLabelsOffset: o,
347
- yAxisLabelWidth: 0
348
- };
349
- let s = (i ? n.flatMap((t) => ke(e, t).ticks) : M(t.ticks)).reduce((t, n) => Math.max(t, j(De(n, e), r.dataLabels)), 0), c = I(e, "chart.grid.labels.axis.yLabel", "") ? r.yAxis * 2 + 24 + k(I(e, "chart.grid.labels.axis.yLabelOffsetX", 0), 0) + r.yAxis : 0, l = s + k(I(e, "chart.grid.labels.yAxis.scaleValueOffsetX", 0), 0) + k(I(e, "chart.grid.labels.yAxis.crosshairSize", 0), 0);
350
- return {
351
- left: J(e) ? 0 : l + c,
352
- right: J(e) ? l + c : 0,
353
- scaleLabelsOffset: l,
354
- yAxisLabelWidth: c
355
- };
356
- }
357
- function je(e, t) {
358
- let { config: n, scale: r, width: i, height: a } = e, o = q(n);
359
- e.drawingArea;
360
- let s = Ae(n, r, t), c = I(n, "chart.legend.position", "bottom"), l = I(n, "chart.legend.show", !0), u = l ? tt({
361
- ...e,
362
- width: i,
363
- height: a
364
- }, t) : { height: 0 }, d = l && c === "top" ? u.height : 0, f = l && c !== "top" ? u.height : 0, p = I(n, "chart.grid.labels.axis.xLabel", ""), m = I(n, "chart.grid.labels.xAxisLabels.show", !0) ? o.xAxis * 2 : 0, h = (p ? o.yAxis * 1.5 : 0) + m + o.xAxis, g = gt(n) + k(I(n, "chart.labels.fontSize", 12), 12) * 1.1, v = k(I(n, "chart.padding.top", 12), 12), y = k(I(n, "chart.padding.right", 12), 12), b = k(I(n, "chart.padding.bottom", 12), 12), x = k(I(n, "chart.padding.left", 12), 12), S = k(I(n, "chart.grid.labels.axis.xLabelOffsetY", 0), 0), ee = k(I(n, "chart.grid.labels.yAxis.crosshairSize", 0), 0), C = s.left, te = s.right, w = i - C - te - 6 - x - y, T = {
365
- top: v + g + d,
366
- right: C + (J(n) ? 0 : ee) + x + w,
367
- bottom: a - h - b - S - f,
368
- left: C + (J(n) ? 0 : ee) + x,
369
- width: Math.max(1, w),
370
- height: 1,
371
- scaleLabelX: C,
372
- rightScaleLabelX: te,
373
- scaleLabelsOffset: s.scaleLabelsOffset,
374
- yAxisLabelWidth: s.yAxisLabelWidth,
375
- individualOffsetX: 36
376
- };
377
- T.height = Math.max(1, T.bottom - T.top);
378
- let E = Y(n), D = E ? _(t) : t, O = Math.max(1, D.length), ne = E ? k(I(n, "chart.grid.labels.yAxis.gap", 12), 12) : 0, A = ne * Math.max(0, O - 1), j = Math.max(1, T.height - A), N = V(n), P = me(n, t), F = Math.max(1, ...t.map((e) => M(e.plots).length));
379
- function L(t, n) {
380
- if (Z(e)) {
381
- let n = Number(t.rawX);
382
- return Number.isFinite(n) ? We({
383
- ...e,
384
- drawingArea: T
385
- }, n) : null;
386
- }
387
- return Q({
388
- ...e,
389
- drawingArea: T
390
- }, t.index ?? n, F);
391
- }
392
- let R = t.map((e, t) => {
393
- let i = e.id !== void 0 && e.id !== null ? D.find((t) => t.id === e.id) ?? D[t] ?? e : D[t] ?? e, a = he(n, e, P, r, N, E), o = k(i.stackIndex, t), s = k(i.stackRatio, 1 / O), c = k(i.cumulatedStackRatio, s * (o + 1)), l = O - 1 - o, u = E ? 1 - c : 0, d = E ? j * u + ne * l : 0, f = E ? j * s : T.height;
394
- function p(e) {
395
- let t = (e - a.min) / (a.max - a.min || 1);
396
- return T.bottom - d - t * f;
397
- }
398
- let m = p(0);
399
- return {
400
- ...e,
401
- __scale: a,
402
- __yOffset: d,
403
- __individualHeight: f,
404
- __zeroY: m,
405
- __scaleYLabels: M(a.ticks).map((t) => ({
406
- value: t,
407
- y: p(t),
408
- serie: e
409
- })),
410
- plots: e.plots.map((e, t) => {
411
- let n = e.value === null || e.value === void 0 ? null : Number(e.value);
412
- return {
413
- ...e,
414
- value: n,
415
- x: L(e, t),
416
- y: n === null || !Number.isFinite(n) ? null : p(n)
417
- };
418
- })
419
- };
420
- });
421
- return {
422
- ...e,
423
- drawingArea: T,
424
- series: R,
425
- __scaleGroups: P,
426
- __useIndividualScale: N
427
- };
428
- }
429
- function Me(e) {
430
- let { config: t, drawingArea: n, scale: r, series: i } = e;
431
- if (!I(t, "chart.grid.labels.show", !0) || !I(t, "chart.grid.labels.yAxis.show", !0)) return "";
432
- let a = V(t), o = Y(t);
433
- if (a) return Ne(e);
434
- let s = q(t), c = J(t), l = I(t, "chart.grid.labels.yAxis.showCrosshairs", !1), u = k(I(t, "chart.grid.labels.yAxis.crosshairSize", 0), 0), d = k(I(t, "chart.grid.labels.yAxis.scaleValueOffsetX", 0), 0), f = I(t, "chart.grid.labels.color", "#2A2A2A"), p = I(t, "chart.grid.stroke", "#CCCCCC"), m = o ? i.flatMap((e) => M(e.__scaleYLabels)) : M(r.ticks).map((e) => {
435
- let t = (e - r.min) / (r.max - r.min || 1);
436
- return {
437
- value: e,
438
- y: n.bottom - t * n.height
439
- };
440
- }), h = [];
441
- return m.forEach((e) => {
442
- Number.isFinite(e.y) && (l && h.push(A("line", {
443
- "data-cy": "axis-y-tick",
444
- x1: c ? n.right : n.left,
445
- x2: c ? n.right + u : n.left - u,
446
- y1: e.y,
447
- y2: e.y,
448
- stroke: p,
449
- "stroke-width": 1,
450
- "stroke-linecap": "round"
451
- })), h.push(R(De(e.value, t), {
452
- "data-cy": "axis-y-label",
453
- transform: `translate(${c ? n.right + u + d + 5 : n.scaleLabelX - u}, ${e.y + s.dataLabels / 3})`,
454
- "font-size": s.dataLabels,
455
- "text-anchor": c ? "start" : "end",
456
- fill: o && e.serie?.color ? I(t, "chart.grid.labels.yAxis.groupColor", null) || e.serie.color : f
457
- })));
458
- }), L("g", { "data-layer": "scale-labels" }, h.join(""));
459
- }
460
- function Ne(e) {
461
- let { config: t, drawingArea: n, series: r } = e, i = q(t), a = J(t), o = Y(t), s = e.__scaleGroups ?? me(t, r), c = I(t, "chart.grid.labels.yAxis.showCrosshairs", !1), l = k(I(t, "chart.grid.labels.yAxis.crosshairSize", 0), 0), u = k(I(t, "chart.grid.labels.yAxis.scaleValueOffsetX", 0), 0), d = k(I(t, "chart.grid.labels.yAxis.labelWidth", 40), 40), f = k(n.individualOffsetX, 36), p = [], m = Object.values(s);
462
- return m.forEach((e, s) => {
463
- let h = r.find((t) => le(t) === e.scaleLabel) ?? r[s];
464
- if (!h) return;
465
- let g = o ? a ? n.right : n.left : a ? n.right + ue(t) * s : n.left - ue(t) * (m.length - s - 1), _ = k(h.__yOffset, 0), v = k(h.__individualHeight, n.height), y = o ? n.bottom - _ - v : n.top, b = o ? n.bottom - _ : n.bottom;
466
- p.push(A("line", {
467
- x1: o || a ? g : g - f,
468
- x2: o || a ? g : g - f,
469
- y1: y,
470
- y2: b,
471
- stroke: e.color,
472
- "stroke-width": I(t, "chart.grid.strokeWidth", 1),
473
- "stroke-linecap": "round"
474
- }));
475
- let x = o ? a ? n.right + l + u + 5 + d + f : n.left - l - u - d : a ? g + l + u + 5 + d : g - i.dataLabels / 2;
476
- p.push(R(e.name, {
477
- transform: `translate(${x}, ${y + (b - y) / 2}) rotate(-90)`,
478
- "font-size": i.dataLabels * .8,
479
- "text-anchor": "middle",
480
- fill: e.color
481
- })), M(e.scale.ticks).forEach((r) => {
482
- let s = (r - e.scale.min) / (e.scale.max - e.scale.min || 1), d = b - s * (b - y);
483
- Number.isFinite(d) && (c && p.push(A("line", {
484
- "data-cy": "axis-y-tick",
485
- x1: o || a ? g : g + 3 - l - f,
486
- x2: o ? a ? g + l : g - l : a ? g + l : g - f,
487
- y1: d,
488
- y2: d,
489
- stroke: e.color,
490
- "stroke-width": 1,
491
- "stroke-linecap": "round"
492
- })), p.push(R(De(r, t), {
493
- "data-cy": "axis-y-label",
494
- transform: `translate(${o ? a ? n.right + l + u + 5 : n.left - l - u - 5 : a ? g + l + u + 5 : g - 5 - f}, ${d + i.dataLabels / 3})`,
495
- "font-size": i.dataLabels,
496
- "text-anchor": a ? "start" : "end",
497
- fill: e.color
498
- })));
499
- });
500
- }), L("g", { "data-layer": "individual-scale-labels" }, p.join(""));
501
- }
502
- function Pe(e) {
503
- return [...new Set(e.flatMap((e) => M(e.plots)).map((e) => Number(e.x)).filter(Number.isFinite))].sort((e, t) => e - t);
504
- }
505
- function Fe(e, t, n = 1) {
506
- let { drawingArea: r, config: i } = e, a = Pe(t), o = r.width * .05;
507
- if (a.length < 2) return Math.max(1e-5, o / Math.max(1, n));
508
- let s = a.slice(1).reduce((e, t, n) => {
509
- let r = a[n], i = Math.abs(t - r);
510
- return i > 0 ? Math.min(e, i) : e;
511
- }, Infinity), c = k(I(i, "bar.periodGap", .2), .2), l = Number.isFinite(s) && s > 0 ? s * (1 - c) : o;
512
- return Math.max(1e-5, l / Math.max(1, n));
513
- }
514
- function Ie(e, t, n) {
515
- let { config: r } = e, i = k(I(r, "bar.innerGap", .05), .05), a = I(r, "bar.borderRadius", 0), o = [];
516
- if (n) {
517
- let n = Fe(e, t, 1), r = n * Math.min(Math.abs(i), .95), s = Math.max(1e-5, n - r);
518
- return t.forEach((t, n) => {
519
- let r = Number.isFinite(Number(t.__zeroY)) ? Number(t.__zeroY) : U(e);
520
- M(t.plots).forEach((i) => {
521
- if (!i || i.value === null || i.value === void 0 || !Number.isFinite(Number(i.value)) || !Number.isFinite(Number(i.x)) || !Number.isFinite(Number(i.y))) return;
522
- let c = i.x - s / 2, { y: l, height: u } = H(e, t, i, r);
523
- i.__barLabelX = i.x, o.push(A("rect", {
524
- "data-cy": "datapoint-bar",
525
- x: c,
526
- y: l,
527
- width: s,
528
- height: u,
529
- rx: a,
530
- fill: K(e, t, n, Number(i.value)),
531
- ...$(e, t)
532
- }));
533
- });
534
- }), L("g", { "data-layer": "bars" }, o.join(""));
535
- }
536
- let s = Math.max(1, t.length), c = Fe(e, t, s), l = c * Math.min(Math.abs(i), .95), u = Math.max(1e-5, c - l), d = c * s;
537
- return t.forEach((t, n) => {
538
- let r = Number.isFinite(Number(t.__zeroY)) ? Number(t.__zeroY) : U(e);
539
- M(t.plots).forEach((i) => {
540
- if (!i || i.value === null || i.value === void 0 || !Number.isFinite(Number(i.value)) || !Number.isFinite(Number(i.x)) || !Number.isFinite(Number(i.y))) return;
541
- let s = i.x - d / 2 + c * n + l / 2, { y: f, height: p } = H(e, t, i, r);
542
- i.__barLabelX = s + u / 2, o.push(A("rect", {
543
- "data-cy": "datapoint-bar",
544
- x: s,
545
- y: f,
546
- width: u,
547
- height: p,
548
- rx: a,
549
- fill: K(e, t, n, Number(i.value)),
550
- ...$(e, t)
551
- }));
552
- });
553
- }), L("g", { "data-layer": "bars" }, o.join(""));
554
- }
555
- function Le(e, t) {
556
- let { config: n, drawingArea: r } = e, i = Y(n), a = t.filter((e) => e.type === "bar");
557
- if (!a.length) return "";
558
- if (Z(e)) return Ie(e, a, i);
559
- let o = Math.max(1, ...t.map((e) => M(e.plots).length)), s = r.width / o, c = k(I(n, "bar.periodGap", .2), .2), l = k(I(n, "bar.innerGap", .05), .05), u = I(n, "bar.borderRadius", 0), d = [];
560
- if (i) {
561
- let t = Math.max(1e-5, s * .9), n = t * Math.min(Math.abs(l), .95);
562
- return a.forEach((i, a) => {
563
- let o = Number.isFinite(Number(i.__zeroY)) ? Number(i.__zeroY) : U(e);
564
- M(i.plots).forEach((c, l) => {
565
- if (!c || c.value === null || c.value === void 0 || !Number.isFinite(Number(c.value)) || !Number.isFinite(Number(c.y))) return;
566
- let f = r.left + s * l + s * .05 + n / 2, { y: p, height: m } = H(e, i, c, o);
567
- c.__barLabelX = f + Math.max(1e-5, t - n) / 2, d.push(A("rect", {
568
- "data-cy": "datapoint-bar",
569
- x: f,
570
- y: p,
571
- width: Math.max(1e-5, t - n),
572
- height: m,
573
- rx: u,
574
- fill: K(e, i, a, Number(c.value)),
575
- ...$(e, i)
576
- }));
577
- });
578
- }), L("g", { "data-layer": "bars" }, d.join(""));
579
- }
580
- let f = s * (1 - c), p = f / Math.max(1, a.length), m = p * Math.min(Math.abs(l), .95);
581
- return U(e), a.forEach((t, n) => {
582
- let i = Number.isFinite(Number(t.__zeroY)) ? Number(t.__zeroY) : U(e);
583
- M(t.plots).forEach((a, o) => {
584
- if (!a || a.value === null || a.value === void 0 || !Number.isFinite(Number(a.value)) || !Number.isFinite(Number(a.y))) return;
585
- let c = r.left + s * o + (s - f) / 2 + p * n + m / 2, { y: l, height: h } = H(e, t, a, i);
586
- a.__barLabelX = c + Math.max(1e-5, p - m) / 2, d.push(A("rect", {
587
- "data-cy": "datapoint-bar",
588
- x: c,
589
- y: l,
590
- width: Math.max(1e-5, p - m),
591
- height: h,
592
- rx: u,
593
- fill: K(e, t, n, Number(a.value)),
594
- ...$(e, t)
595
- }));
596
- });
597
- }), L("g", { "data-layer": "bars" }, d.join(""));
598
- }
599
- function Re(e) {
600
- let { config: t, drawingArea: n, scale: r, series: i } = e;
601
- return V(t) || Y(t) ? i.flatMap((e) => M(e.__scaleYLabels)) : M(r.ticks).map((e) => {
602
- let t = (e - r.min) / (r.max - r.min || 1);
603
- return {
604
- value: e,
605
- y: n.bottom - t * n.height
606
- };
607
- });
608
- }
609
- function ze(e, t, n) {
610
- let { drawingArea: r } = e, i = r.width / Math.max(1, n);
611
- return r.left + i * t;
612
- }
613
- function Be(e, t) {
614
- let { config: n, drawingArea: r } = e, i = Math.max(1, ...t.map((e) => M(e.plots).length)), a = r.top, o = r.bottom;
615
- if (Z(e)) {
616
- let e = [...new Set(t.flatMap((e) => M(e.plots)).map((e) => Number(e.x)).filter(Number.isFinite))].sort((e, t) => e - t);
617
- return e.length ? I(n, "chart.grid.position", "middle") === "middle" ? e.map((e, t, n) => {
618
- if (t === 0) return null;
619
- let r = n[t - 1], i = r + (e - r) / 2;
620
- return `M${i},${a} L${i},${o}`;
621
- }).filter(Boolean).join(" ") : e.map((e) => `M${e},${a} L${e},${o}`).join(" ") : "";
622
- }
623
- let s = i + +(I(n, "chart.grid.position", "middle") === "middle");
624
- return Array.from({ length: s }).map((t, r) => {
625
- let s = I(n, "chart.grid.position", "middle") === "middle" ? ze(e, r, i) : Q(e, r, i);
626
- return `M${s},${a} L${s},${o}`;
627
- }).join(" ");
628
- }
629
- function Ve(e) {
630
- let { config: t, drawingArea: n, scale: r, series: i } = e, a = I(t, "chart.grid.show", !0), o = I(t, "chart.grid.showHorizontalLines", !0), s = I(t, "chart.grid.showVerticalLines", !1), c = I(t, "chart.grid.stroke", "#CCCCCC"), l = k(I(t, "chart.grid.strokeWidth", .5), .5), u = [];
631
- if (a && o && Re(e).forEach((e) => {
632
- Number.isFinite(Number(e.y)) && u.push(A("line", {
633
- "data-cy": "xy-grid-horizontal-line",
634
- x1: n.left,
635
- x2: n.right,
636
- y1: e.y,
637
- y2: e.y,
638
- stroke: c,
639
- "stroke-width": l,
640
- "stroke-linecap": "round"
641
- }));
642
- }), a && s) {
643
- let t = Be(e, i);
644
- t && u.push(A("path", {
645
- "data-cy": "xy-grid-vertical-line",
646
- d: t,
647
- stroke: c,
648
- "stroke-width": l,
649
- "stroke-linecap": "round"
650
- }));
651
- }
652
- u.push(A("line", {
653
- x1: n.left,
654
- y1: n.bottom,
655
- x2: n.right,
656
- y2: n.bottom,
657
- stroke: c,
658
- "stroke-width": l,
659
- "stroke-linecap": "round"
660
- }));
661
- let d = J(t) ? n.right : n.left;
662
- return u.push(A("line", {
663
- x1: d,
664
- y1: n.top,
665
- x2: d,
666
- y2: n.bottom,
667
- stroke: c,
668
- "stroke-width": l,
669
- "stroke-linecap": "round"
670
- })), r.min < 0 && r.max > 0 && u.push(A("line", {
671
- x1: n.left,
672
- y1: U(e),
673
- x2: n.right,
674
- y2: U(e),
675
- stroke: c,
676
- "stroke-width": l,
677
- "stroke-dasharray": 4,
678
- "stroke-linecap": "round"
679
- })), L("g", { "data-layer": "grid" }, u.join(""));
680
- }
681
- function He(e) {
682
- return e && typeof e == "object" && Number.isFinite(Number(e.x)) && Number.isFinite(Number(e.y));
683
- }
684
- function Z(e) {
685
- return e.isContinuous ? !0 : M(e.series).some((e) => M(e.series).some(He));
686
- }
687
- function Ue(e) {
688
- if (e.xScale && Number.isFinite(Number(e.xScale.min)) && Number.isFinite(Number(e.xScale.max))) return {
689
- min: Number(e.xScale.min),
690
- max: Number(e.xScale.max)
691
- };
692
- let t = M(e.series).flatMap((e) => M(e.series)).filter(He).map((e) => Number(e.x));
693
- if (!t.length) return {
694
- min: 0,
695
- max: 1
696
- };
697
- let n = Math.min(...t), r = Math.max(...t);
698
- return n === r ? {
699
- min: n - 1,
700
- max: r + 1
701
- } : {
702
- min: n,
703
- max: r
704
- };
705
- }
706
- function We(e, t) {
707
- let { drawingArea: n, config: r } = e, i = Ue(e), a = (Number(t) - i.min) / (i.max - i.min || 1), o = I(r, "chart.grid.labels.xAxis.reverse", !1) ? 1 - a : a;
708
- return n.left + n.width * o;
709
- }
710
- function Ge(e, t, n) {
711
- let { config: r } = e, i = m({
712
- v: t,
713
- p: I(r, "chart.labels.prefix", ""),
714
- s: I(r, "chart.labels.suffix", ""),
715
- r: I(r, "chart.grid.labels.xAxis.rounding", 0)
716
- });
717
- return b(I(r, "chart.grid.labels.xAxis.formatter", null), t, i, {
718
- datapoint: t,
719
- seriesIndex: null
720
- });
721
- }
722
- function Ke(e) {
723
- let { xScale: t, config: n } = e, r = M(t?.ticks);
724
- return (I(n, "chart.grid.labels.xAxis.reverse", !1) ? [...r].reverse() : r).map((t, n) => ({
725
- id: `continuous_x_label_${n}`,
726
- text: Ge(e, t, n),
727
- value: t,
728
- x: We(e, t),
729
- index: n,
730
- absoluteIndex: n
731
- }));
732
- }
733
- function Q(e, t, n) {
734
- let { drawingArea: r, config: i } = e, a = I(i, "chart.grid.position", "middle"), o = r.width, s = a === "middle" ? o / Math.max(1, n) : o / Math.max(1, n - 1);
735
- return a === "middle" ? r.left + s / 2 + s * t : r.left + s * t;
736
- }
737
- async function qe(e, t) {
738
- let { config: n } = e, r = Math.max(0, ...t.map((e) => M(e.plots).length));
739
- return await D({
740
- values: I(n, "chart.grid.labels.xAxisLabels.values", []),
741
- maxDatapoints: r,
742
- formatter: I(n, "chart.grid.labels.xAxisLabels.datetimeFormatter", null),
743
- start: k(e.slotStartIndex ?? e.startAbs, 0),
744
- end: k(e.slotEndIndex ?? e.endAbs, r)
745
- });
746
- }
747
- async function Je(e, t) {
748
- let { config: n } = e, r = I(n, "chart.grid.labels.xAxisLabels", {}), i = Math.max(0, ...t.map((e) => M(e.plots).length)), a = await qe(e, t), o = await D({
749
- values: I(n, "chart.grid.labels.xAxisLabels.values", []),
750
- maxDatapoints: i,
751
- formatter: I(n, "chart.grid.labels.xAxisLabels.datetimeFormatter", null),
752
- start: 0,
753
- end: i
754
- }), s = a.map((e) => e?.text ?? ""), c = o.map((e) => e?.text ?? ""), l = Math.min(k(r.modulo, 1), Math.max(1, new Set(s).size));
755
- return ee(!!r.showOnlyFirstAndLast, !!r.showOnlyAtModulo, Math.max(1, l || 1), s, c, k(e.slotStartIndex ?? e.startAbs, 0), e.selectedXIndex ?? null, i);
756
- }
757
- async function Ye(e, t) {
758
- return Z(e) ? Ke(e) : await Je(e, t);
759
- }
760
- function Xe(e, t, n, r) {
761
- return Z(e) ? t.x : Q(e, n, r);
762
- }
763
- function Ze(e) {
764
- return g(e.userConfig ?? e.sourceConfig ?? e.props?.config ?? {}, "chart.grid.labels.xAxisLabels.rotation") ? k(I(e.config, "chart.grid.labels.xAxisLabels.rotation", 0), 0) : I(e.config, "chart.grid.labels.xAxisLabels.autoRotate.enable", !1) ? k(I(e.config, "chart.grid.labels.xAxisLabels.autoRotate.angle", 0), 0) : k(I(e.config, "chart.grid.labels.xAxisLabels.rotation", 0), 0);
765
- }
766
- async function Qe(e, t) {
767
- let { config: n, drawingArea: r } = e;
768
- if (!t[0] || !I(n, "chart.grid.labels.xAxisLabels.show", !0)) return "";
769
- I(n, "chart.grid.labels.xAxisLabels", {});
770
- let i = k(I(n, "chart.grid.labels.xAxisLabels.fontSize", 12), 12), a = I(n, "chart.grid.labels.xAxisLabels.color", I(n, "chart.grid.labels.color", "#2A2A2A")), o = Ze(e), s = Math.max(1, t[0].plots.length), c = await Ye(e, t), l = o > 0 ? "start" : o < 0 ? "end" : "middle";
771
- return L("g", { "data-layer": "x-axis-labels" }, c.map((t, n) => {
772
- let c = typeof t == "string" ? t : t?.text;
773
- if (!c) return "";
774
- let u = `translate(${Xe(e, t, n, s)}, ${r.bottom + i * 1.5}), rotate(${o})`;
775
- return String(c).includes("\n") ? L("text", {
776
- class: "vue-data-ui-time-label",
777
- "data-cy": "time-label",
778
- "text-anchor": l,
779
- "font-size": i,
780
- fill: a,
781
- transform: u
782
- }, p({
783
- content: String(c),
784
- fontSize: i,
785
- fill: a,
786
- x: 0,
787
- y: 0
788
- })) : R(c, {
789
- class: "vue-data-ui-time-label",
790
- "data-cy": "time-label",
791
- "text-anchor": l,
792
- "font-size": i,
793
- fill: a,
794
- transform: u
795
- });
796
- }).join(""));
797
- }
798
- function $e(e) {
799
- let { config: t, drawingArea: n, height: r } = e, i = q(t), a = I(t, "chart.grid.labels.axis.xLabel", ""), o = I(t, "chart.grid.labels.axis.yLabel", ""), s = I(t, "chart.grid.labels.axis.color", I(t, "chart.grid.labels.color", "#2A2A2A")), c = k(I(t, "chart.grid.labels.axis.yLabelOffsetX", 0), 0), l = k(I(t, "chart.grid.labels.axis.xLabelOffsetY", 0), 0), u = k(I(t, "chart.grid.labels.yAxis.crosshairSize", 0), 0), d = k(I(t, "chart.grid.labels.yAxis.scaleValueOffsetX", 0), 0), f = k(I(t, "chart.grid.labels.yAxis.labelWidth", 0), 0), p = J(t), m = [];
800
- if (a && m.push(R(a, {
801
- x: n.left + n.width / 2,
802
- y: Math.min(r - 4, n.bottom + i.xAxis * 3 + l),
803
- "font-size": i.yAxis,
804
- "text-anchor": "middle",
805
- fill: s
806
- })), o) {
807
- let e = p ? n.right + u + d + 5 + f + c : n.scaleLabelX - u - d - f - c, t = n.top + n.height / 2;
808
- m.push(R(o, {
809
- x: e,
810
- y: t,
811
- transform: `rotate(-90 ${e} ${t})`,
812
- "font-size": i.yAxis,
813
- "text-anchor": "middle",
814
- fill: s
815
- }));
816
- }
817
- return L("g", { "data-layer": "axis-labels" }, m.join(""));
818
- }
819
- async function et(e, t) {
820
- let { config: n, drawingArea: r } = e, i = I(n, "chart.grid.labels.xAxisLabels.show", !0), a = I(n, "chart.grid.labels.xAxis.showCrosshairs", !1);
821
- if (!i || !a || !t[0]) return "";
822
- let o = k(I(n, "chart.grid.labels.xAxis.crosshairSize", 6), 6), s = !!I(n, "chart.grid.labels.xAxis.crosshairsAlwaysAtZero", !1), c = Math.max(1, t[0].plots.length), l = await Ye(e, t), u = U(e), d = l.map((t, n) => {
823
- if (!(typeof t == "string" ? t : t?.text)) return "";
824
- let i = Z(e) ? t.x : Q(e, n, c);
825
- return `M${i},${s ? u - (u === r.bottom ? 0 : o / 2) : r.bottom} L${i},${s ? u + o / (u === r.bottom ? 1 : 2) : r.bottom + o}`;
826
- }).filter(Boolean).join(" ");
827
- return d ? L("g", { "data-layer": "x-axis-ticks" }, A("path", {
828
- d,
829
- stroke: I(n, "chart.grid.stroke", "#CCCCCC"),
830
- "stroke-width": 1,
831
- "stroke-linecap": "round",
832
- "data-cy": "axis-x-tick"
833
- })) : "";
834
- }
835
- function tt(e, t) {
836
- let { config: n, width: r } = e, i = I(n, "chart.legend", {}), a = k(i.fontSize, 12), o = k(i.markerSize, 10), s = k(i.itemGap, 16), c = k(i.rowGap, 8), l = k(i.padding, 8), u = Math.max(1, r - l * 2), d = [], f = [], p = 0;
837
- return t.forEach((e) => {
838
- let t = String(e.name ?? ""), n = o + 6 + j(t, a) + s;
839
- f.length && p + n > u && (d.push({
840
- items: f,
841
- width: p
842
- }), f = [], p = 0), f.push({
843
- serie: e,
844
- label: t,
845
- itemWidth: n
846
- }), p += n;
847
- }), f.length && d.push({
848
- items: f,
849
- width: p
850
- }), {
851
- rows: d,
852
- fontSize: a,
853
- markerSize: o,
854
- itemGap: s,
855
- rowGap: c,
856
- padding: l,
857
- height: d.length * Math.max(o, a) + Math.max(0, d.length - 1) * c + l * 2
858
- };
859
- }
860
- function nt(e, t) {
861
- let { config: n, width: r, height: i } = e;
862
- if (!I(n, "chart.legend.show", !0) || !t.length) return "";
863
- let a = I(n, "chart.legend", {}), o = a.position || "bottom", s = a.color || I(n, "chart.color", "#2A2A2A"), c = tt(e, t), l = Math.max(c.markerSize, c.fontSize), u = o === "top" ? c.padding + l : i - c.height + c.padding + l, d = [];
864
- return c.rows.forEach((e, t) => {
865
- let n = Math.max(c.padding, r / 2 - e.width / 2), i = u + t * (l + c.rowGap);
866
- e.items.forEach(({ serie: e, label: t, itemWidth: r }) => {
867
- d.push(A("rect", {
868
- x: n,
869
- y: i - c.markerSize / 2,
870
- width: c.markerSize,
871
- height: c.markerSize,
872
- rx: 2,
873
- fill: e.color
874
- })), d.push(R(t, {
875
- x: n + c.markerSize + 6,
876
- y: i + 2,
877
- "font-size": c.fontSize,
878
- "dominant-baseline": "middle",
879
- fill: s
880
- })), n += r;
881
- });
882
- }), L("g", { "data-layer": "legend" }, d.join(""));
883
- }
884
- function rt(e, t) {
885
- return `areaGradient_${t}_${W()}`;
886
- }
887
- function it(e, n) {
888
- let { config: r } = e;
889
- if (!I(r, "line.area.useGradient", !1)) return "";
890
- let i = k(I(r, "line.area.opacity", 30), 30), a = n.filter((e) => e.type === "line" && e.useArea).map((n, r) => L("linearGradient", {
891
- id: rt(e, r),
892
- x1: "0%",
893
- x2: "0%",
894
- y1: "0%",
895
- y2: "100%"
896
- }, [A("stop", {
897
- offset: "0%",
898
- "stop-color": E(t(w(n.color), .03), i),
899
- "stop-opacity": 1
900
- }), A("stop", {
901
- offset: "100%",
902
- "stop-color": n.color,
903
- "stop-opacity": 0
904
- })].join(""))).join("");
905
- return a ? L("defs", {}, a) : "";
906
- }
907
- function at(e, t) {
908
- let { config: n } = e, r = !!I(n, "line.cutNullValues", !1), i = [];
909
- return t.filter((e) => e.type === "line" && e.useArea).forEach((t, n) => {
910
- let a = M(t.plots), o = a.filter((e) => e && e.value !== null);
911
- if (o.length < 2) return;
912
- let c = Number.isFinite(Number(t.__zeroY)) ? Number(t.__zeroY) : U(e), l = we(e, t, n);
913
- if (t.smooth && !t.useStepper) {
914
- s(r ? a : o, c, r).forEach((e) => {
915
- e && i.push(A("path", {
916
- d: e,
917
- fill: l,
918
- "data-cy": "datapoint-line-area-smooth"
919
- }));
920
- });
921
- return;
922
- }
923
- (t.useStepper ? T(r ? a : o, c) : r ? x(a, c) : u(o, c)).split(";").filter(Boolean).forEach((e) => {
924
- i.push(A("path", {
925
- d: `M${e}Z`,
926
- fill: l,
927
- "data-cy": "datapoint-line-area-straight"
928
- }));
929
- });
930
- }), L("g", { "data-layer": "line-areas" }, i.join(""));
931
- }
932
- function ot(e, t) {
933
- let n = k(t.slotStartIndex ?? t.startAbs, 0);
934
- return M(e.dashIndices).map((e) => Number(e) - n).filter(Number.isFinite);
935
- }
936
- function st(e, t, n, r, i) {
937
- let { config: a } = e, o = k(t.strokeWidth || I(a, "line.strokeWidth", 2), 2);
938
- return A("path", {
939
- d: `M${r}`,
940
- fill: "none",
941
- stroke: xe(e, t, n),
942
- "stroke-width": o,
943
- "stroke-linecap": "round",
944
- "stroke-linejoin": "round",
945
- "stroke-dasharray": i ? o * 2 : 0
946
- });
947
- }
948
- function ct(t, r) {
949
- let { config: o } = t, s = r.filter((e) => e.type === "line"), l = !!I(o, "line.cutNullValues", !1), u = [];
950
- return s.forEach((r, s) => {
951
- let d = l ? M(r.plots) : M(r.plots).filter((e) => e.value !== null), p = d.filter((e) => e.value !== null);
952
- if (!(p.length < 2)) {
953
- if (M(r.dashIndices).length > 0 && !r.useStepper) {
954
- let e = ot(r, t);
955
- (r.smooth || I(o, "line.smooth", !1) ? a(d, e) : i(d, e)).forEach((e) => {
956
- e?.path && u.push(st(t, r, s, e.path, !!e.dashed));
957
- });
958
- return;
959
- }
960
- (r.useStepper ? T(d).split(";").filter(Boolean) : [r.smooth || I(o, "line.smooth", !1) ? l ? n(d) : c(p) : l ? f(d) : e(p, !1, !0)]).forEach((e) => {
961
- e && u.push(st(t, r, s, e, !!r.dashed));
962
- });
963
- }
964
- }), L("g", { "data-layer": "lines" }, u.join(""));
965
- }
966
- function lt(e, t, n) {
967
- let { config: r } = e;
968
- return I(r, "plot.useGradient", !1) ? `url(#${Se(e, n)})` : I(r, "plot.dot.useSerieColor", !0) ? t.color : I(r, "plot.dot.fill", t.color);
969
- }
970
- function $(e, t) {
971
- let n = I(e.config, "bar.border", {});
972
- return {
973
- stroke: n.useSerieColor ? t.color : n.stroke,
974
- "stroke-width": k(n.strokeWidth, 0)
975
- };
976
- }
977
- function ut(e, t) {
978
- let { config: n } = e, r = t.filter((e) => e.type === "plot"), i = I(n, "plot.radius", 4), a = I(n, "plot.dot.strokeWidth", 2), o = I(n, "chart.backgroundColor", "#FFFFFF"), s = [];
979
- return r.forEach((t, r) => {
980
- t.plots.forEach((c, l) => {
981
- F(c.value) && s.push(N({
982
- dataCy: `xy-plot-${r}-${l}`,
983
- shape: t.shape,
984
- plot: c,
985
- radius: t.radius || i,
986
- fill: lt(e, t, r),
987
- stroke: I(n, "plot.dot.useSerieColor", !0) ? o : t.color,
988
- strokeWidth: a
989
- }));
990
- });
991
- }), L("g", { "data-layer": "plots" }, s.join(""));
992
- }
993
- function dt(e) {
994
- return ![
995
- null,
996
- void 0,
997
- NaN,
998
- Infinity,
999
- -Infinity
1000
- ].includes(e);
1001
- }
1002
- function ft(e, t, n) {
1003
- let r = e[t - 1], i = e[t + 1], a = !!r && !!i && r.value == null && i.value == null || !r && !!i && i.value == null || !!r && !i && r.value == null;
1004
- return dt(e[t]?.value) && a && !!I(n, "line.cutNullValues", !1);
1005
- }
1006
- function pt(e, t, n, r, i) {
1007
- let { config: a } = e;
1008
- if (!n || !dt(n.value)) return !1;
1009
- if (!(i > k(I(a, "line.dot.hideAboveMaxSerieLength", Infinity), Infinity))) return !0;
1010
- let o = e.selectedSerieIndex ?? null, s = e.selectedMinimapIndex ?? null;
1011
- return o !== null && o === r || s !== null && s === r || ft(t.plots, r, a);
1012
- }
1013
- function mt(e, t) {
1014
- let { config: n } = e, r = t.filter((e) => e.type === "line"), i = Math.max(0, ...r.map((e) => M(e.plots).length)), a = I(n, "line.radius", 4), o = I(n, "line.dot.strokeWidth", 2), s = I(n, "chart.backgroundColor", "#FFFFFF"), c = [];
1015
- return r.forEach((t, r) => {
1016
- t.plots.forEach((l, u) => {
1017
- pt(e, t, l, u, i) && c.push(N({
1018
- dataCy: "datapoint-line-plot",
1019
- shape: t.shape,
1020
- plot: l,
1021
- radius: t.radius || a,
1022
- fill: Ce(e, t, r),
1023
- stroke: I(n, "line.dot.useSerieColor", !0) ? s : t.color,
1024
- strokeWidth: o
1025
- }));
1026
- });
1027
- }), L("g", { "data-layer": "line-dots" }, c.join(""));
1028
- }
1029
- function ht(e, t) {
1030
- let { config: n } = e;
1031
- if (Y(n)) return "";
1032
- let r = I(n, "line.interLine", {}), i = M(r.pairs), a = M(r.colors);
1033
- if (!i.length) return "";
1034
- let o = t.filter((e) => e.type === "line"), s = k(r.fillOpacity, .2), c = !!I(n, "line.cutNullValues", !1), l = [];
1035
- return i.forEach((e, t) => {
1036
- let [n, r] = Array.isArray(e) ? e : [e?.a, e?.b];
1037
- if (!n || !r) return;
1038
- let i = o.find((e) => e.name === n), u = o.find((e) => e.name === r);
1039
- if (!i || !u) return;
1040
- let d = a?.[t]?.[0] ?? i.color, f = a?.[t]?.[1] ?? u.color;
1041
- v({
1042
- lineA: M(i.plots),
1043
- lineB: M(u.plots),
1044
- smoothA: !!i.smooth,
1045
- smoothB: !!u.smooth,
1046
- colorLineA: d,
1047
- colorLineB: f,
1048
- sampleStepPx: 2,
1049
- cutNullValues: c
1050
- }).forEach((e, i) => {
1051
- l.push(A("path", {
1052
- "data-cy": "interline-area",
1053
- d: e.d,
1054
- fill: e.color,
1055
- "fill-opacity": s,
1056
- stroke: "none",
1057
- "pointer-events": "none",
1058
- "data-key": `inter_${n}_${r}_${t}_${i}`
1059
- }));
1060
- });
1061
- }), l.length ? L("g", { "data-layer": "interline-areas" }, l.join("")) : "";
1062
- }
1063
- function gt(e) {
1064
- let t = I(e, "chart.title", {}), n = I(t, "subtitle", {});
1065
- if (!t.show) return 0;
1066
- let r = k(t.fontSize, 20), i = n.text ? k(n.fontSize, 14) : 0, a = k(t.paddingTop, 12), o = k(t.paddingBottom, 6);
1067
- return a + r + (n.text ? i + 4 : 0) + o;
1068
- }
1069
- function _t(e) {
1070
- let { config: t, width: n } = e, r = I(t, "chart.title", {}), i = I(r, "subtitle", {});
1071
- if (!r.show || !r.text) return "";
1072
- let a = r.textAlign || "center", o = a === "left" ? k(r.paddingLeft, 12) : a === "right" ? n - k(r.paddingRight, 12) : n / 2, s = a === "left" ? "start" : a === "right" ? "end" : "middle", c = k(r.fontSize, 20), l = k(i.fontSize, 14), u = k(r.paddingTop, 12) + c, d = [R(r.text, {
1073
- "data-cy": "xy-div-title",
1074
- x: o,
1075
- y: u,
1076
- "font-size": c,
1077
- "font-weight": r.bold ? "700" : "400",
1078
- "text-anchor": s,
1079
- fill: r.color || I(t, "chart.color", "#2A2A2A")
1080
- })];
1081
- return i.text && d.push(R(i.text, {
1082
- "data-cy": "xy-div-subtitle",
1083
- x: o,
1084
- y: u + l + 4,
1085
- "font-size": l,
1086
- "font-weight": i.bold ? "700" : "400",
1087
- "text-anchor": s,
1088
- fill: i.color || r.color || I(t, "chart.color", "#2A2A2A")
1089
- })), L("g", { "data-layer": "title" }, d.join(""));
1090
- }
1091
- function vt(e) {
1092
- return e.svgTitle ? L("desc", { "aria-hidden": "true" }, [e.svgTitle].join("")) : "";
1093
- }
1094
- function yt(e, t, n, r, i) {
1095
- return !n || n.value === null || n.value === void 0 || !Number.isFinite(Number(n.value)) || !I(e.config, "dataLabels.show", !0) || !I(e.config, `${i}.labels.show`, !1) ? !1 : !Object.hasOwn(t, "dataLabels") || t.dataLabels === !0 || e.selectedSerieIndex === r || e.selectedMinimapIndex === r;
1096
- }
1097
- function bt(e, t, n, r) {
1098
- let { config: i } = e, a = k(I(i, `${r}.labels.fontSize`, I(i, "chart.labels.fontSize", 12)), 12), o = I(i, `${r}.labels.color`, I(i, "chart.color", "#2A2A2A")), s = m({
1099
- p: t.prefix || I(i, "chart.labels.prefix", ""),
1100
- v: n.value,
1101
- s: t.suffix || I(i, "chart.labels.suffix", ""),
1102
- r: I(i, `${r}.labels.rounding`, 0)
1103
- });
1104
- return p({
1105
- content: Z(e) && Number.isFinite(Number(n.x)) ? `x: ${m({
1106
- v: n.x,
1107
- r: I(i, "chart.grid.labels.xAxis.rounding", 0)
1108
- })}\ny: ${s}` : b(I(i, `${r}.labels.formatter`, null), n.value, s, {
1109
- datapoint: n,
1110
- serie: t
1111
- }),
1112
- fontSize: a,
1113
- fill: o,
1114
- x: 0,
1115
- y: 0
1116
- });
1117
- }
1118
- function xt(e, t, n) {
1119
- let r = I(e.config, `${n}.labels.textAnchor`, null);
1120
- return r === null ? k(I(e.config, `${n}.labels.rotation`, 0), 0) === 0 ? "middle" : I(e.config, `${n}.labels.alwaysOnTop`, !1) || t.value >= 0 ? "start" : "end" : r;
1121
- }
1122
- function St(e, t, n) {
1123
- let r = k(I(e.config, `${n}.labels.offsetX`, 0), 0), i = k(I(e.config, `${n}.labels.offsetY`, -12), -12), a = k(I(e.config, `${n}.labels.rotation`, 0), 0), o = !!I(e.config, `${n}.labels.alwaysOnTop`, !1);
1124
- return `translate(${t.x + r}, ${t.y + (o || t.value >= 0 ? i : -i * 3)}) rotate(${a})`;
1125
- }
1126
- function Ct(e, t, n) {
1127
- let r = k(I(e.config, "bar.labels.offsetX", 0), 0), i = k(I(e.config, "bar.labels.offsetY", -6), -6), a = k(I(e.config, "bar.labels.rotation", 0), 0), o = !!I(e.config, "bar.labels.alwaysOnTop", !1), s = Number.isFinite(Number(t.__zeroY)) ? Number(t.__zeroY) : U(e), c = Math.abs(s - n.y), l = n.__barLabelX ?? n.x, u = n.y + (o ? i - (n.value < 0 ? c : 0) : n.value >= 0 ? i : -i * 3);
1128
- return `translate(${l + r}, ${u}) rotate(${a})`;
1129
- }
1130
- function wt(e, t) {
1131
- let { config: n } = e, r = k(I(n, "chart.labels.fontSize", 12), 12), i = I(n, "chart.backgroundColor", "#FFFFFF"), a = [];
1132
- return t.forEach((t) => {
1133
- M(t.plots).forEach((o, s) => {
1134
- let c = t.type;
1135
- [
1136
- "line",
1137
- "bar",
1138
- "plot"
1139
- ].includes(c) && yt(e, t, o, s, c) && a.push(L("text", {
1140
- "data-cy": `datapoint-${c}-label`,
1141
- transform: c === "bar" ? Ct(e, t, o) : St(e, o, c),
1142
- "text-anchor": xt(e, o, c),
1143
- "font-size": I(n, `${c}.labels.fontSize`, r),
1144
- fill: I(n, `${c}.labels.color`, I(n, "chart.color", "#2A2A2A")),
1145
- stroke: i,
1146
- "paint-order": "stroke"
1147
- }, bt(e, t, o, c)));
1148
- });
1149
- }), L("g", { "data-layer": "datapoint-labels" }, a.join(""));
1150
- }
1151
- function Tt(e) {
1152
- return k(e.slotStartIndex ?? e.startAbs, 0);
1153
- }
1154
- function Et(e, t) {
1155
- let n = Math.max(0, ...t.map((e) => M(e.plots).length));
1156
- return k(e.slotEndIndex ?? e.endAbs, n);
1157
- }
1158
- function Dt(e, t) {
1159
- let { drawingArea: n, config: r } = e;
1160
- return I(r, "chart.grid.position", "middle") === "middle" ? n.width / Math.max(1, t) : n.width / Math.max(1, t - 1);
1161
- }
1162
- function Ot(e, t, n) {
1163
- let { drawingArea: r, config: i } = e, a = Dt(e, n);
1164
- return I(i, "chart.grid.position", "middle") === "middle" ? r.left + a * t : r.left + a * t - a / 2;
1165
- }
1166
- function kt(e, t) {
1167
- return Dt(e, t);
1168
- }
1169
- function At(e, t, n, r, i, a) {
1170
- let { drawingArea: o } = e, s = t.caption ?? {};
1171
- if (!s.text) return "";
1172
- let c = kt(e, a) * i, l = s.width === "auto" ? c : k(s.width, c), u = Ot(e, r, a) - (s.width === "auto" ? 0 : l / 2 - c / 2), d = o.top + k(s.offsetY, 0);
1173
- return L("foreignObject", {
1174
- "data-key": `highlight_area_caption_${n}`,
1175
- x: u,
1176
- y: d,
1177
- width: l,
1178
- height: 1,
1179
- overflow: "visible"
1180
- }, L("div", {
1181
- xmlns: "http://www.w3.org/1999/xhtml",
1182
- "data-cy": "highlight-area-caption",
1183
- style: [
1184
- `padding:${k(s.padding, 0)}px`,
1185
- `text-align:${s.textAlign || "center"}`,
1186
- `font-size:${k(s.fontSize, 12)}px`,
1187
- `color:${s.color || "#2A2A2A"}`,
1188
- `font-weight:${s.bold ? "bold" : "normal"}`
1189
- ].join(";")
1190
- }, te(s.text)));
1191
- }
1192
- function jt(e, t) {
1193
- let { config: n, drawingArea: r } = e, i = M(I(n, "chart.highlightArea", []));
1194
- if (!i.length) return "";
1195
- let a = Math.max(1, ...t.map((e) => M(e.plots).length)), o = Tt(e), s = Et(e, t), c = [];
1196
- return i.forEach((t, n) => {
1197
- if (!t?.show) return;
1198
- let i = k(t.from, 0), l = Math.min(k(t.to, i), a - 1);
1199
- if (l < i) return;
1200
- for (let u = i; u <= l; u += 1) {
1201
- if (u < o || u > s - 1) continue;
1202
- let i = u - o;
1203
- c.push(A("rect", {
1204
- "data-cy": "highlight-area",
1205
- "data-key": `highlight_area_${n}_${u}`,
1206
- x: Ot(e, i, a),
1207
- y: r.top,
1208
- width: kt(e, a),
1209
- height: Math.max(1, r.height),
1210
- fill: E(t.color, k(t.opacity, 20)),
1211
- "pointer-events": "none"
1212
- }));
1213
- }
1214
- let u = Math.max(i, o);
1215
- u <= Math.min(l, s - 1) && c.push(At(e, t, n, u - o, l - i + 1, a));
1216
- }), c.length ? L("g", { "data-layer": "highlight-areas" }, c.join("")) : "";
1217
- }
1218
- function Mt(e, t) {
1219
- if (t == null) return null;
1220
- let { drawingArea: n, scale: r } = e, i = U(e), a = r.max - r.min || 1;
1221
- return i - (Number(t) - 0) / a * n.height;
1222
- }
1223
- function Nt(e) {
1224
- return j(e.text, k(e.fontSize, 12));
1225
- }
1226
- function Pt(e, t, n) {
1227
- let r = k(e.fontSize, 12), i = e.padding ?? {}, a = e.border ?? {}, o = Nt(e), s = r, c;
1228
- return c = e.textAnchor === "middle" ? t - o / 2 - k(i.left, 0) : e.textAnchor === "end" ? t - o - k(i.right, 0) : t - k(i.left, 0), {
1229
- x: c,
1230
- y: n - s * .75 - k(i.top, 0),
1231
- width: o + k(i.left, 0) + k(i.right, 0),
1232
- height: s + k(i.top, 0) + k(i.bottom, 0),
1233
- fill: e.backgroundColor,
1234
- stroke: a.stroke,
1235
- rx: a.rx,
1236
- ry: a.ry,
1237
- "stroke-width": a.strokeWidth
1238
- };
1239
- }
1240
- function Ft(e) {
1241
- let { config: t, drawingArea: n } = e;
1242
- if (Y(t)) return "";
1243
- let r = M(I(t, "chart.annotations", [])).filter((e) => e?.show && (e.yAxis?.yTop !== null || e.yAxis?.yBottom !== null) && (e.yAxis?.yTop !== void 0 || e.yAxis?.yBottom !== void 0));
1244
- if (!r.length) return "";
1245
- let i = [];
1246
- return r.forEach((t, r) => {
1247
- let a = t.yAxis ?? {}, o = a.label ?? {}, s = a.line ?? {}, c = a.area ?? {}, l = a.yTop, u = a.yBottom, d = l != null && u != null && l !== u, f = Mt(e, l), p = Mt(e, u), m = Number.isFinite(f), h = Number.isFinite(p);
1248
- if (!m && !h) return;
1249
- let g = [];
1250
- if (m && g.push(A("line", {
1251
- x1: n.left,
1252
- y1: f,
1253
- x2: n.right,
1254
- y2: f,
1255
- stroke: s.stroke,
1256
- "stroke-width": s.strokeWidth,
1257
- "stroke-dasharray": s.strokeDasharray,
1258
- "stroke-linecap": "round",
1259
- "data-cy": "xy-annotation-y-top-line"
1260
- })), h && g.push(A("line", {
1261
- x1: n.left,
1262
- y1: p,
1263
- x2: n.right,
1264
- y2: p,
1265
- stroke: s.stroke,
1266
- "stroke-width": s.strokeWidth,
1267
- "stroke-dasharray": s.strokeDasharray,
1268
- "stroke-linecap": "round",
1269
- "data-cy": "xy-annotation-y-bottom-line"
1270
- })), d && m && h && g.push(A("rect", {
1271
- x: n.left,
1272
- y: Math.min(f, p),
1273
- width: n.width,
1274
- height: Math.abs(f - p),
1275
- fill: E(c.fill, k(c.opacity, 20)),
1276
- "data-cy": "xy-annotation-y-area",
1277
- "pointer-events": "none"
1278
- })), o.text) {
1279
- let e = o.padding ?? {}, t = m && h ? Math.min(f, p) : m ? f : p, r = (o.position === "start" ? n.left + k(e.left, 0) : n.right - k(e.right, 0)) + k(o.offsetX, 0), i = t - k(o.fontSize, 12) / 3 + k(o.offsetY, 0) - k(e.top, 0), a = Pt(o, r, i);
1280
- Number.isFinite(a.y) && Number.isFinite(i) && (g.push(A("rect", {
1281
- class: "vue-ui-xy-annotation-label-box",
1282
- ...a,
1283
- "data-cy": "xy-annotation-label-box"
1284
- })), g.push(R(o.text, {
1285
- class: "vue-ui-xy-annotation-label",
1286
- x: r,
1287
- y: i,
1288
- "font-size": o.fontSize,
1289
- fill: o.color,
1290
- "text-anchor": o.textAnchor,
1291
- "data-cy": "xy-annotation-label"
1292
- })));
1293
- }
1294
- i.push(L("g", {
1295
- "data-layer": "annotation",
1296
- "data-key": `annotation_y_${r}`
1297
- }, g.join("")));
1298
- }), i.length ? L("g", { "data-layer": "annotations" }, i.join("")) : "";
1299
- }
1300
- function It(e, t) {
1301
- let n = e.additionalSvgContent;
1302
- return typeof n == "function" ? n({
1303
- width: e.width,
1304
- height: e.height,
1305
- drawingArea: e.drawingArea,
1306
- scale: e.scale,
1307
- config: e.config,
1308
- series: t.map((e) => ({
1309
- ...e,
1310
- plots: M(e.plots).map((e) => ({ ...e }))
1311
- }))
1312
- }) ?? "" : n ?? "";
1313
- }
1314
- async function Lt(e) {
1315
- let t = e.config, n = k(e.width, t.chart.width ?? 1e3), r = k(e.height, t.chart.height ?? 600), i = _e({
1316
- ...e,
1317
- config: t,
1318
- width: n,
1319
- height: r
1320
- }), a = je({
1321
- ...e,
1322
- config: t,
1323
- width: n,
1324
- height: r,
1325
- scale: fe(t, e.scale, i)
1326
- }, i), o = a.series;
1327
- return `
1328
- <svg
1329
- xmlns="${C}"
1330
- width="100%"
1331
- viewBox="0 0 ${n} ${r}"
1332
- role="img"
1333
- >
1334
- ${P()}
1335
- ${vt(a)}
1336
- ${it(a, o)}
1337
- ${Te(a, o)}
1338
- ${Ee(a)}
1339
- ${_t(a)}
1340
- ${jt(a, o)}
1341
- ${Ve(a)}
1342
- ${await et(a, o)}
1343
- ${Me(a)}
1344
- ${$e(a)}
1345
- ${await Qe(a, o)}
1346
- ${Le(a, o)}
1347
- ${ht(a, o)}
1348
- ${at(a, o)}
1349
- ${ct(a, o)}
1350
- ${ut(a, o)}
1351
- ${mt(a, o)}
1352
- ${wt(a, o)}
1353
- ${nt(a, o)}
1354
- ${Ft(a)}
1355
- ${It(a, o)}
1356
- </svg>`.trim();
1357
- }
1358
- //#endregion
1359
- //#region src/svg/vue-ui-xy/index.js
1360
- async function Rt(e = {}) {
1361
- return await Lt(ce(e));
1362
- }
1363
- //#endregion
1364
- export { Rt as t };