vue-data-ui 2.12.8-beta.2 → 2.12.8-beta.4

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 (92) hide show
  1. package/README.md +21 -0
  2. package/dist/{Arrow-HbfibAF0.js → Arrow-XoY1VXNf.js} +1 -1
  3. package/dist/{BaseDraggableDialog-DGrErCX-.js → BaseDraggableDialog-CXe0WfN-.js} +2 -2
  4. package/dist/{BaseIcon-j0c6lJUs.js → BaseIcon-d4dmqhkb.js} +1 -1
  5. package/dist/{ColorPicker-DitXXl-H.js → ColorPicker-B3v0IhDO.js} +2 -2
  6. package/dist/{DataTable-CsoAI95B.js → DataTable-CmbjnjRg.js} +2 -2
  7. package/dist/{Legend-ZW-PFcHg.js → Legend-YPYnzTBz.js} +2 -2
  8. package/dist/{NonSvgPenAndPaper-DJTUaQ94.js → NonSvgPenAndPaper-SD-bH_GI.js} +3 -3
  9. package/dist/{PackageVersion-DCAZ9Z7V.js → PackageVersion-OcbP0WH2.js} +1 -1
  10. package/dist/{PenAndPaper-B9RP4oFj.js → PenAndPaper-BgPXmpGI.js} +3 -3
  11. package/dist/{Shape-BBbhObHC.js → Shape-WvXjwML_.js} +1 -1
  12. package/dist/{Slicer-Vh74fjdf.js → Slicer-CaMHCF_p.js} +2 -2
  13. package/dist/{SparkTooltip-CG-HMbX2.js → SparkTooltip-BTLad6y3.js} +1 -1
  14. package/dist/{Title-Dx8ctnVy.js → Title-CJcZXNtK.js} +1 -1
  15. package/dist/{Tooltip-COHlzpZI.js → Tooltip-dXp8FaUj.js} +1 -1
  16. package/dist/{UserOptions-CGn3YdRV.js → UserOptions-Cs7JW3dK.js} +154 -138
  17. package/dist/dom-to-png-DGfv21rX.js +247 -0
  18. package/dist/img-fdViJw1e.js +20 -0
  19. package/dist/{index-CbcpITE_.js → index-BzQ0j5xI.js} +190 -128
  20. package/dist/{pdf-Cy09nTjn.js → pdf-Bj65uPK-.js} +1 -1
  21. package/dist/style.css +1 -1
  22. package/dist/types/vue-data-ui.d.cts +60 -1
  23. package/dist/types/vue-data-ui.d.ts +60 -1
  24. package/dist/{useNestedProp-y56W8I7J.js → useNestedProp-DqpZEE3h.js} +1 -1
  25. package/dist/{usePrinter-u-gQiRNz.js → usePrinter-CpG5jh_z.js} +2 -2
  26. package/dist/{vue-data-ui-DGmMT-Yp.js → vue-data-ui-CeIncf6V.js} +63 -63
  27. package/dist/vue-data-ui.js +1 -1
  28. package/dist/{vue-ui-3d-bar-Du4TkjPV.js → vue-ui-3d-bar-fAJK0nIB.js} +175 -174
  29. package/dist/{vue-ui-accordion-BkA7rtwr.js → vue-ui-accordion-bpaEpjqI.js} +3 -3
  30. package/dist/{vue-ui-age-pyramid-bw7gLRlR.js → vue-ui-age-pyramid-D5w5EqmV.js} +200 -199
  31. package/dist/{vue-ui-annotator-C-_zXB7H.js → vue-ui-annotator-CSGemK-O.js} +2 -2
  32. package/dist/{vue-ui-bullet-BRnz7E8e.js → vue-ui-bullet-FPBahjOr.js} +9 -8
  33. package/dist/{vue-ui-candlestick-9cPPnO0t.js → vue-ui-candlestick-BpP9MQC2.js} +115 -114
  34. package/dist/{vue-ui-carousel-table-BJuSGbk2.js → vue-ui-carousel-table-lpdLFAfT.js} +80 -79
  35. package/dist/{vue-ui-chestnut-D2dnrdHT.js → vue-ui-chestnut-D5um0tmC.js} +453 -452
  36. package/dist/{vue-ui-chord-Rvygj27H.js → vue-ui-chord-CgrXXOgv.js} +43 -42
  37. package/dist/{vue-ui-circle-pack-BR79EDAC.js → vue-ui-circle-pack-Jk-Yd8T_.js} +143 -142
  38. package/dist/{vue-ui-cursor-K11x9TYc.js → vue-ui-cursor-BjmAMjTd.js} +2 -2
  39. package/dist/{vue-ui-dashboard-BgxqXwqN.js → vue-ui-dashboard-CQ0B1DMq.js} +62 -62
  40. package/dist/{vue-ui-digits-D7StMUym.js → vue-ui-digits-B3h4BufU.js} +2 -2
  41. package/dist/{vue-ui-donut-CyOg8kph.js → vue-ui-donut-DcjJqRof.js} +151 -150
  42. package/dist/{vue-ui-donut-evolution-CVhQaMNQ.js → vue-ui-donut-evolution-DmSbXlMu.js} +111 -110
  43. package/dist/{vue-ui-dumbbell-C7Wex4VO.js → vue-ui-dumbbell-BLcmTUd_.js} +54 -53
  44. package/dist/{vue-ui-flow-DFNdP-V9.js → vue-ui-flow-BmIGl6DC.js} +14 -13
  45. package/dist/{vue-ui-funnel-DqWcZVvF.js → vue-ui-funnel-BJfxaSQC.js} +75 -74
  46. package/dist/{vue-ui-galaxy-BhPbJqYr.js → vue-ui-galaxy-Cpnr2YW-.js} +84 -83
  47. package/dist/{vue-ui-gauge-sP6YPTJH.js → vue-ui-gauge-BhPFNziU.js} +33 -32
  48. package/dist/{vue-ui-gizmo-B4fq_bGX.js → vue-ui-gizmo-B2wA-kmz.js} +3 -3
  49. package/dist/{vue-ui-heatmap-CpNjtuyD.js → vue-ui-heatmap-CpwNMx3i.js} +222 -221
  50. package/dist/{vue-ui-history-plot-CtgTg4fG.js → vue-ui-history-plot-DpxHqDZw.js} +234 -233
  51. package/dist/{vue-ui-kpi-CN2AE1VF.js → vue-ui-kpi-CvqXwiiE.js} +3 -3
  52. package/dist/{vue-ui-mini-loader-CYt8LlhO.js → vue-ui-mini-loader-DIjSfc7L.js} +2 -2
  53. package/dist/{vue-ui-molecule-D3kexAu_.js → vue-ui-molecule-3-vg0Re6.js} +44 -43
  54. package/dist/{vue-ui-mood-radar-hHqR8eS7.js → vue-ui-mood-radar-B7W7wGkW.js} +76 -75
  55. package/dist/{vue-ui-nested-donuts-DXwaOA_n.js → vue-ui-nested-donuts-ByoeDL-3.js} +53 -52
  56. package/dist/{vue-ui-onion-C7R2R5tf.js → vue-ui-onion-CNVwf4QX.js} +72 -71
  57. package/dist/{vue-ui-parallel-coordinate-plot-Dh772r8W.js → vue-ui-parallel-coordinate-plot-C0KJrBX8.js} +13 -12
  58. package/dist/{vue-ui-quadrant-jrOesLSU.js → vue-ui-quadrant-C-wPn5l5.js} +13 -12
  59. package/dist/{vue-ui-quick-chart-CtLnhGZA.js → vue-ui-quick-chart-SV-m_FhA.js} +8 -7
  60. package/dist/{vue-ui-radar-BikYRjfw.js → vue-ui-radar-DqOzvLUy.js} +283 -282
  61. package/dist/{vue-ui-rating-DUYbT-Ve.js → vue-ui-rating-CsZXcINB.js} +2 -2
  62. package/dist/{vue-ui-relation-circle-CjnDrflp.js → vue-ui-relation-circle-B0zxq02O.js} +75 -74
  63. package/dist/{vue-ui-ridgeline-o7-RpeJx.js → vue-ui-ridgeline-CykFyAin.js} +102 -101
  64. package/dist/{vue-ui-rings-Dinj5ws1.js → vue-ui-rings-DoJwXgd3.js} +110 -109
  65. package/dist/{vue-ui-scatter-CODAsxBq.js → vue-ui-scatter-BTT3BYrI.js} +166 -165
  66. package/dist/{vue-ui-skeleton-miKWlCAi.js → vue-ui-skeleton-CavMQlAm.js} +3 -3
  67. package/dist/{vue-ui-smiley-DwqlNm1O.js → vue-ui-smiley-DdT6TBz8.js} +2 -2
  68. package/dist/{vue-ui-spark-trend-BjL35phT.js → vue-ui-spark-trend-D9q63V2-.js} +3 -3
  69. package/dist/{vue-ui-sparkbar-2o2ZLL50.js → vue-ui-sparkbar-DCS_f__b.js} +3 -3
  70. package/dist/{vue-ui-sparkgauge-CMlBpOcc.js → vue-ui-sparkgauge-CGDjBHjo.js} +3 -3
  71. package/dist/{vue-ui-sparkhistogram-C7Ue-aaI.js → vue-ui-sparkhistogram-Ctpm0106.js} +4 -4
  72. package/dist/{vue-ui-sparkline-w29yzdZG.js → vue-ui-sparkline-BVyjNK_A.js} +3 -3
  73. package/dist/{vue-ui-sparkstackbar-DbIxY7W3.js → vue-ui-sparkstackbar-BsNDucJO.js} +3 -3
  74. package/dist/{vue-ui-stackbar-CWqpeYW-.js → vue-ui-stackbar-DuGcJQ6F.js} +39 -38
  75. package/dist/{vue-ui-strip-plot-DyjQVaDX.js → vue-ui-strip-plot-C6vbloAI.js} +82 -81
  76. package/dist/{vue-ui-table-Bx82XIlz.js → vue-ui-table-Bb6pNaIM.js} +3 -3
  77. package/dist/{vue-ui-table-heatmap-RvSyx9L6.js → vue-ui-table-heatmap-_ypWL_z2.js} +77 -76
  78. package/dist/{vue-ui-table-sparkline-DebvtEV3.js → vue-ui-table-sparkline-_pPedR_D.js} +74 -73
  79. package/dist/{vue-ui-thermometer-yPKRIlqA.js → vue-ui-thermometer-CmLnTIU7.js} +22 -21
  80. package/dist/{vue-ui-timer-C15nOU7T.js → vue-ui-timer-CpAJT80M.js} +5 -5
  81. package/dist/{vue-ui-tiremarks-C2G8HtiX.js → vue-ui-tiremarks-DXgmJClr.js} +38 -37
  82. package/dist/{vue-ui-treemap-cFhw0xSg.js → vue-ui-treemap-Ci2Yi9Gh.js} +109 -108
  83. package/dist/{vue-ui-vertical-bar-dWiOw4sV.js → vue-ui-vertical-bar-pn_EqFmU.js} +82 -81
  84. package/dist/{vue-ui-waffle-Uldnmn6D.js → vue-ui-waffle-vqh1kEDT.js} +33 -32
  85. package/dist/{vue-ui-wheel-Cz79iDLO.js → vue-ui-wheel-BCcK6wwZ.js} +8 -7
  86. package/dist/{vue-ui-word-cloud-BGeHV6hS.js → vue-ui-word-cloud-Bu8Giu0b.js} +110 -109
  87. package/dist/{vue-ui-world-D1Dy-4mh.js → vue-ui-world-CzRlg19V.js} +57 -56
  88. package/dist/{vue-ui-xy-BA7xWU7_.js → vue-ui-xy-0gHPOOwZ.js} +982 -856
  89. package/dist/{vue-ui-xy-canvas-B2kkKb64.js → vue-ui-xy-canvas-DuAgXbBB.js} +41 -40
  90. package/package.json +1 -1
  91. package/dist/dom-to-png-BjSUS-jY.js +0 -243
  92. package/dist/img-DWfzRJdv.js +0 -19
