vue-data-ui 3.25.5 → 3.25.7

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 (210) hide show
  1. package/dist/{BaseDraggableDialog-BM_R41j8.js → BaseDraggableDialog-Gm4Q30j0.js} +1 -1
  2. package/dist/{BaseIcon-t83PDe9k.js → BaseIcon-D8R6_sKH.js} +5 -5
  3. package/dist/{BaseLegendToggle-__JnV08B.js → BaseLegendToggle-CXQrLjd-.js} +1 -1
  4. package/dist/{BaseZoomControls-Xo16vFa4.js → BaseZoomControls-BTzjVDPM.js} +1 -1
  5. package/dist/{ColorPicker-Bn3MY7eL.js → ColorPicker-CUy15T72.js} +1 -1
  6. package/dist/{DataTable-COIO9gi4.js → DataTable-oiM9uWrQ.js} +1 -1
  7. package/dist/{HillActions-Cl-dNBZR.js → HillActions-Dn8aKOVJ.js} +1 -1
  8. package/dist/{NonSvgPenAndPaper-KXRhcsxM.js → NonSvgPenAndPaper-DFXjpRyl.js} +2 -2
  9. package/dist/{PackageVersion-M2Ws-VwJ.js → PackageVersion-UfoQuPMf.js} +1 -1
  10. package/dist/{PenAndPaper-BgH3m_LP.js → PenAndPaper-KFzKlvbi.js} +2 -2
  11. package/dist/{SlicerPreview-GvsdvE-h.js → SlicerPreview-B6iHOC9L.js} +1 -1
  12. package/dist/{UserOptions-f3Q0nqrj.js → UserOptions-2x4VklMW.js} +1 -1
  13. package/dist/components/vue-ui-3d-bar.js +1 -1
  14. package/dist/components/vue-ui-accordion.js +1 -1
  15. package/dist/components/vue-ui-age-pyramid.js +1 -1
  16. package/dist/components/vue-ui-annotator.js +1 -1
  17. package/dist/components/vue-ui-bullet.js +1 -1
  18. package/dist/components/vue-ui-bump.js +1 -1
  19. package/dist/components/vue-ui-candlestick.js +1 -1
  20. package/dist/components/vue-ui-carousel-table.js +1 -1
  21. package/dist/components/vue-ui-chestnut.js +1 -1
  22. package/dist/components/vue-ui-chord.js +1 -1
  23. package/dist/components/vue-ui-circle-pack.js +1 -1
  24. package/dist/components/vue-ui-cursor.js +1 -1
  25. package/dist/components/vue-ui-dag.js +1 -1
  26. package/dist/components/vue-ui-dashboard.js +1 -1
  27. package/dist/components/vue-ui-digits.js +1 -1
  28. package/dist/components/vue-ui-donut-evolution.js +1 -1
  29. package/dist/components/vue-ui-donut.js +1 -1
  30. package/dist/components/vue-ui-dumbbell.js +1 -1
  31. package/dist/components/vue-ui-flow.js +1 -1
  32. package/dist/components/vue-ui-funnel.js +1 -1
  33. package/dist/components/vue-ui-galaxy.js +1 -1
  34. package/dist/components/vue-ui-gauge.js +1 -1
  35. package/dist/components/vue-ui-geo.js +1 -1
  36. package/dist/components/vue-ui-gizmo.js +1 -1
  37. package/dist/components/vue-ui-heatmap.js +1 -1
  38. package/dist/components/vue-ui-hill.js +1 -1
  39. package/dist/components/vue-ui-history-plot.js +1 -1
  40. package/dist/components/vue-ui-horizontal-bar.js +1 -1
  41. package/dist/components/vue-ui-icon.js +1 -1
  42. package/dist/components/vue-ui-kpi.js +1 -1
  43. package/dist/components/vue-ui-label.js +1 -1
  44. package/dist/components/vue-ui-mini-loader.js +1 -1
  45. package/dist/components/vue-ui-molecule.js +1 -1
  46. package/dist/components/vue-ui-mood-radar.js +1 -1
  47. package/dist/components/vue-ui-nested-donuts.js +1 -1
  48. package/dist/components/vue-ui-onion.js +1 -1
  49. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  50. package/dist/components/vue-ui-quadrant.js +1 -1
  51. package/dist/components/vue-ui-quick-chart.js +1 -1
  52. package/dist/components/vue-ui-radar.js +1 -1
  53. package/dist/components/vue-ui-rating.js +1 -1
  54. package/dist/components/vue-ui-relation-circle.js +1 -1
  55. package/dist/components/vue-ui-ridgeline.js +1 -1
  56. package/dist/components/vue-ui-rings.js +1 -1
  57. package/dist/components/vue-ui-scatter.js +1 -1
  58. package/dist/components/vue-ui-skeleton.js +1 -1
  59. package/dist/components/vue-ui-smiley.js +1 -1
  60. package/dist/components/vue-ui-spark-trend.js +1 -1
  61. package/dist/components/vue-ui-sparkbar.js +1 -1
  62. package/dist/components/vue-ui-sparkgauge.js +1 -1
  63. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  64. package/dist/components/vue-ui-sparkline.js +1 -1
  65. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  66. package/dist/components/vue-ui-stackbar.js +1 -1
  67. package/dist/components/vue-ui-stackline.js +1 -1
  68. package/dist/components/vue-ui-strip-plot.js +1 -1
  69. package/dist/components/vue-ui-table-heatmap.js +1 -1
  70. package/dist/components/vue-ui-table-sparkline.js +1 -1
  71. package/dist/components/vue-ui-table.js +1 -1
  72. package/dist/components/vue-ui-thermometer.js +1 -1
  73. package/dist/components/vue-ui-timer.js +1 -1
  74. package/dist/components/vue-ui-tiremarks.js +1 -1
  75. package/dist/components/vue-ui-treemap.js +1 -1
  76. package/dist/components/vue-ui-vertical-bar.js +1 -1
  77. package/dist/components/vue-ui-waffle.js +1 -1
  78. package/dist/components/vue-ui-wheel.js +1 -1
  79. package/dist/components/vue-ui-word-cloud.js +1 -1
  80. package/dist/components/vue-ui-world.js +1 -1
  81. package/dist/components/vue-ui-xy-canvas.js +1 -1
  82. package/dist/components/vue-ui-xy.js +1 -1
  83. package/dist/{package-ta2JoIjx.js → package-B-3S5q00.js} +1 -1
  84. package/dist/{render-common-bvOuxfN3.js → render-common-CAXK7ycr.js} +1 -1
  85. package/dist/ssr/vue-ui-donut.js +1 -1
  86. package/dist/ssr/vue-ui-xy.js +1 -1
  87. package/dist/ssr.js +2 -2
  88. package/dist/style.css +1 -1
  89. package/dist/types/vue-data-ui.d.ts +10 -0
  90. package/dist/{useConfig-C_mX5pOZ.js → useConfig-CIQZ6_r7.js} +11 -1
  91. package/dist/{useObjectBindings-uXpBcVyo.js → useObjectBindings---mHNfbS.js} +2 -2
  92. package/dist/utils.js +1 -1
  93. package/dist/{vue-data-ui-BjdCpsRV.js → vue-data-ui-DlWT702n.js} +70 -70
  94. package/dist/vue-data-ui.js +71 -71
  95. package/dist/vue-ui-3d-bar-DbOk2kpM.js +1831 -0
  96. package/dist/{vue-ui-accordion-DRf3NQyH.js → vue-ui-accordion-BSmBUjwZ.js} +2 -2
  97. package/dist/vue-ui-age-pyramid-C7_mGIRk.js +1293 -0
  98. package/dist/{vue-ui-annotator-DZ0O8Xa5.js → vue-ui-annotator-CTQHAPho.js} +676 -676
  99. package/dist/vue-ui-bullet-CDy_dkYz.js +702 -0
  100. package/dist/{vue-ui-bump-DoHnD1Xy.js → vue-ui-bump-DP24leiD.js} +380 -380
  101. package/dist/vue-ui-candlestick-kJLmYaR7.js +1859 -0
  102. package/dist/{vue-ui-carousel-table-k1cBJ1i1.js → vue-ui-carousel-table-BQzAQDw6.js} +2 -2
  103. package/dist/vue-ui-chestnut-DnnRp3Kl.js +2016 -0
  104. package/dist/vue-ui-chord-DO15ZDCS.js +1347 -0
  105. package/dist/vue-ui-circle-pack-DYTllMPV.js +1635 -0
  106. package/dist/{vue-ui-cursor-CQWLyEx0.js → vue-ui-cursor-CtViSjNp.js} +2 -2
  107. package/dist/{vue-ui-dag-BqlsutMj.js → vue-ui-dag-NXtGYzqg.js} +792 -792
  108. package/dist/{vue-ui-dashboard-Be3MmkgS.js → vue-ui-dashboard-D3_4QohV.js} +67 -67
  109. package/dist/{vue-ui-digits-BqdfbcKX.js → vue-ui-digits-CB09pLQx.js} +2 -2
  110. package/dist/vue-ui-donut-evolution-DhrtxvAd.js +1552 -0
  111. package/dist/{vue-ui-donut-gzGZ42uH.js → vue-ui-donut-eysaEyTy.js} +2 -2
  112. package/dist/vue-ui-donut-yTE6D8yV.js +2415 -0
  113. package/dist/vue-ui-dumbbell-CmGIeULQ.js +1533 -0
  114. package/dist/vue-ui-flow-qYAq3Rmn.js +1217 -0
  115. package/dist/vue-ui-funnel-CLAii4wi.js +749 -0
  116. package/dist/vue-ui-galaxy-BVX-o2f-.js +1085 -0
  117. package/dist/vue-ui-gauge-D76-4Z_0.js +934 -0
  118. package/dist/{vue-ui-geo-Ca8kPYr-.js → vue-ui-geo-BQ7-UnuG.js} +429 -429
  119. package/dist/{vue-ui-gizmo-wUqHJICb.js → vue-ui-gizmo-C47zjcs-.js} +2 -2
  120. package/dist/vue-ui-heatmap-XJef60IZ.js +1558 -0
  121. package/dist/{vue-ui-hill-D6Y9Xy2K.js → vue-ui-hill-D5BYGPXB.js} +470 -470
  122. package/dist/vue-ui-history-plot-D-d-1ZiM.js +1698 -0
  123. package/dist/{vue-ui-horizontal-bar-3on3-H3B.js → vue-ui-horizontal-bar-BgFHi6_7.js} +511 -511
  124. package/dist/{vue-ui-kpi-CUpRRIUf.js → vue-ui-kpi-Cb8QJeaj.js} +2 -2
  125. package/dist/{vue-ui-label-DR2qUZOG.js → vue-ui-label-ClMQ5Gez.js} +1 -1
  126. package/dist/{vue-ui-mini-loader-D8W-fERs.js → vue-ui-mini-loader-DtPOVIkK.js} +1 -1
  127. package/dist/vue-ui-molecule-BzwMl-in.js +929 -0
  128. package/dist/{vue-ui-mood-radar-TW251icr.js → vue-ui-mood-radar-BUR_YCcr.js} +376 -376
  129. package/dist/vue-ui-nested-donuts-BEB4nfsD.js +1503 -0
  130. package/dist/vue-ui-onion-CG6myK7a.js +1235 -0
  131. package/dist/{vue-ui-parallel-coordinate-plot-RM25bxtf.js → vue-ui-parallel-coordinate-plot-CSO4johj.js} +407 -407
  132. package/dist/vue-ui-quadrant-CKav0I6g.js +1967 -0
  133. package/dist/{vue-ui-quick-chart-Cswm3_eI.js → vue-ui-quick-chart-BAQNS9_2.js} +4 -4
  134. package/dist/vue-ui-radar-ClPAgf5I.js +1374 -0
  135. package/dist/vue-ui-rating-CWFMoYpE.js +359 -0
  136. package/dist/vue-ui-relation-circle-Da2MhrVe.js +905 -0
  137. package/dist/vue-ui-ridgeline-D7gFs8yR.js +1630 -0
  138. package/dist/vue-ui-rings-DkDJ0k5b.js +1252 -0
  139. package/dist/vue-ui-scatter-yv4JzJID.js +2405 -0
  140. package/dist/{vue-ui-skeleton-D_u8EWeW.js → vue-ui-skeleton-oFnh5zWs.js} +698 -698
  141. package/dist/vue-ui-smiley-DJVusLnp.js +376 -0
  142. package/dist/vue-ui-spark-trend-IqZWPvSB.js +457 -0
  143. package/dist/vue-ui-sparkbar-_FW47iYj.js +401 -0
  144. package/dist/vue-ui-sparkgauge--2vk2Y23.js +268 -0
  145. package/dist/vue-ui-sparkhistogram-CFEIPa5n.js +589 -0
  146. package/dist/{vue-ui-sparkline-9qkNNZG6.js → vue-ui-sparkline-Cs9CJR6W.js} +511 -511
  147. package/dist/vue-ui-sparkstackbar-Cvbue77A.js +738 -0
  148. package/dist/vue-ui-stackbar-C5ANS2hd.js +2355 -0
  149. package/dist/vue-ui-stackline-7yajJFW4.js +2469 -0
  150. package/dist/vue-ui-strip-plot-BT6Eqhup.js +1740 -0
  151. package/dist/vue-ui-table-CiccGbRB.js +1352 -0
  152. package/dist/{vue-ui-table-heatmap-XmDK1aHJ.js → vue-ui-table-heatmap-DnP3pzh2.js} +2 -2
  153. package/dist/vue-ui-table-sparkline-Bp7RiZh4.js +738 -0
  154. package/dist/{vue-ui-thermometer-CLx3SPRv.js → vue-ui-thermometer-CawumQKP.js} +192 -192
  155. package/dist/{vue-ui-timer-BDWUNb6t.js → vue-ui-timer-CXinMW7q.js} +153 -153
  156. package/dist/vue-ui-tiremarks-BnI2uhki.js +540 -0
  157. package/dist/vue-ui-treemap-DTlFbfD6.js +1733 -0
  158. package/dist/vue-ui-waffle-CjgRkQAp.js +1621 -0
  159. package/dist/vue-ui-wheel-B02tiG0p.js +873 -0
  160. package/dist/vue-ui-word-cloud-BZnCOMHx.js +1710 -0
  161. package/dist/{vue-ui-world-C2atz4Xm.js → vue-ui-world-DO2VZ-T-.js} +524 -524
  162. package/dist/vue-ui-xy-BC9GVdWE.js +5283 -0
  163. package/dist/{vue-ui-xy-CpA0W6zM.js → vue-ui-xy-CD6BiP_g.js} +2 -2
  164. package/dist/vue-ui-xy-canvas-DANPuyf4.js +1824 -0
  165. package/dist/{vue_ui_age_pyramid-BY6c-oX_.js → vue_ui_age_pyramid-B2R66DgQ.js} +15 -6
  166. package/package.json +1 -1
  167. package/dist/vue-ui-3d-bar-C0aLR6lw.js +0 -1831
  168. package/dist/vue-ui-age-pyramid-DUcB3lYs.js +0 -1243
  169. package/dist/vue-ui-bullet-DIOCMF2H.js +0 -702
  170. package/dist/vue-ui-candlestick-Cf8TYPl5.js +0 -1859
  171. package/dist/vue-ui-chestnut-BMAuaeif.js +0 -2016
  172. package/dist/vue-ui-chord-DCe2iPjk.js +0 -1347
  173. package/dist/vue-ui-circle-pack-Eb5hS_z3.js +0 -1635
  174. package/dist/vue-ui-donut-CuQVKuZa.js +0 -2415
  175. package/dist/vue-ui-donut-evolution-DckruxZ9.js +0 -1552
  176. package/dist/vue-ui-dumbbell-BYU-hh2E.js +0 -1531
  177. package/dist/vue-ui-flow-DLRcNDLc.js +0 -1217
  178. package/dist/vue-ui-funnel-DjoqNN1U.js +0 -749
  179. package/dist/vue-ui-galaxy-BhR4IOra.js +0 -1085
  180. package/dist/vue-ui-gauge-Cq161Kwp.js +0 -934
  181. package/dist/vue-ui-heatmap-Bl5ymvi9.js +0 -1555
  182. package/dist/vue-ui-history-plot-CvVjsdCL.js +0 -1698
  183. package/dist/vue-ui-molecule-BExVLLgE.js +0 -929
  184. package/dist/vue-ui-nested-donuts-CWzJKr3S.js +0 -1503
  185. package/dist/vue-ui-onion-VaYZQK5i.js +0 -1235
  186. package/dist/vue-ui-quadrant-Dmtwow7n.js +0 -1967
  187. package/dist/vue-ui-radar-C3GYthqu.js +0 -1374
  188. package/dist/vue-ui-rating-CBdDXL80.js +0 -359
  189. package/dist/vue-ui-relation-circle-BA0qy0kp.js +0 -905
  190. package/dist/vue-ui-ridgeline-C5skjBTe.js +0 -1630
  191. package/dist/vue-ui-rings-BJ8yEQMw.js +0 -1252
  192. package/dist/vue-ui-scatter-DXg8ESgr.js +0 -2405
  193. package/dist/vue-ui-smiley-DQOp87rr.js +0 -376
  194. package/dist/vue-ui-spark-trend-CjCufXof.js +0 -457
  195. package/dist/vue-ui-sparkbar-BniEM15a.js +0 -401
  196. package/dist/vue-ui-sparkgauge-BtyCrqTQ.js +0 -268
  197. package/dist/vue-ui-sparkhistogram-DQdn3PW1.js +0 -589
  198. package/dist/vue-ui-sparkstackbar-BXQlOdOk.js +0 -738
  199. package/dist/vue-ui-stackbar-CkjicNDv.js +0 -2355
  200. package/dist/vue-ui-stackline-BB1IZta8.js +0 -2469
  201. package/dist/vue-ui-strip-plot-DGLGuH6e.js +0 -1740
  202. package/dist/vue-ui-table-BXz_HY2g.js +0 -1352
  203. package/dist/vue-ui-table-sparkline-MTEw3imE.js +0 -738
  204. package/dist/vue-ui-tiremarks-DoaypTC-.js +0 -540
  205. package/dist/vue-ui-treemap-Bv7PgpiC.js +0 -1733
  206. package/dist/vue-ui-waffle-z2DhvSAx.js +0 -1621
  207. package/dist/vue-ui-wheel-DYLBJuFb.js +0 -873
  208. package/dist/vue-ui-word-cloud-CbpEhSdL.js +0 -1710
  209. package/dist/vue-ui-xy-B3DQ6t46.js +0 -5283
  210. package/dist/vue-ui-xy-canvas-CJefORWc.js +0 -1824
