vue-data-ui 3.0.22 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Arrow-C3_2GkYQ.js → Arrow-DvG07exK.js} +1 -1
- package/dist/{BaseDraggableDialog-BhxUDwEm.js → BaseDraggableDialog-O7900pGp.js} +72 -59
- package/dist/{BaseIcon-B717hnWR.js → BaseIcon-DHtro8us.js} +1 -1
- package/dist/{useLoading-D7YHNtLX.js → BaseScanner-BgWxam9d.js} +11 -11
- package/dist/{ColorPicker-CH5_RNaK.js → ColorPicker-CpWzNn4r.js} +2 -2
- package/dist/DataTable-DJjA2_wf.js +140 -0
- package/dist/Legend-2-dC7DVb.js +72 -0
- package/dist/{NonSvgPenAndPaper-DCJGSteM.js → NonSvgPenAndPaper-DHeE4Yuv.js} +3 -3
- package/dist/{PackageVersion-CE7HSich.js → PackageVersion-DU12WH3O.js} +1 -1
- package/dist/{PenAndPaper-BMHsOtT8.js → PenAndPaper-B7QEDgx4.js} +3 -3
- package/dist/{Shape-C3J8aKNH.js → Shape-Dj2Hl33H.js} +1 -1
- package/dist/{Slicer-BEBDljWA.js → Slicer-D99HytqX.js} +2 -2
- package/dist/{SparkTooltip-CVSZQtoP.js → SparkTooltip-B-wL07rI.js} +1 -1
- package/dist/{Title-BL-IjQmj.js → Title-Dq2_Z9kR.js} +1 -1
- package/dist/{Tooltip-CCnDaboi.js → Tooltip-Y219DXZO.js} +1 -1
- package/dist/{UserOptions-BWMV0_Ze.js → UserOptions-BuGfCdAY.js} +2 -2
- package/dist/{dom-to-png-DwUGURhV.js → dom-to-png-BhciAKaM.js} +1 -1
- package/dist/{img-DsVqerdt.js → img-JOqdlnUs.js} +1 -1
- package/dist/{index-BHb_mcWF.js → index-CDQbCd41.js} +37 -2
- package/dist/{pdf-Ckt8JtYf.js → pdf-Dd-LIJqz.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +35 -0
- package/dist/types/vue-data-ui.d.ts +35 -0
- package/dist/{useAutoSizeLabelsInsideViewbox-Cy946l1e.js → useAutoSizeLabelsInsideViewbox-Bky5KGFZ.js} +1 -1
- package/dist/{useNestedProp-aC9S6EFJ.js → useNestedProp-BPEHGiYX.js} +1 -1
- package/dist/{usePrinter-B7rhbRrT.js → usePrinter-Bnl1YeUU.js} +2 -2
- package/dist/{vue-data-ui-Bu7qDtf0.js → vue-data-ui-DcNYz3cZ.js} +64 -64
- package/dist/vue-data-ui.js +1 -1
- package/dist/vue-ui-3d-bar-BNIFAeN-.js +1369 -0
- package/dist/{vue-ui-accordion-DsnF0JuK.js → vue-ui-accordion-Bf_LHFFX.js} +3 -3
- package/dist/{vue-ui-age-pyramid-s8xyb3Gf.js → vue-ui-age-pyramid-Bz-l1afR.js} +333 -286
- package/dist/{vue-ui-annotator-DRacM62z.js → vue-ui-annotator-BcfRH2BF.js} +2 -2
- package/dist/{vue-ui-bullet-DdDrdyOJ.js → vue-ui-bullet-DK1aM9fX.js} +8 -8
- package/dist/{vue-ui-candlestick-BsNnInNt.js → vue-ui-candlestick-D6mMjvtu.js} +453 -406
- package/dist/{vue-ui-carousel-table-Ci9mrUBd.js → vue-ui-carousel-table-Vp5f238W.js} +4 -4
- package/dist/{vue-ui-chestnut-fHfJNK0V.js → vue-ui-chestnut-BKc4v-lf.js} +509 -459
- package/dist/vue-ui-chord-CquhRjf0.js +1100 -0
- package/dist/vue-ui-circle-pack-D6zLgxa3.js +755 -0
- package/dist/{vue-ui-cursor-Bk5LHg5V.js → vue-ui-cursor-DIXb2S93.js} +2 -2
- package/dist/{vue-ui-dashboard-CjZMEYs6.js → vue-ui-dashboard-DmiriAK7.js} +62 -62
- package/dist/{vue-ui-digits-nDIvHyRB.js → vue-ui-digits-CLAIo9gW.js} +2 -2
- package/dist/{vue-ui-donut-CF9FdxfC.js → vue-ui-donut-C8h_tCSO.js} +477 -431
- package/dist/{vue-ui-donut-evolution-f5k-Yu3N.js → vue-ui-donut-evolution-C3r0YhKz.js} +482 -435
- package/dist/{vue-ui-dumbbell-Dm3gsrzi.js → vue-ui-dumbbell-D-t4M00E.js} +443 -398
- package/dist/vue-ui-flow-D7_D_UNm.js +900 -0
- package/dist/vue-ui-funnel-B0QOfZRz.js +666 -0
- package/dist/vue-ui-galaxy-Ccw5uNes.js +744 -0
- package/dist/{vue-ui-gauge-DkDpUAN7.js → vue-ui-gauge-DvW7nFmK.js} +8 -8
- package/dist/{vue-ui-gizmo-BD5fLs8r.js → vue-ui-gizmo-WGQxvGPy.js} +4 -4
- package/dist/vue-ui-heatmap-BQkLujyp.js +1127 -0
- package/dist/{vue-ui-history-plot-ICoBBO-y.js → vue-ui-history-plot-eU33r_Ot.js} +408 -361
- package/dist/{vue-ui-kpi-Dp2M2EFo.js → vue-ui-kpi-CKg2i71M.js} +3 -3
- package/dist/{vue-ui-mini-loader-C5672jjA.js → vue-ui-mini-loader-BmkGQsm_.js} +2 -2
- package/dist/vue-ui-molecule-Dlu0hjSg.js +702 -0
- package/dist/{vue-ui-mood-radar-B-qhYUcB.js → vue-ui-mood-radar-DQaxfw9R.js} +342 -291
- package/dist/{vue-ui-nested-donuts-V6BvP3pF.js → vue-ui-nested-donuts-Djj9Aw_i.js} +548 -502
- package/dist/{vue-ui-onion-BKqqbWbg.js → vue-ui-onion-ZgsErXis.js} +363 -317
- package/dist/vue-ui-parallel-coordinate-plot-B5fB22Jc.js +979 -0
- package/dist/vue-ui-quadrant-CMevCtXH.js +1483 -0
- package/dist/{vue-ui-quick-chart-BVZSdQeT.js → vue-ui-quick-chart-DcparKSX.js} +7 -7
- package/dist/vue-ui-radar-DFbxoKCK.js +858 -0
- package/dist/{vue-ui-rating-CncrxDCY.js → vue-ui-rating-ZUpxCWrk.js} +2 -2
- package/dist/{vue-ui-relation-circle-VYM1dclx.js → vue-ui-relation-circle-eNKJY4Sx.js} +8 -8
- package/dist/vue-ui-ridgeline-D4shpQZd.js +1204 -0
- package/dist/vue-ui-rings-TdTHMbsa.js +785 -0
- package/dist/{vue-ui-scatter-D2b-u5dv.js → vue-ui-scatter-CVuV9ljU.js} +594 -548
- package/dist/{vue-ui-skeleton-BTuBaaE_.js → vue-ui-skeleton-CFxBU2-p.js} +3 -3
- package/dist/{vue-ui-smiley-D1UxJNbV.js → vue-ui-smiley-Har3B3aQ.js} +2 -2
- package/dist/{vue-ui-spark-trend-BCP0BWMI.js → vue-ui-spark-trend-FPk-XEwI.js} +4 -4
- package/dist/{vue-ui-sparkbar-eBo-RSvE.js → vue-ui-sparkbar-V3eJ0w0t.js} +4 -4
- package/dist/{vue-ui-sparkgauge-DberOXWX.js → vue-ui-sparkgauge-DKTGkWnJ.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-CoKQGG5X.js → vue-ui-sparkhistogram-DJsgFwHs.js} +5 -5
- package/dist/{vue-ui-sparkline-B_L4UNES.js → vue-ui-sparkline-Dmrm5SL5.js} +4 -4
- package/dist/{vue-ui-sparkstackbar-iAaRIyqb.js → vue-ui-sparkstackbar-B0Pl7VMI.js} +4 -4
- package/dist/{vue-ui-stackbar-B_0PJ7R2.js → vue-ui-stackbar-CNsgBPhj.js} +525 -479
- package/dist/{vue-ui-strip-plot-CWkA4l9P.js → vue-ui-strip-plot-CYAWwYOM.js} +390 -343
- package/dist/{vue-ui-table-CILVy7YP.js → vue-ui-table-Dn6H98rP.js} +3 -3
- package/dist/{vue-ui-table-heatmap-DL2n2Z7p.js → vue-ui-table-heatmap-COI9LRqC.js} +5 -5
- package/dist/{vue-ui-table-sparkline-DOt2EKpe.js → vue-ui-table-sparkline-B7Gg5FfJ.js} +4 -4
- package/dist/{vue-ui-thermometer-BTP1ic_T.js → vue-ui-thermometer-Bgynq5El.js} +8 -8
- package/dist/{vue-ui-timer-Bc-zJH9j.js → vue-ui-timer-CXng51v5.js} +5 -5
- package/dist/{vue-ui-tiremarks-B9n528e1.js → vue-ui-tiremarks-Cy1U3hO1.js} +7 -7
- package/dist/vue-ui-treemap-BsvIvRmE.js +1092 -0
- package/dist/{vue-ui-vertical-bar-CK2j09gJ.js → vue-ui-vertical-bar-DHqWeDIf.js} +512 -464
- package/dist/{vue-ui-waffle-DJkqgqlR.js → vue-ui-waffle-D1Mscj3N.js} +416 -370
- package/dist/{vue-ui-wheel-CcbgpIUr.js → vue-ui-wheel-DpV-N5tF.js} +7 -7
- package/dist/vue-ui-word-cloud-MaNQ3Kdk.js +811 -0
- package/dist/{vue-ui-world-DLmB_Z96.js → vue-ui-world-DYz6zw3x.js} +512 -466
- package/dist/{vue-ui-xy-KmrNT6qh.js → vue-ui-xy-B1nqNbzw.js} +1559 -1508
- package/dist/vue-ui-xy-canvas-D4wd-Asd.js +1291 -0
- package/package.json +1 -1
- package/dist/DataTable-Y5T9UxMO.js +0 -133
- package/dist/Legend-DkU3at-b.js +0 -72
- package/dist/vue-ui-3d-bar-CBfQ3Pcb.js +0 -1323
- package/dist/vue-ui-chord-0wf798ls.js +0 -1049
- package/dist/vue-ui-circle-pack-CuRHG8gr.js +0 -709
- package/dist/vue-ui-flow-K7UBguES.js +0 -852
- package/dist/vue-ui-funnel-DoDZbsTp.js +0 -620
- package/dist/vue-ui-galaxy-BsDlHxzE.js +0 -691
- package/dist/vue-ui-heatmap-DOT2tBy_.js +0 -1078
- package/dist/vue-ui-molecule-DgqVh2k0.js +0 -656
- package/dist/vue-ui-parallel-coordinate-plot-BZf24Zur.js +0 -927
- package/dist/vue-ui-quadrant-S58B2LrQ.js +0 -1432
- package/dist/vue-ui-radar-Dh67mQ9E.js +0 -807
- package/dist/vue-ui-ridgeline-CsByERvm.js +0 -1157
- package/dist/vue-ui-rings-CR2UfgnV.js +0 -739
- package/dist/vue-ui-treemap-Cl9qo9O-.js +0 -1046
- package/dist/vue-ui-word-cloud-CZ_TRf4o.js +0 -765
- package/dist/vue-ui-xy-canvas-6VYNyX6a.js +0 -1243
|
@@ -1,1243 +0,0 @@
|
|
|
1
|
-
import { defineAsyncComponent as ee, ref as d, computed as L, useSlots as Ga, onMounted as sa, watch as N, nextTick as na, shallowRef as ze, onBeforeUnmount as Za, createElementBlock as ie, openBlock as S, unref as p, normalizeClass as ja, normalizeStyle as ae, createCommentVNode as H, createElementVNode as B, createBlock as R, createSlots as qa, withCtx as x, renderSlot as k, normalizeProps as V, guardReactiveProps as G, createVNode as Ja, Teleport as Ka, toDisplayString as ia, createTextVNode as Qa } from "vue";
|
|
2
|
-
import { u as el, c as al, a as ll, p as Z, b as tl, C as pe, d as ol, D as $e, k as le, i as te, e as va, a4 as rl, G as ul, ae as sl, o as nl, f as il, y as ca, v as vl, w as cl, z as dl, s as ve, l as hl } from "./index-BHb_mcWF.js";
|
|
3
|
-
import { d as yl, t as fl, u as gl, c as pl, a as da, l as C, r as Ie, b as P, p as ha } from "./useResponsive-DfdjqQps.js";
|
|
4
|
-
import { u as ya } from "./useNestedProp-aC9S6EFJ.js";
|
|
5
|
-
import { u as ml } from "./usePrinter-B7rhbRrT.js";
|
|
6
|
-
import { u as bl } from "./useUserOptionState-BIvW1Kz7.js";
|
|
7
|
-
import { u as xl } from "./useChartAccessibility-9icAAmYg.js";
|
|
8
|
-
import Ll from "./Legend-DkU3at-b.js";
|
|
9
|
-
import kl from "./Title-BL-IjQmj.js";
|
|
10
|
-
import { S as Cl } from "./Slicer-BEBDljWA.js";
|
|
11
|
-
import { u as wl } from "./useTimeLabels-BGFjWgrv.js";
|
|
12
|
-
import Sl from "./img-DsVqerdt.js";
|
|
13
|
-
import { _ as zl } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
|
-
const $l = ["id"], Il = ["id"], Ml = ["id"], Tl = ["onClick"], Ol = {
|
|
15
|
-
key: 3,
|
|
16
|
-
class: "vue-data-ui-watermark"
|
|
17
|
-
}, Rl = ["innerHTML"], Pl = {
|
|
18
|
-
__name: "vue-ui-xy-canvas",
|
|
19
|
-
props: {
|
|
20
|
-
dataset: {
|
|
21
|
-
type: Array,
|
|
22
|
-
default() {
|
|
23
|
-
return [];
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
config: {
|
|
27
|
-
type: Object,
|
|
28
|
-
default() {
|
|
29
|
-
return {};
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
emits: ["selectLegend"],
|
|
34
|
-
setup(Me, { expose: fa, emit: ga }) {
|
|
35
|
-
const pa = ee(() => import("./vue-ui-accordion-DsnF0JuK.js")), ma = ee(() => import("./DataTable-Y5T9UxMO.js")), ba = ee(() => import("./NonSvgPenAndPaper-DCJGSteM.js")), xa = ee(() => import("./vue-ui-skeleton-BTuBaaE_.js")), La = ee(() => import("./Tooltip-CCnDaboi.js")), ka = ee(() => import("./UserOptions-BWMV0_Ze.js")), { vue_ui_xy_canvas: Ca } = el(), g = Me, Y = d(al()), F = d(null), oe = d(null), n = d(null), y = d(1), E = d(1), ce = d(!1), c = d(null), de = d(""), Te = d(null), $ = d([]), j = d(1), _ = d(!0), q = d(!0), me = d(null), Oe = d(0), Re = d(0), he = d(!1), Pe = d(null), Fe = d(null), Ee = d(null), Ae = d(null), be = d(0), xe = d(0), Le = d(0), M = d(null), De = d(!1), ke = L(() => !!g.dataset && g.dataset.length), wa = ga, Sa = Ga();
|
|
36
|
-
sa(() => {
|
|
37
|
-
Sa["chart-background"] && console.warn("VueUiXyCanvas does not support the #chart-background slot.");
|
|
38
|
-
});
|
|
39
|
-
const a = L({
|
|
40
|
-
get: () => Ye(),
|
|
41
|
-
set: (e) => e
|
|
42
|
-
}), { userOptionsVisible: Ce, setUserOptionsVisibility: Ne, keepUserOptionState: He } = bl({ config: a.value }), { svgRef: T } = xl({ config: a.value.style.chart.title });
|
|
43
|
-
function Ye() {
|
|
44
|
-
const e = ya({
|
|
45
|
-
userConfig: g.config,
|
|
46
|
-
defaultConfig: Ca
|
|
47
|
-
});
|
|
48
|
-
let l = {};
|
|
49
|
-
return e.theme ? l = {
|
|
50
|
-
...ya({
|
|
51
|
-
userConfig: tl.vue_ui_xy_canvas[e.theme] || g.config,
|
|
52
|
-
defaultConfig: e
|
|
53
|
-
}),
|
|
54
|
-
customPalette: ll[e.theme] || Z
|
|
55
|
-
} : l = e, g.config && pe(g.config, "style.chart.scale.min") ? l.style.chart.scale.min = g.config.style.chart.scale.min : l.style.chart.scale.min = null, g.config && pe(g.config, "style.chart.scale.max") ? l.style.chart.scale.max = g.config.style.chart.scale.max : l.style.chart.scale.max = null, g.config && pe(g.config, "style.chart.zoom.startIndex") ? l.style.chart.zoom.startIndex = g.config.style.chart.zoom.startIndex : l.style.chart.zoom.startIndex = null, g.config && pe(g.config, "style.chart.zoom.endIndex") ? l.style.chart.zoom.endIndex = g.config.style.chart.zoom.endIndex : l.style.chart.zoom.endIndex = null, l;
|
|
56
|
-
}
|
|
57
|
-
N(() => g.config, (e) => {
|
|
58
|
-
a.value = Ye(), Ce.value = !a.value.userOptions.showOnChartHover, we(), be.value += 1, xe.value += 1, Le.value += 1, u.value.showTable = a.value.table.show, u.value.showDataLabels = a.value.style.chart.dataLabels.show, u.value.stacked = a.value.style.chart.stacked, u.value.showTooltip = a.value.style.chart.tooltip.show;
|
|
59
|
-
}, { deep: !0 }), N(() => g.dataset, () => {
|
|
60
|
-
we(), be.value += 1, xe.value += 1, Le.value += 1;
|
|
61
|
-
}, { deep: !0 });
|
|
62
|
-
const _e = d(a.value.style.chart.aspectRatio), { isPrinting: Ue, isImaging: We, generatePdf: Xe, generateImage: Be } = ml({
|
|
63
|
-
elementId: `xy_canvas_${Y.value}`,
|
|
64
|
-
fileName: a.value.style.chart.title.text || "vue-ui-xy-canvas",
|
|
65
|
-
options: a.value.userOptions.print
|
|
66
|
-
}), u = d({
|
|
67
|
-
showTable: a.value.table.show,
|
|
68
|
-
showDataLabels: a.value.style.chart.dataLabels.show,
|
|
69
|
-
stacked: a.value.style.chart.stacked,
|
|
70
|
-
showTooltip: a.value.style.chart.tooltip.show
|
|
71
|
-
});
|
|
72
|
-
function Ve(e) {
|
|
73
|
-
he.value = e, Re.value += 1;
|
|
74
|
-
}
|
|
75
|
-
const Ge = L(() => ol(a.value.customPalette)), I = L(() => J.value ? Math.max(...J.value.filter((e, l) => !$.value.includes(e.absoluteIndex)).map((e) => e.series.length)) : 0), t = L(() => {
|
|
76
|
-
const e = y.value - y.value * (a.value.style.chart.paddingProportions.left + a.value.style.chart.paddingProportions.right);
|
|
77
|
-
return {
|
|
78
|
-
canvasWidth: y.value,
|
|
79
|
-
canvasHeight: E.value,
|
|
80
|
-
left: y.value * a.value.style.chart.paddingProportions.left,
|
|
81
|
-
top: E.value * a.value.style.chart.paddingProportions.top,
|
|
82
|
-
right: y.value - y.value * a.value.style.chart.paddingProportions.right,
|
|
83
|
-
bottom: E.value - E.value * a.value.style.chart.paddingProportions.bottom,
|
|
84
|
-
width: e,
|
|
85
|
-
height: E.value - E.value * (a.value.style.chart.paddingProportions.top + a.value.style.chart.paddingProportions.bottom),
|
|
86
|
-
slot: e / (r.value.end - r.value.start)
|
|
87
|
-
};
|
|
88
|
-
});
|
|
89
|
-
function Ze(e, l) {
|
|
90
|
-
return e / l;
|
|
91
|
-
}
|
|
92
|
-
function za({ hasAutoScale: e, series: l, min: o, max: s, scale: i, yOffset: b, individualHeight: v, stackIndex: f = null }) {
|
|
93
|
-
return l.map((W, z) => {
|
|
94
|
-
const D = i.min < 0 ? Math.abs(i.min) : 0, X = Ze(W + D, D + i.max);
|
|
95
|
-
let se, ne;
|
|
96
|
-
e && (se = i.min, ne = Ze(W - se, i.max - se));
|
|
97
|
-
let O = 0;
|
|
98
|
-
return f === null ? O = t.value.bottom - t.value.height * (e ? ne : X) : O = t.value.bottom - b - v * (e ? ne : X), {
|
|
99
|
-
x: t.value.left + t.value.slot * z + t.value.slot / 2,
|
|
100
|
-
y: O,
|
|
101
|
-
value: W
|
|
102
|
-
};
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
const m = L(() => {
|
|
106
|
-
const e = a.value.style.chart.scale.min !== null ? a.value.style.chart.scale.min : Math.min(...J.value.filter((v, f) => !$.value.includes(v.absoluteIndex)).flatMap((v) => v.series.slice(r.value.start, r.value.end))), l = a.value.style.chart.scale.max !== null ? a.value.style.chart.scale.max : Math.max(...J.value.filter((v, f) => !$.value.includes(v.absoluteIndex)).flatMap((v) => v.series.slice(r.value.start, r.value.end))), o = $e(e < 0 ? e : 0, l === e ? e + 1 < 0 ? 0 : e + 1 : l < 0 ? 0 : l, a.value.style.chart.scale.ticks), s = o.min < 0 ? Math.abs(o.min) : 0, i = t.value.bottom - t.value.height * (s / (o.max + s)), b = o.ticks.map((v) => ({
|
|
107
|
-
y: t.value.bottom - t.value.height * ((v + s) / (o.max + s)),
|
|
108
|
-
x: t.value.left - 8,
|
|
109
|
-
value: v
|
|
110
|
-
}));
|
|
111
|
-
return {
|
|
112
|
-
absoluteMin: s,
|
|
113
|
-
max: l,
|
|
114
|
-
min: e,
|
|
115
|
-
scale: o,
|
|
116
|
-
yLabels: b,
|
|
117
|
-
zero: i
|
|
118
|
-
};
|
|
119
|
-
}), $a = L(() => h.value.map((e) => `
|
|
120
|
-
<div style="display:flex;flex-direction:row;gap:6px;align-items:center;">
|
|
121
|
-
<svg viewBox="0 0 10 10" height="12" width="12">
|
|
122
|
-
<circle cx="5" cy="5" r="5" fill="${e.color}"/>
|
|
123
|
-
</svg>
|
|
124
|
-
<span>${e.name ? e.name + ": " : ""}</span>
|
|
125
|
-
<span>${le(
|
|
126
|
-
a.value.style.chart.dataLabels.formatter,
|
|
127
|
-
e.series[c.value],
|
|
128
|
-
te({
|
|
129
|
-
p: e.prefix || "",
|
|
130
|
-
v: e.series[c.value],
|
|
131
|
-
s: e.suffix || "",
|
|
132
|
-
r: e.rounding || 0
|
|
133
|
-
}),
|
|
134
|
-
{ datapoint: e, seriesIndex: c.value }
|
|
135
|
-
)}</span>
|
|
136
|
-
</div>
|
|
137
|
-
`)), J = L(() => g.dataset.map((e, l) => ({
|
|
138
|
-
...e,
|
|
139
|
-
series: rl({
|
|
140
|
-
data: ul(e.series),
|
|
141
|
-
threshold: a.value.downsample.threshold
|
|
142
|
-
}),
|
|
143
|
-
absoluteIndex: l,
|
|
144
|
-
color: va(e.color || Ge.value[l] || Z[l] || Z[l % Z.length])
|
|
145
|
-
})));
|
|
146
|
-
N(I, (e) => {
|
|
147
|
-
e && je();
|
|
148
|
-
});
|
|
149
|
-
const h = L(() => sl(J.value.filter((e, l) => !$.value.includes(e.absoluteIndex))).map((e, l) => ({
|
|
150
|
-
...e,
|
|
151
|
-
series: e.series.slice(r.value.start, r.value.end)
|
|
152
|
-
})).map((e, l) => {
|
|
153
|
-
let o = [null, void 0].includes(e.scaleMin) ? Math.min(...e.series) || 0 : e.scaleMin, s = [null, void 0].includes(e.scaleMax) ? Math.max(...e.series) || 1 : e.scaleMax;
|
|
154
|
-
o === s && (o = o >= 0 ? s - 1 : o, s = s >= 0 ? s : o + 1), e.series.filter((O) => ![null, void 0].includes(O)).map((O) => (O - o) / (s - o));
|
|
155
|
-
const i = {
|
|
156
|
-
valueMin: o,
|
|
157
|
-
valueMax: s
|
|
158
|
-
}, b = e.scaleSteps || a.value.style.chart.scale.ticks;
|
|
159
|
-
let v;
|
|
160
|
-
e.autoScaling ? v = $e(i.valueMin, i.valueMax, b) : v = $e(i.valueMin < 0 ? i.valueMin : 0, i.valueMax <= 0 ? 0 : i.valueMax, b);
|
|
161
|
-
const f = u.value.stacked ? t.value.height * (1 - e.cumulatedStackRatio) : 0, W = u.value.stacked ? t.value.height / a.value.style.chart.stackGap : 0, z = u.value.stacked ? t.value.height * e.stackRatio - W : t.value.height, D = v.min < 0 ? Math.abs(v.min) : 0;
|
|
162
|
-
let X;
|
|
163
|
-
e.autoScaling && u.value.stacked && s <= 0 ? X = t.value.bottom - f - z : X = t.value.bottom - f - z * (D / (v.max + D));
|
|
164
|
-
const se = v.ticks.map((O, Va) => ({
|
|
165
|
-
y: t.value.bottom - f - z * (Va / (v.ticks.length - 1)),
|
|
166
|
-
x: t.value.left - 8,
|
|
167
|
-
value: O
|
|
168
|
-
})), ne = za({
|
|
169
|
-
hasAutoScale: u.value.stacked && e.autoScaling,
|
|
170
|
-
series: e.series,
|
|
171
|
-
min: u.value.stacked ? o : m.value.min,
|
|
172
|
-
max: u.value.stacked ? s : m.value.max,
|
|
173
|
-
scale: u.value.stacked ? v : m.value.scale,
|
|
174
|
-
yOffset: f,
|
|
175
|
-
individualHeight: z,
|
|
176
|
-
stackIndex: u.value.stacked ? l : null
|
|
177
|
-
});
|
|
178
|
-
return {
|
|
179
|
-
...e,
|
|
180
|
-
coordinatesLine: ne,
|
|
181
|
-
min: o,
|
|
182
|
-
max: s,
|
|
183
|
-
localScale: v,
|
|
184
|
-
localZero: X,
|
|
185
|
-
localMin: D,
|
|
186
|
-
localYLabels: se,
|
|
187
|
-
yOffset: f,
|
|
188
|
-
individualHeight: z
|
|
189
|
-
};
|
|
190
|
-
})), r = d({
|
|
191
|
-
start: 0,
|
|
192
|
-
end: I.value
|
|
193
|
-
});
|
|
194
|
-
function je() {
|
|
195
|
-
Je();
|
|
196
|
-
}
|
|
197
|
-
const qe = d(null);
|
|
198
|
-
async function Je() {
|
|
199
|
-
await na(), await na();
|
|
200
|
-
const { startIndex: e, endIndex: l } = a.value.style.chart.zoom, o = qe.value, s = I.value;
|
|
201
|
-
r.value = { start: 0, end: s }, (e != null || l != null) && o ? (e != null ? o.setStartValue(e) : (r.value.start = 0, o.setStartValue(0)), l != null ? o.setEndValue(Ia(l + 1)) : (r.value.end = s, o.setEndValue(s))) : (r.value = { start: 0, end: s }, Oe.value += 1);
|
|
202
|
-
}
|
|
203
|
-
function Ia(e) {
|
|
204
|
-
const l = I.value;
|
|
205
|
-
return e > l ? l : 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;
|
|
206
|
-
}
|
|
207
|
-
const Ma = L(() => h.value.filter((e) => ["line", "plot", void 0].includes(e.type))), w = L(() => h.value.filter((e) => e.type === "bar"));
|
|
208
|
-
function Ta() {
|
|
209
|
-
if (!T.value)
|
|
210
|
-
return;
|
|
211
|
-
const e = oe.value.offsetWidth, l = oe.value.offsetHeight;
|
|
212
|
-
T.value.width = e * j.value * 2, T.value.height = l * j.value * 2, y.value = e * j.value * 2, E.value = l * j.value * 2, n.value.scale(j.value, j.value), re();
|
|
213
|
-
}
|
|
214
|
-
function Oa() {
|
|
215
|
-
if (n.value.clearRect(0, 0, 1e4, 1e4), n.value.fillStyle = a.value.style.chart.backgroundColor, n.value.fillRect(0, 0, t.value.canvasWidth, t.value.canvasHeight), u.value.stacked)
|
|
216
|
-
a.value.style.chart.grid.y.verticalLines.show && r.value.end - r.value.start < a.value.style.chart.grid.y.verticalLines.hideUnderXLength ? h.value.forEach((e) => {
|
|
217
|
-
for (let l = 0; l < r.value.end - r.value.start + 1; l += 1)
|
|
218
|
-
C(
|
|
219
|
-
n.value,
|
|
220
|
-
[
|
|
221
|
-
{
|
|
222
|
-
x: t.value.left + t.value.slot * l,
|
|
223
|
-
y: t.value.bottom - e.yOffset - e.individualHeight
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
x: t.value.left + t.value.slot * l,
|
|
227
|
-
y: t.value.bottom - e.yOffset
|
|
228
|
-
}
|
|
229
|
-
],
|
|
230
|
-
{
|
|
231
|
-
color: a.value.style.chart.grid.y.verticalLines.color
|
|
232
|
-
}
|
|
233
|
-
);
|
|
234
|
-
}) : a.value.style.chart.grid.y.verticalLines.show && r.value.end - r.value.start >= a.value.style.chart.grid.y.verticalLines.hideUnderXLength && h.value.forEach((e) => {
|
|
235
|
-
for (let l = r.value.start; l < r.value.end; l += 1)
|
|
236
|
-
l % Math.floor((r.value.end - r.value.start) / a.value.style.chart.grid.y.timeLabels.modulo) === 0 && C(
|
|
237
|
-
n.value,
|
|
238
|
-
[
|
|
239
|
-
{
|
|
240
|
-
x: t.value.left + t.value.slot * (l - r.value.start) + t.value.slot / 2,
|
|
241
|
-
y: t.value.bottom - e.yOffset - e.individualHeight
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
x: t.value.left + t.value.slot * (l - r.value.start) + t.value.slot / 2,
|
|
245
|
-
y: t.value.bottom - e.yOffset
|
|
246
|
-
}
|
|
247
|
-
],
|
|
248
|
-
{
|
|
249
|
-
color: a.value.style.chart.grid.y.verticalLines.color
|
|
250
|
-
}
|
|
251
|
-
);
|
|
252
|
-
}), a.value.style.chart.grid.x.horizontalLines.show && (a.value.style.chart.grid.x.horizontalLines.alternate ? h.value.forEach((e) => {
|
|
253
|
-
e.localYLabels.forEach((l, o) => {
|
|
254
|
-
o < e.localYLabels.length - 1 && Ie(
|
|
255
|
-
n.value,
|
|
256
|
-
[
|
|
257
|
-
{ x: t.value.left, y: l.y },
|
|
258
|
-
{ x: t.value.right, y: l.y },
|
|
259
|
-
{ x: t.value.right, y: e.localYLabels[o + 1].y },
|
|
260
|
-
{ x: t.value.left, y: e.localYLabels[o + 1].y }
|
|
261
|
-
],
|
|
262
|
-
{
|
|
263
|
-
fillColor: o % 2 === 0 ? "transparent" : ve(a.value.style.chart.grid.x.horizontalLines.color, a.value.style.chart.grid.x.horizontalLines.opacity),
|
|
264
|
-
strokeColor: "transparent"
|
|
265
|
-
}
|
|
266
|
-
);
|
|
267
|
-
});
|
|
268
|
-
}) : h.value.forEach((e) => {
|
|
269
|
-
e.localYLabels.slice(r.value.start, r.value.end).forEach((l) => {
|
|
270
|
-
C(
|
|
271
|
-
n.value,
|
|
272
|
-
[
|
|
273
|
-
{ x: t.value.left, y: l.y },
|
|
274
|
-
{ x: t.value.right, y: l.y }
|
|
275
|
-
],
|
|
276
|
-
{
|
|
277
|
-
color: a.value.style.chart.grid.x.horizontalLines.color
|
|
278
|
-
}
|
|
279
|
-
);
|
|
280
|
-
});
|
|
281
|
-
})), a.value.style.chart.grid.zeroLine.show && h.value.forEach((e) => {
|
|
282
|
-
C(
|
|
283
|
-
n.value,
|
|
284
|
-
[
|
|
285
|
-
{ x: t.value.left, y: e.localZero },
|
|
286
|
-
{ x: t.value.right, y: e.localZero }
|
|
287
|
-
],
|
|
288
|
-
{
|
|
289
|
-
color: a.value.style.chart.grid.zeroLine.color,
|
|
290
|
-
lineDash: a.value.style.chart.grid.zeroLine.dashed ? [10, 10] : [0, 0]
|
|
291
|
-
}
|
|
292
|
-
);
|
|
293
|
-
}), a.value.style.chart.grid.y.axisLabels.show && h.value.forEach((e) => {
|
|
294
|
-
C(
|
|
295
|
-
n.value,
|
|
296
|
-
[
|
|
297
|
-
{ x: t.value.left, y: t.value.bottom - e.yOffset },
|
|
298
|
-
{ x: t.value.left, y: t.value.bottom - e.yOffset - e.individualHeight }
|
|
299
|
-
],
|
|
300
|
-
{
|
|
301
|
-
color: e.color
|
|
302
|
-
}
|
|
303
|
-
), C(
|
|
304
|
-
n.value,
|
|
305
|
-
[
|
|
306
|
-
{ x: t.value.right, y: t.value.bottom - e.yOffset },
|
|
307
|
-
{ x: t.value.right, y: t.value.bottom - e.yOffset - e.individualHeight }
|
|
308
|
-
],
|
|
309
|
-
{
|
|
310
|
-
color: e.color
|
|
311
|
-
}
|
|
312
|
-
);
|
|
313
|
-
}), h.value.forEach((e) => {
|
|
314
|
-
P(
|
|
315
|
-
n.value,
|
|
316
|
-
e.name,
|
|
317
|
-
y.value / 35,
|
|
318
|
-
t.value.bottom - e.yOffset - e.individualHeight / 2,
|
|
319
|
-
{
|
|
320
|
-
align: "center",
|
|
321
|
-
rotation: -90,
|
|
322
|
-
color: e.color,
|
|
323
|
-
font: `${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`
|
|
324
|
-
}
|
|
325
|
-
);
|
|
326
|
-
});
|
|
327
|
-
else {
|
|
328
|
-
if (a.value.style.chart.grid.y.verticalLines.show && r.value.end - r.value.start < a.value.style.chart.grid.y.verticalLines.hideUnderXLength)
|
|
329
|
-
for (let e = 0; e < r.value.end - r.value.start + 1; e += 1)
|
|
330
|
-
C(
|
|
331
|
-
n.value,
|
|
332
|
-
[
|
|
333
|
-
{ x: t.value.left + t.value.slot * e, y: t.value.top },
|
|
334
|
-
{ x: t.value.left + t.value.slot * e, y: t.value.bottom }
|
|
335
|
-
],
|
|
336
|
-
{
|
|
337
|
-
color: a.value.style.chart.grid.y.verticalLines.color
|
|
338
|
-
}
|
|
339
|
-
);
|
|
340
|
-
else if (a.value.style.chart.grid.y.verticalLines.show && r.value.end - r.value.start >= a.value.style.chart.grid.y.verticalLines.hideUnderXLength)
|
|
341
|
-
for (let e = r.value.start; e < r.value.end; e += 1)
|
|
342
|
-
e % Math.floor((r.value.end - r.value.start) / a.value.style.chart.grid.y.timeLabels.modulo) === 0 && C(
|
|
343
|
-
n.value,
|
|
344
|
-
[
|
|
345
|
-
{ x: t.value.left + t.value.slot * (e - r.value.start) + t.value.slot / 2, y: t.value.top },
|
|
346
|
-
{ x: t.value.left + t.value.slot * (e - r.value.start) + t.value.slot / 2, y: t.value.bottom }
|
|
347
|
-
],
|
|
348
|
-
{
|
|
349
|
-
color: a.value.style.chart.grid.y.verticalLines.color
|
|
350
|
-
}
|
|
351
|
-
);
|
|
352
|
-
a.value.style.chart.grid.x.horizontalLines.show && (a.value.style.chart.grid.x.horizontalLines.alternate ? m.value.yLabels.forEach((e, l) => {
|
|
353
|
-
l < m.value.yLabels.length - 1 && Ie(
|
|
354
|
-
n.value,
|
|
355
|
-
[
|
|
356
|
-
{ x: t.value.left, y: e.y },
|
|
357
|
-
{ x: t.value.right, y: e.y },
|
|
358
|
-
{ x: t.value.right, y: m.value.yLabels[l + 1].y },
|
|
359
|
-
{ x: t.value.left, y: m.value.yLabels[l + 1].y }
|
|
360
|
-
],
|
|
361
|
-
{
|
|
362
|
-
fillColor: l % 2 === 0 ? "transparent" : ve(a.value.style.chart.grid.x.horizontalLines.color, a.value.style.chart.grid.x.horizontalLines.opacity),
|
|
363
|
-
strokeColor: "transparent"
|
|
364
|
-
}
|
|
365
|
-
);
|
|
366
|
-
}) : m.value.yLabels.forEach((e) => {
|
|
367
|
-
C(
|
|
368
|
-
n.value,
|
|
369
|
-
[
|
|
370
|
-
{ x: t.value.left, y: e.y },
|
|
371
|
-
{ x: t.value.right, y: e.y }
|
|
372
|
-
],
|
|
373
|
-
{
|
|
374
|
-
color: a.value.style.chart.grid.x.horizontalLines.color
|
|
375
|
-
}
|
|
376
|
-
);
|
|
377
|
-
})), a.value.style.chart.grid.y.showAxis && C(
|
|
378
|
-
n.value,
|
|
379
|
-
[
|
|
380
|
-
{ x: t.value.left, y: t.value.top },
|
|
381
|
-
{ x: t.value.left, y: t.value.bottom }
|
|
382
|
-
],
|
|
383
|
-
{
|
|
384
|
-
color: a.value.style.chart.grid.y.axisColor,
|
|
385
|
-
lineWidth: a.value.style.chart.grid.y.axisThickness
|
|
386
|
-
}
|
|
387
|
-
), a.value.style.chart.grid.x.showAxis && C(
|
|
388
|
-
n.value,
|
|
389
|
-
[
|
|
390
|
-
{ x: t.value.left, y: t.value.bottom },
|
|
391
|
-
{ x: t.value.right, y: t.value.bottom }
|
|
392
|
-
],
|
|
393
|
-
{
|
|
394
|
-
color: a.value.style.chart.grid.x.axisColor,
|
|
395
|
-
lineWidth: a.value.style.chart.grid.x.axisThickness
|
|
396
|
-
}
|
|
397
|
-
), a.value.style.chart.grid.zeroLine.show && C(
|
|
398
|
-
n.value,
|
|
399
|
-
[
|
|
400
|
-
{ x: t.value.left, y: m.value.zero },
|
|
401
|
-
{ x: t.value.right, y: m.value.zero }
|
|
402
|
-
],
|
|
403
|
-
{
|
|
404
|
-
color: a.value.style.chart.grid.zeroLine.color,
|
|
405
|
-
lineDash: a.value.style.chart.grid.zeroLine.dashed ? [10, 10] : [0, 0]
|
|
406
|
-
}
|
|
407
|
-
);
|
|
408
|
-
}
|
|
409
|
-
a.value.style.chart.grid.y.axisName && P(
|
|
410
|
-
n.value,
|
|
411
|
-
a.value.style.chart.grid.y.axisName,
|
|
412
|
-
y.value - y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio * 1.2,
|
|
413
|
-
t.value.bottom - t.value.height / 2,
|
|
414
|
-
{
|
|
415
|
-
font: `${a.value.style.chart.grid.y.axisLabels.bold ? "bold " : ""}${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
|
|
416
|
-
color: a.value.style.chart.color,
|
|
417
|
-
align: "center",
|
|
418
|
-
rotation: 90
|
|
419
|
-
}
|
|
420
|
-
), a.value.style.chart.grid.x.axisName && P(
|
|
421
|
-
n.value,
|
|
422
|
-
a.value.style.chart.grid.x.axisName,
|
|
423
|
-
y.value / 2,
|
|
424
|
-
E.value,
|
|
425
|
-
{
|
|
426
|
-
font: `${a.value.style.chart.grid.y.axisLabels.bold ? "bold " : ""}${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
|
|
427
|
-
color: a.value.style.chart.color,
|
|
428
|
-
align: "center"
|
|
429
|
-
}
|
|
430
|
-
);
|
|
431
|
-
}
|
|
432
|
-
function Ra(e) {
|
|
433
|
-
for (let l = 0; l < e.coordinatesLine.length; l += 1) {
|
|
434
|
-
const o = (c.value === l ? y.value / 150 : a.value.style.chart.line.plots.show ? y.value / 200 : 0) * a.value.style.chart.line.plots.radiusRatio;
|
|
435
|
-
da(
|
|
436
|
-
n.value,
|
|
437
|
-
{ x: e.coordinatesLine[l].x, y: e.coordinatesLine[l].y },
|
|
438
|
-
o,
|
|
439
|
-
{
|
|
440
|
-
color: a.value.style.chart.backgroundColor,
|
|
441
|
-
fillStyle: e.color
|
|
442
|
-
}
|
|
443
|
-
);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
function Pa() {
|
|
447
|
-
h.value.forEach((e) => {
|
|
448
|
-
e.showYMarker && ue(e) && P(
|
|
449
|
-
n.value,
|
|
450
|
-
le(
|
|
451
|
-
a.value.style.chart.dataLabels.formatter,
|
|
452
|
-
ue(e).value,
|
|
453
|
-
te({
|
|
454
|
-
p: e.prefix || a.value.style.chart.grid.y.axisLabels.prefix || "",
|
|
455
|
-
v: ue(e).value,
|
|
456
|
-
s: e.suffix || a.value.style.chart.grid.y.axisLabels.suffix || "",
|
|
457
|
-
r: e.rounding || a.value.style.chart.grid.y.axisLabels.rounding || 0
|
|
458
|
-
}),
|
|
459
|
-
{ datapoint: ue(e), seriesIndex: null }
|
|
460
|
-
),
|
|
461
|
-
t.value.left - 8 + a.value.style.chart.grid.y.axisLabels.offsetX,
|
|
462
|
-
ue(e).y,
|
|
463
|
-
{
|
|
464
|
-
align: "right",
|
|
465
|
-
font: `${a.value.style.chart.grid.y.axisLabels.bold ? "bold " : ""}${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
|
|
466
|
-
color: e.color
|
|
467
|
-
}
|
|
468
|
-
);
|
|
469
|
-
});
|
|
470
|
-
}
|
|
471
|
-
function Fa() {
|
|
472
|
-
a.value.style.chart.grid.y.axisLabels.show && (u.value.stacked ? h.value.forEach((e) => {
|
|
473
|
-
e.localYLabels.forEach((l, o) => {
|
|
474
|
-
P(
|
|
475
|
-
n.value,
|
|
476
|
-
le(
|
|
477
|
-
a.value.style.chart.dataLabels.formatter,
|
|
478
|
-
l.value,
|
|
479
|
-
te({
|
|
480
|
-
p: e.prefix || a.value.style.chart.grid.y.axisLabels.prefix || "",
|
|
481
|
-
v: l.value,
|
|
482
|
-
s: e.suffix || a.value.style.chart.grid.y.axisLabels.suffix || "",
|
|
483
|
-
r: e.rounding || a.value.style.chart.grid.y.axisLabels.rounding || 0
|
|
484
|
-
}),
|
|
485
|
-
{ datapoint: l, seriesIndex: o }
|
|
486
|
-
),
|
|
487
|
-
l.x + a.value.style.chart.grid.y.axisLabels.offsetX,
|
|
488
|
-
l.y,
|
|
489
|
-
{
|
|
490
|
-
align: "right",
|
|
491
|
-
font: `${a.value.style.chart.grid.y.axisLabels.bold ? "bold " : ""}${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
|
|
492
|
-
color: e.color,
|
|
493
|
-
globalAlpha: e.showYMarker && ![null, void 0].includes(c.value) ? 0.2 : 1
|
|
494
|
-
}
|
|
495
|
-
);
|
|
496
|
-
});
|
|
497
|
-
}) : m.value.yLabels.forEach((e, l) => {
|
|
498
|
-
P(
|
|
499
|
-
n.value,
|
|
500
|
-
le(
|
|
501
|
-
a.value.style.chart.dataLabels.formatter,
|
|
502
|
-
e.value,
|
|
503
|
-
te({
|
|
504
|
-
p: a.value.style.chart.grid.y.axisLabels.prefix || "",
|
|
505
|
-
v: e.value,
|
|
506
|
-
s: a.value.style.chart.grid.y.axisLabels.suffix || "",
|
|
507
|
-
r: a.value.style.chart.grid.y.axisLabels.rounding || 0
|
|
508
|
-
}),
|
|
509
|
-
{ datapoint: e, seriesIndex: l }
|
|
510
|
-
),
|
|
511
|
-
e.x + a.value.style.chart.grid.y.axisLabels.offsetX,
|
|
512
|
-
e.y,
|
|
513
|
-
{
|
|
514
|
-
align: "right",
|
|
515
|
-
font: `${a.value.style.chart.grid.y.axisLabels.bold ? "bold " : ""}${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
|
|
516
|
-
color: a.value.style.chart.grid.y.axisLabels.color,
|
|
517
|
-
globalAlpha: h.value.some((o) => o.showYMarker) && ![null, void 0].includes(c.value) ? 0.2 : 1
|
|
518
|
-
}
|
|
519
|
-
);
|
|
520
|
-
}));
|
|
521
|
-
}
|
|
522
|
-
function Ea(e) {
|
|
523
|
-
for (let l = 0; l < e.coordinatesLine.length; l += 1)
|
|
524
|
-
P(
|
|
525
|
-
n.value,
|
|
526
|
-
le(
|
|
527
|
-
a.value.style.chart.dataLabels.formatter,
|
|
528
|
-
e.coordinatesLine[l].value,
|
|
529
|
-
te({
|
|
530
|
-
p: e.prefix || "",
|
|
531
|
-
v: e.coordinatesLine[l].value,
|
|
532
|
-
s: e.suffix || "",
|
|
533
|
-
r: e.rounding || 0
|
|
534
|
-
}),
|
|
535
|
-
{ datapoint: e.coordinatesLine[l], seriesIndex: l }
|
|
536
|
-
),
|
|
537
|
-
e.coordinatesLine[l].x,
|
|
538
|
-
e.coordinatesLine[l].y + a.value.style.chart.dataLabels.offsetY,
|
|
539
|
-
{
|
|
540
|
-
align: "center",
|
|
541
|
-
font: `${a.value.style.chart.dataLabels.bold ? "bold " : ""}${Math.round(y.value / 40 * a.value.style.chart.dataLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
|
|
542
|
-
color: a.value.style.chart.dataLabels.useSerieColor ? e.color : a.value.style.chart.dataLabels.color
|
|
543
|
-
}
|
|
544
|
-
);
|
|
545
|
-
}
|
|
546
|
-
const U = L(() => wl({
|
|
547
|
-
values: a.value.style.chart.grid.y.timeLabels.values,
|
|
548
|
-
maxDatapoints: I.value,
|
|
549
|
-
formatter: a.value.style.chart.grid.y.timeLabels.datetimeFormatter,
|
|
550
|
-
start: 0,
|
|
551
|
-
end: a.value.style.chart.grid.y.timeLabels.values.length
|
|
552
|
-
}));
|
|
553
|
-
function Aa() {
|
|
554
|
-
for (let e = r.value.start; e < r.value.end; e += 1)
|
|
555
|
-
(r.value.end - r.value.start < a.value.style.chart.grid.y.timeLabels.modulo || r.value.end - r.value.start >= a.value.style.chart.grid.y.timeLabels.modulo && (e % Math.floor((r.value.end - r.value.start) / a.value.style.chart.grid.y.timeLabels.modulo) === 0 || e === c.value + r.value.start && a.value.style.chart.grid.y.timeLabels.showMarker)) && P(
|
|
556
|
-
n.value,
|
|
557
|
-
U.value[e] ? U.value[e].text : e + 1,
|
|
558
|
-
t.value.left + t.value.slot * (e - r.value.start) + t.value.slot / 2,
|
|
559
|
-
t.value.bottom + y.value / a.value.style.chart.grid.y.timeLabels.offsetY,
|
|
560
|
-
{
|
|
561
|
-
align: a.value.style.chart.grid.y.timeLabels.rotation === 0 ? "center" : a.value.style.chart.grid.y.timeLabels.rotation > 0 ? "left" : "right",
|
|
562
|
-
font: `${a.value.style.chart.grid.y.timeLabels.bold ? "bold " : ""}${Math.round(y.value / 40 * a.value.style.chart.grid.y.timeLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
|
|
563
|
-
color: a.value.style.chart.grid.y.timeLabels.showMarker ? ve(a.value.style.chart.grid.y.timeLabels.color, c.value !== null ? c.value + r.value.start === e ? 100 : 20 : 100) : a.value.style.chart.grid.y.timeLabels.color,
|
|
564
|
-
rotation: a.value.style.chart.grid.y.timeLabels.rotation
|
|
565
|
-
}
|
|
566
|
-
);
|
|
567
|
-
}
|
|
568
|
-
function Ke() {
|
|
569
|
-
C(
|
|
570
|
-
n.value,
|
|
571
|
-
[
|
|
572
|
-
{ x: t.value.left + t.value.slot * c.value + t.value.slot / 2, y: t.value.top },
|
|
573
|
-
{ x: t.value.left + t.value.slot * c.value + t.value.slot / 2, y: t.value.bottom }
|
|
574
|
-
],
|
|
575
|
-
{
|
|
576
|
-
color: a.value.style.chart.selector.color,
|
|
577
|
-
lineDash: a.value.style.chart.selector.dashed ? [8, 8] : [0, 0],
|
|
578
|
-
lineWidth: 2
|
|
579
|
-
}
|
|
580
|
-
);
|
|
581
|
-
}
|
|
582
|
-
function Da() {
|
|
583
|
-
M.value && C(
|
|
584
|
-
n.value,
|
|
585
|
-
[
|
|
586
|
-
{ x: t.value.left, y: M.value },
|
|
587
|
-
{ x: t.value.right, y: M.value }
|
|
588
|
-
],
|
|
589
|
-
{
|
|
590
|
-
color: a.value.style.chart.selector.color,
|
|
591
|
-
lineDash: a.value.style.chart.selector.dashed ? [8, 8] : [0, 0],
|
|
592
|
-
lineWidth: 2
|
|
593
|
-
}
|
|
594
|
-
);
|
|
595
|
-
}
|
|
596
|
-
function Na() {
|
|
597
|
-
w.value.forEach((e, l) => {
|
|
598
|
-
for (let o = 0; o < e.coordinatesLine.length; o += 1)
|
|
599
|
-
Ie(
|
|
600
|
-
n.value,
|
|
601
|
-
[
|
|
602
|
-
{
|
|
603
|
-
x: t.value.left + t.value.slot * o + t.value.slot / 10 + (u.value.stacked ? 0 : t.value.slot / w.value.length * l - (l === 0 ? 0 : t.value.slot / (5 * w.value.length) * l)),
|
|
604
|
-
y: u.value.stacked ? e.localZero : m.value.zero
|
|
605
|
-
},
|
|
606
|
-
{
|
|
607
|
-
x: t.value.left + t.value.slot * o + t.value.slot / 10 + (u.value.stacked ? 0 : t.value.slot / w.value.length * l - (l === 0 ? 0 : t.value.slot / (5 * w.value.length) * l)) + t.value.slot * 0.8 / (u.value.stacked ? 1 : w.value.length),
|
|
608
|
-
y: u.value.stacked ? e.localZero : m.value.zero
|
|
609
|
-
},
|
|
610
|
-
{
|
|
611
|
-
x: t.value.left + t.value.slot * o + t.value.slot / 10 + (u.value.stacked ? 0 : t.value.slot / w.value.length * l - (l === 0 ? 0 : t.value.slot / (5 * w.value.length) * l)) + t.value.slot * 0.8 / (u.value.stacked ? 1 : w.value.length),
|
|
612
|
-
y: e.coordinatesLine[o].y
|
|
613
|
-
},
|
|
614
|
-
{
|
|
615
|
-
x: t.value.left + t.value.slot * o + t.value.slot / 10 + (u.value.stacked ? 0 : t.value.slot / w.value.length * l - (l === 0 ? 0 : t.value.slot / (5 * w.value.length) * l)),
|
|
616
|
-
y: e.coordinatesLine[o].y
|
|
617
|
-
}
|
|
618
|
-
],
|
|
619
|
-
{
|
|
620
|
-
strokeColor: a.value.style.chart.backgroundColor,
|
|
621
|
-
gradient: {
|
|
622
|
-
type: "linear",
|
|
623
|
-
start: {
|
|
624
|
-
x: e.coordinatesLine[o].x,
|
|
625
|
-
y: e.coordinatesLine[o].y
|
|
626
|
-
},
|
|
627
|
-
end: {
|
|
628
|
-
x: e.coordinatesLine[o].x,
|
|
629
|
-
y: u.value.stacked ? e.localZero : m.value.zero
|
|
630
|
-
},
|
|
631
|
-
stops: [
|
|
632
|
-
{ offset: 0, color: e.color },
|
|
633
|
-
{ offset: 1, color: a.value.style.chart.bar.gradient.show ? hl(e.color, 0.5) : e.color }
|
|
634
|
-
]
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
), u.value.showDataLabels && [!0, void 0].includes(e.dataLabels) && P(
|
|
638
|
-
n.value,
|
|
639
|
-
le(
|
|
640
|
-
a.value.style.chart.dataLabels.formatter,
|
|
641
|
-
e.coordinatesLine[o].value,
|
|
642
|
-
te({
|
|
643
|
-
p: e.prefix || "",
|
|
644
|
-
v: e.coordinatesLine[o].value,
|
|
645
|
-
s: e.suffix || "",
|
|
646
|
-
r: e.rounding || 0
|
|
647
|
-
}),
|
|
648
|
-
{ datapoint: e.coordinatesLine[o], seriesIndex: o }
|
|
649
|
-
),
|
|
650
|
-
t.value.left + t.value.slot * o + t.value.slot / 10 + (u.value.stacked ? 0 : t.value.slot / w.value.length * l - (l === 0 ? 0 : t.value.slot / (5 * w.value.length) * l)) + t.value.slot * 0.4 / (u.value.stacked ? 1 : w.value.length),
|
|
651
|
-
(e.coordinatesLine[o].value < 0 ? u.value.stacked ? e.localZero : m.value.zero : e.coordinatesLine[o].y) + a.value.style.chart.dataLabels.offsetY,
|
|
652
|
-
{
|
|
653
|
-
align: "center",
|
|
654
|
-
font: `${Math.round(y.value / 40 * a.value.style.chart.dataLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
|
|
655
|
-
color: a.value.style.chart.dataLabels.useSerieColor ? e.color : a.value.style.chart.dataLabels.color,
|
|
656
|
-
strokeColor: a.value.style.chart.backgroundColor,
|
|
657
|
-
lineWidth: 0.8
|
|
658
|
-
}
|
|
659
|
-
);
|
|
660
|
-
});
|
|
661
|
-
}
|
|
662
|
-
function Ha(e) {
|
|
663
|
-
e.useArea ? u.value.stacked ? ha(
|
|
664
|
-
n.value,
|
|
665
|
-
[{ x: e.coordinatesLine[0].x, y: e.localZero }, ...e.coordinatesLine, { x: e.coordinatesLine.at(-1).x, y: e.localZero }],
|
|
666
|
-
{
|
|
667
|
-
fillColor: ve(e.color, a.value.style.chart.area.opacity),
|
|
668
|
-
strokeColor: "transparent"
|
|
669
|
-
}
|
|
670
|
-
) : ha(
|
|
671
|
-
n.value,
|
|
672
|
-
[{ x: e.coordinatesLine[0].x, y: m.value.zero }, ...e.coordinatesLine, { x: e.coordinatesLine.at(-1).x, y: m.value.zero }],
|
|
673
|
-
{
|
|
674
|
-
fillColor: ve(e.color, a.value.style.chart.area.opacity),
|
|
675
|
-
strokeColor: "transparent"
|
|
676
|
-
}
|
|
677
|
-
) : C(n.value, e.coordinatesLine, {
|
|
678
|
-
color: e.color,
|
|
679
|
-
lineWidth: 3
|
|
680
|
-
});
|
|
681
|
-
}
|
|
682
|
-
function Ya() {
|
|
683
|
-
h.value.forEach((e, l) => {
|
|
684
|
-
C(
|
|
685
|
-
n.value,
|
|
686
|
-
[
|
|
687
|
-
{ x: t.value.left, y: t.value.bottom - e.yOffset },
|
|
688
|
-
{ x: t.value.right, y: t.value.bottom - e.yOffset }
|
|
689
|
-
],
|
|
690
|
-
{
|
|
691
|
-
color: a.value.style.chart.grid.x.horizontalLines.color,
|
|
692
|
-
lineWidth: 1
|
|
693
|
-
}
|
|
694
|
-
);
|
|
695
|
-
});
|
|
696
|
-
}
|
|
697
|
-
function re() {
|
|
698
|
-
Oa(), _.value ? (c.value !== null && a.value.style.chart.selector.show && Ke(), Na(), u.value.stacked && a.value.style.chart.grid.x.showAxis && Ya(), Ma.value.forEach((e) => {
|
|
699
|
-
(e.type === "line" || !e.type) && Ha(e), q.value && (Ra(e), u.value.showDataLabels && [!0, void 0].includes(e.dataLabels) && Ea(e));
|
|
700
|
-
}), me.value = pl(T.value)) : (me.value && (n.value.clearRect(0, 0, 1e4, 1e4), n.value.drawImage(me.value, 0, 0)), c.value !== null && a.value.style.chart.selector.show && Ke(), c.value !== null && h.value.forEach((e) => {
|
|
701
|
-
if (e.type === "line" || !e.type || e.type === "plot") {
|
|
702
|
-
if (!e.coordinatesLine[c.value]) return;
|
|
703
|
-
e.coordinatesLine[c.value].x !== void 0 && e.coordinatesLine[c.value].y !== void 0 && da(
|
|
704
|
-
n.value,
|
|
705
|
-
{
|
|
706
|
-
x: e.coordinatesLine[c.value].x,
|
|
707
|
-
y: e.coordinatesLine[c.value].y
|
|
708
|
-
},
|
|
709
|
-
y.value / 150 * a.value.style.chart.line.plots.radiusRatio,
|
|
710
|
-
{
|
|
711
|
-
color: a.value.style.chart.backgroundColor,
|
|
712
|
-
fillStyle: e.color
|
|
713
|
-
}
|
|
714
|
-
);
|
|
715
|
-
}
|
|
716
|
-
})), a.value.style.chart.grid.y.timeLabels.show && Aa(), a.value.style.chart.selector.show && a.value.style.chart.selector.showHorizontalSelector && Da(), Fa(), Pa(), _.value = !1;
|
|
717
|
-
}
|
|
718
|
-
const ye = yl(() => {
|
|
719
|
-
q.value = !0, Ta();
|
|
720
|
-
}, I.value > 200 ? 10 : 1, !q.value);
|
|
721
|
-
function ue(e) {
|
|
722
|
-
if ([null, void 0].includes(c.value) || !e.coordinatesLine[c.value]) return !1;
|
|
723
|
-
const { y: l, value: o } = e.coordinatesLine[c.value];
|
|
724
|
-
return { y: l, value: o };
|
|
725
|
-
}
|
|
726
|
-
function _a(e) {
|
|
727
|
-
const { left: l, top: o } = T.value.getBoundingClientRect(), s = e.clientX - l;
|
|
728
|
-
if (M.value = (e.clientY - o) * 2, (M.value < t.value.top || M.value > t.value.bottom) && (M.value = null), s * 2 < t.value.left || s * 2 > t.value.right) {
|
|
729
|
-
ce.value = !1, c.value = null;
|
|
730
|
-
return;
|
|
731
|
-
}
|
|
732
|
-
const i = s * 2 - t.value.left;
|
|
733
|
-
if (c.value = Math.floor(i / t.value.slot), ce.value = !0, !q.value) return;
|
|
734
|
-
let b = "";
|
|
735
|
-
const v = a.value.style.chart.tooltip.customFormat;
|
|
736
|
-
ca(v) && dl(() => v({
|
|
737
|
-
seriesIndex: c.value,
|
|
738
|
-
datapoint: h.value.map((f) => ({
|
|
739
|
-
shape: f.shape || null,
|
|
740
|
-
name: f.name,
|
|
741
|
-
color: f.color,
|
|
742
|
-
type: f.type || "line",
|
|
743
|
-
value: f.series.find((W, z) => z === c.value)
|
|
744
|
-
})),
|
|
745
|
-
series: h.value,
|
|
746
|
-
config: a.value
|
|
747
|
-
})) ? de.value = v({
|
|
748
|
-
seriesIndex: c.value,
|
|
749
|
-
datapoint: h.value.map((f) => ({
|
|
750
|
-
shape: f.shape || null,
|
|
751
|
-
name: f.name,
|
|
752
|
-
color: f.color,
|
|
753
|
-
type: f.type || "line",
|
|
754
|
-
value: f.series.find((W, z) => z === c.value)
|
|
755
|
-
})),
|
|
756
|
-
series: h.value,
|
|
757
|
-
config: a.value
|
|
758
|
-
}) : (a.value.style.chart.grid.y.timeLabels.values.slice(r.value.start, r.value.end)[c.value] && (b += `<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${a.value.style.chart.tooltip.borderColor}; width:100%">${U.value.slice(r.value.start, r.value.end)[c.value].text}</div>`), b += $a.value.join(""), de.value = b), q.value = !1;
|
|
759
|
-
}
|
|
760
|
-
N(() => c.value, (e) => {
|
|
761
|
-
ye();
|
|
762
|
-
}), N(() => r.value, (e) => {
|
|
763
|
-
_.value = !0, re();
|
|
764
|
-
}, {
|
|
765
|
-
deep: !0
|
|
766
|
-
}), N(() => u.value.showDataLabels, (e) => {
|
|
767
|
-
_.value = !0, re();
|
|
768
|
-
}), N(() => M.value, (e) => {
|
|
769
|
-
e && re();
|
|
770
|
-
}), N(() => u.value.stacked, (e) => {
|
|
771
|
-
_.value = !0, q.value = !0, ye();
|
|
772
|
-
});
|
|
773
|
-
function Ua() {
|
|
774
|
-
ce.value = !1, c.value = null, de.value = "", M.value = null, re();
|
|
775
|
-
}
|
|
776
|
-
const A = ze(null), K = ze(null), Q = ze(null);
|
|
777
|
-
sa(() => {
|
|
778
|
-
De.value = !0, we();
|
|
779
|
-
});
|
|
780
|
-
function we() {
|
|
781
|
-
if (nl(g.dataset) ? il({
|
|
782
|
-
componentName: "VueUiXyCanvas",
|
|
783
|
-
type: "dataset"
|
|
784
|
-
}) : T.value && (n.value = T.value.getContext("2d", { willReadFrequently: !0 })), a.value.responsive) {
|
|
785
|
-
const e = fl(() => {
|
|
786
|
-
const { width: l, height: o } = gl({
|
|
787
|
-
chart: F.value,
|
|
788
|
-
title: a.value.style.chart.title.text ? Pe.value : null,
|
|
789
|
-
legend: a.value.style.chart.legend.show ? Fe.value : null,
|
|
790
|
-
slicer: a.value.style.chart.zoom.show && I.value > 1 ? Ee.value : null,
|
|
791
|
-
source: Ae.value
|
|
792
|
-
});
|
|
793
|
-
requestAnimationFrame(() => {
|
|
794
|
-
_e.value = `${l} / ${o}`;
|
|
795
|
-
});
|
|
796
|
-
});
|
|
797
|
-
A.value && (K.value && A.value.unobserve(K.value), A.value.disconnect()), A.value = new ResizeObserver(e), K.value = F.value.parentNode, A.value.observe(K.value);
|
|
798
|
-
}
|
|
799
|
-
Q.value && Q.value.disconnect(), Q.value = new ResizeObserver((e) => {
|
|
800
|
-
for (const l of e)
|
|
801
|
-
l.contentBoxSize && oe.value && (_.value = !0, ye());
|
|
802
|
-
}), Q.value.observe(oe.value), Je();
|
|
803
|
-
}
|
|
804
|
-
Za(() => {
|
|
805
|
-
Q.value && Q.value.disconnect(), A.value && (K.value && A.value.unobserve(K.value), A.value.disconnect());
|
|
806
|
-
});
|
|
807
|
-
function Qe(e) {
|
|
808
|
-
wa("selectLegend", h.value.find((l) => l.absoluteIndex === e)), $.value.includes(e) ? $.value = $.value.filter((l) => l !== e) : $.value.push(e), _.value = !0, ye();
|
|
809
|
-
}
|
|
810
|
-
const ea = L(() => J.value.map((e, l) => ({
|
|
811
|
-
...e,
|
|
812
|
-
name: e.name,
|
|
813
|
-
color: va(e.color) || Ge.value[l] || Z[l] || Z[l % Z.length],
|
|
814
|
-
shape: e.shape || "circle",
|
|
815
|
-
prefix: e.prefix || "",
|
|
816
|
-
suffix: e.suffix || "",
|
|
817
|
-
rounding: e.rounding || 0
|
|
818
|
-
})).map((e) => ({
|
|
819
|
-
...e,
|
|
820
|
-
opacity: $.value.includes(e.absoluteIndex) ? 0.5 : 1,
|
|
821
|
-
segregate: () => Qe(e.absoluteIndex),
|
|
822
|
-
isSegregated: $.value.includes(e.absoluteIndex)
|
|
823
|
-
}))), Wa = L(() => ({
|
|
824
|
-
cy: "donut-div-legend",
|
|
825
|
-
backgroundColor: a.value.style.chart.legend.backgroundColor,
|
|
826
|
-
color: a.value.style.chart.legend.color,
|
|
827
|
-
fontSize: a.value.style.chart.legend.fontSize,
|
|
828
|
-
paddingBottom: 12,
|
|
829
|
-
fontWeight: a.value.style.chart.legend.bold ? "bold" : ""
|
|
830
|
-
})), fe = L(() => {
|
|
831
|
-
const e = [""].concat(h.value.map((i) => i.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>');
|
|
832
|
-
let l = [];
|
|
833
|
-
for (let i = 0; i < I.value; i += 1) {
|
|
834
|
-
const b = h.value.map((v) => v.series[i] ?? 0).reduce((v, f) => v + f, 0);
|
|
835
|
-
l.push([a.value.style.chart.grid.y.timeLabels.values.slice(r.value.start, r.value.end)[i] ? U.value.slice(r.value.start, r.value.end)[i].text : i + 1].concat(h.value.map((v) => (v.series[i] ?? 0).toFixed(a.value.table.rounding))).concat((b ?? 0).toFixed(a.value.table.rounding)));
|
|
836
|
-
}
|
|
837
|
-
const o = {
|
|
838
|
-
th: {
|
|
839
|
-
backgroundColor: a.value.table.th.backgroundColor,
|
|
840
|
-
color: a.value.table.th.color,
|
|
841
|
-
outline: a.value.table.th.outline
|
|
842
|
-
},
|
|
843
|
-
td: {
|
|
844
|
-
backgroundColor: a.value.table.td.backgroundColor,
|
|
845
|
-
color: a.value.table.td.color,
|
|
846
|
-
outline: a.value.table.td.outline
|
|
847
|
-
},
|
|
848
|
-
breakpoint: a.value.table.responsiveBreakpoint
|
|
849
|
-
}, s = [a.value.table.columnNames.period].concat(h.value.map((i) => i.name)).concat(a.value.table.columnNames.total);
|
|
850
|
-
return { head: e, body: l.slice(0, r.value.end - r.value.start), config: o, colNames: s };
|
|
851
|
-
}), aa = L(() => {
|
|
852
|
-
if (h.value.length === 0) return { head: [], body: [], config: {}, columnNames: [] };
|
|
853
|
-
const e = h.value.map((o) => ({
|
|
854
|
-
label: o.name,
|
|
855
|
-
color: o.color,
|
|
856
|
-
type: o.type
|
|
857
|
-
})), l = [];
|
|
858
|
-
for (let o = r.value.start; o < r.value.end; o += 1) {
|
|
859
|
-
const s = [a.value.style.chart.grid.y.timeLabels.values[o] ? U.value[o].text : o + 1];
|
|
860
|
-
h.value.forEach((i) => {
|
|
861
|
-
s.push(Number((i.series[o] || 0).toFixed(a.value.table.rounding)));
|
|
862
|
-
}), l.push(s);
|
|
863
|
-
}
|
|
864
|
-
return { head: e, body: l };
|
|
865
|
-
});
|
|
866
|
-
function la(e = null) {
|
|
867
|
-
const l = [[a.value.style.chart.title.text], [a.value.style.chart.title.subtitle.text], [""]], o = ["", ...aa.value.head.map((v) => v.label)], s = aa.value.body, i = l.concat([o]).concat(s), b = vl(i);
|
|
868
|
-
e ? e(b) : cl({ csvContent: b, title: a.value.style.chart.title.text || "vue-ui-xy-canvas" });
|
|
869
|
-
}
|
|
870
|
-
function Xa() {
|
|
871
|
-
return h.value;
|
|
872
|
-
}
|
|
873
|
-
function ta() {
|
|
874
|
-
u.value.showTable = !u.value.showTable;
|
|
875
|
-
}
|
|
876
|
-
function oa() {
|
|
877
|
-
u.value.showDataLabels = !u.value.showDataLabels;
|
|
878
|
-
}
|
|
879
|
-
function ra() {
|
|
880
|
-
u.value.stacked = !u.value.stacked;
|
|
881
|
-
}
|
|
882
|
-
function ua() {
|
|
883
|
-
u.value.showTooltip = !u.value.showTooltip;
|
|
884
|
-
}
|
|
885
|
-
const ge = d(!1);
|
|
886
|
-
function Se() {
|
|
887
|
-
ge.value = !ge.value;
|
|
888
|
-
}
|
|
889
|
-
async function Ba({ scale: e = 2 } = {}) {
|
|
890
|
-
if (!F.value) return;
|
|
891
|
-
const { width: l, height: o } = F.value.getBoundingClientRect(), s = l / o, { imageUri: i, base64: b } = await Sl({ domElement: F.value, base64: !0, img: !0, scale: e });
|
|
892
|
-
return {
|
|
893
|
-
imageUri: i,
|
|
894
|
-
base64: b,
|
|
895
|
-
title: a.value.style.chart.title.text,
|
|
896
|
-
width: l,
|
|
897
|
-
height: o,
|
|
898
|
-
aspectRatio: s
|
|
899
|
-
};
|
|
900
|
-
}
|
|
901
|
-
return fa({
|
|
902
|
-
getData: Xa,
|
|
903
|
-
getImage: Ba,
|
|
904
|
-
generateCsv: la,
|
|
905
|
-
generatePdf: Xe,
|
|
906
|
-
generateImage: Be,
|
|
907
|
-
toggleTable: ta,
|
|
908
|
-
toggleLabels: oa,
|
|
909
|
-
toggleStack: ra,
|
|
910
|
-
toggleTooltip: ua,
|
|
911
|
-
toggleAnnotator: Se,
|
|
912
|
-
toggleFullscreen: Ve
|
|
913
|
-
}), (e, l) => (S(), ie("div", {
|
|
914
|
-
style: ae(`width:100%; position:relative; ${a.value.responsive ? "height: 100%" : ""}`),
|
|
915
|
-
ref_key: "xy",
|
|
916
|
-
ref: F,
|
|
917
|
-
id: `xy_canvas_${Y.value}`,
|
|
918
|
-
class: ja(`vue-ui-donut ${he.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
|
|
919
|
-
onMouseenter: l[5] || (l[5] = () => p(Ne)(!0)),
|
|
920
|
-
onMouseleave: l[6] || (l[6] = () => p(Ne)(!1))
|
|
921
|
-
}, [
|
|
922
|
-
a.value.style.chart.title.text ? (S(), ie("div", {
|
|
923
|
-
key: 0,
|
|
924
|
-
ref_key: "chartTitle",
|
|
925
|
-
ref: Pe,
|
|
926
|
-
style: ae(`width:100%;background:${a.value.style.chart.backgroundColor};`)
|
|
927
|
-
}, [
|
|
928
|
-
(S(), R(kl, {
|
|
929
|
-
key: `title_${be.value}`,
|
|
930
|
-
config: {
|
|
931
|
-
title: {
|
|
932
|
-
cy: "xy-canvas-title",
|
|
933
|
-
...a.value.style.chart.title
|
|
934
|
-
},
|
|
935
|
-
subtitle: {
|
|
936
|
-
cy: "xy-canvas-subtitle",
|
|
937
|
-
...a.value.style.chart.title.subtitle
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
}, null, 8, ["config"]))
|
|
941
|
-
], 4)) : H("", !0),
|
|
942
|
-
B("div", {
|
|
943
|
-
id: `legend-top-${Y.value}`
|
|
944
|
-
}, null, 8, Il),
|
|
945
|
-
a.value.userOptions.show && ke.value && (p(He) || p(Ce)) ? (S(), R(p(ka), {
|
|
946
|
-
ref: "details",
|
|
947
|
-
key: `user_option_${Re.value}`,
|
|
948
|
-
backgroundColor: a.value.style.chart.backgroundColor,
|
|
949
|
-
color: a.value.style.chart.color,
|
|
950
|
-
isPrinting: p(Ue),
|
|
951
|
-
isImaging: p(We),
|
|
952
|
-
uid: Y.value,
|
|
953
|
-
hasTooltip: a.value.userOptions.buttons.tooltip && a.value.style.chart.tooltip.show,
|
|
954
|
-
hasPdf: a.value.userOptions.buttons.pdf,
|
|
955
|
-
hasImg: a.value.userOptions.buttons.img,
|
|
956
|
-
hasXls: a.value.userOptions.buttons.csv,
|
|
957
|
-
hasLabel: a.value.userOptions.buttons.labels,
|
|
958
|
-
hasStack: Me.dataset.length > 1 && a.value.userOptions.buttons.stack,
|
|
959
|
-
hasFullscreen: a.value.userOptions.buttons.fullscreen,
|
|
960
|
-
hasTable: r.value.end - r.value.start < 200 && a.value.userOptions.buttons.table,
|
|
961
|
-
isFullscreen: he.value,
|
|
962
|
-
isTooltip: u.value.showTooltip,
|
|
963
|
-
isStacked: u.value.stacked,
|
|
964
|
-
titles: { ...a.value.userOptions.buttonTitles },
|
|
965
|
-
chartElement: F.value,
|
|
966
|
-
position: a.value.userOptions.position,
|
|
967
|
-
hasAnnotator: a.value.userOptions.buttons.annotator,
|
|
968
|
-
isAnnotation: ge.value,
|
|
969
|
-
callbacks: a.value.userOptions.callbacks,
|
|
970
|
-
printScale: a.value.userOptions.print.scale,
|
|
971
|
-
onToggleFullscreen: Ve,
|
|
972
|
-
onGeneratePdf: p(Xe),
|
|
973
|
-
onGenerateCsv: la,
|
|
974
|
-
onGenerateImage: p(Be),
|
|
975
|
-
onToggleTable: ta,
|
|
976
|
-
onToggleLabels: oa,
|
|
977
|
-
onToggleStack: ra,
|
|
978
|
-
onToggleTooltip: ua,
|
|
979
|
-
onToggleAnnotator: Se,
|
|
980
|
-
style: ae({
|
|
981
|
-
visibility: p(He) ? p(Ce) ? "visible" : "hidden" : "visible"
|
|
982
|
-
})
|
|
983
|
-
}, qa({ _: 2 }, [
|
|
984
|
-
e.$slots.menuIcon ? {
|
|
985
|
-
name: "menuIcon",
|
|
986
|
-
fn: x(({ isOpen: o, color: s }) => [
|
|
987
|
-
k(e.$slots, "menuIcon", V(G({ isOpen: o, color: s })), void 0, !0)
|
|
988
|
-
]),
|
|
989
|
-
key: "0"
|
|
990
|
-
} : void 0,
|
|
991
|
-
e.$slots.optionTooltip ? {
|
|
992
|
-
name: "optionTooltip",
|
|
993
|
-
fn: x(() => [
|
|
994
|
-
k(e.$slots, "optionTooltip", {}, void 0, !0)
|
|
995
|
-
]),
|
|
996
|
-
key: "1"
|
|
997
|
-
} : void 0,
|
|
998
|
-
e.$slots.optionPdf ? {
|
|
999
|
-
name: "optionPdf",
|
|
1000
|
-
fn: x(() => [
|
|
1001
|
-
k(e.$slots, "optionPdf", {}, void 0, !0)
|
|
1002
|
-
]),
|
|
1003
|
-
key: "2"
|
|
1004
|
-
} : void 0,
|
|
1005
|
-
e.$slots.optionCsv ? {
|
|
1006
|
-
name: "optionCsv",
|
|
1007
|
-
fn: x(() => [
|
|
1008
|
-
k(e.$slots, "optionCsv", {}, void 0, !0)
|
|
1009
|
-
]),
|
|
1010
|
-
key: "3"
|
|
1011
|
-
} : void 0,
|
|
1012
|
-
e.$slots.optionImg ? {
|
|
1013
|
-
name: "optionImg",
|
|
1014
|
-
fn: x(() => [
|
|
1015
|
-
k(e.$slots, "optionImg", {}, void 0, !0)
|
|
1016
|
-
]),
|
|
1017
|
-
key: "4"
|
|
1018
|
-
} : void 0,
|
|
1019
|
-
e.$slots.optionTable ? {
|
|
1020
|
-
name: "optionTable",
|
|
1021
|
-
fn: x(() => [
|
|
1022
|
-
k(e.$slots, "optionTable", {}, void 0, !0)
|
|
1023
|
-
]),
|
|
1024
|
-
key: "5"
|
|
1025
|
-
} : void 0,
|
|
1026
|
-
e.$slots.optionLabels ? {
|
|
1027
|
-
name: "optionLabels",
|
|
1028
|
-
fn: x(() => [
|
|
1029
|
-
k(e.$slots, "optionLabels", {}, void 0, !0)
|
|
1030
|
-
]),
|
|
1031
|
-
key: "6"
|
|
1032
|
-
} : void 0,
|
|
1033
|
-
e.$slots.optionStack ? {
|
|
1034
|
-
name: "optionStack",
|
|
1035
|
-
fn: x(() => [
|
|
1036
|
-
k(e.$slots, "optionStack", {}, void 0, !0)
|
|
1037
|
-
]),
|
|
1038
|
-
key: "7"
|
|
1039
|
-
} : void 0,
|
|
1040
|
-
e.$slots.optionFullscreen ? {
|
|
1041
|
-
name: "optionFullscreen",
|
|
1042
|
-
fn: x(({ toggleFullscreen: o, isFullscreen: s }) => [
|
|
1043
|
-
k(e.$slots, "optionFullscreen", V(G({ toggleFullscreen: o, isFullscreen: s })), void 0, !0)
|
|
1044
|
-
]),
|
|
1045
|
-
key: "8"
|
|
1046
|
-
} : void 0,
|
|
1047
|
-
e.$slots.optionAnnotator ? {
|
|
1048
|
-
name: "optionAnnotator",
|
|
1049
|
-
fn: x(({ toggleAnnotator: o, isAnnotator: s }) => [
|
|
1050
|
-
k(e.$slots, "optionAnnotator", V(G({ toggleAnnotator: o, isAnnotator: s })), void 0, !0)
|
|
1051
|
-
]),
|
|
1052
|
-
key: "9"
|
|
1053
|
-
} : void 0
|
|
1054
|
-
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasLabel", "hasStack", "hasFullscreen", "hasTable", "isFullscreen", "isTooltip", "isStacked", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "callbacks", "printScale", "onGeneratePdf", "onGenerateImage", "style"])) : H("", !0),
|
|
1055
|
-
B("div", {
|
|
1056
|
-
class: "vue-ui-xy-canvas",
|
|
1057
|
-
style: ae(`position: relative; aspect-ratio: ${_e.value}`),
|
|
1058
|
-
ref_key: "container",
|
|
1059
|
-
ref: oe
|
|
1060
|
-
}, [
|
|
1061
|
-
ke.value ? (S(), ie("canvas", {
|
|
1062
|
-
key: 0,
|
|
1063
|
-
ref_key: "canvas",
|
|
1064
|
-
ref: T,
|
|
1065
|
-
style: { width: "100%", height: "100%" },
|
|
1066
|
-
onMousemove: l[0] || (l[0] = (o) => _a(o)),
|
|
1067
|
-
onMouseleave: Ua
|
|
1068
|
-
}, null, 544)) : (S(), R(p(xa), {
|
|
1069
|
-
key: 1,
|
|
1070
|
-
config: {
|
|
1071
|
-
type: "line",
|
|
1072
|
-
style: {
|
|
1073
|
-
backgroundColor: a.value.style.chart.backgroundColor,
|
|
1074
|
-
line: {
|
|
1075
|
-
axis: {
|
|
1076
|
-
color: "#CCCCCC"
|
|
1077
|
-
},
|
|
1078
|
-
path: {
|
|
1079
|
-
color: "#CCCCCC",
|
|
1080
|
-
strokeWidth: 0.5
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1084
|
-
}
|
|
1085
|
-
}, null, 8, ["config"])),
|
|
1086
|
-
Ja(p(La), {
|
|
1087
|
-
show: u.value.showTooltip && ce.value,
|
|
1088
|
-
backgroundColor: a.value.style.chart.tooltip.backgroundColor,
|
|
1089
|
-
color: a.value.style.chart.tooltip.color,
|
|
1090
|
-
fontSize: a.value.style.chart.tooltip.fontSize,
|
|
1091
|
-
borderRadius: a.value.style.chart.tooltip.borderRadius,
|
|
1092
|
-
borderColor: a.value.style.chart.tooltip.borderColor,
|
|
1093
|
-
borderWidth: a.value.style.chart.tooltip.borderWidth,
|
|
1094
|
-
position: a.value.style.chart.tooltip.position,
|
|
1095
|
-
offsetY: a.value.style.chart.tooltip.offsetY,
|
|
1096
|
-
parent: p(T),
|
|
1097
|
-
content: de.value,
|
|
1098
|
-
isFullscreen: he.value,
|
|
1099
|
-
backgroundOpacity: a.value.style.chart.tooltip.backgroundOpacity,
|
|
1100
|
-
isCustom: p(ca)(a.value.style.chart.tooltip.customFormat),
|
|
1101
|
-
smooth: a.value.style.chart.tooltip.smooth,
|
|
1102
|
-
backdropFilter: a.value.style.chart.tooltip.backdropFilter
|
|
1103
|
-
}, {
|
|
1104
|
-
"tooltip-before": x(() => [
|
|
1105
|
-
k(e.$slots, "tooltip-before", V(G({ ...Te.value })), void 0, !0)
|
|
1106
|
-
]),
|
|
1107
|
-
"tooltip-after": x(() => [
|
|
1108
|
-
k(e.$slots, "tooltip-after", V(G({ ...Te.value })), void 0, !0)
|
|
1109
|
-
]),
|
|
1110
|
-
_: 3
|
|
1111
|
-
}, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "position", "offsetY", "parent", "content", "isFullscreen", "backgroundOpacity", "isCustom", "smooth", "backdropFilter"])
|
|
1112
|
-
], 4),
|
|
1113
|
-
B("div", {
|
|
1114
|
-
ref_key: "chartSlicer",
|
|
1115
|
-
ref: Ee,
|
|
1116
|
-
style: ae(`width:100%;background:${a.value.style.chart.backgroundColor}`),
|
|
1117
|
-
"data-dom-to-png-ignore": ""
|
|
1118
|
-
}, [
|
|
1119
|
-
a.value.style.chart.zoom.show && I.value > 1 ? (S(), R(Cl, {
|
|
1120
|
-
ref_key: "slicerComponent",
|
|
1121
|
-
ref: qe,
|
|
1122
|
-
key: `slicer_${Oe.value}`,
|
|
1123
|
-
background: a.value.style.chart.zoom.color,
|
|
1124
|
-
borderColor: a.value.style.chart.backgroundColor,
|
|
1125
|
-
fontSize: a.value.style.chart.zoom.fontSize,
|
|
1126
|
-
useResetSlot: a.value.style.chart.zoom.useResetSlot,
|
|
1127
|
-
labelLeft: a.value.style.chart.grid.y.timeLabels.values[r.value.start] ? U.value[r.value.start].text : "",
|
|
1128
|
-
labelRight: a.value.style.chart.grid.y.timeLabels.values[r.value.end - 1] ? U.value[r.value.end - 1].text : "",
|
|
1129
|
-
textColor: a.value.style.chart.color,
|
|
1130
|
-
inputColor: a.value.style.chart.zoom.color,
|
|
1131
|
-
selectColor: a.value.style.chart.zoom.highlightColor,
|
|
1132
|
-
max: I.value,
|
|
1133
|
-
min: 0,
|
|
1134
|
-
valueStart: r.value.start,
|
|
1135
|
-
valueEnd: r.value.end,
|
|
1136
|
-
start: r.value.start,
|
|
1137
|
-
"onUpdate:start": l[1] || (l[1] = (o) => r.value.start = o),
|
|
1138
|
-
end: r.value.end,
|
|
1139
|
-
"onUpdate:end": l[2] || (l[2] = (o) => r.value.end = o),
|
|
1140
|
-
refreshStartPoint: a.value.style.chart.zoom.startIndex !== null ? a.value.style.chart.zoom.startIndex : 0,
|
|
1141
|
-
refreshEndPoint: a.value.style.chart.zoom.endIndex !== null ? a.value.style.chart.zoom.endIndex + 1 : I.value,
|
|
1142
|
-
enableRangeHandles: a.value.style.chart.zoom.enableRangeHandles,
|
|
1143
|
-
enableSelectionDrag: a.value.style.chart.zoom.enableSelectionDrag,
|
|
1144
|
-
onReset: je
|
|
1145
|
-
}, {
|
|
1146
|
-
"reset-action": x(({ reset: o }) => [
|
|
1147
|
-
k(e.$slots, "reset-action", V(G({ reset: o })), void 0, !0)
|
|
1148
|
-
]),
|
|
1149
|
-
_: 3
|
|
1150
|
-
}, 8, ["background", "borderColor", "fontSize", "useResetSlot", "labelLeft", "labelRight", "textColor", "inputColor", "selectColor", "max", "valueStart", "valueEnd", "start", "end", "refreshStartPoint", "refreshEndPoint", "enableRangeHandles", "enableSelectionDrag"])) : H("", !0)
|
|
1151
|
-
], 4),
|
|
1152
|
-
B("div", {
|
|
1153
|
-
id: `legend-bottom-${Y.value}`
|
|
1154
|
-
}, null, 8, Ml),
|
|
1155
|
-
De.value ? (S(), R(Ka, {
|
|
1156
|
-
key: 2,
|
|
1157
|
-
to: a.value.style.chart.legend.position === "top" ? `#legend-top-${Y.value}` : `#legend-bottom-${Y.value}`
|
|
1158
|
-
}, [
|
|
1159
|
-
B("div", {
|
|
1160
|
-
ref_key: "chartLegend",
|
|
1161
|
-
ref: Fe
|
|
1162
|
-
}, [
|
|
1163
|
-
a.value.style.chart.legend.show && ke.value ? (S(), R(Ll, {
|
|
1164
|
-
legendSet: ea.value,
|
|
1165
|
-
config: Wa.value,
|
|
1166
|
-
key: `legend_${Le.value}`,
|
|
1167
|
-
onClickMarker: l[3] || (l[3] = ({ i: o }) => Qe(o))
|
|
1168
|
-
}, {
|
|
1169
|
-
item: x(({ legend: o, index: s }) => [
|
|
1170
|
-
B("div", {
|
|
1171
|
-
onClick: (i) => o.segregate(),
|
|
1172
|
-
style: ae(`opacity:${$.value.includes(s) ? 0.5 : 1}`)
|
|
1173
|
-
}, ia(o.name), 13, Tl)
|
|
1174
|
-
]),
|
|
1175
|
-
_: 1
|
|
1176
|
-
}, 8, ["legendSet", "config"])) : k(e.$slots, "legend", {
|
|
1177
|
-
key: 1,
|
|
1178
|
-
legend: ea.value
|
|
1179
|
-
}, void 0, !0)
|
|
1180
|
-
], 512)
|
|
1181
|
-
], 8, ["to"])) : H("", !0),
|
|
1182
|
-
e.$slots.watermark ? (S(), ie("div", Ol, [
|
|
1183
|
-
k(e.$slots, "watermark", V(G({ isPrinting: p(Ue) || p(We) })), void 0, !0)
|
|
1184
|
-
])) : H("", !0),
|
|
1185
|
-
e.$slots.source ? (S(), ie("div", {
|
|
1186
|
-
key: 4,
|
|
1187
|
-
ref_key: "source",
|
|
1188
|
-
ref: Ae,
|
|
1189
|
-
dir: "auto"
|
|
1190
|
-
}, [
|
|
1191
|
-
k(e.$slots, "source", {}, void 0, !0)
|
|
1192
|
-
], 512)) : H("", !0),
|
|
1193
|
-
r.value.end - r.value.start < 200 ? (S(), R(p(pa), {
|
|
1194
|
-
key: 5,
|
|
1195
|
-
hideDetails: "",
|
|
1196
|
-
config: {
|
|
1197
|
-
open: u.value.showTable,
|
|
1198
|
-
maxHeight: 1e4,
|
|
1199
|
-
body: {
|
|
1200
|
-
backgroundColor: a.value.style.chart.backgroundColor,
|
|
1201
|
-
color: a.value.style.chart.color
|
|
1202
|
-
},
|
|
1203
|
-
head: {
|
|
1204
|
-
backgroundColor: a.value.style.chart.backgroundColor,
|
|
1205
|
-
color: a.value.style.chart.color
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
}, {
|
|
1209
|
-
content: x(() => [
|
|
1210
|
-
(S(), R(p(ma), {
|
|
1211
|
-
key: `table_${xe.value}`,
|
|
1212
|
-
colNames: fe.value.colNames,
|
|
1213
|
-
head: fe.value.head,
|
|
1214
|
-
body: fe.value.body,
|
|
1215
|
-
config: fe.value.config,
|
|
1216
|
-
title: `${a.value.style.chart.title.text}${a.value.style.chart.title.subtitle.text ? ` : ${a.value.style.chart.title.subtitle.text}` : ""}`,
|
|
1217
|
-
onClose: l[4] || (l[4] = (o) => u.value.showTable = !1)
|
|
1218
|
-
}, {
|
|
1219
|
-
th: x(({ th: o }) => [
|
|
1220
|
-
B("div", { innerHTML: o }, null, 8, Rl)
|
|
1221
|
-
]),
|
|
1222
|
-
td: x(({ td: o }) => [
|
|
1223
|
-
Qa(ia(o), 1)
|
|
1224
|
-
]),
|
|
1225
|
-
_: 1
|
|
1226
|
-
}, 8, ["colNames", "head", "body", "config", "title"]))
|
|
1227
|
-
]),
|
|
1228
|
-
_: 1
|
|
1229
|
-
}, 8, ["config"])) : H("", !0),
|
|
1230
|
-
a.value.userOptions.buttons.annotator && h.value.length ? (S(), R(p(ba), {
|
|
1231
|
-
key: 6,
|
|
1232
|
-
parent: F.value,
|
|
1233
|
-
backgroundColor: a.value.style.chart.backgroundColor,
|
|
1234
|
-
color: a.value.style.chart.color,
|
|
1235
|
-
active: ge.value,
|
|
1236
|
-
onClose: Se
|
|
1237
|
-
}, null, 8, ["parent", "backgroundColor", "color", "active"])) : H("", !0)
|
|
1238
|
-
], 46, $l));
|
|
1239
|
-
}
|
|
1240
|
-
}, Gl = /* @__PURE__ */ zl(Pl, [["__scopeId", "data-v-35f8991b"]]);
|
|
1241
|
-
export {
|
|
1242
|
-
Gl as default
|
|
1243
|
-
};
|