@@ -1,13 +1,13 @@
1
- import { defineAsyncComponent as J, ref as d, computed as k, useSlots as _a, onMounted as ra, watch as A, nextTick as ge, shallowRef as $e, onBeforeUnmount as Ba, createElementBlock as se, openBlock as z, unref as p, normalizeClass as Va, normalizeStyle as K, createCommentVNode as U, createBlock as D, createElementVNode as ne, createSlots as Za, withCtx as b, renderSlot as x, normalizeProps as W, guardReactiveProps as X, createVNode as Ga, toDisplayString as ua, createTextVNode as ja } from "vue";
2
- import { u as qa, c as Ja, t as Ka, p as _, a as Qa, C as pe, b as el, D as Ie, i as Q, f as ee, d as sa, a1 as al, H as ll, ai as tl, o as ol, e as rl, x as na, q as ul, r as sl, y as nl, s as ie, l as il } from "./index-CbcpITE_.js";
1
+ import { defineAsyncComponent as J, ref as d, computed as C, useSlots as _a, onMounted as ra, watch as A, nextTick as ge, shallowRef as $e, onBeforeUnmount as Ba, createElementBlock as se, openBlock as z, unref as p, normalizeClass as Va, normalizeStyle as K, createCommentVNode as U, createBlock as D, createElementVNode as ne, createSlots as Za, withCtx as b, renderSlot as x, normalizeProps as W, guardReactiveProps as X, createVNode as Ga, toDisplayString as ua, createTextVNode as ja } from "vue";
2
+ import { u as qa, c as Ja, t as Ka, p as _, a as Qa, C as pe, b as el, D as Ie, i as Q, f as ee, d as sa, a1 as al, H as ll, ai as tl, o as ol, e as rl, x as na, q as ul, r as sl, y as nl, s as ie, l as il } from "./index-BzQ0j5xI.js";
3
3
  import { d as vl, t as cl, u as dl, c as hl, a as ia, l as L, r as Me, b as R, p as va } from "./useResponsive-JZ9xq-JV.js";
