vue-data-ui 3.0.0-next.7 → 3.0.0-next.70
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.
- package/dist/{Arrow-Bl8urcli.js → Arrow-fzydFjfE.js} +1 -1
- package/dist/{BaseDraggableDialog-CyhpaZU5.js → BaseDraggableDialog-BwazM8ka.js} +2 -2
- package/dist/{BaseIcon-BCZfTCeM.js → BaseIcon-BnbvQjs5.js} +1 -1
- package/dist/{ColorPicker-CSJf42vx.js → ColorPicker-DR1Yr4kR.js} +2 -2
- package/dist/{DataTable-mQ6Wd-rR.js → DataTable-CKpA_OA_.js} +2 -2
- package/dist/{Legend-B2hrDh4G.js → Legend-ChXhJNzd.js} +2 -2
- package/dist/{NonSvgPenAndPaper-DQ8KsK4W.js → NonSvgPenAndPaper-CPOpM7Os.js} +3 -3
- package/dist/{PackageVersion-CeEYZfaH.js → PackageVersion-CBHvscRY.js} +1 -1
- package/dist/{PenAndPaper-DhSxfUrQ.js → PenAndPaper-BCcfYvgR.js} +3 -3
- package/dist/{Shape-C2qH26wh.js → Shape-C1rNfsMY.js} +43 -37
- package/dist/Slicer-D8a4Wv1q.js +602 -0
- package/dist/{SparkTooltip-BcHgW6YX.js → SparkTooltip-BUdf02cs.js} +1 -1
- package/dist/{Title-B7Xb3YuE.js → Title-feqCv0Si.js} +1 -1
- package/dist/{Tooltip-BidRoM5E.js → Tooltip-DQbksria.js} +23 -19
- package/dist/{UserOptions-0tvMM8PF.js → UserOptions-CGnAZpYs.js} +2 -2
- package/dist/{dom-to-png-CTrlbKHr.js → dom-to-png-DTPmkDTK.js} +1 -1
- package/dist/{img-D72yZNUg.js → img-_RMhslMZ.js} +1 -1
- package/dist/{index-Cg-RjxqH.js → index-CnY41r21.js} +2103 -1411
- package/dist/{pdf-DgX01_wu.js → pdf-C02XBmhm.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +600 -22
- package/dist/types/vue-data-ui.d.ts +600 -22
- package/dist/useAutoSizeLabelsInsideViewbox-DVYZBwNc.js +81 -0
- package/dist/useFitSvgText-2crs6Fv5.js +69 -0
- package/dist/useLoading-D7YHNtLX.js +29 -0
- package/dist/useNestedProp-DtUATNAU.js +13 -0
- package/dist/usePanZoom-BVca3eMk.js +122 -0
- package/dist/{usePrinter-BUzmyQf9.js → usePrinter-CJ1uZx0D.js} +2 -2
- package/dist/useTimeLabelCollider-CIsgDrl9.js +78 -0
- package/dist/{useTimeLabels-Mrr0jrpL.js → useTimeLabels-DkzmKfZn.js} +211 -152
- package/dist/{vue-data-ui-DpO93ey5.js → vue-data-ui-DDBabVWX.js} +105 -100
- package/dist/vue-data-ui.js +23 -22
- package/dist/vue-ui-3d-bar-CtPXePUa.js +1323 -0
- package/dist/{vue-ui-accordion-CRomxzaL.js → vue-ui-accordion-CnLY8CrQ.js} +3 -3
- package/dist/vue-ui-age-pyramid-CvrNLE47.js +834 -0
- package/dist/{vue-ui-annotator-BAOxPiFx.js → vue-ui-annotator-NuSwWka4.js} +2 -2
- package/dist/vue-ui-bullet-CpIVgkPB.js +571 -0
- package/dist/vue-ui-candlestick-DGWKUeJp.js +999 -0
- package/dist/{vue-ui-carousel-table-DVGlPZIa.js → vue-ui-carousel-table-DWbQS8F3.js} +29 -29
- package/dist/{vue-ui-chestnut-P1v4ffD0.js → vue-ui-chestnut-K4-oOYff.js} +5 -5
- package/dist/vue-ui-chord-DqmP8yTR.js +1038 -0
- package/dist/{vue-ui-circle-pack-FXmemXgl.js → vue-ui-circle-pack-D_ufubH5.js} +24 -24
- package/dist/{vue-ui-cursor-CdvMgIrP.js → vue-ui-cursor-B0tP4woK.js} +2 -2
- package/dist/{vue-ui-dashboard-Vke0452J.js → vue-ui-dashboard-D_7qyx3P.js} +62 -62
- package/dist/{vue-ui-digits-BVhyYqCs.js → vue-ui-digits-pUQErY07.js} +2 -2
- package/dist/{vue-ui-donut-BpIivKcf.js → vue-ui-donut-Dl__PVfq.js} +320 -308
- package/dist/vue-ui-donut-evolution-BCGGTZZI.js +1075 -0
- package/dist/vue-ui-dumbbell-KzCa3k9g.js +1119 -0
- package/dist/vue-ui-flow-B1AOqk14.js +841 -0
- package/dist/{vue-ui-funnel-BbFmbsft.js → vue-ui-funnel-DCl9v71X.js} +16 -16
- package/dist/{vue-ui-galaxy-Cn6vHbaw.js → vue-ui-galaxy-0rAzDHe5.js} +60 -58
- package/dist/vue-ui-gauge-Cg4qAOEf.js +791 -0
- package/dist/vue-ui-gizmo-CQmMkODw.js +210 -0
- package/dist/vue-ui-heatmap-CgkgUDI0.js +1078 -0
- package/dist/vue-ui-history-plot-CYvkTszV.js +1073 -0
- package/dist/{vue-ui-kpi-jN_yMnLj.js → vue-ui-kpi-BDuOZbc2.js} +26 -26
- package/dist/{vue-ui-mini-loader-rYr76x8g.js → vue-ui-mini-loader-BZaU_YD-.js} +2 -2
- package/dist/{vue-ui-molecule-BWZHOQLi.js → vue-ui-molecule-HYjHgVuN.js} +53 -51
- package/dist/vue-ui-mood-radar-4pYtL93A.js +785 -0
- package/dist/vue-ui-nested-donuts-BVbvVm19.js +1286 -0
- package/dist/vue-ui-onion-DQg97Dwm.js +776 -0
- package/dist/vue-ui-parallel-coordinate-plot-KQ4FTUda.js +915 -0
- package/dist/{vue-ui-quadrant-BFFzfDw3.js → vue-ui-quadrant-D8OU7TFs.js} +512 -459
- package/dist/vue-ui-quick-chart-BOKDoHdK.js +1761 -0
- package/dist/vue-ui-radar-2hTf-Qrf.js +796 -0
- package/dist/{vue-ui-rating-BAauyqTn.js → vue-ui-rating-QriKDSO7.js} +2 -2
- package/dist/vue-ui-relation-circle-DqLiKEHw.js +598 -0
- package/dist/vue-ui-ridgeline-CvFlsavM.js +1153 -0
- package/dist/vue-ui-rings-B2ges9Ud.js +728 -0
- package/dist/vue-ui-scatter-DQJeFlv4.js +1178 -0
- package/dist/{vue-ui-skeleton-CUOhCY4p.js → vue-ui-skeleton-Bghm5obp.js} +3 -3
- package/dist/{vue-ui-smiley-B6SqWMov.js → vue-ui-smiley-C3SkDNoz.js} +26 -26
- package/dist/vue-ui-spark-trend-dd8h3N7H.js +315 -0
- package/dist/vue-ui-sparkbar-BTj8M7fY.js +351 -0
- package/dist/vue-ui-sparkgauge-BBQAo-W1.js +232 -0
- package/dist/vue-ui-sparkhistogram-C4ZEcb8S.js +380 -0
- package/dist/vue-ui-sparkline-Bm3GpqJx.js +489 -0
- package/dist/vue-ui-sparkstackbar-Dde4iayd.js +421 -0
- package/dist/vue-ui-stackbar-DPvfNjwH.js +1370 -0
- package/dist/vue-ui-strip-plot-iZIN9U90.js +915 -0
- package/dist/{vue-ui-table-Dwjl3L0p.js → vue-ui-table-C4EoviSd.js} +11 -11
- package/dist/{vue-ui-table-heatmap-DazTE3fa.js → vue-ui-table-heatmap-D-eqO3LU.js} +5 -5
- package/dist/{vue-ui-table-sparkline-BXMPUEpN.js → vue-ui-table-sparkline-CD7IH49g.js} +14 -14
- package/dist/vue-ui-thermometer-BKEFH2Xt.js +541 -0
- package/dist/{vue-ui-timer-yLvNAZL_.js → vue-ui-timer-hhKj1gPp.js} +5 -5
- package/dist/vue-ui-tiremarks-CmNwCnVC.js +406 -0
- package/dist/vue-ui-treemap-BL7T8x_B.js +1035 -0
- package/dist/{vue-ui-vertical-bar-BrYCoVym.js → vue-ui-vertical-bar-CGn_OX3P.js} +71 -69
- package/dist/vue-ui-waffle-qfT-wDhI.js +910 -0
- package/dist/vue-ui-wheel-B8J8C3AN.js +379 -0
- package/dist/vue-ui-word-cloud-B6oHFfEK.js +765 -0
- package/dist/{vue-ui-world-B4Dqrk4l.js → vue-ui-world-BEv_oTrC.js} +11 -9
- package/dist/vue-ui-xy-DPBrciAR.js +3771 -0
- package/dist/{vue-ui-xy-canvas-D7fL36kT.js → vue-ui-xy-canvas-BXT3mXj5.js} +265 -264
- package/package.json +1 -1
- package/dist/Slicer-BD8Z8VCW.js +0 -577
- package/dist/useLoading-Bt5Doa8m.js +0 -28
- package/dist/useNestedProp-C_G5E08Y.js +0 -13
- package/dist/usePanZoom-BQMvRXEQ.js +0 -115
- package/dist/vue-ui-3d-bar-D8imUwEz.js +0 -1227
- package/dist/vue-ui-age-pyramid-CV7gtFOC.js +0 -746
- package/dist/vue-ui-bullet-BtuMMBF7.js +0 -513
- package/dist/vue-ui-candlestick-BsRtXKrv.js +0 -873
- package/dist/vue-ui-chord-CIuzYmpM.js +0 -949
- package/dist/vue-ui-donut-evolution-BRlsCA4U.js +0 -903
- package/dist/vue-ui-dumbbell-D87Dumjh.js +0 -753
- package/dist/vue-ui-flow-D_L_xssL.js +0 -765
- package/dist/vue-ui-gauge-Ds4terqY.js +0 -738
- package/dist/vue-ui-gizmo-BTncpI62.js +0 -192
- package/dist/vue-ui-heatmap-B6GpjeWC.js +0 -877
- package/dist/vue-ui-history-plot-DTDzEeGq.js +0 -924
- package/dist/vue-ui-mood-radar-CPfS6f1L.js +0 -670
- package/dist/vue-ui-nested-donuts-Bsd2kGoJ.js +0 -1177
- package/dist/vue-ui-onion-BQ4nISXW.js +0 -701
- package/dist/vue-ui-parallel-coordinate-plot-BoHgVgbn.js +0 -807
- package/dist/vue-ui-quick-chart-oNMTeOAL.js +0 -1612
- package/dist/vue-ui-radar-98mXFZe-.js +0 -741
- package/dist/vue-ui-relation-circle-6oDCSxkO.js +0 -542
- package/dist/vue-ui-ridgeline-CugMGjOU.js +0 -969
- package/dist/vue-ui-rings-bsGXaD2m.js +0 -685
- package/dist/vue-ui-scatter-7ssLliGg.js +0 -1045
- package/dist/vue-ui-spark-trend-jauInkkN.js +0 -291
- package/dist/vue-ui-sparkbar-DXByIxQH.js +0 -301
- package/dist/vue-ui-sparkgauge-BMrV2gDi.js +0 -201
- package/dist/vue-ui-sparkhistogram-CoNM4G7o.js +0 -313
- package/dist/vue-ui-sparkline-DrN3_wS0.js +0 -459
- package/dist/vue-ui-sparkstackbar-W1a0JQi9.js +0 -381
- package/dist/vue-ui-stackbar-D1-gbUgE.js +0 -1207
- package/dist/vue-ui-strip-plot-KhfvrVuN.js +0 -761
- package/dist/vue-ui-thermometer-Cn6lJRs3.js +0 -495
- package/dist/vue-ui-tiremarks-BYsWePfK.js +0 -358
- package/dist/vue-ui-treemap-Ce7RVFG3.js +0 -965
- package/dist/vue-ui-waffle-CCrR2T1G.js +0 -863
- package/dist/vue-ui-wheel-BuxjnrDN.js +0 -352
- package/dist/vue-ui-word-cloud-C6fawHJE.js +0 -659
- package/dist/vue-ui-xy-ubRnv9iJ.js +0 -2980
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import { useCssVars as pe, computed as k, defineAsyncComponent as me, ref as y, toRefs as be, onMounted as U, watch as X, nextTick as j, createElementBlock as s, openBlock as a, normalizeStyle as S, createCommentVNode as c, createBlock as G, createElementVNode as g, createTextVNode as _e, toDisplayString as p, unref as n, createVNode as xe, renderSlot as q, Fragment as d, renderList as h, normalizeClass as Y } from "vue";
|
|
2
|
+
import { u as ke, c as Ce, t as Ae, b as we, o as $e, f as P, g as Le, s as m, k as J, i as K, X as ze, x as D } from "./index-CnY41r21.js";
|
|
3
|
+
import { t as Se, u as Me } from "./useResponsive-DfdjqQps.js";
|
|
4
|
+
import { u as Fe, B as Ie } from "./useLoading-D7YHNtLX.js";
|
|
5
|
+
import { u as Te } from "./useFitSvgText-2crs6Fv5.js";
|
|
6
|
+
import { u as Q } from "./useNestedProp-DtUATNAU.js";
|
|
7
|
+
import { u as Ee } from "./useChartAccessibility-9icAAmYg.js";
|
|
8
|
+
import { _ as Ne } from "./Shape-C1rNfsMY.js";
|
|
9
|
+
import { _ as De } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
|
+
const We = { key: 0 }, Ve = { key: 1 }, He = ["xmlns", "viewBox"], Oe = ["width", "height"], Re = ["id"], Be = ["stop-color"], Ue = ["stop-color"], Xe = ["id"], je = ["stop-color"], Ge = ["stop-color"], qe = ["id"], Ye = ["stop-color"], Pe = ["stop-color"], Je = ["height", "width", "fill", "x", "stroke", "stroke-width", "rx", "stroke-dasharray"], Ke = { key: 1 }, Qe = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "rx"], Ze = { key: 2 }, et = ["x", "y", "font-size", "font-weight", "fill"], tt = ["x", "y", "font-size", "fill"], lt = ["x", "y", "font-size", "fill"], at = ["height", "width", "x", "onMouseover", "onMouseleave", "onClick"], st = {
|
|
11
|
+
__name: "vue-ui-sparkhistogram",
|
|
12
|
+
props: {
|
|
13
|
+
config: {
|
|
14
|
+
type: Object,
|
|
15
|
+
default() {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
dataset: {
|
|
20
|
+
type: Array,
|
|
21
|
+
default() {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
emits: ["selectDatapoint"],
|
|
27
|
+
setup(Z, { emit: ee }) {
|
|
28
|
+
pe((l) => ({
|
|
29
|
+
c8e2d1ee: ve.value
|
|
30
|
+
}));
|
|
31
|
+
const te = me(() => import("./PackageVersion-CBHvscRY.js")), { vue_ui_sparkhistogram: le } = ke(), b = Z, _ = y(Ce()), W = y(null), V = y(null), M = y(null), C = y(null), w = y(null), e = y(T()), { loading: H, FINAL_DATASET: A } = Fe({
|
|
32
|
+
...be(b),
|
|
33
|
+
FINAL_CONFIG: e,
|
|
34
|
+
prepareConfig: T,
|
|
35
|
+
skeletonDataset: [
|
|
36
|
+
{ value: 1, intensity: 0.2, color: "#CACACA" },
|
|
37
|
+
{ value: 2, intensity: 0.3, color: "#CACACA" },
|
|
38
|
+
{ value: 3, intensity: 0.5, color: "#CACACA" },
|
|
39
|
+
{ value: 5, intensity: 0.7, color: "#CACACA" },
|
|
40
|
+
{ value: 8, intensity: 0.9, color: "#CACACA" },
|
|
41
|
+
{ value: 13, intensity: 0.95, color: "#CACACA" },
|
|
42
|
+
{ value: 21, intensity: 1, color: "#CACACA" },
|
|
43
|
+
{ value: 13, intensity: 0.95, color: "#CACACA" },
|
|
44
|
+
{ value: 8, intensity: 0.9, color: "#CACACA" },
|
|
45
|
+
{ value: 5, intensity: 0.7, color: "#CACACA" },
|
|
46
|
+
{ value: 3, intensity: 0.5, color: "#CACACA" },
|
|
47
|
+
{ value: 2, intensity: 0.3, color: "#CACACA" },
|
|
48
|
+
{ value: 1, intensity: 0.2, color: "#CACACA" }
|
|
49
|
+
],
|
|
50
|
+
skeletonConfig: Ae({
|
|
51
|
+
defaultConfig: e.value,
|
|
52
|
+
userConfig: {
|
|
53
|
+
style: {
|
|
54
|
+
animation: { show: !1 },
|
|
55
|
+
backgroundColor: "#99999930"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
}), F = y(e.value.style.layout.width), I = y(e.value.style.layout.height), { svgRef: O } = Ee({ config: e.value.style.title });
|
|
60
|
+
function T() {
|
|
61
|
+
const l = Q({
|
|
62
|
+
userConfig: b.config,
|
|
63
|
+
defaultConfig: le
|
|
64
|
+
});
|
|
65
|
+
return l.theme ? {
|
|
66
|
+
...Q({
|
|
67
|
+
userConfig: we.vue_ui_sparkhistogram[l.theme] || b.config,
|
|
68
|
+
defaultConfig: l
|
|
69
|
+
})
|
|
70
|
+
} : l;
|
|
71
|
+
}
|
|
72
|
+
U(() => {
|
|
73
|
+
B();
|
|
74
|
+
});
|
|
75
|
+
const R = k(() => !!e.value.debug);
|
|
76
|
+
function B() {
|
|
77
|
+
if ($e(b.dataset) ? P({
|
|
78
|
+
componentName: "VueUiSparkHistogram",
|
|
79
|
+
type: "dataset",
|
|
80
|
+
debug: R.value
|
|
81
|
+
}) : b.dataset.forEach((l, o) => {
|
|
82
|
+
Le({
|
|
83
|
+
datasetObject: l,
|
|
84
|
+
requiredAttributes: ["value"]
|
|
85
|
+
}).forEach((t) => {
|
|
86
|
+
P({
|
|
87
|
+
componentName: "VueUiSparkHistogram",
|
|
88
|
+
type: "datasetSerieAttribute",
|
|
89
|
+
property: t,
|
|
90
|
+
index: o,
|
|
91
|
+
debug: R.value
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
}), e.value.responsive) {
|
|
95
|
+
const l = Se(() => {
|
|
96
|
+
const { width: o, height: t } = Me({
|
|
97
|
+
chart: M.value,
|
|
98
|
+
title: e.value.style.title.text ? V.value : null,
|
|
99
|
+
source: W.value
|
|
100
|
+
});
|
|
101
|
+
requestAnimationFrame(() => {
|
|
102
|
+
F.value = Math.max(10, o), I.value = Math.max(10, t - 12);
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
C.value && (w.value && C.value.unobserve(w.value), C.value.disconnect()), C.value = new ResizeObserver(l), w.value = M.value.parentNode, C.value.observe(w.value);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
X(() => b.config, (l) => {
|
|
109
|
+
e.value = T(), B();
|
|
110
|
+
}, { deep: !0 });
|
|
111
|
+
const v = k(() => {
|
|
112
|
+
const l = I.value, o = F.value, t = e.value.style.layout.padding.top, i = l - e.value.style.layout.padding.bottom, f = e.value.style.layout.padding.left, $ = o - e.value.style.layout.padding.right, L = t + (l - t - e.value.style.layout.padding.bottom) / 2, E = l - e.value.style.layout.padding.top - e.value.style.layout.padding.bottom, z = o - e.value.style.layout.padding.left - e.value.style.layout.padding.right;
|
|
113
|
+
return {
|
|
114
|
+
bottom: i,
|
|
115
|
+
centerY: L,
|
|
116
|
+
drawingHeight: E,
|
|
117
|
+
drawingWidth: z,
|
|
118
|
+
height: l,
|
|
119
|
+
left: f,
|
|
120
|
+
right: $,
|
|
121
|
+
top: t,
|
|
122
|
+
width: o
|
|
123
|
+
};
|
|
124
|
+
}), ae = k(() => Math.max(...A.value.map((l) => Math.abs(l.value || 0))));
|
|
125
|
+
function se(l) {
|
|
126
|
+
return Math.abs(l) / ae.value;
|
|
127
|
+
}
|
|
128
|
+
const u = k(() => A.value.map((l, o) => {
|
|
129
|
+
const t = se(l.value || 0), i = v.value.drawingHeight * t, f = v.value.drawingWidth / A.value.length, $ = f * (e.value.style.bars.gap / 100), L = f - $, E = v.value.centerY - i / 2, z = v.value.left + ($ / 2 + o * f), de = v.value.left + o * f, N = typeof l.intensity > "u" ? 100 : Math.round(l.intensity * 100), ye = l.color ? l.color : l.value >= 0 ? m(e.value.style.bars.colors.positive, N) : m(e.value.style.bars.colors.negative, N), he = l.color ? l.color : l.value >= 0 ? e.value.style.bars.colors.positive : e.value.style.bars.colors.negative, fe = l.color ? `url(#gradient_datapoint_${o}_${_.value})` : l.value >= 0 ? `url(#gradient_positive_${o}_${_.value})` : `url(#gradient_negative_${o}_${_.value})`, ge = z + L / 2;
|
|
130
|
+
return {
|
|
131
|
+
...l,
|
|
132
|
+
color: ye,
|
|
133
|
+
gradient: fe,
|
|
134
|
+
height: i,
|
|
135
|
+
intensity: N,
|
|
136
|
+
proportion: t,
|
|
137
|
+
stroke: he,
|
|
138
|
+
textAnchor: ge,
|
|
139
|
+
trapX: de,
|
|
140
|
+
unitWidth: f,
|
|
141
|
+
width: L,
|
|
142
|
+
x: z,
|
|
143
|
+
y: E
|
|
144
|
+
};
|
|
145
|
+
}));
|
|
146
|
+
function oe(l, o) {
|
|
147
|
+
return J(
|
|
148
|
+
e.value.style.labels.value.formatter,
|
|
149
|
+
l.value,
|
|
150
|
+
K({
|
|
151
|
+
p: e.value.style.labels.value.prefix,
|
|
152
|
+
v: l.value,
|
|
153
|
+
s: e.value.style.labels.value.suffix,
|
|
154
|
+
r: e.value.style.labels.value.rounding
|
|
155
|
+
}),
|
|
156
|
+
{ datapoint: l, seriesIndex: o }
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
const r = y(null), ie = ee;
|
|
160
|
+
function ue(l, o) {
|
|
161
|
+
ie("selectDatapoint", { datapoint: l, index: o }), e.value.events.datapointClick && e.value.events.datapointClick({ datapoint: l, seriesIndex: o });
|
|
162
|
+
}
|
|
163
|
+
function ne(l, o) {
|
|
164
|
+
r.value = o, e.value.events.datapointEnter && e.value.events.datapointEnter({ datapoint: l, seriesIndex: o });
|
|
165
|
+
}
|
|
166
|
+
function re(l, o) {
|
|
167
|
+
r.value = null, e.value.events.datapointLeave && e.value.events.datapointLeave({ datapoint: l, seriesIndex: o });
|
|
168
|
+
}
|
|
169
|
+
const ve = k(() => `${e.value.style.animation.speedMs}ms`), ce = k(() => v.value.drawingWidth / A.value.length * 0.9), { fitText: x } = Te({
|
|
170
|
+
svgRef: O,
|
|
171
|
+
unitWidth: ce
|
|
172
|
+
});
|
|
173
|
+
return U(async () => {
|
|
174
|
+
await j(), x(".vue-ui-sparkhistogram-top-label", e.value.style.labels.value.minFontSize), x(".vue-ui-sparkhistogram-bottom-label", e.value.style.labels.valueLabel.minFontSize), x(".vue-ui-sparkhistogram-time-label", e.value.style.labels.timeLabel.minFontSize);
|
|
175
|
+
}), X([F, I, () => A.value], async () => {
|
|
176
|
+
await j(), x(".vue-ui-sparkhistogram-top-label", e.value.style.labels.value.minFontSize), x(".vue-ui-sparkhistogram-bottom-label", e.value.style.labels.valueLabel.minFontSize), x(".vue-ui-sparkhistogram-time-label", e.value.style.labels.timeLabel.minFontSize);
|
|
177
|
+
}), (l, o) => (a(), s("div", {
|
|
178
|
+
class: "vue-ui-spark-histogram",
|
|
179
|
+
ref_key: "histogramChart",
|
|
180
|
+
ref: M,
|
|
181
|
+
style: S(`width:100%;background:${e.value.style.backgroundColor};font-family:${e.value.style.fontFamily}`),
|
|
182
|
+
onMouseleave: o[0] || (o[0] = (t) => r.value = null)
|
|
183
|
+
}, [
|
|
184
|
+
e.value.style.title.text ? (a(), s("div", {
|
|
185
|
+
key: 0,
|
|
186
|
+
ref_key: "chartTitle",
|
|
187
|
+
ref: V,
|
|
188
|
+
style: S(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${e.value.style.title.margin};padding: 0 6px;text-align:${e.value.style.title.textAlign}`)
|
|
189
|
+
}, [
|
|
190
|
+
g("div", {
|
|
191
|
+
style: S(`font-size:${e.value.style.title.fontSize}px;color:${e.value.style.title.color};font-weight:${e.value.style.title.bold ? "bold" : "normal"}`)
|
|
192
|
+
}, [
|
|
193
|
+
_e(p(e.value.style.title.text) + " ", 1),
|
|
194
|
+
r.value !== null ? (a(), s("span", We, "- " + p(u.value[r.value].timeLabel || "") + " " + p(n(J)(
|
|
195
|
+
e.value.style.labels.value.formatter,
|
|
196
|
+
u.value[r.value].value,
|
|
197
|
+
n(K)({
|
|
198
|
+
p: e.value.style.labels.value.prefix,
|
|
199
|
+
v: u.value[r.value].value,
|
|
200
|
+
s: e.value.style.labels.value.suffix,
|
|
201
|
+
r: e.value.style.labels.value.rounding
|
|
202
|
+
}),
|
|
203
|
+
{ datapoint: u.value[r.value], seriesIndex: r.value }
|
|
204
|
+
)), 1)) : c("", !0),
|
|
205
|
+
![void 0, null].includes(r.value) && ![null, void 0].includes(u.value[r.value].valueLabel) ? (a(), s("span", Ve, "(" + p(u.value[r.value].valueLabel || 0) + ")", 1)) : c("", !0)
|
|
206
|
+
], 4),
|
|
207
|
+
e.value.style.title.subtitle.text ? (a(), s("div", {
|
|
208
|
+
key: 0,
|
|
209
|
+
style: S(`font-size:${e.value.style.title.subtitle.fontSize}px;color:${e.value.style.title.subtitle.color};font-weight:${e.value.style.title.subtitle.bold ? "bold" : "normal"}`)
|
|
210
|
+
}, p(e.value.style.title.subtitle.text), 5)) : c("", !0)
|
|
211
|
+
], 4)) : c("", !0),
|
|
212
|
+
(a(), s("svg", {
|
|
213
|
+
ref_key: "svgRef",
|
|
214
|
+
ref: O,
|
|
215
|
+
xmlns: n(ze),
|
|
216
|
+
viewBox: `0 0 ${v.value.width} ${v.value.height}`,
|
|
217
|
+
style: { overflow: "visible" }
|
|
218
|
+
}, [
|
|
219
|
+
xe(n(te)),
|
|
220
|
+
l.$slots["chart-background"] ? (a(), s("foreignObject", {
|
|
221
|
+
key: 0,
|
|
222
|
+
x: 0,
|
|
223
|
+
y: 0,
|
|
224
|
+
width: v.value.width,
|
|
225
|
+
height: v.value.height,
|
|
226
|
+
style: {
|
|
227
|
+
pointerEvents: "none"
|
|
228
|
+
}
|
|
229
|
+
}, [
|
|
230
|
+
q(l.$slots, "chart-background", {}, void 0, !0)
|
|
231
|
+
], 8, Oe)) : c("", !0),
|
|
232
|
+
g("defs", null, [
|
|
233
|
+
(a(!0), s(d, null, h(u.value, (t, i) => (a(), s("radialGradient", {
|
|
234
|
+
id: `gradient_positive_${i}_${_.value}`,
|
|
235
|
+
cy: "50%",
|
|
236
|
+
cx: "50%",
|
|
237
|
+
r: "50%",
|
|
238
|
+
fx: "50%",
|
|
239
|
+
fy: "50%"
|
|
240
|
+
}, [
|
|
241
|
+
g("stop", {
|
|
242
|
+
offset: "0%",
|
|
243
|
+
"stop-color": n(m)(n(D)(e.value.style.bars.colors.positive, 0.05), t.intensity)
|
|
244
|
+
}, null, 8, Be),
|
|
245
|
+
g("stop", {
|
|
246
|
+
offset: "100%",
|
|
247
|
+
"stop-color": n(m)(e.value.style.bars.colors.positive, t.intensity)
|
|
248
|
+
}, null, 8, Ue)
|
|
249
|
+
], 8, Re))), 256)),
|
|
250
|
+
(a(!0), s(d, null, h(u.value, (t, i) => (a(), s("radialGradient", {
|
|
251
|
+
id: `gradient_negative_${i}_${_.value}`,
|
|
252
|
+
cy: "50%",
|
|
253
|
+
cx: "50%",
|
|
254
|
+
r: "50%",
|
|
255
|
+
fx: "50%",
|
|
256
|
+
fy: "50%"
|
|
257
|
+
}, [
|
|
258
|
+
g("stop", {
|
|
259
|
+
offset: "0%",
|
|
260
|
+
"stop-color": n(m)(n(D)(e.value.style.bars.colors.negative, 0.05), t.intensity)
|
|
261
|
+
}, null, 8, je),
|
|
262
|
+
g("stop", {
|
|
263
|
+
offset: "100%",
|
|
264
|
+
"stop-color": n(m)(e.value.style.bars.colors.negative, t.intensity)
|
|
265
|
+
}, null, 8, Ge)
|
|
266
|
+
], 8, Xe))), 256)),
|
|
267
|
+
(a(!0), s(d, null, h(u.value, (t, i) => (a(), s("radialGradient", {
|
|
268
|
+
id: `gradient_datapoint_${i}_${_.value}`,
|
|
269
|
+
cy: "50%",
|
|
270
|
+
cx: "50%",
|
|
271
|
+
r: "50%",
|
|
272
|
+
fx: "50%",
|
|
273
|
+
fy: "50%"
|
|
274
|
+
}, [
|
|
275
|
+
g("stop", {
|
|
276
|
+
offset: "0%",
|
|
277
|
+
"stop-color": n(m)(n(D)(t.color, 0.05), t.intensity)
|
|
278
|
+
}, null, 8, Ye),
|
|
279
|
+
g("stop", {
|
|
280
|
+
offset: "100%",
|
|
281
|
+
"stop-color": n(m)(t.color, t.intensity)
|
|
282
|
+
}, null, 8, Pe)
|
|
283
|
+
], 8, qe))), 256))
|
|
284
|
+
]),
|
|
285
|
+
(a(!0), s(d, null, h(u.value, (t, i) => (a(), s("g", null, [
|
|
286
|
+
r.value !== null && r.value === i ? (a(), s("rect", {
|
|
287
|
+
key: 0,
|
|
288
|
+
height: v.value.height,
|
|
289
|
+
width: t.unitWidth,
|
|
290
|
+
fill: e.value.style.selector.fill,
|
|
291
|
+
x: t.trapX,
|
|
292
|
+
y: 0,
|
|
293
|
+
stroke: e.value.style.selector.stroke,
|
|
294
|
+
"stroke-width": e.value.style.selector.strokeWidth,
|
|
295
|
+
rx: e.value.style.selector.borderRadius,
|
|
296
|
+
"stroke-dasharray": e.value.style.selector.strokeDasharray
|
|
297
|
+
}, null, 8, Je)) : c("", !0)
|
|
298
|
+
]))), 256)),
|
|
299
|
+
!e.value.style.bars.shape || e.value.style.bars.shape === "square" ? (a(), s("g", Ke, [
|
|
300
|
+
(a(!0), s(d, null, h(u.value, (t, i) => (a(), s("rect", {
|
|
301
|
+
x: t.x,
|
|
302
|
+
y: t.y,
|
|
303
|
+
height: t.height,
|
|
304
|
+
width: t.width,
|
|
305
|
+
fill: e.value.style.bars.colors.gradient.show ? t.gradient : t.color,
|
|
306
|
+
stroke: t.stroke,
|
|
307
|
+
"stroke-width": e.value.style.bars.strokeWidth,
|
|
308
|
+
rx: `${e.value.style.bars.borderRadius * t.proportion / 12}%`,
|
|
309
|
+
class: Y({ "vue-ui-sparkhistogram-shape": e.value.style.animation.show })
|
|
310
|
+
}, null, 10, Qe))), 256))
|
|
311
|
+
])) : (a(), s("g", Ze, [
|
|
312
|
+
(a(!0), s(d, null, h(u.value, (t, i) => (a(), G(Ne, {
|
|
313
|
+
plot: { x: t.x + t.width / 2, y: t.y + t.height / 2 },
|
|
314
|
+
color: e.value.style.bars.colors.gradient.show ? t.gradient : t.color,
|
|
315
|
+
shape: e.value.style.bars.shape,
|
|
316
|
+
radius: Math.min(t.height * 0.4, t.width * 0.4),
|
|
317
|
+
class: Y({ "vue-ui-sparkhistogram-shape": e.value.style.animation.show })
|
|
318
|
+
}, null, 8, ["plot", "color", "shape", "radius", "class"]))), 256))
|
|
319
|
+
])),
|
|
320
|
+
n(H) ? c("", !0) : (a(), s(d, { key: 3 }, [
|
|
321
|
+
(a(!0), s(d, null, h(u.value, (t, i) => (a(), s("text", {
|
|
322
|
+
class: "vue-ui-sparkhistogram-top-label",
|
|
323
|
+
"text-anchor": "middle",
|
|
324
|
+
x: t.textAnchor,
|
|
325
|
+
y: t.y - e.value.style.labels.value.fontSize / 3 + e.value.style.labels.value.offsetY,
|
|
326
|
+
"font-size": e.value.style.labels.value.fontSize,
|
|
327
|
+
"font-weight": e.value.style.labels.value.bold ? "bold" : "normal",
|
|
328
|
+
fill: e.value.style.labels.value.color
|
|
329
|
+
}, p(oe(t, i)), 9, et))), 256)),
|
|
330
|
+
(a(!0), s(d, null, h(u.value, (t, i) => (a(), s("g", null, [
|
|
331
|
+
t.valueLabel ? (a(), s("text", {
|
|
332
|
+
key: 0,
|
|
333
|
+
class: "vue-ui-sparkhistogram-bottom-label",
|
|
334
|
+
x: t.textAnchor,
|
|
335
|
+
y: t.y + t.height + e.value.style.labels.valueLabel.fontSize,
|
|
336
|
+
"font-size": e.value.style.labels.valueLabel.fontSize,
|
|
337
|
+
"text-anchor": "middle",
|
|
338
|
+
fill: e.value.style.labels.valueLabel.color
|
|
339
|
+
}, p(t.valueLabel), 9, tt)) : c("", !0)
|
|
340
|
+
]))), 256)),
|
|
341
|
+
(a(!0), s(d, null, h(u.value, (t, i) => (a(), s("g", null, [
|
|
342
|
+
t.timeLabel ? (a(), s("text", {
|
|
343
|
+
key: 0,
|
|
344
|
+
class: "vue-ui-sparkhistogram-time-label",
|
|
345
|
+
x: t.textAnchor,
|
|
346
|
+
y: v.value.height - e.value.style.labels.timeLabel.fontSize / 2,
|
|
347
|
+
"font-size": e.value.style.labels.timeLabel.fontSize,
|
|
348
|
+
fill: e.value.style.labels.timeLabel.color,
|
|
349
|
+
"text-anchor": "middle"
|
|
350
|
+
}, p(t.timeLabel), 9, lt)) : c("", !0)
|
|
351
|
+
]))), 256))
|
|
352
|
+
], 64)),
|
|
353
|
+
(a(!0), s(d, null, h(u.value, (t, i) => (a(), s("g", null, [
|
|
354
|
+
g("rect", {
|
|
355
|
+
height: v.value.height,
|
|
356
|
+
width: t.unitWidth,
|
|
357
|
+
fill: "transparent",
|
|
358
|
+
x: t.trapX,
|
|
359
|
+
y: 0,
|
|
360
|
+
onMouseover: (f) => ne(t, i),
|
|
361
|
+
onMouseleave: (f) => re(t, i),
|
|
362
|
+
onClick: () => ue(t, i)
|
|
363
|
+
}, null, 40, at)
|
|
364
|
+
]))), 256))
|
|
365
|
+
], 8, He)),
|
|
366
|
+
l.$slots.source ? (a(), s("div", {
|
|
367
|
+
key: 1,
|
|
368
|
+
ref_key: "source",
|
|
369
|
+
ref: W,
|
|
370
|
+
dir: "auto"
|
|
371
|
+
}, [
|
|
372
|
+
q(l.$slots, "source", {}, void 0, !0)
|
|
373
|
+
], 512)) : c("", !0),
|
|
374
|
+
n(H) ? (a(), G(Ie, { key: 2 })) : c("", !0)
|
|
375
|
+
], 36));
|
|
376
|
+
}
|
|
377
|
+
}, ht = /* @__PURE__ */ De(st, [["__scopeId", "data-v-f8e879db"]]);
|
|
378
|
+
export {
|
|
379
|
+
ht as default
|
|
380
|
+
};
|