@@ -1,1824 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { $ as t, Ct as n, D as r, Lt as i, Ot as a, Pt as o, S as s, Ut as c, Vt as l, X as u, Yt as ee, Zt as te, _ as ne, bt as re, i as ie, jt as ae, lt as oe, nt as se, o as ce, pt as le, q as ue, w as de } from "./lib-Dql7cqyA.js";
3
- import { n as fe, t as pe } from "./useHints-Dq_w2E8B.js";
4
- import { n as me, r as he, t as ge } from "./useTimeLabels-d2f-W1L4.js";
5
- import { t as _e } from "./useConfig-C_mX5pOZ.js";
6
- import { t as ve } from "./usePrinter-DISD7q5m.js";
7
- import { n as ye, t as be } from "./BaseScanner-DZvpgOjM.js";
8
- import { t as xe } from "./useNestedProp-Chvyfpl-.js";
9
- import { t as Se } from "./useThemeCheck-C43Tcqmk.js";
10
- import { t as Ce } from "./img-DhGApYG0.js";
11
- import { n as we } from "./Title-CPHi-evi.js";
12
- import { t as Te } from "./_plugin-vue_export-helper-B3ysoDQm.js";
13
- import { a as d, c as f, i as Ee, l as De, n as Oe, o as ke, r as Ae, s as je, t as Me } from "./useResponsive-ZtArZtUf.js";
14
- import { t as Ne } from "./BaseIcon-t83PDe9k.js";
15
- import { t as Pe } from "./SlicerPreview-GvsdvE-h.js";
16
- import { t as Fe } from "./vue-ui-accordion-DRf3NQyH.js";
17
- import { t as Ie } from "./BaseLegendToggle-__JnV08B.js";
18
- import { t as Le } from "./useUserOptionState-DK-_1ddE.js";
19
- import { t as Re } from "./useChartAccessibility-DYqac8yF.js";
20
- import { t as ze } from "./Legend-X4kF4PvW.js";
21
- import { t as Be } from "./vue_ui_xy_canvas-Cb6dg3eK.js";
22
- import { Teleport as Ve, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as He, createElementVNode as g, createSlots as Ue, createTextVNode as We, createVNode as Ge, defineAsyncComponent as Ke, guardReactiveProps as _, mergeProps as qe, nextTick as Je, normalizeClass as Ye, normalizeProps as v, normalizeStyle as Xe, onBeforeUnmount as Ze, onMounted as Qe, openBlock as y, ref as b, renderSlot as x, resolveDynamicComponent as $e, shallowRef as et, toDisplayString as tt, toRefs as nt, unref as S, useSlots as rt, watch as C, watchEffect as it, withCtx as w } from "vue";
23
- //#region src/components/vue-ui-xy-canvas.vue
24
- var at = /* @__PURE__ */ e({ default: () => _t }), ot = ["id"], st = ["id"], ct = {
25
- class: "sr-only",
26
- "aria-live": "polite",
27
- "aria-atomic": "true"
28
- }, lt = ["id"], ut = ["aria-label", "aria-describedby"], dt = {
29
- key: 0,
30
- style: {
31
- position: "absolute",
32
- top: "100%",
33
- left: "0",
34
- width: "100%"
35
- },
36
- "data-dom-to-png-ignore": "",
37
- "aria-hidden": "true"
38
- }, ft = ["id"], pt = ["onClick"], mt = {
39
- key: 4,
40
- class: "vue-data-ui-watermark"
41
- }, ht = { key: 0 }, gt = { key: 1 }, _t = /*#__PURE__*/ Te({
42
- __name: "vue-ui-xy-canvas",
43
- props: {
44
- dataset: {
45
- type: Array,
46
- default() {
47
- return [];
48
- }
49
- },
50
- config: {
51
- type: Object,
52
- default() {
53
- return {};
54
- }
55
- },
56
- selectedXIndex: {
57
- type: Number,
58
- default: void 0
59
- }
60
- },
61
- emits: [
62
- "selectLegend",
63
- "selectX",
64
- "copyAlt"
65
- ],
66
- setup(e, { expose: Te, emit: at }) {
67
- let _t = Ke(() => import("./Tooltip-hhrkQ3Lk.js")), vt = Ke(() => import("./DataTable-COIO9gi4.js")), yt = Ke(() => import("./UserOptions-f3Q0nqrj.js").then((e) => e.n)), bt = Ke(() => import("./NonSvgPenAndPaper-KXRhcsxM.js")), xt = Ke(() => import("./BaseDraggableDialog-BM_R41j8.js").then((e) => e.n)), { vue_ui_xy_canvas: St } = _e(), { isThemeValid: Ct, warnInvalidTheme: wt } = Se(), T = e, E = b(ue()), D = b(null), Tt = b(null), O = b(null), k = b(1), A = b(1), Et = b(!1), j = b(null), Dt = b(""), Ot = b(null), M = b([]), kt = b(1), N = b(!0), P = b(!0), At = b(null), jt = b(0), Mt = b(!1), Nt = b(null), Pt = b(null), F = b(null), Ft = b(null), It = b(0), Lt = b(0), Rt = b(0), I = b(null), zt = b(!1), Bt = b(null), Vt = b(null), Ht = b(!1), Ut = b(!1), Wt = b(!1), L = b(null), Gt = b(!1), Kt = b(!1), qt = b(!1), R = b(null), Jt = b({
68
- x: 0,
69
- y: 0
70
- }), z = p(() => Array.isArray(rn.value) && rn.value.length > 0), Yt = at, Xt = rt(), B = b(un());
71
- fe({
72
- config: () => B.value,
73
- dataset: () => T.dataset,
74
- component: "VueUiXyCanvas",
75
- rules: [
76
- pe.emptyArray,
77
- {
78
- test: (e) => e.every((e) => e.series.length < 300),
79
- message: [
80
- "👀 Series have < 300 datapoints. Consider:",
81
- "",
82
- "▶️ Using VueUiXy instead, if you need more options, or more customization possibilities."
83
- ]
84
- },
85
- {
86
- test: (e) => e.some((e) => e.series.length > 1e4),
87
- message: [
88
- "👀 The dataset has > 10_000 datapoints. Above this threshold, the dataset is computed through an LTTB algorithm, to preserve the shape of the data without increasing the number of datapoints.",
89
- "",
90
- "▶️ If you need this level of detail, you can change config.downsample.threshold and set a higher value. Note that performance can be impacted. JS runtime might crash with > 100_000 datapoints."
91
- ]
92
- }
93
- ]
94
- });
95
- let Zt = p(() => {
96
- let e = B.value.style.chart.title.text || "XY chart", t = J.value.end - J.value.start;
97
- return `${e}. ${q.value.filter((e) => !M.value.includes(e.absoluteIndex)).length} series. ${t} visible data points.`;
98
- }), Qt = p(() => {
99
- if (R.value === null) return "";
100
- let e = R.value + J.value.start;
101
- return `${B.value.style.chart.grid.x.timeLabels.values.slice(J.value.start, J.value.end)[R.value] ? B.value.style.chart.tooltip.useDefaultTimeFormat ? Z.value.slice(J.value.start, J.value.end)[R.value]?.text : $n.value[R.value]?.text : Z.value[e]?.text ?? `Point ${e + 1}`}. ${q.value.filter((e) => !M.value.includes(e.absoluteIndex)).map((e) => {
102
- let t = e.series[R.value], n = t?.value ?? t ?? null;
103
- return `${e.name}: ${n}`;
104
- }).join(". ")}.`;
105
- }), $t = p(() => B.value.userOptions.useCursorPointer), en = p(() => B.value.debug);
106
- Qe(() => {
107
- Xt["chart-background"] && en.value && console.warn("VueUiXyCanvas does not support the #chart-background slot.");
108
- });
109
- let tn = p(() => te({
110
- defaultConfig: {
111
- userOptions: { show: !1 },
112
- table: { show: !1 },
113
- style: { chart: {
114
- backgroundColor: "#99999930",
115
- grid: {
116
- x: {
117
- axisColor: "#6A6A6A",
118
- timeLabels: { show: !1 },
119
- axisName: "",
120
- horizontalLines: { color: "#6A6A6A" }
121
- },
122
- y: {
123
- axisColor: "#6A6A6A",
124
- axisLabels: { show: !1 },
125
- axisName: "",
126
- verticalLines: { color: "#6A6A6A" }
127
- },
128
- zeroLine: { color: "#6A6A6A" }
129
- },
130
- legend: { backgroundColor: "#99999930" },
131
- paddingProportions: { left: .05 },
132
- scale: {
133
- max: null,
134
- min: null
135
- },
136
- zoom: {
137
- endIndex: null,
138
- startIndex: null
139
- }
140
- } }
141
- },
142
- userConfig: B.value.skeletonConfig ?? {}
143
- })), { loading: nn, FINAL_DATASET: rn } = ye({
144
- ...nt(T),
145
- FINAL_CONFIG: B,
146
- prepareConfig: un,
147
- skeletonDataset: T.config?.skeletonDataset ?? [{
148
- name: "",
149
- series: [
150
- 0,
151
- 1,
152
- 2,
153
- 3,
154
- 5,
155
- 8,
156
- 13,
157
- 21,
158
- 34,
159
- 55,
160
- 89,
161
- 134
162
- ],
163
- type: "line",
164
- smooth: !0,
165
- color: "#BABABA"
166
- }, {
167
- name: "",
168
- series: [
169
- 0,
170
- .5,
171
- 1,
172
- 1.5,
173
- 2.5,
174
- 4,
175
- 6.5,
176
- 10.5,
177
- 17,
178
- 27.5,
179
- 44.5,
180
- 67
181
- ],
182
- type: "bar",
183
- color: "#AAAAAA"
184
- }],
185
- skeletonConfig: te({
186
- defaultConfig: B.value,
187
- userConfig: tn.value
188
- })
189
- }), { userOptionsVisible: an, setUserOptionsVisibility: on, keepUserOptionState: sn } = Le({ config: B.value }), { svgRef: V } = Re({ config: B.value.style.chart.title });
190
- function cn() {
191
- on(!0);
192
- }
193
- function ln() {
194
- on(!1), Yt("selectX", {
195
- dataset: null,
196
- index: null,
197
- indexLabel: null
198
- }), j.value = null;
199
- }
200
- function un() {
201
- let e = xe({
202
- userConfig: T.config,
203
- defaultConfig: St
204
- }), t = {}, n = e.theme;
205
- if (n) {
206
- if (!Ct.value(e)) wt(e), t = e;
207
- else {
208
- let r = xe({
209
- userConfig: Be[n] || T.config,
210
- defaultConfig: e
211
- });
212
- t = {
213
- ...xe({
214
- userConfig: T.config,
215
- defaultConfig: r
216
- }),
217
- customPalette: e.customPalette.length ? e.customPalette : ee[n] || i
218
- };
219
- }
220
- } else t = e;
221
- return T.config && re(T.config, "style.chart.grid.y.timeLabels") && (console.warn("VueUiXyCanvas: you are using the deprecated config.style.chart.grid.y.timeLabels. It is recommended to move this configuration to config.style.chart.grid.x.timeLabels."), t.style.chart.grid.x.timeLabels = xe({
222
- defaultConfig: t.style.chart.grid.x.timeLabels,
223
- userConfig: T.config.style.chart.grid.y.timeLabels
224
- })), t;
225
- }
226
- C(() => T.config, (e) => {
227
- nn.value || (B.value = un()), an.value = !B.value.userOptions.showOnChartHover, Tr(), It.value += 1, Lt.value += 1, Rt.value += 1, H.value.showTable = B.value.table.show, H.value.showDataLabels = B.value.style.chart.dataLabels.show, H.value.stacked = B.value.style.chart.stacked, H.value.showTooltip = B.value.style.chart.tooltip.show;
228
- }, { deep: !0 }), C(() => T.dataset, async (e) => {
229
- !Array.isArray(e) || e.length === 0 || (await Je(), V.value && !O.value && (O.value = V.value.getContext("2d", { willReadFrequently: !0 })), N.value = !0, P.value = !0, await Nn(), Hn(), It.value += 1, Lt.value += 1, Rt.value += 1);
230
- }, { deep: !0 });
231
- let dn = b(B.value.style.chart.aspectRatio), { isPrinting: fn, isImaging: pn, generatePdf: mn, generateImage: hn } = ve({
232
- elementId: `xy_canvas_${E.value}`,
233
- fileName: B.value.style.chart.title.text || "vue-ui-xy-canvas",
234
- options: B.value.userOptions.print
235
- }), H = b({
236
- showTable: B.value.table.show,
237
- showDataLabels: B.value.style.chart.dataLabels.show,
238
- stacked: B.value.style.chart.stacked,
239
- showTooltip: B.value.style.chart.tooltip.show
240
- });
241
- function gn(e) {
242
- Mt.value = e, jt.value += 1;
243
- }
244
- let _n = p(() => de(B.value.customPalette)), vn = p(() => M.value.length === K.value.length), U = p(() => K.value ? Math.max(...K.value.filter((e, t) => vn.value ? !0 : !M.value.includes(e.absoluteIndex)).map((e) => e.series.length)) : 0);
245
- function yn(e) {
246
- L.value = e, Q();
247
- }
248
- let bn = b(0), xn = b(0);
249
- function Sn() {
250
- if (!O.value || !B.value.style.chart.grid.x.timeLabels.show) return 0;
251
- let e = Z.value || [], t = J.value.start ?? 0, n = J.value.end ?? 0;
252
- if (!Math.max(0, n - t)) return 0;
253
- let r = Math.round(k.value / 40 * B.value.style.chart.grid.x.timeLabels.fontSizeRatio), i = `${B.value.style.chart.grid.x.timeLabels.bold ? "bold " : ""}${r}px ${B.value.style.fontFamily}`;
254
- O.value.save(), O.value.font = i;
255
- let a = 0;
256
- for (let r = t; r < n; r += 1) {
257
- let t = e[r]?.text ?? `${r + 1}`, n = O.value.measureText(String(t));
258
- n.width > a && (a = n.width);
259
- }
260
- O.value.restore();
261
- let o = (B.value.style.chart.grid.x.timeLabels.rotation || 0) * Math.PI / 180, s = r, c = Math.abs(Math.sin(o)) * a + Math.abs(Math.cos(o)) * s, l = B.value.style.chart.grid.x.timeLabels.offsetY || 1, u = k.value / l;
262
- return Math.max(0, u + c + 4);
263
- }
264
- function Cn() {
265
- bn.value = Sn();
266
- }
267
- function wn() {
268
- xn.value && cancelAnimationFrame(xn.value), xn.value = requestAnimationFrame(() => {
269
- requestAnimationFrame(() => {
270
- Cn();
271
- });
272
- });
273
- }
274
- Ze(() => {
275
- xn.value && cancelAnimationFrame(xn.value);
276
- });
277
- let W = p(() => {
278
- let e = k.value - k.value * (B.value.style.chart.paddingProportions.left + B.value.style.chart.paddingProportions.right), t = A.value * B.value.style.chart.paddingProportions.top, n = A.value * B.value.style.chart.paddingProportions.bottom, r = bn.value, i = A.value - n - r, a = A.value - (t + n) - r;
279
- return {
280
- canvasWidth: k.value,
281
- canvasHeight: A.value,
282
- left: k.value * B.value.style.chart.paddingProportions.left,
283
- top: t,
284
- right: k.value - k.value * B.value.style.chart.paddingProportions.right,
285
- bottom: i,
286
- width: e,
287
- height: a,
288
- slot: e / (J.value.end - J.value.start)
289
- };
290
- });
291
- function Tn(e, t) {
292
- return e / t;
293
- }
294
- function En({ hasAutoScale: e, series: t, min: n, max: r, scale: i, yOffset: a, individualHeight: o, stackIndex: s = null }) {
295
- return t.map((t, n) => {
296
- let r = i.min < 0 ? Math.abs(i.min) : 0, c = Tn(t + r, r + i.max), l, u;
297
- e && (l = i.min, u = Tn(t - l, i.max - l));
298
- let ee = 0;
299
- return ee = s === null ? W.value.bottom - W.value.height * (e ? u : c) : W.value.bottom - a - o * (e ? u : c), {
300
- x: W.value.left + W.value.slot * n + W.value.slot / 2,
301
- y: ee,
302
- value: t
303
- };
304
- });
305
- }
306
- let G = p(() => {
307
- let e = B.value.style.chart.scale.min === null ? Math.min(...K.value.filter((e, t) => !M.value.includes(e.absoluteIndex)).flatMap((e) => e.series.slice(J.value.start, J.value.end))) : B.value.style.chart.scale.min, t = B.value.style.chart.scale.max === null ? Math.max(...K.value.filter((e, t) => !M.value.includes(e.absoluteIndex)).flatMap((e) => e.series.slice(J.value.start, J.value.end))) : B.value.style.chart.scale.max, n = ne(e < 0 ? e : 0, t === e ? e + 1 < 0 ? 0 : e + 1 : t < 0 ? 0 : t, B.value.style.chart.scale.ticks), r = n.min < 0 ? Math.abs(n.min) : 0, i = W.value.bottom - W.value.height * (r / (n.max + r));
308
- return {
309
- absoluteMin: r,
310
- max: t,
311
- min: e,
312
- scale: n,
313
- yLabels: n.ticks.map((e) => ({
314
- y: W.value.bottom - W.value.height * ((e + r) / (n.max + r)),
315
- x: W.value.left - 8,
316
- value: e
317
- })),
318
- zero: i
319
- };
320
- }), Dn = p(() => q.value.map((e) => `
321
- <div style="display:flex;flex-direction:row;gap:6px;align-items:center;">
322
- <svg viewBox="0 0 10 10" height="12" width="12">
323
- <circle cx="5" cy="5" r="5" fill="${e.color}"/>
324
- </svg>
325
- <span>${e.name ? e.name + ": " : ""}</span>
326
- <span>${ie(B.value.style.chart.dataLabels.formatter, e.series[j.value] ?? "-", u({
327
- p: e.prefix || "",
328
- v: e.series[j.value] ?? "-",
329
- s: e.suffix || "",
330
- r: e.rounding || 0
331
- }), {
332
- datapoint: e,
333
- seriesIndex: j.value
334
- })}</span>
335
- </div>
336
- `)), On = p(() => B.value.style.chart.line.cutNullValues), K = p(() => rn.value.map((e, t) => ({
337
- ...e,
338
- series: a({
339
- data: l(e.series, [], On.value),
340
- threshold: B.value.downsample.threshold
341
- }),
342
- absoluteIndex: t,
343
- color: s(e.color || _n.value[t] || i[t] || i[t % i.length])
344
- }))), kn = p(() => {
345
- if (!B.value.style.chart.zoom.minimap.show) return [];
346
- let e = K.value.filter((e) => !M.value.includes(e.absoluteIndex)), t = Math.max(...e.map((e) => e.series.length)), n = [];
347
- for (let r = 0; r < t; r += 1) n.push(e.map((e) => e.series[r] || 0).reduce((e, t) => (e || 0) + (t || 0), 0));
348
- let r = Math.min(...n);
349
- return n.map((e) => e + (r < 0 ? Math.abs(r) : 0));
350
- }), An = p(() => B.value.style.chart.zoom.minimap.show ? K.value.map((e) => ({
351
- ...e,
352
- isVisible: !M.value.includes(e.absoluteIndex)
353
- })) : []);
354
- C(U, (e) => {
355
- e && Nn();
356
- });
357
- let q = p(() => ce(K.value.filter((e, t) => !M.value.includes(e.absoluteIndex))).map((e, t) => ({
358
- ...e,
359
- series: e.series.slice(J.value.start, J.value.end)
360
- })).map((e, t) => {
361
- let n = [null, void 0].includes(e.scaleMin) ? Math.min(...e.series) || 0 : e.scaleMin, r = [null, void 0].includes(e.scaleMax) ? Math.max(...e.series) || 1 : e.scaleMax;
362
- n === r && (n = n >= 0 ? r - 1 : n, r = r >= 0 ? r : n + 1);
363
- let i = {
364
- ratios: e.series.filter((e) => ![null, void 0].includes(e)).map((e) => (e - n) / (r - n)),
365
- valueMin: n,
366
- valueMax: r
367
- }, a = e.scaleSteps || B.value.style.chart.scale.ticks, o;
368
- o = e.autoScaling ? ne(i.valueMin, i.valueMax, a) : ne(i.valueMin < 0 ? i.valueMin : 0, i.valueMax <= 0 ? 0 : i.valueMax, a);
369
- let s = H.value.stacked ? W.value.height * (1 - e.cumulatedStackRatio) : 0, c = H.value.stacked ? W.value.height / B.value.style.chart.stackGap : 0, l = H.value.stacked ? W.value.height * e.stackRatio - c : W.value.height, u = o.min < 0 ? Math.abs(o.min) : 0, ee;
370
- ee = e.autoScaling && H.value.stacked && r <= 0 ? W.value.bottom - s - l : W.value.bottom - s - l * (u / (o.max + u));
371
- let te = o.ticks.map((e, t) => ({
372
- y: W.value.bottom - s - l * (t / (o.ticks.length - 1)),
373
- x: W.value.left - 8,
374
- value: e
375
- })), re = En({
376
- hasAutoScale: H.value.stacked && e.autoScaling,
377
- series: e.series,
378
- min: H.value.stacked ? n : G.value.min,
379
- max: H.value.stacked ? r : G.value.max,
380
- scale: H.value.stacked ? o : G.value.scale,
381
- yOffset: s,
382
- individualHeight: l,
383
- stackIndex: H.value.stacked ? t : null
384
- });
385
- return {
386
- ...e,
387
- coordinatesLine: re,
388
- min: n,
389
- max: r,
390
- localScale: o,
391
- localZero: ee,
392
- localMin: u,
393
- localYLabels: te,
394
- yOffset: s,
395
- individualHeight: l
396
- };
397
- })), J = b({
398
- start: 0,
399
- end: U.value
400
- }), Y = b({
401
- start: 0,
402
- end: U.value
403
- }), jn = b(null);
404
- function Mn() {
405
- return new Promise((e) => requestAnimationFrame(() => requestAnimationFrame(() => e())));
406
- }
407
- Ze(() => {
408
- jn.value && cancelAnimationFrame(jn.value);
409
- });
410
- async function Nn() {
411
- In(), await Je(), jn.value && cancelAnimationFrame(jn.value), jn.value = requestAnimationFrame(async () => {
412
- await Mn(), In();
413
- });
414
- }
415
- let Pn = p(() => B.value.style.chart.zoom.preview.enable && (Y.value.start !== J.value.start || Y.value.end !== J.value.end));
416
- function Fn(e, t) {
417
- Y.value[e] = t;
418
- }
419
- async function In() {
420
- if (!Ht.value) {
421
- Ht.value = !0;
422
- try {
423
- let { startIndex: e, endIndex: t } = B.value.style.chart.zoom, n = Math.max(...K.value.map((e) => e.series.length)), r = e ?? 0, i = t == null ? n : Math.min(zn(t + 1), n);
424
- Wt.value = !0, J.value.start = r, J.value.end = i, Y.value.start = r, Y.value.end = i, Bn(), Ut.value = !0, await Je(), F.value && (F.value.setStartValue(J.value.start), F.value.setEndValue(J.value.end));
425
- } finally {
426
- queueMicrotask(() => {
427
- Wt.value = !1;
428
- }), Ht.value = !1;
429
- }
430
- }
431
- }
432
- function Ln(e) {
433
- Ht.value || Wt.value || e !== J.value.start && (J.value.start = e, Y.value.start = e, Bn());
434
- }
435
- function Rn(e) {
436
- if (Ht.value || Wt.value) return;
437
- let t = zn(e);
438
- t !== J.value.end && (J.value.end = t, Y.value.end = t, Bn());
439
- }
440
- function zn(e) {
441
- let t = U.value;
442
- return e > t ? t : e < 0 || e < J.value.start ? B.value.style.chart.zoom.startIndex === null ? 1 : B.value.style.chart.zoom.startIndex + 1 : e;
443
- }
444
- function Bn() {
445
- let e = Math.max(1, Math.max(...K.value.map((e) => e.series.length))), t = Math.max(0, Math.min(J.value.start ?? 0, e - 1)), n = Math.max(t + 1, Math.min(J.value.end ?? e, e));
446
- (!Number.isFinite(t) || !Number.isFinite(n) || n <= t) && (t = 0, n = e), J.value = {
447
- start: t,
448
- end: n
449
- }, Y.value.start = t, Y.value.end = n, F.value && (F.value.setStartValue(t), F.value.setEndValue(n));
450
- }
451
- let Vn = p(() => q.value.filter((e) => [
452
- "line",
453
- "plot",
454
- void 0
455
- ].includes(e.type))), X = p(() => q.value.filter((e) => e.type === "bar"));
456
- function Hn() {
457
- if (!V.value || !Tt.value) return;
458
- let e = Tt.value.offsetWidth, t = Tt.value.offsetHeight;
459
- V.value.width = e * kt.value * 2, V.value.height = t * kt.value * 2, k.value = e * kt.value * 2, A.value = t * kt.value * 2, O.value?.scale(kt.value, kt.value), Q();
460
- }
461
- C(z, async (e) => {
462
- if (!e) {
463
- At.value = null, Et.value = !1, j.value = null, I.value = null;
464
- return;
465
- }
466
- await Je(), V.value && !O.value && (O.value = V.value.getContext("2d", { willReadFrequently: !0 })), N.value = !0, P.value = !0, await Nn(), Hn(), Q();
467
- });
468
- function Un() {
469
- if (O.value && (O.value.clearRect(0, 0, 1e4, 1e4), O.value.fillStyle = B.value.style.chart.backgroundColor, O.value.fillRect(0, 0, W.value.canvasWidth, W.value.canvasHeight), z.value)) {
470
- if (H.value.stacked) B.value.style.chart.grid.y.verticalLines.show && J.value.end - J.value.start < B.value.style.chart.grid.y.verticalLines.hideUnderXLength ? q.value.forEach((e) => {
471
- for (let t = 0; t < J.value.end - J.value.start + 1; t += 1) d(O.value, [{
472
- x: W.value.left + W.value.slot * t,
473
- y: W.value.bottom - e.yOffset - e.individualHeight
474
- }, {
475
- x: W.value.left + W.value.slot * t,
476
- y: W.value.bottom - e.yOffset
477
- }], { color: B.value.style.chart.grid.y.verticalLines.color });
478
- }) : B.value.style.chart.grid.y.verticalLines.show && J.value.end - J.value.start >= B.value.style.chart.grid.y.verticalLines.hideUnderXLength && q.value.forEach((e) => {
479
- for (let t = J.value.start; t < J.value.end; t += 1) t % Math.floor((J.value.end - J.value.start) / B.value.style.chart.grid.x.timeLabels.modulo) === 0 && d(O.value, [{
480
- x: W.value.left + W.value.slot * (t - J.value.start) + W.value.slot / 2,
481
- y: W.value.bottom - e.yOffset - e.individualHeight
482
- }, {
483
- x: W.value.left + W.value.slot * (t - J.value.start) + W.value.slot / 2,
484
- y: W.value.bottom - e.yOffset
485
- }], { color: B.value.style.chart.grid.y.verticalLines.color });
486
- }), B.value.style.chart.grid.x.horizontalLines.show && (B.value.style.chart.grid.x.horizontalLines.alternate ? q.value.forEach((e) => {
487
- e.localYLabels.forEach((t, n) => {
488
- n < e.localYLabels.length - 1 && je(O.value, [
489
- {
490
- x: W.value.left,
491
- y: t.y
492
- },
493
- {
494
- x: W.value.right,
495
- y: t.y
496
- },
497
- {
498
- x: W.value.right,
499
- y: e.localYLabels[n + 1].y
500
- },
501
- {
502
- x: W.value.left,
503
- y: e.localYLabels[n + 1].y
504
- }
505
- ], {
506
- fillColor: n % 2 == 0 ? "transparent" : c(B.value.style.chart.grid.x.horizontalLines.color, B.value.style.chart.grid.x.horizontalLines.opacity),
507
- strokeColor: "transparent"
508
- });
509
- });
510
- }) : q.value.forEach((e) => {
511
- e.localYLabels.slice(J.value.start, J.value.end).forEach((e) => {
512
- d(O.value, [{
513
- x: W.value.left,
514
- y: e.y
515
- }, {
516
- x: W.value.right,
517
- y: e.y
518
- }], { color: B.value.style.chart.grid.x.horizontalLines.color });
519
- });
520
- })), B.value.style.chart.grid.zeroLine.show && q.value.forEach((e) => {
521
- d(O.value, [{
522
- x: W.value.left,
523
- y: e.localZero
524
- }, {
525
- x: W.value.right,
526
- y: e.localZero
527
- }], {
528
- color: B.value.style.chart.grid.zeroLine.color,
529
- lineDash: B.value.style.chart.grid.zeroLine.dashed ? [10, 10] : [0, 0]
530
- });
531
- }), B.value.style.chart.grid.y.axisLabels.show && q.value.forEach((e) => {
532
- d(O.value, [{
533
- x: W.value.left,
534
- y: W.value.bottom - e.yOffset
535
- }, {
536
- x: W.value.left,
537
- y: W.value.bottom - e.yOffset - e.individualHeight
538
- }], { color: e.color }), d(O.value, [{
539
- x: W.value.right,
540
- y: W.value.bottom - e.yOffset
541
- }, {
542
- x: W.value.right,
543
- y: W.value.bottom - e.yOffset - e.individualHeight
544
- }], { color: e.color });
545
- }), q.value.forEach((e) => {
546
- f(O.value, e.name, k.value / 35, W.value.bottom - e.yOffset - e.individualHeight / 2, {
547
- align: "center",
548
- rotation: -90,
549
- color: e.color,
550
- font: `${Math.round(k.value / 40 * B.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${B.value.style.fontFamily}`
551
- });
552
- });
553
- else {
554
- if (B.value.style.chart.grid.y.verticalLines.show && J.value.end - J.value.start < B.value.style.chart.grid.y.verticalLines.hideUnderXLength) for (let e = 0; e < J.value.end - J.value.start + 1; e += 1) d(O.value, [{
555
- x: W.value.left + W.value.slot * e,
556
- y: W.value.top
557
- }, {
558
- x: W.value.left + W.value.slot * e,
559
- y: W.value.bottom
560
- }], { color: B.value.style.chart.grid.y.verticalLines.color });
561
- else if (B.value.style.chart.grid.y.verticalLines.show && J.value.end - J.value.start >= B.value.style.chart.grid.y.verticalLines.hideUnderXLength) for (let e = J.value.start; e < J.value.end; e += 1) e % Math.floor((J.value.end - J.value.start) / B.value.style.chart.grid.x.timeLabels.modulo) === 0 && d(O.value, [{
562
- x: W.value.left + W.value.slot * (e - J.value.start) + W.value.slot / 2,
563
- y: W.value.top
564
- }, {
565
- x: W.value.left + W.value.slot * (e - J.value.start) + W.value.slot / 2,
566
- y: W.value.bottom
567
- }], { color: B.value.style.chart.grid.y.verticalLines.color });
568
- B.value.style.chart.grid.x.horizontalLines.show && (B.value.style.chart.grid.x.horizontalLines.alternate ? G.value.yLabels.forEach((e, t) => {
569
- t < G.value.yLabels.length - 1 && je(O.value, [
570
- {
571
- x: W.value.left,
572
- y: e.y
573
- },
574
- {
575
- x: W.value.right,
576
- y: e.y
577
- },
578
- {
579
- x: W.value.right,
580
- y: G.value.yLabels[t + 1].y
581
- },
582
- {
583
- x: W.value.left,
584
- y: G.value.yLabels[t + 1].y
585
- }
586
- ], {
587
- fillColor: t % 2 == 0 ? "transparent" : c(B.value.style.chart.grid.x.horizontalLines.color, B.value.style.chart.grid.x.horizontalLines.opacity),
588
- strokeColor: "transparent"
589
- });
590
- }) : G.value.yLabels.forEach((e) => {
591
- d(O.value, [{
592
- x: W.value.left,
593
- y: e.y
594
- }, {
595
- x: W.value.right,
596
- y: e.y
597
- }], { color: B.value.style.chart.grid.x.horizontalLines.color });
598
- })), B.value.style.chart.grid.y.showAxis && d(O.value, [{
599
- x: W.value.left,
600
- y: W.value.top
601
- }, {
602
- x: W.value.left,
603
- y: W.value.bottom
604
- }], {
605
- color: B.value.style.chart.grid.y.axisColor,
606
- lineWidth: B.value.style.chart.grid.y.axisThickness
607
- }), B.value.style.chart.grid.x.showAxis && d(O.value, [{
608
- x: W.value.left,
609
- y: W.value.bottom
610
- }, {
611
- x: W.value.right,
612
- y: W.value.bottom
613
- }], {
614
- color: B.value.style.chart.grid.x.axisColor,
615
- lineWidth: B.value.style.chart.grid.x.axisThickness
616
- }), B.value.style.chart.grid.zeroLine.show && d(O.value, [{
617
- x: W.value.left,
618
- y: G.value.zero
619
- }, {
620
- x: W.value.right,
621
- y: G.value.zero
622
- }], {
623
- color: B.value.style.chart.grid.zeroLine.color,
624
- lineDash: B.value.style.chart.grid.zeroLine.dashed ? [10, 10] : [0, 0]
625
- });
626
- }
627
- B.value.style.chart.grid.y.axisName && f(O.value, B.value.style.chart.grid.y.axisName, k.value - k.value / 40 * B.value.style.chart.grid.y.axisLabels.fontSizeRatio * 1.2, W.value.bottom - W.value.height / 2, {
628
- font: `${B.value.style.chart.grid.y.axisLabels.bold ? "bold " : ""}${Math.round(k.value / 40 * B.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${B.value.style.fontFamily}`,
629
- color: B.value.style.chart.color,
630
- align: "center",
631
- rotation: 90
632
- }), B.value.style.chart.grid.x.axisName && f(O.value, B.value.style.chart.grid.x.axisName, k.value / 2, A.value, {
633
- font: `${B.value.style.chart.grid.y.axisLabels.bold ? "bold " : ""}${Math.round(k.value / 40 * B.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${B.value.style.fontFamily}`,
634
- color: B.value.style.chart.color,
635
- align: "center"
636
- });
637
- }
638
- }
639
- function Wn(e) {
640
- for (let t = 0; t < e.coordinatesLine.length; t += 1) {
641
- let n = (j.value === t || L.value === t ? k.value / 150 : B.value.style.chart.line.plots.show || e.type === "plot" ? k.value / 200 : 0) * B.value.style.chart.line.plots.radiusRatio;
642
- Oe(O.value, {
643
- x: e.coordinatesLine[t].x,
644
- y: e.coordinatesLine[t].y
645
- }, n, {
646
- color: B.value.style.chart.backgroundColor,
647
- fillStyle: e.color,
648
- strokeColor: "transparent"
649
- });
650
- }
651
- }
652
- function Gn() {
653
- q.value.forEach((e) => {
654
- e.showYMarker && dr(e) && f(O.value, ie(B.value.style.chart.dataLabels.formatter, dr(e).value, u({
655
- p: e.prefix || B.value.style.chart.grid.y.axisLabels.prefix || "",
656
- v: dr(e).value,
657
- s: e.suffix || B.value.style.chart.grid.y.axisLabels.suffix || "",
658
- r: e.rounding || B.value.style.chart.grid.y.axisLabels.rounding || 0
659
- }), {
660
- datapoint: dr(e),
661
- seriesIndex: null
662
- }), W.value.left - 8 + B.value.style.chart.grid.y.axisLabels.offsetX, dr(e).y, {
663
- align: "right",
664
- font: `${B.value.style.chart.grid.y.axisLabels.bold ? "bold " : ""}${Math.round(k.value / 40 * B.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${B.value.style.fontFamily}`,
665
- color: e.color
666
- });
667
- });
668
- }
669
- function Kn() {
670
- B.value.style.chart.grid.y.axisLabels.show && (H.value.stacked ? q.value.forEach((e) => {
671
- e.localYLabels.forEach((t, n) => {
672
- f(O.value, ie(B.value.style.chart.dataLabels.formatter, t.value, u({
673
- p: e.prefix || B.value.style.chart.grid.y.axisLabels.prefix || "",
674
- v: t.value,
675
- s: e.suffix || B.value.style.chart.grid.y.axisLabels.suffix || "",
676
- r: e.rounding || B.value.style.chart.grid.y.axisLabels.rounding || 0
677
- }), {
678
- datapoint: t,
679
- seriesIndex: n
680
- }), t.x + B.value.style.chart.grid.y.axisLabels.offsetX, t.y, {
681
- align: "right",
682
- font: `${B.value.style.chart.grid.y.axisLabels.bold ? "bold " : ""}${Math.round(k.value / 40 * B.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${B.value.style.fontFamily}`,
683
- color: e.color,
684
- globalAlpha: e.showYMarker && ![null, void 0].includes(j.value ?? L.value) ? .2 : 1
685
- });
686
- });
687
- }) : G.value.yLabels.forEach((e, t) => {
688
- f(O.value, ie(B.value.style.chart.dataLabels.formatter, e.value, u({
689
- p: B.value.style.chart.grid.y.axisLabels.prefix || "",
690
- v: e.value,
691
- s: B.value.style.chart.grid.y.axisLabels.suffix || "",
692
- r: B.value.style.chart.grid.y.axisLabels.rounding || 0
693
- }), {
694
- datapoint: e,
695
- seriesIndex: t
696
- }), e.x + B.value.style.chart.grid.y.axisLabels.offsetX, e.y, {
697
- align: "right",
698
- font: `${B.value.style.chart.grid.y.axisLabels.bold ? "bold " : ""}${Math.round(k.value / 40 * B.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${B.value.style.fontFamily}`,
699
- color: B.value.style.chart.grid.y.axisLabels.color,
700
- globalAlpha: q.value.some((e) => e.showYMarker) && ![null, void 0].includes(j.value ?? L.value) ? .2 : 1
701
- });
702
- }));
703
- }
704
- function qn(e) {
705
- for (let t = 0; t < e.coordinatesLine.length; t += 1) f(O.value, ie(B.value.style.chart.dataLabels.formatter, e.coordinatesLine[t].value, u({
706
- p: e.prefix || "",
707
- v: e.coordinatesLine[t].value,
708
- s: e.suffix || "",
709
- r: e.rounding || 0
710
- }), {
711
- datapoint: e.coordinatesLine[t],
712
- seriesIndex: t
713
- }), e.coordinatesLine[t].x, e.coordinatesLine[t].y + B.value.style.chart.dataLabels.offsetY, {
714
- align: "center",
715
- font: `${B.value.style.chart.dataLabels.bold ? "bold " : ""}${Math.round(k.value / 40 * B.value.style.chart.dataLabels.fontSizeRatio)}px ${B.value.style.fontFamily}`,
716
- color: B.value.style.chart.dataLabels.useSerieColor ? e.color : B.value.style.chart.dataLabels.color,
717
- strokeColor: B.value.style.chart.backgroundColor,
718
- lineWidth: .5
719
- });
720
- }
721
- let Z = b([]), Jn = 0;
722
- it(() => {
723
- let e = ++Jn;
724
- (async () => {
725
- let t = await ge({
726
- values: B.value.style.chart.grid.x.timeLabels.values,
727
- maxDatapoints: U.value,
728
- formatter: B.value.style.chart.grid.x.timeLabels.datetimeFormatter,
729
- start: 0,
730
- end: U.value
731
- });
732
- e === Jn && (Z.value = t);
733
- })();
734
- }), it(() => {
735
- B.value.style.chart.grid.x.timeLabels.show, B.value.style.chart.grid.x.timeLabels.rotation, B.value.style.chart.grid.x.timeLabels.offsetY, B.value.style.chart.grid.x.timeLabels.fontSizeRatio, B.value.style.chart.grid.x.timeLabels.bold, J.value.start, J.value.end, k.value, A.value, (Z.value || []).map((e) => e?.text ?? "").join("|"), wn();
736
- }, { flush: "post" });
737
- let Yn = b({
738
- months: [],
739
- shortMonths: [],
740
- days: [],
741
- shortDays: []
742
- }), Xn = 0;
743
- it(() => {
744
- let e = ++Xn, t = B.value.style.chart.grid.x.timeLabels.datetimeFormatter;
745
- (async () => {
746
- let n = await he(t.locale).catch(() => he("en"));
747
- e === Xn && (Yn.value = n.data);
748
- })();
749
- });
750
- let Zn = p(() => {
751
- let e = B.value.style.chart.grid.x.timeLabels.datetimeFormatter, t = me({
752
- useUTC: e.useUTC,
753
- locale: Yn.value,
754
- januaryAsYear: e.januaryAsYear
755
- });
756
- return (e, n) => {
757
- let r = B.value.style.chart.grid.x.timeLabels.values?.[e];
758
- return r == null ? "" : t.formatDate(new Date(r), n);
759
- };
760
- }), Qn = p(() => (B.value.style.chart.grid.x.timeLabels.values || []).map((e, t) => ({
761
- text: Zn.value(t, B.value.style.chart.zoom.timeFormat),
762
- absoluteIndex: t
763
- }))), $n = p(() => (B.value.style.chart.grid.x.timeLabels.values || []).map((e, t) => ({
764
- text: Zn.value(t, B.value.style.chart.tooltip.timeFormat),
765
- absoluteIndex: t
766
- })));
767
- function er() {
768
- for (let e = J.value.start; e < J.value.end; e += 1) (J.value.end - J.value.start < B.value.style.chart.grid.x.timeLabels.modulo || J.value.end - J.value.start >= B.value.style.chart.grid.x.timeLabels.modulo && (e % Math.floor((J.value.end - J.value.start) / B.value.style.chart.grid.x.timeLabels.modulo) === 0 || (e === j.value + J.value.start || e === L.value) && B.value.style.chart.grid.x.timeLabels.showMarker)) && f(O.value, Z.value[e] ? Z.value[e].text : e + 1, W.value.left + W.value.slot * (e - J.value.start) + W.value.slot / 2, W.value.bottom + k.value / B.value.style.chart.grid.x.timeLabels.offsetY, {
769
- align: B.value.style.chart.grid.x.timeLabels.rotation === 0 ? "center" : B.value.style.chart.grid.x.timeLabels.rotation > 0 ? "left" : "right",
770
- font: `${B.value.style.chart.grid.x.timeLabels.bold ? "bold " : ""}${Math.round(k.value / 40 * B.value.style.chart.grid.x.timeLabels.fontSizeRatio)}px ${B.value.style.fontFamily}`,
771
- color: B.value.style.chart.grid.x.timeLabels.showMarker ? c(B.value.style.chart.grid.x.timeLabels.color, j.value !== null || L.value !== null ? j.value + J.value.start === e || L.value === e ? 100 : 20 : 100) : B.value.style.chart.grid.x.timeLabels.color,
772
- rotation: B.value.style.chart.grid.x.timeLabels.rotation
773
- });
774
- }
775
- function tr() {
776
- d(O.value, [{
777
- x: W.value.left + W.value.slot * (j.value ?? L.value) + W.value.slot / 2,
778
- y: W.value.top
779
- }, {
780
- x: W.value.left + W.value.slot * (j.value ?? L.value) + W.value.slot / 2,
781
- y: W.value.bottom
782
- }], {
783
- color: B.value.style.chart.selector.color,
784
- lineDash: B.value.style.chart.selector.dashed ? [8, 8] : [0, 0],
785
- lineWidth: 2,
786
- linceCap: "round"
787
- });
788
- }
789
- function nr() {
790
- I.value && d(O.value, [{
791
- x: W.value.left,
792
- y: I.value
793
- }, {
794
- x: W.value.right,
795
- y: I.value
796
- }], {
797
- color: B.value.style.chart.selector.color,
798
- lineDash: B.value.style.chart.selector.dashed ? [8, 8] : [0, 0],
799
- lineWidth: 2,
800
- linceCap: "round"
801
- });
802
- }
803
- function rr() {
804
- X.value.forEach((e, t) => {
805
- for (let n = 0; n < e.coordinatesLine.length; n += 1) je(O.value, [
806
- {
807
- x: W.value.left + W.value.slot * n + W.value.slot / 10 + (H.value.stacked ? 0 : W.value.slot / X.value.length * t - (t === 0 ? 0 : W.value.slot / (5 * X.value.length) * t)),
808
- y: H.value.stacked ? e.localZero : G.value.zero
809
- },
810
- {
811
- x: W.value.left + W.value.slot * n + W.value.slot / 10 + (H.value.stacked ? 0 : W.value.slot / X.value.length * t - (t === 0 ? 0 : W.value.slot / (5 * X.value.length) * t)) + W.value.slot * .8 / (H.value.stacked ? 1 : X.value.length),
812
- y: H.value.stacked ? e.localZero : G.value.zero
813
- },
814
- {
815
- x: W.value.left + W.value.slot * n + W.value.slot / 10 + (H.value.stacked ? 0 : W.value.slot / X.value.length * t - (t === 0 ? 0 : W.value.slot / (5 * X.value.length) * t)) + W.value.slot * .8 / (H.value.stacked ? 1 : X.value.length),
816
- y: e.coordinatesLine[n].y
817
- },
818
- {
819
- x: W.value.left + W.value.slot * n + W.value.slot / 10 + (H.value.stacked ? 0 : W.value.slot / X.value.length * t - (t === 0 ? 0 : W.value.slot / (5 * X.value.length) * t)),
820
- y: e.coordinatesLine[n].y
821
- }
822
- ], {
823
- strokeColor: B.value.style.chart.backgroundColor,
824
- gradient: {
825
- type: "linear",
826
- start: {
827
- x: e.coordinatesLine[n].x,
828
- y: e.coordinatesLine[n].y
829
- },
830
- end: {
831
- x: e.coordinatesLine[n].x,
832
- y: H.value.stacked ? e.localZero : G.value.zero
833
- },
834
- stops: [{
835
- offset: 0,
836
- color: e.color
837
- }, {
838
- offset: 1,
839
- color: B.value.style.chart.bar.gradient.show ? ae(e.color, .5) : e.color
840
- }]
841
- }
842
- }), H.value.showDataLabels && [!0, void 0].includes(e.dataLabels) && f(O.value, ie(B.value.style.chart.dataLabels.formatter, e.coordinatesLine[n].value, u({
843
- p: e.prefix || "",
844
- v: e.coordinatesLine[n].value,
845
- s: e.suffix || "",
846
- r: e.rounding || 0
847
- }), {
848
- datapoint: e.coordinatesLine[n],
849
- seriesIndex: n
850
- }), W.value.left + W.value.slot * n + W.value.slot / 10 + (H.value.stacked ? 0 : W.value.slot / X.value.length * t - (t === 0 ? 0 : W.value.slot / (5 * X.value.length) * t)) + W.value.slot * .4 / (H.value.stacked ? 1 : X.value.length), (e.coordinatesLine[n].value < 0 ? H.value.stacked ? e.localZero : G.value.zero : e.coordinatesLine[n].y) + B.value.style.chart.dataLabels.offsetY, {
851
- align: "center",
852
- font: `${Math.round(k.value / 40 * B.value.style.chart.dataLabels.fontSizeRatio)}px ${B.value.style.fontFamily}`,
853
- color: B.value.style.chart.dataLabels.useSerieColor ? e.color : B.value.style.chart.dataLabels.color,
854
- strokeColor: B.value.style.chart.backgroundColor,
855
- lineWidth: .8
856
- });
857
- });
858
- }
859
- function ir(e, t) {
860
- let n = e.coordinatesLine.map((t, n) => e.series[n] != null && Number.isFinite(t?.y) ? t : null), r = [], i = [], a = [];
861
- for (let e = 0; e < n.length; e += 1) {
862
- let o = n[e];
863
- if (o) a.push(o);
864
- else {
865
- if (a.length >= 2) {
866
- let e = a[0], n = a[a.length - 1];
867
- r.push([
868
- {
869
- x: e.x,
870
- y: t
871
- },
872
- ...a,
873
- {
874
- x: n.x,
875
- y: t
876
- }
877
- ]);
878
- } else a.length === 1 && i.push(a[0]);
879
- a = [];
880
- }
881
- }
882
- if (a.length >= 2) {
883
- let e = a[0], n = a[a.length - 1];
884
- r.push([
885
- {
886
- x: e.x,
887
- y: t
888
- },
889
- ...a,
890
- {
891
- x: n.x,
892
- y: t
893
- }
894
- ]);
895
- } else a.length === 1 && i.push(a[0]);
896
- return {
897
- polygons: r,
898
- singles: i
899
- };
900
- }
901
- function ar(e) {
902
- let t = e.coordinatesLine.map((t, n) => e.series[n] != null && Number.isFinite(t?.y) ? t : null), n = [], r = [];
903
- for (let e = 0; e < t.length; e += 1) {
904
- let i = t[e];
905
- i ? r.push(i) : (r.length >= 2 && n.push(r), r = []);
906
- }
907
- return r.length >= 2 && n.push(r), n;
908
- }
909
- function or(e) {
910
- if (On.value) {
911
- let t = ar(e);
912
- for (let n of t) d(O.value, n, {
913
- color: e.color,
914
- lineWidth: 3
915
- });
916
- } else d(O.value, e.coordinatesLine, {
917
- color: e.color,
918
- lineWidth: 3
919
- });
920
- }
921
- function sr(e) {
922
- let t = !!On.value;
923
- if (e.useArea) {
924
- let n = H.value.stacked ? e.localZero : G.value.zero;
925
- if (t) {
926
- let { polygons: t, singles: r } = ir(e, n);
927
- for (let n of t) ke(O.value, n, {
928
- fillColor: c(e.color, B.value.style.chart.area.opacity),
929
- strokeColor: "transparent"
930
- });
931
- let i = k.value / 200 * B.value.style.chart.line.plots.radiusRatio;
932
- for (let t of r) Oe(O.value, {
933
- x: t.x,
934
- y: t.y
935
- }, i, {
936
- color: B.value.style.chart.backgroundColor,
937
- fillStyle: e.color,
938
- strokeColor: "transparent"
939
- });
940
- } else {
941
- let t = {
942
- x: e.coordinatesLine[0].x,
943
- y: n
944
- }, r = {
945
- x: e.coordinatesLine.at(-1).x,
946
- y: n
947
- };
948
- ke(O.value, [
949
- t,
950
- ...e.coordinatesLine,
951
- r
952
- ], {
953
- fillColor: c(e.color, B.value.style.chart.area.opacity),
954
- strokeColor: "transparent"
955
- });
956
- }
957
- or(e);
958
- return;
959
- }
960
- or(e);
961
- }
962
- function cr() {
963
- q.value.forEach((e, t) => {
964
- d(O.value, [{
965
- x: W.value.left,
966
- y: W.value.bottom - e.yOffset
967
- }, {
968
- x: W.value.right,
969
- y: W.value.bottom - e.yOffset
970
- }], {
971
- color: B.value.style.chart.grid.x.horizontalLines.color,
972
- lineWidth: 1
973
- });
974
- });
975
- }
976
- function lr() {
977
- let { left: e, top: t, width: n, height: r } = W.value, i = J.value.start, a = J.value.end - i, o = n / a, s = Y.value.start - i, c = Y.value.end - i, l = Math.max(0, Math.min(a, s)), u = Math.max(0, Math.min(a, c));
978
- je(O.value, [
979
- {
980
- x: e + l * o,
981
- y: t
982
- },
983
- {
984
- x: e + l * o + (u - l) * o,
985
- y: t
986
- },
987
- {
988
- x: e + l * o + (u - l) * o,
989
- y: t + r
990
- },
991
- {
992
- x: e + l * o,
993
- y: t + r
994
- }
995
- ], {
996
- fillColor: B.value.style.chart.zoom.preview.fill,
997
- strokeColor: B.value.style.chart.zoom.preview.stroke,
998
- lineDash: [
999
- ,
1000
- ,
1001
- ,
1002
- ,
1003
- ].fill(B.value.style.chart.zoom.preview.strokeDasharray),
1004
- lineWidth: B.value.style.chart.zoom.preview.strokeWidth
1005
- });
1006
- }
1007
- function Q() {
1008
- !z.value || !V.value || !O.value || (Un(), N.value ? ((j.value !== null || L.value !== null) && B.value.style.chart.selector.show && tr(), rr(), H.value.stacked && B.value.style.chart.grid.x.showAxis && cr(), Vn.value.forEach((e) => {
1009
- (e.type === "line" || !e.type) && sr(e), P.value && (Wn(e), H.value.showDataLabels && [!0, void 0].includes(e.dataLabels) && qn(e));
1010
- }), V.value && (At.value = Ae(V.value))) : (At.value && (O.value.clearRect(0, 0, 1e4, 1e4), O.value.drawImage(At.value, 0, 0)), (j.value !== null || L.value !== null) && B.value.style.chart.selector.show && tr(), (j.value !== null || L.value !== null) && q.value.forEach((e) => {
1011
- let t = j.value ?? L.value, n = e.coordinatesLine[t];
1012
- (e.type === "line" || !e.type || e.type === "plot") && n && Number.isFinite(n.x) && Number.isFinite(n.y) && Oe(O.value, {
1013
- x: n.x,
1014
- y: n.y
1015
- }, k.value / 150 * B.value.style.chart.line.plots.radiusRatio, {
1016
- color: B.value.style.chart.backgroundColor,
1017
- fillStyle: e.color,
1018
- strokeColor: "transparent"
1019
- });
1020
- })), B.value.style.chart.grid.x.timeLabels.show && er(), B.value.style.chart.selector.show && B.value.style.chart.selector.showHorizontalSelector && nr(), Kn(), Gn(), B.value.style.chart.zoom.preview.enable && (J.value.start !== Y.value.start || J.value.end !== Y.value.end) && lr(), N.value = !1);
1021
- }
1022
- let ur = Ee(() => {
1023
- P.value = !0, Hn();
1024
- }, U.value > 200 ? 10 : 1, !P.value);
1025
- function dr(e) {
1026
- if ([null, void 0].includes(j.value ?? L.value) || !e.coordinatesLine[j.value ?? L.value]) return !1;
1027
- let { y: t, value: n } = e.coordinatesLine[j.value ?? L.value];
1028
- return {
1029
- y: t,
1030
- value: n
1031
- };
1032
- }
1033
- function fr(e) {
1034
- if (!z.value || !V.value || vn.value) return;
1035
- let { left: t, top: r } = V.value.getBoundingClientRect(), i = e.clientX - t;
1036
- if (I.value = (e.clientY - r) * 2, (I.value < W.value.top || I.value > W.value.bottom) && (I.value = null), i * 2 < W.value.left || i * 2 > W.value.right) {
1037
- _r();
1038
- return;
1039
- }
1040
- let a = i * 2 - W.value.left, o = Math.floor(a / W.value.slot);
1041
- if (j.value = o, R.value = o, Et.value = !0, Kt.value = !1, !P.value) return;
1042
- let s = "", c = B.value.style.chart.tooltip.customFormat, l = q.value.map((e) => ({
1043
- shape: e.shape || null,
1044
- name: e.name,
1045
- color: e.color,
1046
- type: e.type || "line",
1047
- value: e.series.find((e, t) => t === j.value)
1048
- }));
1049
- Ot.value = {
1050
- timeLabel: B.value.style.chart.grid.x.timeLabels.values.slice(J.value.start, J.value.end)[j.value] ? B.value.style.chart.tooltip.useDefaultTimeFormat ? Z.value.slice(J.value.start, J.value.end)[j.value]?.text : $n.value[j.value]?.text : "",
1051
- datapoint: l,
1052
- seriesIndex: j.value,
1053
- series: q.value,
1054
- config: B.value
1055
- }, xr({
1056
- seriesIndex: j.value,
1057
- datapoint: l
1058
- }), n(c) && oe(() => c({
1059
- seriesIndex: j.value,
1060
- datapoint: l,
1061
- series: q.value,
1062
- config: B.value
1063
- })) ? Dt.value = c({
1064
- seriesIndex: j.value,
1065
- datapoint: l,
1066
- series: q.value,
1067
- config: B.value
1068
- }) : (B.value.style.chart.grid.x.timeLabels.values.slice(J.value.start, J.value.end)[j.value] ? s += `<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${B.value.style.chart.tooltip.borderColor}; width:100%">${B.value.style.chart.tooltip.useDefaultTimeFormat ? Z.value.slice(J.value.start, J.value.end)[j.value]?.text : $n.value[j.value]?.text}</div>` : s += `<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${B.value.style.chart.tooltip.borderColor}; width:100%">${Z.value[j.value + J.value.start]?.text ?? ""}</div>`, s += Dn.value.join(""), Dt.value = s), P.value = !1;
1069
- }
1070
- function pr(e) {
1071
- return q.value.map((t) => ({
1072
- shape: t.shape || null,
1073
- name: t.name,
1074
- color: t.color,
1075
- type: t.type || "line",
1076
- value: t.series.find((t, n) => n === e)
1077
- }));
1078
- }
1079
- function mr(e) {
1080
- let t = "", r = B.value.style.chart.tooltip.customFormat, i = pr(e);
1081
- return xr({
1082
- seriesIndex: e,
1083
- datapoint: i
1084
- }), n(r) && oe(() => r({
1085
- seriesIndex: e,
1086
- datapoint: i,
1087
- series: q.value,
1088
- config: B.value
1089
- })) ? r({
1090
- seriesIndex: e,
1091
- datapoint: i,
1092
- series: q.value,
1093
- config: B.value
1094
- }) : (B.value.style.chart.grid.x.timeLabels.values.slice(J.value.start, J.value.end)[e] ? t += `<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${B.value.style.chart.tooltip.borderColor}; width:100%">${B.value.style.chart.tooltip.useDefaultTimeFormat ? Z.value.slice(J.value.start, J.value.end)[e]?.text : $n.value[e]?.text}</div>` : t += `<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${B.value.style.chart.tooltip.borderColor}; width:100%">${Z.value[e + J.value.start]?.text ?? ""}</div>`, t += Dn.value.join(""), t);
1095
- }
1096
- function hr(e) {
1097
- if (!V.value || !W.value?.slot) return;
1098
- let t = V.value.getBoundingClientRect(), n = t.width / W.value.canvasWidth, r = t.height / W.value.canvasHeight, i = W.value.left + W.value.slot * e + W.value.slot / 2, a = W.value.top + W.value.height / 2;
1099
- Jt.value = {
1100
- x: t.left + i * n,
1101
- y: t.top + a * r
1102
- };
1103
- }
1104
- function gr(e, { fromKeyboard: t = !1 } = {}) {
1105
- !z.value || vn.value || e != null && (e < 0 || e >= J.value.end - J.value.start || (j.value = e, R.value = e, Et.value = !0, Kt.value = t, Dt.value = mr(e), t && hr(e), P.value = !1, Q()));
1106
- }
1107
- function _r() {
1108
- Et.value = !1, j.value = null, R.value = null, Dt.value = "", I.value = null, Kt.value = !1, Q();
1109
- }
1110
- function vr() {
1111
- qt.value = !0;
1112
- }
1113
- function yr() {
1114
- qt.value = !1, _r();
1115
- }
1116
- function br(e) {
1117
- if (!V.value || Vr.value || document.activeElement !== V.value) return;
1118
- let t = e.key === "ArrowLeft", n = e.key === "ArrowRight";
1119
- if (!t && !n) return;
1120
- let r = J.value.end - J.value.start;
1121
- if (r <= 0) return;
1122
- e.preventDefault(), e.stopPropagation();
1123
- let i = R.value;
1124
- i !== null && i >= 0 && i < r ? n ? (i += 1, i >= r && (i = 0)) : (--i, i < 0 && (i = r - 1)) : i = n ? 0 : r - 1, gr(i, { fromKeyboard: !0 });
1125
- }
1126
- function xr({ seriesIndex: e, datapoint: t }) {
1127
- let n = J.value.start + e;
1128
- Yt("selectX", {
1129
- dataset: t,
1130
- index: n,
1131
- indexLabel: ""
1132
- });
1133
- }
1134
- C(() => T.selectedXIndex, (e) => {
1135
- if ([null, void 0].includes(T.selectedXIndex)) {
1136
- _r();
1137
- return;
1138
- }
1139
- let t = e - J.value.start;
1140
- t < 0 || e >= J.value.end ? _r() : gr(t, { fromKeyboard: !1 });
1141
- }, { immediate: !0 }), C(() => j.value, (e) => {
1142
- ur();
1143
- }), C(() => J.value, (e) => {
1144
- N.value = !0, Q();
1145
- }, { deep: !0 }), C(() => Y.value, (e) => {
1146
- Q();
1147
- }, { deep: !0 }), C(() => H.value.showDataLabels, (e) => {
1148
- N.value = !0, Q();
1149
- }), C(() => I.value, (e) => {
1150
- e && Q();
1151
- }), C(() => H.value.stacked, (e) => {
1152
- N.value = !0, P.value = !0, ur();
1153
- });
1154
- function Sr() {
1155
- _r();
1156
- }
1157
- let $ = et(null), Cr = et(null), wr = et(null);
1158
- Qe(() => {
1159
- zt.value = !0, Tr();
1160
- });
1161
- function Tr() {
1162
- if (o(T.dataset) && se({
1163
- componentName: "VueUiXyCanvas",
1164
- type: "dataset",
1165
- debug: en.value
1166
- }), Je(() => {
1167
- V.value && !O.value && (O.value = V.value.getContext("2d", { willReadFrequently: !0 })), O.value && z.value && (N.value = !0, P.value = !0, Hn());
1168
- }), B.value.responsive) {
1169
- let e = De(() => {
1170
- let { width: e, height: t } = Me({
1171
- chart: D.value,
1172
- title: B.value.style.chart.title.text ? Nt.value : null,
1173
- legend: B.value.style.chart.legend.show ? Pt.value : null,
1174
- slicer: B.value.style.chart.zoom.show && U.value > 6 ? F.value?.$el : null,
1175
- source: Ft.value
1176
- });
1177
- requestAnimationFrame(() => {
1178
- dn.value = `${e} / ${t}`;
1179
- });
1180
- });
1181
- $.value && (Cr.value && $.value.unobserve(Cr.value), $.value.disconnect()), $.value = new ResizeObserver(e), Cr.value = D.value.parentNode, $.value.observe(Cr.value);
1182
- }
1183
- wr.value && wr.value.disconnect(), wr.value = new ResizeObserver(async (e) => {
1184
- for (let t of e) t.contentBoxSize && Tt.value && (N.value = !0, ur());
1185
- }), wr.value.observe(Tt.value), Nn();
1186
- }
1187
- Ze(() => {
1188
- wr.value && wr.value.disconnect(), $.value && (Cr.value && $.value.unobserve(Cr.value), $.value.disconnect());
1189
- });
1190
- function Er() {
1191
- M.value.length ? M.value = [] : jr.value.forEach((e, t) => {
1192
- M.value.push(t);
1193
- }), N.value = !0, ur(), Yt("selectLegend", q.value);
1194
- }
1195
- function Dr(e) {
1196
- M.value.includes(e) ? M.value = M.value.filter((t) => t !== e) : M.value.push(e), N.value = !0, ur(), Yt("selectLegend", q.value);
1197
- }
1198
- function Or(e) {
1199
- return K.value.length ? K.value.find((t) => t.name === e) || (en.value && console.warn(`VueUiXyCanvas - Series name not found "${e}"`), null) : (en.value && console.warn("VueUiXyCanvas - There are no series to show."), null);
1200
- }
1201
- function kr(e) {
1202
- let t = Or(e);
1203
- t !== null && M.value.includes(t.absoluteIndex) && Dr(t.absoluteIndex);
1204
- }
1205
- function Ar(e) {
1206
- let t = Or(e);
1207
- t !== null && (M.value.includes(t.absoluteIndex) || Dr(t.absoluteIndex));
1208
- }
1209
- let jr = p(() => K.value.map((e, t) => ({
1210
- ...e,
1211
- name: e.name,
1212
- color: s(e.color) || _n.value[t] || i[t] || i[t % i.length],
1213
- shape: e.shape || "circle",
1214
- prefix: e.prefix || "",
1215
- suffix: e.suffix || "",
1216
- rounding: e.rounding || 0
1217
- })).map((e) => ({
1218
- ...e,
1219
- opacity: M.value.includes(e.absoluteIndex) ? .5 : 1,
1220
- segregate: () => Dr(e.absoluteIndex),
1221
- isSegregated: M.value.includes(e.absoluteIndex)
1222
- }))), Mr = p(() => ({
1223
- cy: "donut-div-legend",
1224
- backgroundColor: B.value.style.chart.legend.backgroundColor,
1225
- color: B.value.style.chart.legend.color,
1226
- fontSize: B.value.style.chart.legend.fontSize,
1227
- paddingBottom: 12,
1228
- fontWeight: B.value.style.chart.legend.bold ? "bold" : ""
1229
- })), Nr = p(() => {
1230
- let e = [""].concat(q.value.map((e) => e.name), "__SUM__"), t = [];
1231
- for (let e = 0; e < U.value; e += 1) {
1232
- let n = q.value.map((t) => t.series[e] ?? 0).reduce((e, t) => e + t, 0);
1233
- t.push([B.value.style.chart.grid.x.timeLabels.values.slice(J.value.start, J.value.end)[e] ? Z?.value?.slice(J.value.start, J.value.end)?.[e]?.text ?? e + 1 : e + 1].concat(q.value.map((t) => (t.series[e] ?? 0).toFixed(B.value.table.rounding)), (n ?? 0).toFixed(B.value.table.rounding)));
1234
- }
1235
- let n = {
1236
- th: {
1237
- backgroundColor: B.value.table.th.backgroundColor,
1238
- color: B.value.table.th.color,
1239
- outline: B.value.table.th.outline
1240
- },
1241
- td: {
1242
- backgroundColor: B.value.table.td.backgroundColor,
1243
- color: B.value.table.td.color,
1244
- outline: B.value.table.td.outline
1245
- },
1246
- breakpoint: B.value.table.responsiveBreakpoint
1247
- }, r = [B.value.table.columnNames.period].concat(q.value.map((e) => e.name), B.value.table.columnNames.total);
1248
- return {
1249
- head: e,
1250
- body: t.slice(0, J.value.end - J.value.start),
1251
- config: n,
1252
- colNames: r
1253
- };
1254
- }), Pr = p(() => {
1255
- if (q.value.length === 0) return {
1256
- head: [],
1257
- body: [],
1258
- config: {},
1259
- columnNames: []
1260
- };
1261
- let e = q.value.map((e) => ({
1262
- label: e.name,
1263
- color: e.color,
1264
- type: e.type
1265
- })), t = [];
1266
- for (let e = J.value.start; e < J.value.end; e += 1) {
1267
- let n = [B.value.style.chart.grid.x.timeLabels.values[e] ? Z.value[e].text : e + 1];
1268
- q.value.forEach((t) => {
1269
- n.push(Number((t.series[e] || 0).toFixed(B.value.table.rounding)));
1270
- }), t.push(n);
1271
- }
1272
- return {
1273
- head: e,
1274
- body: t
1275
- };
1276
- });
1277
- function Fr(e = null) {
1278
- let n = [
1279
- [B.value.style.chart.title.text],
1280
- [B.value.style.chart.title.subtitle.text],
1281
- [""]
1282
- ], i = ["", ...Pr.value.head.map((e) => e.label)], a = Pr.value.body, o = n.concat([i]).concat(a), s = r(o);
1283
- e ? e(s) : t({
1284
- csvContent: s,
1285
- title: B.value.style.chart.title.text || "vue-ui-xy-canvas"
1286
- });
1287
- }
1288
- function Ir() {
1289
- return q.value;
1290
- }
1291
- function Lr() {
1292
- H.value.showTable = !H.value.showTable;
1293
- }
1294
- function Rr() {
1295
- H.value.showDataLabels = !H.value.showDataLabels;
1296
- }
1297
- function zr() {
1298
- H.value.stacked = !H.value.stacked;
1299
- }
1300
- function Br() {
1301
- H.value.showTooltip = !H.value.showTooltip;
1302
- }
1303
- let Vr = b(!1);
1304
- function Hr() {
1305
- Vr.value = !Vr.value;
1306
- }
1307
- async function Ur({ scale: e = 2 } = {}) {
1308
- if (!D.value) return;
1309
- let { imageUri: t, base64: n } = await Ce({
1310
- domElement: D.value,
1311
- base64: !0,
1312
- img: !0,
1313
- scale: e
1314
- }), r = D.value.getBoundingClientRect(), i = {
1315
- width: r.width,
1316
- height: r.height,
1317
- aspectRatio: r.height ? r.width / r.height : 0
1318
- }, a = await le(t, e) ?? i;
1319
- return {
1320
- imageUri: t,
1321
- base64: n,
1322
- title: B.value.style.chart.title.text,
1323
- ...a
1324
- };
1325
- }
1326
- let Wr = p(() => {
1327
- let e = B.value.table.useDialog && !B.value.table.show, t = H.value.showTable;
1328
- return {
1329
- component: e ? xt : Fe,
1330
- title: `${B.value.style.chart.title.text}${B.value.style.chart.title.subtitle.text ? `: ${B.value.style.chart.title.subtitle.text}` : ""}`,
1331
- props: e ? {
1332
- backgroundColor: B.value.table.th.backgroundColor,
1333
- color: B.value.table.th.color,
1334
- headerColor: B.value.table.th.color,
1335
- headerBg: B.value.table.th.backgroundColor,
1336
- isFullscreen: Mt.value,
1337
- fullscreenParent: D.value,
1338
- forcedWidth: Math.min(800, window.innerWidth * .8),
1339
- isCursorPointer: $t.value
1340
- } : {
1341
- hideDetails: !0,
1342
- config: {
1343
- open: t,
1344
- maxHeight: 1e4,
1345
- body: {
1346
- backgroundColor: B.value.style.chart.backgroundColor,
1347
- color: B.value.style.chart.color
1348
- },
1349
- head: {
1350
- backgroundColor: B.value.style.chart.backgroundColor,
1351
- color: B.value.style.chart.color
1352
- }
1353
- }
1354
- }
1355
- };
1356
- });
1357
- C(() => H.value.showTable, (e) => {
1358
- B.value.table.show || (e && B.value.table.useDialog && Bt.value ? Bt.value.open() : "close" in Bt.value && Bt.value.close());
1359
- });
1360
- function Gr() {
1361
- H.value.showTable = !1, Vt.value && Vt.value.setTableIconState(!1);
1362
- }
1363
- function Kr(e) {
1364
- if (e?.stage === "start") {
1365
- Gt.value = !0;
1366
- return;
1367
- }
1368
- if (e?.stage === "end") {
1369
- Gt.value = !1;
1370
- return;
1371
- }
1372
- hn();
1373
- }
1374
- async function qr() {
1375
- if (Yt("copyAlt", {
1376
- config: B.value,
1377
- dataset: q.value
1378
- }), !B.value.userOptions.callbacks.altCopy) {
1379
- console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.");
1380
- return;
1381
- }
1382
- await Promise.resolve(B.value.userOptions.callbacks.altCopy({
1383
- config: B.value,
1384
- dataset: q.value
1385
- }));
1386
- }
1387
- return Te({
1388
- getData: Ir,
1389
- getImage: Ur,
1390
- generateCsv: Fr,
1391
- generatePdf: mn,
1392
- generateImage: hn,
1393
- hideSeries: Ar,
1394
- showSeries: kr,
1395
- toggleTable: Lr,
1396
- toggleLabels: Rr,
1397
- toggleStack: zr,
1398
- toggleTooltip: Br,
1399
- toggleAnnotator: Hr,
1400
- toggleFullscreen: gn,
1401
- copyAlt: qr
1402
- }), (t, r) => (y(), He("div", {
1403
- style: Xe(`width:100%; position:relative; ${B.value.responsive ? "height: 100%" : ""}; background:${B.value.style.chart.backgroundColor};`),
1404
- ref_key: "xy",
1405
- ref: D,
1406
- id: `xy_canvas_${E.value}`,
1407
- class: Ye(`vue-data-ui-component vue-ui-xy-canvas ${Mt.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
1408
- onMouseenter: cn,
1409
- onMouseleave: ln
1410
- }, [
1411
- g("div", {
1412
- id: `chart-instructions-${E.value}`,
1413
- class: "sr-only"
1414
- }, [g("p", null, tt(B.value.a11y.translations.keyboardNavigation), 1)], 8, st),
1415
- g("div", ct, tt(Qt.value), 1),
1416
- B.value.style.chart.title.text ? (y(), He("div", {
1417
- key: 0,
1418
- ref_key: "chartTitle",
1419
- ref: Nt,
1420
- style: Xe(`width:100%;background:${B.value.style.chart.backgroundColor};`)
1421
- }, [(y(), m(we, {
1422
- key: `title_${It.value}`,
1423
- config: {
1424
- title: {
1425
- cy: "xy-canvas-title",
1426
- ...B.value.style.chart.title
1427
- },
1428
- subtitle: {
1429
- cy: "xy-canvas-subtitle",
1430
- ...B.value.style.chart.title.subtitle
1431
- }
1432
- }
1433
- }, null, 8, ["config"]))], 4)) : h("", !0),
1434
- g("div", { id: `legend-top-${E.value}` }, null, 8, lt),
1435
- B.value.userOptions.show && z.value && (S(sn) || S(an)) ? (y(), m(S(yt), {
1436
- ref_key: "userOptionsRef",
1437
- ref: Vt,
1438
- key: `user_option_${jt.value}`,
1439
- backgroundColor: B.value.style.chart.backgroundColor,
1440
- color: B.value.style.chart.color,
1441
- isPrinting: S(fn),
1442
- isImaging: S(pn),
1443
- uid: E.value,
1444
- hasTooltip: B.value.userOptions.buttons.tooltip && B.value.style.chart.tooltip.show,
1445
- hasPdf: B.value.userOptions.buttons.pdf,
1446
- hasImg: B.value.userOptions.buttons.img,
1447
- hasXls: B.value.userOptions.buttons.csv,
1448
- hasLabel: B.value.userOptions.buttons.labels,
1449
- hasStack: e.dataset.length > 1 && B.value.userOptions.buttons.stack,
1450
- hasFullscreen: B.value.userOptions.buttons.fullscreen,
1451
- hasAltCopy: B.value.userOptions.buttons.altCopy,
1452
- hasTable: J.value.end - J.value.start <= 730 && B.value.userOptions.buttons.table,
1453
- isFullscreen: Mt.value,
1454
- isTooltip: H.value.showTooltip,
1455
- isStacked: H.value.stacked,
1456
- titles: { ...B.value.userOptions.buttonTitles },
1457
- chartElement: D.value,
1458
- position: B.value.userOptions.position,
1459
- hasAnnotator: B.value.userOptions.buttons.annotator,
1460
- isAnnotation: Vr.value,
1461
- callbacks: B.value.userOptions.callbacks,
1462
- printScale: B.value.userOptions.print.scale,
1463
- tableDialog: B.value.table.useDialog,
1464
- isCursorPointer: $t.value,
1465
- onToggleFullscreen: gn,
1466
- onGeneratePdf: S(mn),
1467
- onGenerateCsv: Fr,
1468
- onGenerateImage: Kr,
1469
- onToggleTable: Lr,
1470
- onToggleLabels: Rr,
1471
- onToggleStack: zr,
1472
- onToggleTooltip: Br,
1473
- onToggleAnnotator: Hr,
1474
- onCopyAlt: qr,
1475
- style: Xe({ visibility: S(sn) ? S(an) ? "visible" : "hidden" : "visible" })
1476
- }, Ue({ _: 2 }, [
1477
- t.$slots.menuIcon ? {
1478
- name: "menuIcon",
1479
- fn: w(({ isOpen: e, color: n }) => [x(t.$slots, "menuIcon", v(_({
1480
- isOpen: e,
1481
- color: n
1482
- })), void 0, !0)]),
1483
- key: "0"
1484
- } : void 0,
1485
- t.$slots.optionTooltip ? {
1486
- name: "optionTooltip",
1487
- fn: w(() => [x(t.$slots, "optionTooltip", {}, void 0, !0)]),
1488
- key: "1"
1489
- } : void 0,
1490
- t.$slots.optionPdf ? {
1491
- name: "optionPdf",
1492
- fn: w(() => [x(t.$slots, "optionPdf", {}, void 0, !0)]),
1493
- key: "2"
1494
- } : void 0,
1495
- t.$slots.optionCsv ? {
1496
- name: "optionCsv",
1497
- fn: w(() => [x(t.$slots, "optionCsv", {}, void 0, !0)]),
1498
- key: "3"
1499
- } : void 0,
1500
- t.$slots.optionImg ? {
1501
- name: "optionImg",
1502
- fn: w(() => [x(t.$slots, "optionImg", {}, void 0, !0)]),
1503
- key: "4"
1504
- } : void 0,
1505
- t.$slots.optionTable ? {
1506
- name: "optionTable",
1507
- fn: w(() => [x(t.$slots, "optionTable", {}, void 0, !0)]),
1508
- key: "5"
1509
- } : void 0,
1510
- t.$slots.optionLabels ? {
1511
- name: "optionLabels",
1512
- fn: w(() => [x(t.$slots, "optionLabels", {}, void 0, !0)]),
1513
- key: "6"
1514
- } : void 0,
1515
- t.$slots.optionStack ? {
1516
- name: "optionStack",
1517
- fn: w(() => [x(t.$slots, "optionStack", {}, void 0, !0)]),
1518
- key: "7"
1519
- } : void 0,
1520
- t.$slots.optionFullscreen ? {
1521
- name: "optionFullscreen",
1522
- fn: w(({ toggleFullscreen: e, isFullscreen: n }) => [x(t.$slots, "optionFullscreen", v(_({
1523
- toggleFullscreen: e,
1524
- isFullscreen: n
1525
- })), void 0, !0)]),
1526
- key: "8"
1527
- } : void 0,
1528
- t.$slots.optionAnnotator ? {
1529
- name: "optionAnnotator",
1530
- fn: w(({ toggleAnnotator: e, isAnnotator: n }) => [x(t.$slots, "optionAnnotator", v(_({
1531
- toggleAnnotator: e,
1532
- isAnnotator: n
1533
- })), void 0, !0)]),
1534
- key: "9"
1535
- } : void 0,
1536
- t.$slots.optionAltCopy ? {
1537
- name: "optionAltCopy",
1538
- fn: w(({ altCopy: e }) => [x(t.$slots, "optionAltCopy", v(_({ altCopy: e })), void 0, !0)]),
1539
- key: "10"
1540
- } : void 0,
1541
- t.$slots["custom-menu-before"] ? {
1542
- name: "custom-menu-before",
1543
- fn: w(() => [x(t.$slots, "custom-menu-before", {}, void 0, !0)]),
1544
- key: "11"
1545
- } : void 0,
1546
- t.$slots["custom-menu-after"] ? {
1547
- name: "custom-menu-after",
1548
- fn: w(() => [x(t.$slots, "custom-menu-after", {}, void 0, !0)]),
1549
- key: "12"
1550
- } : void 0
1551
- ]), 1032, /* @__PURE__ */ "backgroundColor.color.isPrinting.isImaging.uid.hasTooltip.hasPdf.hasImg.hasXls.hasLabel.hasStack.hasFullscreen.hasAltCopy.hasTable.isFullscreen.isTooltip.isStacked.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.style".split("."))) : h("", !0),
1552
- g("div", {
1553
- class: "vue-ui-xy-canvas",
1554
- style: Xe(`position: relative; aspect-ratio: ${dn.value}`),
1555
- ref_key: "container",
1556
- ref: Tt
1557
- }, [
1558
- g("canvas", {
1559
- ref_key: "canvas",
1560
- ref: V,
1561
- "aria-label": Zt.value,
1562
- "aria-describedby": `chart-instructions-${E.value}`,
1563
- role: "img",
1564
- "aria-live": "polite",
1565
- tabindex: "0",
1566
- style: {
1567
- width: "100%",
1568
- height: "100%"
1569
- },
1570
- onMousemove: r[0] ||= (e) => fr(e),
1571
- onMouseleave: Sr,
1572
- onFocus: vr,
1573
- onBlur: yr,
1574
- onKeydown: br
1575
- }, null, 40, ut),
1576
- t.$slots.hint ? (y(), He("div", dt, [x(t.$slots, "hint", v(_({
1577
- hint: B.value.a11y.translations.keyboardNavigation,
1578
- isVisible: qt.value
1579
- })), void 0, !0)])) : h("", !0),
1580
- x(t.$slots, "skeleton", {}, () => [S(nn) ? (y(), m(be, { key: 0 })) : h("", !0)], !0),
1581
- Ge(S(_t), {
1582
- teleportTo: B.value.style.chart.tooltip.teleportTo,
1583
- show: H.value.showTooltip && Et.value,
1584
- backgroundColor: B.value.style.chart.tooltip.backgroundColor,
1585
- color: B.value.style.chart.tooltip.color,
1586
- fontSize: B.value.style.chart.tooltip.fontSize,
1587
- borderRadius: B.value.style.chart.tooltip.borderRadius,
1588
- borderColor: B.value.style.chart.tooltip.borderColor,
1589
- borderWidth: B.value.style.chart.tooltip.borderWidth,
1590
- position: B.value.style.chart.tooltip.position,
1591
- offsetX: B.value.style.chart.tooltip.offsetX,
1592
- offsetY: B.value.style.chart.tooltip.offsetY,
1593
- parent: t.$refs.xy,
1594
- content: Dt.value,
1595
- isFullscreen: Mt.value,
1596
- backgroundOpacity: B.value.style.chart.tooltip.backgroundOpacity,
1597
- isCustom: S(n)(B.value.style.chart.tooltip.customFormat),
1598
- smooth: B.value.style.chart.tooltip.smooth,
1599
- backdropFilter: B.value.style.chart.tooltip.backdropFilter,
1600
- smoothForce: B.value.style.chart.tooltip.smoothForce,
1601
- smoothSnapThreshold: B.value.style.chart.tooltip.smoothSnapThreshold,
1602
- isA11yMode: Kt.value,
1603
- a11yPosition: Jt.value
1604
- }, {
1605
- "tooltip-before": w(() => [x(t.$slots, "tooltip-before", v(_({ ...Ot.value })), void 0, !0)]),
1606
- tooltip: w(() => [x(t.$slots, "tooltip", v(_({ ...Ot.value })), void 0, !0)]),
1607
- "tooltip-after": w(() => [x(t.$slots, "tooltip-after", v(_({ ...Ot.value })), void 0, !0)]),
1608
- _: 3
1609
- }, 8, [
1610
- "teleportTo",
1611
- "show",
1612
- "backgroundColor",
1613
- "color",
1614
- "fontSize",
1615
- "borderRadius",
1616
- "borderColor",
1617
- "borderWidth",
1618
- "position",
1619
- "offsetX",
1620
- "offsetY",
1621
- "parent",
1622
- "content",
1623
- "isFullscreen",
1624
- "backgroundOpacity",
1625
- "isCustom",
1626
- "smooth",
1627
- "backdropFilter",
1628
- "smoothForce",
1629
- "smoothSnapThreshold",
1630
- "isA11yMode",
1631
- "a11yPosition"
1632
- ])
1633
- ], 4),
1634
- B.value.style.chart.zoom.show && U.value > 6 && z.value && Ut.value && !S(nn) ? (y(), m(Pe, {
1635
- key: 2,
1636
- ref_key: "chartSlicer",
1637
- ref: F,
1638
- "data-dom-to-png-ignore-layout": "",
1639
- allMinimaps: An.value,
1640
- background: B.value.style.chart.zoom.color,
1641
- borderColor: B.value.style.chart.backgroundColor,
1642
- customFormat: B.value.style.chart.zoom.customFormat,
1643
- cutNullValues: On.value,
1644
- enableRangeHandles: B.value.style.chart.zoom.enableRangeHandles,
1645
- enableSelectionDrag: B.value.style.chart.zoom.enableSelectionDrag,
1646
- end: J.value.end,
1647
- focusOnDrag: B.value.style.chart.zoom.focusOnDrag,
1648
- focusRangeRatio: B.value.style.chart.zoom.focusRangeRatio,
1649
- fontSize: B.value.style.chart.zoom.fontSize,
1650
- immediate: !B.value.style.chart.zoom.preview.enable,
1651
- inputColor: B.value.style.chart.zoom.color,
1652
- isPreview: Pn.value,
1653
- labelLeft: B.value.style.chart.grid.x.timeLabels.values[J.value.start] ? Z.value[J.value.start]?.text : "",
1654
- labelRight: B.value.style.chart.grid.x.timeLabels.values[J.value.end - 1] ? Z.value[J.value.end - 1]?.text : "",
1655
- max: U.value,
1656
- min: 0,
1657
- minimap: kn.value,
1658
- minimapCompact: B.value.style.chart.zoom.minimap.compact,
1659
- minimapFrameColor: B.value.style.chart.zoom.minimap.frameColor,
1660
- minimapIndicatorColor: B.value.style.chart.zoom.minimap.indicatorColor,
1661
- minimapLineColor: B.value.style.chart.zoom.minimap.lineColor,
1662
- minimapMerged: B.value.style.chart.zoom.minimap.merged,
1663
- minimapSelectedColor: B.value.style.chart.zoom.minimap.selectedColor,
1664
- minimapSelectedColorOpacity: B.value.style.chart.zoom.minimap.selectedColorOpacity,
1665
- minimapSelectedIndex: j.value,
1666
- minimapSelectionRadius: B.value.style.chart.zoom.minimap.selectionRadius,
1667
- preciseLabels: Qn.value?.length ? Qn.value : Z.value,
1668
- refreshEndPoint: B.value.style.chart.zoom.endIndex === null ? U.value : B.value.style.chart.zoom.endIndex + 1,
1669
- refreshStartPoint: B.value.style.chart.zoom.startIndex === null ? 0 : B.value.style.chart.zoom.startIndex,
1670
- selectColor: B.value.style.chart.zoom.highlightColor,
1671
- selectedSeries: K.value,
1672
- smoothMinimap: B.value.style.chart.zoom.minimap.smooth,
1673
- start: J.value.start,
1674
- timeLabels: Z.value,
1675
- usePreciseLabels: B.value.style.chart.grid.x.timeLabels.datetimeFormatter.enable && !B.value.style.chart.zoom.useDefaultFormat,
1676
- textColor: B.value.style.chart.color,
1677
- useResetSlot: B.value.style.chart.zoom.useResetSlot,
1678
- valueEnd: J.value.end,
1679
- valueStart: J.value.start,
1680
- verticalHandles: B.value.style.chart.zoom.minimap.verticalHandles,
1681
- maxWidth: B.value.style.chart.zoom.maxWidth,
1682
- minimapLeftInsetRatio: W.value.canvasWidth > 0 && B.value.style.chart.zoom.autoFit ? W.value.left / W.value.canvasWidth : null,
1683
- minimapRightInsetRatio: W.value.canvasWidth > 0 && B.value.style.chart.zoom.autoFit ? (W.value.canvasWidth - W.value.right) / W.value.canvasWidth : null,
1684
- additionalMinimapHeight: B.value.style.chart.zoom.minimap.additionalHeight,
1685
- handleType: B.value.style.chart.zoom.minimap.handleType,
1686
- handleIconColor: B.value.style.chart.zoom.minimap.handleIconColor,
1687
- handleBorderWidth: B.value.style.chart.zoom.minimap.handleBorderWidth,
1688
- handleBorderColor: B.value.style.chart.zoom.minimap.handleBorderColor,
1689
- handleFill: B.value.style.chart.zoom.minimap.handleFill,
1690
- handleWidth: B.value.style.chart.zoom.minimap.handleWidth,
1691
- onFutureEnd: r[1] ||= (e) => Fn("end", e),
1692
- onFutureStart: r[2] ||= (e) => Fn("start", e),
1693
- onReset: Nn,
1694
- onTrapMouse: yn,
1695
- "onUpdate:end": Rn,
1696
- "onUpdate:start": Ln
1697
- }, {
1698
- "reset-action": w(({ reset: e }) => [x(t.$slots, "reset-action", v(_({ reset: e })), void 0, !0)]),
1699
- _: 3
1700
- }, 8, /* @__PURE__ */ "allMinimaps.background.borderColor.customFormat.cutNullValues.enableRangeHandles.enableSelectionDrag.end.focusOnDrag.focusRangeRatio.fontSize.immediate.inputColor.isPreview.labelLeft.labelRight.max.minimap.minimapCompact.minimapFrameColor.minimapIndicatorColor.minimapLineColor.minimapMerged.minimapSelectedColor.minimapSelectedColorOpacity.minimapSelectedIndex.minimapSelectionRadius.preciseLabels.refreshEndPoint.refreshStartPoint.selectColor.selectedSeries.smoothMinimap.start.timeLabels.usePreciseLabels.textColor.useResetSlot.valueEnd.valueStart.verticalHandles.maxWidth.minimapLeftInsetRatio.minimapRightInsetRatio.additionalMinimapHeight.handleType.handleIconColor.handleBorderWidth.handleBorderColor.handleFill.handleWidth".split("."))) : h("", !0),
1701
- g("div", { id: `legend-bottom-${E.value}` }, null, 8, ft),
1702
- zt.value && (B.value.style.chart.legend.show || t.$slots.legend) ? (y(), m(Ve, {
1703
- key: 3,
1704
- to: B.value.style.chart.legend.position === "top" ? `#legend-top-${E.value}` : `#legend-bottom-${E.value}`
1705
- }, [g("div", {
1706
- ref_key: "chartLegend",
1707
- ref: Pt
1708
- }, [x(t.$slots, "legend", { legend: jr.value }, () => [B.value.style.chart.legend.show && z.value ? (y(), m(ze, {
1709
- legendSet: jr.value,
1710
- config: Mr.value,
1711
- key: `legend_${Rt.value}`,
1712
- isCursorPointer: $t.value,
1713
- onClickMarker: r[3] ||= ({ i: e }) => Dr(e)
1714
- }, {
1715
- item: w(({ legend: e, index: t }) => [g("div", {
1716
- onClick: (t) => e.segregate(),
1717
- style: Xe(`opacity:${M.value.includes(t) ? .5 : 1}`)
1718
- }, tt(e.name), 13, pt)]),
1719
- legendToggle: w(() => [jr.value.length > 2 && B.value.style.chart.legend.selectAllToggle.show && !S(nn) ? (y(), m(Ie, {
1720
- key: 0,
1721
- backgroundColor: B.value.style.chart.legend.selectAllToggle.backgroundColor,
1722
- color: B.value.style.chart.legend.selectAllToggle.color,
1723
- fontSize: B.value.style.chart.legend.fontSize,
1724
- checked: M.value.length > 0,
1725
- isCursorPointer: $t.value,
1726
- onToggle: Er
1727
- }, null, 8, [
1728
- "backgroundColor",
1729
- "color",
1730
- "fontSize",
1731
- "checked",
1732
- "isCursorPointer"
1733
- ])) : h("", !0)]),
1734
- _: 1
1735
- }, 8, [
1736
- "legendSet",
1737
- "config",
1738
- "isCursorPointer"
1739
- ])) : h("", !0)], !0)], 512)], 8, ["to"])) : h("", !0),
1740
- t.$slots.watermark ? (y(), He("div", mt, [x(t.$slots, "watermark", v(_({ isPrinting: S(fn) || S(pn) || Gt.value })), void 0, !0)])) : h("", !0),
1741
- t.$slots.source ? (y(), He("div", {
1742
- key: 5,
1743
- ref_key: "source",
1744
- ref: Ft,
1745
- dir: "auto"
1746
- }, [x(t.$slots, "source", {}, void 0, !0)], 512)) : h("", !0),
1747
- z.value && B.value.userOptions.buttons.table ? (y(), m($e(Wr.value.component), qe({ key: 6 }, Wr.value.props, {
1748
- ref_key: "tableUnit",
1749
- ref: Bt,
1750
- onClose: Gr
1751
- }), Ue({
1752
- content: w(() => [(y(), m(S(vt), {
1753
- key: `table_${Lt.value}`,
1754
- colNames: Nr.value.colNames,
1755
- head: Nr.value.head,
1756
- body: Nr.value.body,
1757
- config: Nr.value.config,
1758
- title: B.value.table.useDialog ? "" : Wr.value.title,
1759
- withCloseButton: !B.value.table.useDialog,
1760
- isCursorPointer: $t.value,
1761
- onClose: Gr
1762
- }, {
1763
- th: w(({ th: e }) => [e === "__SUM__" ? (y(), He("div", ht, [Ge(Ne, {
1764
- name: "sigma",
1765
- stroke: Nr.value.config.th.color,
1766
- size: 16
1767
- }, null, 8, ["stroke"])])) : (y(), He("div", gt, tt(e), 1))]),
1768
- td: w(({ td: e }) => [We(tt(e), 1)]),
1769
- _: 1
1770
- }, 8, [
1771
- "colNames",
1772
- "head",
1773
- "body",
1774
- "config",
1775
- "title",
1776
- "withCloseButton",
1777
- "isCursorPointer"
1778
- ]))]),
1779
- _: 2
1780
- }, [B.value.table.useDialog ? {
1781
- name: "title",
1782
- fn: w(() => [We(tt(Wr.value.title), 1)]),
1783
- key: "0"
1784
- } : void 0, B.value.table.useDialog ? {
1785
- name: "actions",
1786
- fn: w(() => [g("button", {
1787
- tabindex: "0",
1788
- class: "vue-ui-user-options-button",
1789
- onClick: r[4] ||= (e) => Fr(B.value.userOptions.callbacks.csv),
1790
- style: Xe({ cursor: $t.value ? "pointer" : "default" })
1791
- }, [Ge(Ne, {
1792
- name: "fileCsv",
1793
- stroke: Wr.value.props.color
1794
- }, null, 8, ["stroke"])], 4)]),
1795
- key: "1"
1796
- } : void 0]), 1040)) : h("", !0),
1797
- B.value.userOptions.buttons.annotator && q.value.length ? (y(), m(S(bt), {
1798
- key: 7,
1799
- parent: D.value,
1800
- backgroundColor: B.value.style.chart.backgroundColor,
1801
- color: B.value.style.chart.color,
1802
- active: Vr.value,
1803
- isCursorPointer: $t.value,
1804
- onClose: Hr
1805
- }, {
1806
- "annotator-action-close": w(() => [x(t.$slots, "annotator-action-close", {}, void 0, !0)]),
1807
- "annotator-action-color": w(({ color: e }) => [x(t.$slots, "annotator-action-color", v(_({ color: e })), void 0, !0)]),
1808
- "annotator-action-draw": w(({ mode: e }) => [x(t.$slots, "annotator-action-draw", v(_({ mode: e })), void 0, !0)]),
1809
- "annotator-action-undo": w(({ disabled: e }) => [x(t.$slots, "annotator-action-undo", v(_({ disabled: e })), void 0, !0)]),
1810
- "annotator-action-redo": w(({ disabled: e }) => [x(t.$slots, "annotator-action-redo", v(_({ disabled: e })), void 0, !0)]),
1811
- "annotator-action-delete": w(({ disabled: e }) => [x(t.$slots, "annotator-action-delete", v(_({ disabled: e })), void 0, !0)]),
1812
- _: 3
1813
- }, 8, [
1814
- "parent",
1815
- "backgroundColor",
1816
- "color",
1817
- "active",
1818
- "isCursorPointer"
1819
- ])) : h("", !0)
1820
- ], 46, ot));
1821
- }
1822
- }, [["__scopeId", "data-v-c47c665d"]]);
1823
- //#endregion
1824
- export { at as n, _t as t };