4
- import { u as ca } from "./useNestedProp-y56W8I7J.js";
5
- import { u as yl } from "./usePrinter-u-gQiRNz.js";
4
+ import { u as ca } from "./useNestedProp-DqpZEE3h.js";
5
+ import { u as yl } from "./usePrinter-CpG5jh_z.js";
6
6
  import { u as fl } from "./useUserOptionState-BIvW1Kz7.js";
7
7
  import { u as gl } from "./useChartAccessibility-9icAAmYg.js";
8
- import pl from "./Legend-ZW-PFcHg.js";
9
- import ml from "./Title-Dx8ctnVy.js";
10
- import { S as bl } from "./Slicer-Vh74fjdf.js";
8
+ import pl from "./Legend-YPYnzTBz.js";
9
+ import ml from "./Title-CJcZXNtK.js";
10
+ import { S as bl } from "./Slicer-CaMHCF_p.js";
11
11
  import { _ as xl } from "./_plugin-vue_export-helper-CHgC5LLL.js";
12
12
  const Ll = ["id"], kl = ["onClick"], Cl = {
13
13
  key: 2,
@@ -30,11 +30,11 @@ const Ll = ["id"], kl = ["onClick"], Cl = {
30
30
  },
31
31
  emits: ["selectLegend"],
32
32
  setup(Te, { expose: da, emit: ha }) {
33
- const ya = J(() => import("./vue-ui-accordion-BkA7rtwr.js")), fa = J(() => import("./DataTable-CsoAI95B.js")), ga = J(() => import("./NonSvgPenAndPaper-DJTUaQ94.js")), pa = J(() => import("./vue-ui-skeleton-miKWlCAi.js")), ma = J(() => import("./Tooltip-COHlzpZI.js")), ba = J(() => import("./UserOptions-CGn3YdRV.js")), { vue_ui_xy_canvas: xa } = qa(), g = Te, me = d(Ja()), ae = d(null), le = d(null), s = d(null), y = d(1), P = d(1), ve = d(!1), v = d(null), ce = d(""), Oe = d(null), $ = d([]), B = d(1), H = d(!0), V = d(!0), be = d(null), Re = d(0), Pe = d(0), de = d(!1), Ee = d(null), Fe = d(null), Ae = d(null), De = d(null), xe = d(0), Le = d(0), ke = d(0), M = d(null), Ce = k(() => !!g.dataset && g.dataset.length), La = ha, ka = _a();
33
+ const ya = J(() => import("./vue-ui-accordion-bpaEpjqI.js")), fa = J(() => import("./DataTable-CmbjnjRg.js")), ga = J(() => import("./NonSvgPenAndPaper-SD-bH_GI.js")), pa = J(() => import("./vue-ui-skeleton-CavMQlAm.js")), ma = J(() => import("./Tooltip-dXp8FaUj.js")), ba = J(() => import("./UserOptions-Cs7JW3dK.js")), { vue_ui_xy_canvas: xa } = qa(), g = Te, me = d(Ja()), ae = d(null), le = d(null), s = d(null), y = d(1), P = d(1), ve = d(!1), v = d(null), ce = d(""), Oe = d(null), $ = d([]), B = d(1), H = d(!0), V = d(!0), be = d(null), Re = d(0), Pe = d(0), de = d(!1), Ee = d(null), Fe = d(null), Ae = d(null), De = d(null), xe = d(0), Le = d(0), ke = d(0), M = d(null), Ce = C(() => !!g.dataset && g.dataset.length), La = ha, ka = _a();
34
34
  ra(() => {
35
35
  ka["chart-background"] && console.warn("VueUiXyCanvas does not support the #chart-background slot.");
36
36
  });
37
- const a = k({
37
+ const a = C({
38
38
  get: () => Ye(),
39
39
  set: (e) => e
40
40
  }), { userOptionsVisible: we, setUserOptionsVisibility: He, keepUserOptionState: Ne } = fl({ config: a.value }), { svgRef: T } = gl({ config: a.value.style.chart.title });
@@ -70,7 +70,7 @@ const Ll = ["id"], kl = ["onClick"], Cl = {
70
70
  function Ca(e) {
71
71
  de.value = e, Pe.value += 1;
72
72
  }
73
- const Ve = k(() => el(a.value.customPalette)), I = k(() => Z.value ? Math.max(...Z.value.filter((e, t) => !$.value.includes(e.absoluteIndex)).map((e) => e.series.length)) : 0), l = k(() => {
73
+ const Ve = C(() => el(a.value.customPalette)), I = C(() => Z.value ? Math.max(...Z.value.filter((e, t) => !$.value.includes(e.absoluteIndex)).map((e) => e.series.length)) : 0), l = C(() => {
74
74
  const e = y.value - y.value * (a.value.style.chart.paddingProportions.left + a.value.style.chart.paddingProportions.right);
75
75
  return {
76
76
  canvasWidth: y.value,
@@ -87,21 +87,21 @@ const Ll = ["id"], kl = ["onClick"], Cl = {
87
87
  function Ze(e, t) {
88
88
  return e / t;
89
89
  }
90
- function wa({ hasAutoScale: e, series: t, min: o, max: n, scale: c, yOffset: w, individualHeight: i, stackIndex: f = null }) {
90
+ function wa({ hasAutoScale: e, series: t, min: o, max: n, scale: c, yOffset: k, individualHeight: i, stackIndex: f = null }) {
91
91
  return t.map((N, S) => {
92
92
  const F = c.min < 0 ? Math.abs(c.min) : 0, Y = Ze(N + F, F + c.max);
93
93
  let re, ue;
94
94
  e && (re = c.min, ue = Ze(N - re, c.max - re));
95
95
  let O = 0;
96
- return f === null ? O = l.value.bottom - l.value.height * (e ? ue : Y) : O = l.value.bottom - w - i * (e ? ue : Y), {
96
+ return f === null ? O = l.value.bottom - l.value.height * (e ? ue : Y) : O = l.value.bottom - k - i * (e ? ue : Y), {
97
97
  x: l.value.left + l.value.slot * S + l.value.slot / 2,
98
98
  y: O,
99
99
  value: N
100
100
  };
101
101
  });
102
102
  }
103
- const m = k(() => {
104
- const e = a.value.style.chart.scale.min !== null ? a.value.style.chart.scale.min : Math.min(...Z.value.filter((i, f) => !$.value.includes(i.absoluteIndex)).flatMap((i) => i.series.slice(r.value.start, r.value.end))), t = a.value.style.chart.scale.max !== null ? a.value.style.chart.scale.max : Math.max(...Z.value.filter((i, f) => !$.value.includes(i.absoluteIndex)).flatMap((i) => i.series.slice(r.value.start, r.value.end))), o = Ie(e < 0 ? e : 0, t === e ? e + 1 < 0 ? 0 : e + 1 : t < 0 ? 0 : t, a.value.style.chart.scale.ticks), n = o.min < 0 ? Math.abs(o.min) : 0, c = l.value.bottom - l.value.height * (n / (o.max + n)), w = o.ticks.map((i) => ({
103
+ const m = C(() => {
104
+ const e = a.value.style.chart.scale.min !== null ? a.value.style.chart.scale.min : Math.min(...Z.value.filter((i, f) => !$.value.includes(i.absoluteIndex)).flatMap((i) => i.series.slice(r.value.start, r.value.end))), t = a.value.style.chart.scale.max !== null ? a.value.style.chart.scale.max : Math.max(...Z.value.filter((i, f) => !$.value.includes(i.absoluteIndex)).flatMap((i) => i.series.slice(r.value.start, r.value.end))), o = Ie(e < 0 ? e : 0, t === e ? e + 1 < 0 ? 0 : e + 1 : t < 0 ? 0 : t, a.value.style.chart.scale.ticks), n = o.min < 0 ? Math.abs(o.min) : 0, c = l.value.bottom - l.value.height * (n / (o.max + n)), k = o.ticks.map((i) => ({
105
105
  y: l.value.bottom - l.value.height * ((i + n) / (o.max + n)),
106
106
  x: l.value.left - 8,
107
107
  value: i
@@ -111,10 +111,10 @@ const Ll = ["id"], kl = ["onClick"], Cl = {
111
111
  max: t,
112
112
  min: e,
113
113
  scale: o,
114
- yLabels: w,
114
+ yLabels: k,
115
115
  zero: c
116
116
  };
117
- }), za = k(() => h.value.map((e) => `
117
+ }), za = C(() => h.value.map((e) => `
118
118
  <div style="display:flex;flex-direction:row;gap:6px;align-items:center;">
119
119
  <svg viewBox="0 0 10 10" height="12" width="12">
120
120
  <circle cx="5" cy="5" r="5" fill="${e.color}"/>
@@ -132,7 +132,7 @@ const Ll = ["id"], kl = ["onClick"], Cl = {
132
132
  { datapoint: e, seriesIndex: v.value }
133
133
  )}</span>
134
134
  </div>
135
- `)), Z = k(() => g.dataset.map((e, t) => ({
135
+ `)), Z = C(() => g.dataset.map((e, t) => ({
136
136
  ...e,
137
137
  series: al({
138
138
  data: ll(e.series),
@@ -144,7 +144,7 @@ const Ll = ["id"], kl = ["onClick"], Cl = {
144
144
  A(I, (e) => {
145
145
  e && Ge();
146
146
  });
147
- const h = k(() => tl(Z.value.filter((e, t) => !$.value.includes(e.absoluteIndex))).map((e, t) => ({
147
+ const h = C(() => tl(Z.value.filter((e, t) => !$.value.includes(e.absoluteIndex))).map((e, t) => ({
148
148
  ...e,
149
149
  series: e.series.slice(r.value.start, r.value.end)
150
150
  })).map((e, t) => {
@@ -153,9 +153,9 @@ const Ll = ["id"], kl = ["onClick"], Cl = {
153
153
  const c = {
154
154
  valueMin: o,
155
155
  valueMax: n
156
- }, w = e.scaleSteps || a.value.style.chart.scale.ticks;
156
+ }, k = e.scaleSteps || a.value.style.chart.scale.ticks;
157
157
  let i;
158
- e.autoScaling ? i = Ie(c.valueMin, c.valueMax, w) : i = Ie(c.valueMin < 0 ? c.valueMin : 0, c.valueMax <= 0 ? 0 : c.valueMax, w);
158
+ e.autoScaling ? i = Ie(c.valueMin, c.valueMax, k) : i = Ie(c.valueMin < 0 ? c.valueMin : 0, c.valueMax <= 0 ? 0 : c.valueMax, k);
159
159
  const f = u.value.stacked ? l.value.height * (1 - e.cumulatedStackRatio) : 0, N = u.value.stacked ? l.value.height / a.value.style.chart.stackGap : 0, S = u.value.stacked ? l.value.height * e.stackRatio - N : l.value.height, F = i.min < 0 ? Math.abs(i.min) : 0;
160
160
  let Y;
161
161
  e.autoScaling && u.value.stacked && n <= 0 ? Y = l.value.bottom - f - S : Y = l.value.bottom - f - S * (F / (i.max + F));
@@ -203,7 +203,7 @@ const Ll = ["id"], kl = ["onClick"], Cl = {
203
203
  const t = I.value;
204
204
  return e > t ? t : e < 0 || a.value.style.chart.zoom.startIndex !== null && e < a.value.style.chart.zoom.startIndex ? a.value.style.chart.zoom.startIndex !== null ? a.value.style.chart.zoom.startIndex + 1 : 1 : e;
205
205
  }
206
- const $a = k(() => h.value.filter((e) => ["line", "plot", void 0].includes(e.type))), C = k(() => h.value.filter((e) => e.type === "bar"));
206
+ const $a = C(() => h.value.filter((e) => ["line", "plot", void 0].includes(e.type))), w = C(() => h.value.filter((e) => e.type === "bar"));
207
207
  function Ia() {
208
208
  if (!T.value)
209
209
  return;
@@ -586,25 +586,25 @@ const Ll = ["id"], kl = ["onClick"], Cl = {
586
586
  );
587
587
  }
588
588
  function Aa() {
589
- C.value.forEach((e, t) => {
589
+ w.value.forEach((e, t) => {
590
590
  for (let o = 0; o < e.coordinatesLine.length; o += 1)
591
591
  Me(
592
592
  s.value,
593
593
  [
594
594
  {
595
- x: l.value.left + l.value.slot * o + l.value.slot / 10 + (u.value.stacked ? 0 : l.value.slot / C.value.length * t - (t === 0 ? 0 : l.value.slot / (5 * C.value.length) * t)),
595
+ x: l.value.left + l.value.slot * o + l.value.slot / 10 + (u.value.stacked ? 0 : l.value.slot / w.value.length * t - (t === 0 ? 0 : l.value.slot / (5 * w.value.length) * t)),
596
596
  y: u.value.stacked ? e.localZero : m.value.zero
597
597
  },
598
598
  {
599
- x: l.value.left + l.value.slot * o + l.value.slot / 10 + (u.value.stacked ? 0 : l.value.slot / C.value.length * t - (t === 0 ? 0 : l.value.slot / (5 * C.value.length) * t)) + l.value.slot * 0.8 / (u.value.stacked ? 1 : C.value.length),
599
+ x: l.value.left + l.value.slot * o + l.value.slot / 10 + (u.value.stacked ? 0 : l.value.slot / w.value.length * t - (t === 0 ? 0 : l.value.slot / (5 * w.value.length) * t)) + l.value.slot * 0.8 / (u.value.stacked ? 1 : w.value.length),
600
600
  y: u.value.stacked ? e.localZero : m.value.zero
601
601
  },
602
602
  {
603
- x: l.value.left + l.value.slot * o + l.value.slot / 10 + (u.value.stacked ? 0 : l.value.slot / C.value.length * t - (t === 0 ? 0 : l.value.slot / (5 * C.value.length) * t)) + l.value.slot * 0.8 / (u.value.stacked ? 1 : C.value.length),
603
+ x: l.value.left + l.value.slot * o + l.value.slot / 10 + (u.value.stacked ? 0 : l.value.slot / w.value.length * t - (t === 0 ? 0 : l.value.slot / (5 * w.value.length) * t)) + l.value.slot * 0.8 / (u.value.stacked ? 1 : w.value.length),
604
604
  y: e.coordinatesLine[o].y
605
605
  },
606
606
  {
607
- x: l.value.left + l.value.slot * o + l.value.slot / 10 + (u.value.stacked ? 0 : l.value.slot / C.value.length * t - (t === 0 ? 0 : l.value.slot / (5 * C.value.length) * t)),
607
+ x: l.value.left + l.value.slot * o + l.value.slot / 10 + (u.value.stacked ? 0 : l.value.slot / w.value.length * t - (t === 0 ? 0 : l.value.slot / (5 * w.value.length) * t)),
608
608
  y: e.coordinatesLine[o].y
609
609
  }
610
610
  ],
@@ -639,7 +639,7 @@ const Ll = ["id"], kl = ["onClick"], Cl = {
639
639
  }),
640
640
  { datapoint: e.coordinatesLine[o], seriesIndex: o }
641
641
  ),
642
- l.value.left + l.value.slot * o + l.value.slot / 10 + (u.value.stacked ? 0 : l.value.slot / C.value.length * t - (t === 0 ? 0 : l.value.slot / (5 * C.value.length) * t)) + l.value.slot * 0.4 / (u.value.stacked ? 1 : C.value.length),
642
+ l.value.left + l.value.slot * o + l.value.slot / 10 + (u.value.stacked ? 0 : l.value.slot / w.value.length * t - (t === 0 ? 0 : l.value.slot / (5 * w.value.length) * t)) + l.value.slot * 0.4 / (u.value.stacked ? 1 : w.value.length),
643
643
  (e.coordinatesLine[o].value < 0 ? u.value.stacked ? e.localZero : m.value.zero : e.coordinatesLine[o].y) + a.value.style.chart.dataLabels.offsetY,
644
644
  {
645
645
  align: "center",
@@ -723,7 +723,7 @@ const Ll = ["id"], kl = ["onClick"], Cl = {
723
723
  }
724
724
  const c = n * 2 - l.value.left;
725
725
  if (v.value = Math.floor(c / l.value.slot), ve.value = !0, !V.value) return;
726
- let w = "";
726
+ let k = "";
727
727
  const i = a.value.style.chart.tooltip.customFormat;
728
728
  na(i) && nl(() => i({
729
729
  seriesIndex: v.value,
@@ -747,7 +747,7 @@ const Ll = ["id"], kl = ["onClick"], Cl = {
747
747
  })),
748
748
  series: h.value,
749
749
  config: a.value
750
- }) : (a.value.style.chart.grid.y.timeLabels.values.slice(r.value.start, r.value.end)[v.value] && (w += `<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${a.value.style.chart.tooltip.borderColor}; width:100%">${a.value.style.chart.grid.y.timeLabels.values.slice(r.value.start, r.value.end)[v.value]}</div>`), w += za.value.join(""), ce.value = w), V.value = !1;
750
+ }) : (a.value.style.chart.grid.y.timeLabels.values.slice(r.value.start, r.value.end)[v.value] && (k += `<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${a.value.style.chart.tooltip.borderColor}; width:100%">${a.value.style.chart.grid.y.timeLabels.values.slice(r.value.start, r.value.end)[v.value]}</div>`), k += za.value.join(""), ce.value = k), V.value = !1;
751
751
  }
752
752
  A(() => v.value, (e) => {
753
753
  he();
@@ -799,7 +799,7 @@ const Ll = ["id"], kl = ["onClick"], Cl = {
799
799
  function Je(e) {
800
800
  La("selectLegend", h.value.find((t) => t.absoluteIndex === e)), $.value.includes(e) ? $.value = $.value.filter((t) => t !== e) : $.value.push(e), H.value = !0, he();
801
801
  }
802
- const Ke = k(() => Z.value.map((e, t) => ({
802
+ const Ke = C(() => Z.value.map((e, t) => ({
803
803
  ...e,
804
804
  name: e.name,
805
805
  color: sa(e.color) || Ve.value[t] || _[t] || _[t % _.length],
@@ -812,19 +812,19 @@ const Ll = ["id"], kl = ["onClick"], Cl = {
812
812
  opacity: $.value.includes(e.absoluteIndex) ? 0.5 : 1,
813
813
  segregate: () => Je(e.absoluteIndex),
814
814
  isSegregated: $.value.includes(e.absoluteIndex)
815
- }))), Ua = k(() => ({
815
+ }))), Ua = C(() => ({
816
816
  cy: "donut-div-legend",
817
817
  backgroundColor: a.value.style.chart.legend.backgroundColor,
818
818
  color: a.value.style.chart.legend.color,
819
819
  fontSize: a.value.style.chart.legend.fontSize,
820
820
  paddingBottom: 12,
821
821
  fontWeight: a.value.style.chart.legend.bold ? "bold" : ""
822
- })), ye = k(() => {
822
+ })), ye = C(() => {
823
823
  const e = [""].concat(h.value.map((c) => c.name)).concat(' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>');
824
824
  let t = [];
825
825
  for (let c = 0; c < I.value; c += 1) {
826
- const w = h.value.map((i) => i.series[c] ?? 0).reduce((i, f) => i + f, 0);
827
- t.push([a.value.style.chart.grid.y.timeLabels.values.slice(r.value.start, r.value.end)[c] ?? c + 1].concat(h.value.map((i) => (i.series[c] ?? 0).toFixed(a.value.table.rounding))).concat((w ?? 0).toFixed(a.value.table.rounding)));
826
+ const k = h.value.map((i) => i.series[c] ?? 0).reduce((i, f) => i + f, 0);
827
+ t.push([a.value.style.chart.grid.y.timeLabels.values.slice(r.value.start, r.value.end)[c] ?? c + 1].concat(h.value.map((i) => (i.series[c] ?? 0).toFixed(a.value.table.rounding))).concat((k ?? 0).toFixed(a.value.table.rounding)));
828
828
  }
829
829
  const o = {
830
830
  th: {
@@ -840,7 +840,7 @@ const Ll = ["id"], kl = ["onClick"], Cl = {
840
840
  breakpoint: a.value.table.responsiveBreakpoint
841
841
  }, n = [a.value.table.columnNames.period].concat(h.value.map((c) => c.name)).concat(a.value.table.columnNames.total);
842
842
  return { head: e, body: t.slice(0, r.value.end - r.value.start), config: o, colNames: n };
843
- }), Qe = k(() => {
843
+ }), Qe = C(() => {
844
844
  if (h.value.length === 0) return { head: [], body: [], config: {}, columnNames: [] };
845
845
  const e = h.value.map((o) => ({
846
846
  label: o.name,
@@ -855,9 +855,9 @@ const Ll = ["id"], kl = ["onClick"], Cl = {
855
855
  }
856
856
  return { head: e, body: t };
857
857
  });
858
- function ea() {
859
- const e = [[a.value.style.chart.title.text], [a.value.style.chart.title.subtitle.text], [""]], t = ["", ...Qe.value.head.map((w) => w.label)], o = Qe.value.body, n = e.concat([t]).concat(o), c = ul(n);
860
- sl({ csvContent: c, title: a.value.style.chart.title.text || "vue-ui-xy-canvas" });
858
+ function ea(e = null) {
859
+ const t = [[a.value.style.chart.title.text], [a.value.style.chart.title.subtitle.text], [""]], o = ["", ...Qe.value.head.map((i) => i.label)], n = Qe.value.body, c = t.concat([o]).concat(n), k = ul(c);
860
+ e ? e(k) : sl({ csvContent: k, title: a.value.style.chart.title.text || "vue-ui-xy-canvas" });
861
861
  }
862
862
  function Wa() {
863
863
  return h.value;
@@ -941,6 +941,7 @@ const Ll = ["id"], kl = ["onClick"], Cl = {
941
941
  position: a.value.userOptions.position,
942
942
  hasAnnotator: a.value.userOptions.buttons.annotator,
943
943
  isAnnotation: fe.value,
944
+ callbacks: a.value.userOptions.callbacks,
944
945
  onToggleFullscreen: Ca,
945
946
  onGeneratePdf: p(_e),
946
947
  onGenerateCsv: ea,
@@ -1024,7 +1025,7 @@ const Ll = ["id"], kl = ["onClick"], Cl = {
1024
1025
  ]),
1025
1026
  key: "9"
1026
1027
  } : void 0
1027
- ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasLabel", "hasStack", "hasFullscreen", "hasTable", "isFullscreen", "isTooltip", "isStacked", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : U("", !0),
1028
+ ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasLabel", "hasStack", "hasFullscreen", "hasTable", "isFullscreen", "isTooltip", "isStacked", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "callbacks", "onGeneratePdf", "onGenerateImage", "style"])) : U("", !0),
1028
1029
  ne("div", {
1029
1030
  class: "vue-ui-xy-canvas",
1030
1031
  style: K(`position: relative; aspect-ratio: ${Ue.value}`),
@@ -1200,7 +1201,7 @@ const Ll = ["id"], kl = ["onClick"], Cl = {
1200
1201
  }, null, 8, ["parent", "backgroundColor", "color", "active"])) : U("", !0)
1201
1202
  ], 46, Ll));
1202
1203
  }
1203
- }, Dl = /* @__PURE__ */ xl(zl, [["__scopeId", "data-v-557b6e93"]]);
1204
+ }, Dl = /* @__PURE__ */ xl(zl, [["__scopeId", "data-v-3390327e"]]);
1204
1205
  export {
1205
1206
  Dl as default
1206
1207
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vue-data-ui",
3
3
  "private": false,
4
- "version": "2.12.8-beta.2",
4
+ "version": "2.12.8-beta.4",
5
5
  "type": "module",
6
6
  "description": "A user-empowering data visualization Vue 3 components library for eloquent data storytelling",
7
7
  "keywords": [
@@ -1,243 +0,0 @@
1
- import { X as x } from "./index-CbcpITE_.js";
2
- async function A(n) {
3
- const i = n.querySelectorAll("img"), o = Array.from(i).map((t) => new Promise((s) => {
4
- if (!t.src || t.src.startsWith("data:")) return s();
5
- if (t.complete && t.naturalWidth !== 0) {
6
- try {
7
- const e = document.createElement("canvas");
8
- e.width = t.naturalWidth, e.height = t.naturalHeight, e.getContext("2d").drawImage(t, 0, 0), t.src = e.toDataURL();
9
- } catch {
10
- }
11
- return s();
12
- }
13
- const a = new window.Image();
14
- a.crossOrigin = "anonymous", a.onload = function() {
15
- try {
16
- const e = document.createElement("canvas");
17
- e.width = a.naturalWidth, e.height = a.naturalHeight, e.getContext("2d").drawImage(a, 0, 0), t.src = e.toDataURL();
18
- } catch {
19
- }
20
- s();
21
- }, a.onerror = function() {
22
- s();
23
- }, a.src = t.src;
24
- }));
25
- await Promise.all(o);
26
- }
27
- function T(n) {
28
- n.querySelectorAll("[data-dom-to-png-ignore]").forEach((o) => {
29
- o.remove();
30
- });
31
- }
32
- function v(n, i, o) {
33
- const t = window.getComputedStyle(i), s = i.getBoundingClientRect(), a = t.display.includes("flex");
34
- let e = {}, c = n.getAttribute("style");
35
- typeof c != "string" && (c = ""), c.split(";").forEach((r) => {
36
- if (typeof r == "string" && r.trim()) {
37
- const [d, m] = r.split(":");
38
- d && m !== void 0 && (e[d.trim()] = m.trim());
39
- }
40
- });
41
- for (let r = 0; r < t.length; r += 1) {
42
- const d = t[r], m = t.getPropertyValue(d);
43
- e[d] = m;
44
- }
45
- e.color = t.color, e["background-color"] = t.backgroundColor;
46
- let l = t.fontFamily || o || "";
47
- (!l || l.trim() === "" || l === "inherit" || l === "initial" || l.toLowerCase().startsWith("system-ui") || l.toLowerCase() === "sans-serif" || l.toLowerCase() === "serif" || l.toLowerCase() === "monospace") && (l = "Helvetica, Arial, sans-serif"), e["font-family"] = l, e["font-size"] = t.fontSize, e["font-weight"] = t.fontWeight, (a || t.display.includes("grid") || ["inline-block", "absolute", "fixed"].includes(t.position)) && (s.width > 0 && (e.width = s.width + "px"), s.height > 0 && (e.height = s.height + "px")), a && t.flexWrap === "nowrap" && (e["white-space"] = "nowrap"), ["box-sizing", "padding", "margin", "border"].forEach((r) => {
48
- e[r] = t.getPropertyValue(r);
49
- }), e.overflow = "visible", e["overflow-x"] = "visible", e["overflow-y"] = "visible";
50
- let u = "";
51
- for (const r in e)
52
- u += `${r}:${e[r]};`;
53
- n.setAttribute("style", u);
54
- const g = n.children || [], y = i.children || [];
55
- for (let r = 0; r < g.length; r++)
56
- g[r].nodeType === 1 && y[r] && v(g[r], y[r], l);
57
- }
58
- function I(n, i) {
59
- n.querySelectorAll("text").forEach((t) => {
60
- t.setAttribute("font-family", i), t.style.fontFamily = i;
61
- });
62
- }
63
- function E(n) {
64
- const i = new TextEncoder().encode(n);
65
- let o = "";
66
- return i.forEach((t) => o += String.fromCharCode(t)), btoa(o);
67
- }
68
- function $(n, i, o) {
69
- let s = new XMLSerializer().serializeToString(n);
70
- s.match(/^<svg[^>]+xmlns="http\:\/\/www\.w3\.org\/2000\/svg"/) || (s = s.replace(/^<svg/, '<svg xmlns="http://www.w3.org/2000/svg"'));
71
- const a = window.btoa(unescape(encodeURIComponent(s))), e = new window.Image();
72
- return e.src = `data:image/svg+xml;base64,${a}`, new Promise((c, l) => {
73
- e.onload = function() {
74
- const u = document.createElement("canvas");
75
- u.width = i, u.height = o, u.getContext("2d").drawImage(e, 0, 0, i, o), c(u.toDataURL("image/png", 1));
76
- }, e.onerror = (u) => l(u);
77
- });
78
- }
79
- function O(n) {
80
- if (n.nodeType !== 1) return;
81
- const i = window.getComputedStyle(n);
82
- let o = "";
83
- for (let t = 0; t < i.length; t++) {
84
- const s = i[t];
85
- o += `${s}:${i.getPropertyValue(s)};`;
86
- }
87
- n.setAttribute("style", o);
88
- for (let t = 0; t < n.children.length; t++)
89
- O(n.children[t]);
90
- }
91
- function W() {
92
- const n = [];
93
- for (const i of document.styleSheets)
94
- try {
95
- const o = i.cssRules;
96
- if (!o) continue;
97
- for (const t of o)
98
- (typeof CSSFontFaceRule < "u" && t instanceof CSSFontFaceRule || t.cssText.trim().startsWith("@font-face")) && n.push(t.cssText);
99
- } catch {
100
- continue;
101
- }
102
- return n;
103
- }
104
- function z(n) {
105
- const i = W();
106
- if (!i.length) return;
107
- const o = document.createElement("style");
108
- o.setAttribute("type", "text/css"), o.textContent = i.join(`
109
- `);
110
- const t = n.querySelector("defs") || document.createElementNS(x, "defs");
111
- t.appendChild(o), n.querySelector("defs") || n.insertBefore(t, n.firstChild);
112
- }
113
- function M(n, i) {
114
- const o = n.querySelectorAll("foreignObject"), t = i.querySelectorAll("foreignObject");
115
- o.forEach((s, a) => {
116
- const e = t[a];
117
- if (!e) return;
118
- function c(l, u) {
119
- if (!l || !u) return;
120
- if (l.nodeType === 1 && u.nodeType === 1) {
121
- const r = window.getComputedStyle(u);
122
- let d = "";
123
- for (let m = 0; m < r.length; m++) {
124
- const C = r[m];
125
- d += `${C}:${r.getPropertyValue(C)};`;
126
- }
127
- l.setAttribute("style", d);
128
- }
129
- const g = l.children || [], y = u.children || [];
130
- for (let r = 0; r < g.length; r++)
131
- c(g[r], y[r]);
132
- }
133
- c(s, e);
134
- });
135
- }
136
- function P(n) {
137
- n.querySelectorAll("foreignObject").forEach((o) => {
138
- let t = "";
139
- const s = Array.from(o.querySelectorAll("*"));
140
- if (s.length !== 0) {
141
- for (const a of document.styleSheets) {
142
- let e;
143
- try {
144
- e = a.cssRules;
145
- } catch {
146
- continue;
147
- }
148
- if (e) {
149
- for (const c of e)
150
- if (!(typeof CSSStyleRule < "u" && !(c instanceof CSSStyleRule)))
151
- try {
152
- s.some((l) => l.matches(c.selectorText)) && (t += c.cssText + `
153
- `);
154
- } catch {
155
- continue;
156
- }
157
- }
158
- }
159
- if (t) {
160
- const a = document.createElement("style");
161
- a.textContent = t, o.insertBefore(a, o.firstChild);
162
- }
163
- }
164
- });
165
- }
166
- function H(n) {
167
- n.querySelectorAll("foreignObject").forEach((o) => {
168
- const t = o.firstElementChild;
169
- t && t.tagName.toLowerCase() !== "svg" && t.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
170
- });
171
- }
172
- function D(n, i) {
173
- const o = n.querySelectorAll("foreignObject"), t = i.querySelectorAll("foreignObject");
174
- o.forEach((s, a) => {
175
- const e = t[a];
176
- if (!s || !e) return;
177
- const c = s.firstElementChild, l = e.firstElementChild;
178
- c && l && R(c, l);
179
- });
180
- }
181
- function R(n, i) {
182
- if (n.nodeType !== 1 || !i) return;
183
- v(n, i);
184
- const o = n.children || [], t = i.children || [];
185
- for (let s = 0; s < o.length; s++)
186
- R(o[s], t[s]);
187
- }
188
- function F(n, i) {
189
- const o = Array.from(i.querySelectorAll("img"));
190
- n.querySelectorAll("img").forEach((t) => {
191
- const s = t.getAttribute("src"), a = o.find((e) => e.getAttribute("src") === s);
192
- if (a) {
193
- const e = window.getComputedStyle(a);
194
- let c = "";
195
- for (let l = 0; l < e.length; l++) {
196
- const u = e[l];
197
- c += `${u}:${e.getPropertyValue(u)};`;
198
- }
199
- t.setAttribute("style", c);
200
- }
201
- });
202
- }
203
- async function B({ container: n, scale: i = 2 }) {
204
- if (!n) throw new Error("No container provided");
205
- await document.fonts.ready;
206
- let o = window.getComputedStyle(n).fontFamily || "Helvetica";
207
- o.toLowerCase().includes("helvetica") || (o += ", Helvetica");
208
- const t = n.cloneNode(!0), s = t.querySelectorAll("canvas"), a = n.querySelectorAll("canvas");
209
- for (let p = 0; p < a.length; p += 1) {
210
- const f = a[p], h = s[p];
211
- if (f && h) {
212
- const w = document.createElement("img");
213
- w.src = f.toDataURL("image/png"), w.width = f.width, w.height = f.height, w.style.width = f.style.width || f.width + "px", w.style.height = f.style.height || f.height + "px", h.replaceWith(w);
214
- }
215
- }
216
- const e = n.querySelector("svg[aria-label]"), c = t.querySelector("svg[aria-label]");
217
- if (e && c) {
218
- H(c), P(c), M(c, e), D(c, e), O(c), I(c, o), F(c, e), await A(c);
219
- const p = e.getBoundingClientRect(), f = p.width, h = p.height, w = Math.round(f * i), q = Math.round(h * i), L = await $(c, w, q), S = document.createElement("img");
220
- S.src = L, S.width = f, S.height = h, S.style.width = f + "px", S.style.height = h + "px", c.parentNode.replaceChild(S, c);
221
- }
222
- v(t, n, o), F(t, n), T(t), await A(t);
223
- const { width: l, height: u } = n.getBoundingClientRect(), g = Math.round(Math.max(t.scrollWidth, l) * i), y = Math.round(Math.max(t.scrollHeight, u) * 1.01 * i), r = document.createElementNS(x, "svg");
224
- r.setAttribute("viewBox", `0 0 ${g} ${y}`), r.setAttribute("width", g), r.setAttribute("height", y), r.setAttribute("style", `font-family:${o};`);
225
- const d = document.createElementNS(x, "foreignObject");
226
- d.setAttribute("x", 0), d.setAttribute("y", 0), d.setAttribute("width", g), d.setAttribute("height", y), d.setAttribute("style", `font-family:${o};`), t.style.transform = `scale(${i})`, t.style.transformOrigin = "top left", t.style.width = l + "px", t.style.height = u + "px", t.style.background = window.getComputedStyle(n).backgroundColor, d.appendChild(t), z(r), r.appendChild(d);
227
- const C = new XMLSerializer().serializeToString(r), j = E(C), b = new window.Image();
228
- return b.crossOrigin = "anonymous", b.src = `data:image/svg+xml;base64,${j}`, new Promise((p, f) => {
229
- b.onload = function() {
230
- try {
231
- const h = document.createElement("canvas");
232
- h.width = g, h.height = y, h.getContext("2d").drawImage(b, 0, 0, g, y), p(h.toDataURL("image/png", 1));
233
- } catch (h) {
234
- f("Failed to draw SVG on canvas: " + h);
235
- }
236
- }, b.onerror = function() {
237
- f("Failed to load SVG image for conversion");
238
- };
239
- });
240
- }
241
- export {
242
- B as d
243
- };
@@ -1,19 +0,0 @@
1
- import { d as i } from "./dom-to-png-BjSUS-jY.js";
2
- async function a({ domElement: r, fileName: n, format: t = "png", scale: c = 2 }) {
3
- if (!r) return Promise.reject("No element provided");
4
- if (t === "svg") {
5
- const o = converter.convertToImg({ container: r, scale: c });
6
- if (!o) return Promise.reject("Could not create SVG image");
7
- const e = document.createElement("a");
8
- return e.href = o.src, e.download = `${n}.svg`, document.body.appendChild(e), e.click(), document.body.removeChild(e), Promise.resolve();
9
- }
10
- try {
11
- const o = await i({ container: r, scale: c }), e = document.createElement("a");
12
- e.href = o, e.download = `${n}.${t}`, document.body.appendChild(e), e.click(), document.body.removeChild(e);
13
- } catch (o) {
14
- throw console.error("Error generating image:", o), o;
15
- }
16
- }
17
- export {
18
- a as default
19
- };