@ironsource/shared-ui 2.1.12-test.60 → 2.1.12-test.62
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/Chart.vue_vue_type_style_index_0_scoped_82f5b24e_lang.css +1 -0
- package/ChartHeader.vue_vue_type_style_index_0_scoped_bd4ef110_lang.css +1 -0
- package/ChartHeaderTrend.vue_vue_type_style_index_0_scoped_78a8c051_lang.css +1 -0
- package/ChartLegend.vue_vue_type_style_index_0_scoped_fd9e4ea2_lang.css +1 -0
- package/ChartPlane.vue_vue_type_style_index_0_scoped_10b18e17_lang.css +1 -0
- package/ChartTooltip.vue_vue_type_style_index_0_scoped_81cdfd5e_lang.css +1 -0
- package/SubHeader.vue_vue_type_style_index_0_scoped_74a5418e_lang.css +1 -0
- package/TooltipHeader.vue_vue_type_style_index_0_scoped_40d98a66_lang.css +1 -0
- package/components/chart/Chart.vue.d.ts +23 -8
- package/components/chart/Chart.vue.js +4 -4
- package/components/chart/Chart.vue2.js +99 -90
- package/components/chart/ChartHeader.vue.d.ts +7 -7
- package/components/chart/ChartHeader.vue.js +3 -3
- package/components/chart/ChartHeader.vue2.js +48 -79
- package/components/chart/ChartHeaderTrend.vue.d.ts +6 -5
- package/components/chart/ChartHeaderTrend.vue.js +3 -3
- package/components/chart/ChartHeaderTrend.vue2.js +15 -14
- package/components/chart/ChartLegend.vue.d.ts +7 -0
- package/components/chart/ChartLegend.vue.js +3 -3
- package/components/chart/ChartLegend.vue2.js +75 -68
- package/components/chart/ChartPlane.vue.d.ts +29 -9
- package/components/chart/ChartPlane.vue.js +3 -3
- package/components/chart/ChartPlane.vue2.js +290 -252
- package/components/chart/ChartStoryArgs.d.ts +27 -2
- package/components/chart/ChartTooltip.vue.d.ts +6 -1
- package/components/chart/ChartTooltip.vue.js +2 -2
- package/components/chart/ChartTooltip.vue2.js +48 -58
- package/components/chart/components/SubHeader.vue.d.ts +52 -0
- package/components/chart/components/SubHeader.vue.js +7 -0
- package/components/chart/components/SubHeader.vue2.js +61 -0
- package/components/chart/components/TooltipHeader.vue.d.ts +45 -0
- package/components/chart/components/TooltipHeader.vue.js +7 -0
- package/components/chart/components/TooltipHeader.vue2.js +59 -0
- package/components/chart/consts.d.ts +12 -6
- package/components/chart/consts.js +31 -21
- package/components/chart/index.d.ts +101 -43
- package/components/chart/mockData.d.ts +11 -0
- package/components/chart/types.d.ts +25 -5
- package/components/chart/types.js +4 -2
- package/components/chart/utils/highlightUtils.d.ts +3 -0
- package/components/chart/utils/highlightUtils.js +18 -0
- package/components/chart/utils/utils.d.ts +2 -1
- package/components/chart/utils/utils.js +23 -8
- package/consts/common.d.ts +1 -0
- package/consts/common.js +4 -0
- package/consts/regex.d.ts +1 -0
- package/consts/regex.js +2 -1
- package/index.js +13 -9
- package/package.json +1 -1
- package/utils/text.d.ts +3 -0
- package/utils/text.js +24 -5
- package/utils/utils.d.ts +1 -0
- package/utils/utils.js +4 -0
- package/Chart.vue_vue_type_style_index_0_scoped_de950ffe_lang.css +0 -1
- package/ChartHeader.vue_vue_type_style_index_0_scoped_1ff0e54f_lang.css +0 -1
- package/ChartHeaderTrend.vue_vue_type_style_index_0_scoped_21ce0774_lang.css +0 -1
- package/ChartLegend.vue_vue_type_style_index_0_scoped_da487aba_lang.css +0 -1
- package/ChartPlane.vue_vue_type_style_index_0_scoped_ae87f435_lang.css +0 -1
- package/ChartTooltip.vue_vue_type_style_index_0_scoped_25d0e129_lang.css +0 -1
|
@@ -1,35 +1,43 @@
|
|
|
1
|
-
import "../../ChartPlane.
|
|
2
|
-
import { Chart as
|
|
3
|
-
import { HoverVerticalLine as
|
|
4
|
-
import { formatValue as
|
|
5
|
-
import { DEFAULT_TICK_COUNT as
|
|
6
|
-
import { ChartType as
|
|
7
|
-
import { useTooltipPosition as
|
|
8
|
-
import
|
|
9
|
-
import { hexColorToRgba as
|
|
10
|
-
import { useChartValues as
|
|
11
|
-
import
|
|
12
|
-
import { useVModel as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { DEFAULT_CHART_COLOR as
|
|
16
|
-
import { TotalType as
|
|
17
|
-
|
|
1
|
+
import "../../ChartPlane.vue_vue_type_style_index_0_scoped_10b18e17_lang.css"; import { defineComponent as re, useCssVars as ie, unref as s, computed as l, ref as k, onMounted as ne, watch as T, nextTick as se, openBlock as p, createElementBlock as S, createVNode as ce, isRef as de, createSlots as ue, withCtx as pe, renderSlot as fe, createCommentVNode as A, createElementVNode as x, normalizeStyle as he, createBlock as L } from "vue";
|
|
2
|
+
import { Chart as F, ArcElement as me, LineElement as ve, BarElement as ye, PointElement as Te, LineController as Ce, BarController as ge, PieController as be, ScatterController as ke, CategoryScale as Se, LinearScale as Ae, Filler as xe, Tooltip as Le } from "chart.js";
|
|
3
|
+
import { HoverVerticalLine as Ee } from "./plugins/HoverVerticalLine.js";
|
|
4
|
+
import { prepareTickLabel as Re, formatValue as Be, calcStepSize as Oe } from "./utils/utils.js";
|
|
5
|
+
import { DEFAULT_TICK_COUNT as De, TOTALS_HELPER_KEY as _, BASE_COLOR_KEY as K, CHART_PADDING as E, POINT_BORDER_COLOR as He, TICK_LABEL_COLOR as M, TICK_LABEL_FONT as U, TICKS_EXTRA_PADDING as Ve, GRID_LINE_COLOR as z, HEADER_HEIGHT as we, COMPACT_HEADER_HEIGHT as Ie, HOVER_AREA_TRANSPARENCY as Ne, HOVER_TRANSPARENCY as C } from "./consts.js";
|
|
6
|
+
import { ChartType as c, TooltipOrder as G, TrendDirection as Pe } from "./types.js";
|
|
7
|
+
import { useTooltipPosition as Fe } from "./composables/useTooltipPosition.js";
|
|
8
|
+
import _e from "./ChartTooltip.vue.js";
|
|
9
|
+
import { hexColorToRgba as f } from "../../utils/color.js";
|
|
10
|
+
import { useChartValues as Ke } from "./composables/useChartValues.js";
|
|
11
|
+
import Me from "./ChartHeader.vue.js";
|
|
12
|
+
import { useMemoize as Ue, useVModel as ze } from "@vueuse/core";
|
|
13
|
+
import Ge from "../emptyState/v4/EmptyStateV4.vue.js";
|
|
14
|
+
import Ye from "./ChartLoader.vue.js";
|
|
15
|
+
import { DEFAULT_CHART_COLOR as $e } from "./colorPalette.js";
|
|
16
|
+
import { TotalType as Y, calculateTotal as We } from "../../utils/totals.js";
|
|
17
|
+
import { isNullOrUndefined as Ze } from "../../utils/utils.js";
|
|
18
|
+
import { storeOriginalDatasetColors as Xe, restoreOriginalDatasetColors as je } from "./utils/highlightUtils.js";
|
|
19
|
+
const qe = { class: "chart-plane-container" }, Je = {
|
|
18
20
|
key: 0,
|
|
21
|
+
class: "header-wrapper"
|
|
22
|
+
}, Qe = {
|
|
23
|
+
key: 1,
|
|
19
24
|
class: "chart-plane"
|
|
20
|
-
},
|
|
25
|
+
}, et = { class: "chart" }, Ct = /* @__PURE__ */ re({
|
|
21
26
|
__name: "ChartPlane",
|
|
22
27
|
props: {
|
|
23
28
|
dataSets: { default: () => [] },
|
|
24
29
|
visibleIds: { default: () => [] },
|
|
25
|
-
|
|
30
|
+
highlightedId: { default: null },
|
|
31
|
+
chartType: { default: c.Line },
|
|
26
32
|
parsing: { default: void 0 },
|
|
27
33
|
xAxisFormat: { default: "string" },
|
|
28
34
|
yAxisFormat: { default: "number" },
|
|
29
|
-
tickCount: { default:
|
|
35
|
+
tickCount: { default: De },
|
|
36
|
+
truncateTickLabels: { type: Boolean, default: !0 },
|
|
30
37
|
header: { default: "" },
|
|
31
38
|
subheader: { default: "" },
|
|
32
39
|
subheaderTooltip: { default: null },
|
|
40
|
+
keepSubheaderVisible: { type: Boolean, default: !1 },
|
|
33
41
|
loading: { type: Boolean, default: !1 },
|
|
34
42
|
noDataIcon: { default: "file-search" },
|
|
35
43
|
noDataTitle: { default: "No data to display" },
|
|
@@ -39,281 +47,311 @@ const Ft = {
|
|
|
39
47
|
height: { default: "100%" },
|
|
40
48
|
compactHeader: { type: Boolean, default: !1 },
|
|
41
49
|
tooltipRespectsTopEdge: { type: Boolean, default: !0 },
|
|
42
|
-
tooltipTotalType: { default:
|
|
43
|
-
tooltipTotalCalcFn: { type: Function, default:
|
|
50
|
+
tooltipTotalType: { default: Y.Total },
|
|
51
|
+
tooltipTotalCalcFn: { type: Function, default: We },
|
|
52
|
+
tooltipOrder: { default: G.Legend },
|
|
44
53
|
trendValue: { default: null },
|
|
45
|
-
trendDirection: { default:
|
|
54
|
+
trendDirection: { default: Pe.UP },
|
|
46
55
|
trendTooltip: { default: null },
|
|
47
56
|
totalsChart: { type: Boolean, default: !1 },
|
|
48
57
|
colorsMap: { default: () => ({}) }
|
|
49
58
|
},
|
|
50
59
|
emits: ["update:chartType"],
|
|
51
|
-
setup(
|
|
52
|
-
const t =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
}))
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
setup(o, { emit: $ }) {
|
|
61
|
+
const t = o;
|
|
62
|
+
ie((e) => ({
|
|
63
|
+
a21c731a: s(te),
|
|
64
|
+
"2855275e": o.height
|
|
65
|
+
}));
|
|
66
|
+
const W = Ue(Re);
|
|
67
|
+
F.register(
|
|
68
|
+
me,
|
|
69
|
+
ve,
|
|
70
|
+
ye,
|
|
71
|
+
Te,
|
|
72
|
+
Ce,
|
|
73
|
+
ge,
|
|
74
|
+
be,
|
|
75
|
+
ke,
|
|
76
|
+
Se,
|
|
77
|
+
Ae,
|
|
78
|
+
xe,
|
|
79
|
+
Le,
|
|
80
|
+
Ee
|
|
70
81
|
);
|
|
71
|
-
const
|
|
82
|
+
const g = ze(t, "chartType", $), Z = l(
|
|
72
83
|
() => t.withAnimation ? "" : "none"
|
|
73
|
-
),
|
|
74
|
-
let
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
|
|
84
|
+
), m = k(null);
|
|
85
|
+
let n = null;
|
|
86
|
+
const R = l(() => t.dataSets.length === 0), u = l(() => !t.loading && !R.value), b = () => {
|
|
87
|
+
m.value && (n && n.destroy(), n = new F(m.value, V.value));
|
|
88
|
+
}, X = () => {
|
|
89
|
+
n && (n.data.datasets = H.value, n.options = V.value.options, n.update(Z.value));
|
|
79
90
|
};
|
|
80
|
-
|
|
81
|
-
e && (await
|
|
82
|
-
}),
|
|
83
|
-
const
|
|
84
|
-
() => t.chartType ===
|
|
85
|
-
),
|
|
86
|
-
() => t.chartType ===
|
|
87
|
-
),
|
|
91
|
+
ne(b), T(() => t.chartType, b), T(u, async (e) => {
|
|
92
|
+
e && (await se(), b());
|
|
93
|
+
}), T([() => t.visibleIds, () => t.dataSets], X);
|
|
94
|
+
const h = l(() => t.totalsChart), v = l(
|
|
95
|
+
() => t.chartType === c.StackedLine || t.chartType === c.StackedBar || h.value
|
|
96
|
+
), B = l(
|
|
97
|
+
() => t.chartType === c.Line || t.chartType === c.StackedLine
|
|
98
|
+
), O = l(() => h.value && !t.parsing.xAxisKey ? { ...t.parsing, xAxisKey: _ } : t.parsing), j = l(() => h.value ? t.dataSets.map((e) => ({
|
|
88
99
|
...e,
|
|
89
|
-
data: e.data.map((
|
|
90
|
-
...
|
|
91
|
-
[
|
|
100
|
+
data: e.data.map((i) => ({
|
|
101
|
+
...i,
|
|
102
|
+
[_]: e.label
|
|
92
103
|
}))
|
|
93
|
-
})) : t.dataSets),
|
|
94
|
-
() =>
|
|
95
|
-
),
|
|
96
|
-
() =>
|
|
104
|
+
})) : t.dataSets), y = l(
|
|
105
|
+
() => j.value.filter((e) => t.visibleIds.includes(e.id))
|
|
106
|
+
), q = (e) => t.colorsMap[e] || $e, D = l(
|
|
107
|
+
() => y.value.length && y.value.every(
|
|
97
108
|
(e) => e.data.length === 1
|
|
98
109
|
)
|
|
99
|
-
),
|
|
100
|
-
const
|
|
110
|
+
), H = l(() => y.value.map((e, i) => {
|
|
111
|
+
const a = q(e.id), r = v.value ? i !== 0 ? "-1" : "start" : void 0;
|
|
101
112
|
return {
|
|
102
113
|
...e,
|
|
103
|
-
fill:
|
|
104
|
-
backgroundColor:
|
|
105
|
-
|
|
106
|
-
t.chartType ===
|
|
114
|
+
fill: r,
|
|
115
|
+
backgroundColor: f(
|
|
116
|
+
a,
|
|
117
|
+
t.chartType === c.StackedLine ? 10 : 70
|
|
107
118
|
),
|
|
108
|
-
borderColor:
|
|
109
|
-
pointBackgroundColor:
|
|
110
|
-
pointHoverBorderColor:
|
|
119
|
+
borderColor: a,
|
|
120
|
+
pointBackgroundColor: a,
|
|
121
|
+
pointHoverBorderColor: a,
|
|
111
122
|
maxBarThickness: 50,
|
|
112
123
|
clip: 5,
|
|
113
124
|
// draw a bit outside the chart area
|
|
114
125
|
icon: e.icon || null,
|
|
115
|
-
iconType: e.iconType || "branded"
|
|
126
|
+
iconType: e.iconType || "branded",
|
|
127
|
+
[K]: a
|
|
128
|
+
// store base color for later use
|
|
116
129
|
};
|
|
117
|
-
})),
|
|
118
|
-
() => t.tooltipTotalType ===
|
|
119
|
-
),
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
130
|
+
})), J = l(
|
|
131
|
+
() => t.tooltipTotalType === Y.Total ? "Total" : "Mean"
|
|
132
|
+
), V = l(() => ({
|
|
133
|
+
type: t.chartType == c.Bar || t.chartType === c.StackedBar ? "bar" : "line",
|
|
134
|
+
// Chart Data
|
|
135
|
+
data: {
|
|
136
|
+
datasets: H.value
|
|
137
|
+
},
|
|
138
|
+
// Chart Options
|
|
139
|
+
options: {
|
|
140
|
+
parsing: O.value,
|
|
141
|
+
interaction: {
|
|
142
|
+
intersect: !1,
|
|
143
|
+
mode: h.value ? "point" : "index",
|
|
144
|
+
axis: "x"
|
|
125
145
|
},
|
|
126
|
-
//
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
);
|
|
152
|
-
return [_.value, String(i)];
|
|
153
|
-
}
|
|
146
|
+
// plugins
|
|
147
|
+
plugins: {
|
|
148
|
+
legend: { display: !1 },
|
|
149
|
+
title: { display: !1 },
|
|
150
|
+
hoverVerticalLine: B.value,
|
|
151
|
+
// tooltip
|
|
152
|
+
tooltip: {
|
|
153
|
+
enabled: !1,
|
|
154
|
+
position: "average",
|
|
155
|
+
external: ({ tooltip: e }) => {
|
|
156
|
+
d.value = { ...e };
|
|
157
|
+
},
|
|
158
|
+
callbacks: {
|
|
159
|
+
footer: (e) => {
|
|
160
|
+
const i = e.map((r) => r.parsed.y || 0), a = t.tooltipTotalCalcFn(
|
|
161
|
+
i,
|
|
162
|
+
t.tooltipTotalType
|
|
163
|
+
);
|
|
164
|
+
return [J.value, String(a)];
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
itemSort: (e, i) => {
|
|
168
|
+
if (t.tooltipOrder === G.YAxis) {
|
|
169
|
+
const a = e.parsed.y || 0, r = i.parsed.y || 0;
|
|
170
|
+
return a === r ? 0 : a > r ? -1 : 1;
|
|
154
171
|
}
|
|
172
|
+
return 0;
|
|
155
173
|
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
// chart layout
|
|
177
|
+
responsive: !0,
|
|
178
|
+
maintainAspectRatio: !1,
|
|
179
|
+
layout: {
|
|
180
|
+
padding: E
|
|
181
|
+
},
|
|
182
|
+
// basic styles
|
|
183
|
+
elements: {
|
|
184
|
+
line: {
|
|
185
|
+
borderWidth: 2,
|
|
186
|
+
tension: 0.3
|
|
156
187
|
},
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
bottom: 11
|
|
165
|
-
}
|
|
188
|
+
point: {
|
|
189
|
+
radius: D.value ? 3 : 1,
|
|
190
|
+
hitRadius: 8,
|
|
191
|
+
borderWidth: 0,
|
|
192
|
+
hoverRadius: 4,
|
|
193
|
+
hoverBorderWidth: 2,
|
|
194
|
+
pointHoverBackgroundColor: He
|
|
166
195
|
},
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
196
|
+
bar: {
|
|
197
|
+
borderRadius: 4
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
scales: {
|
|
201
|
+
// Horizontal Axis (X)
|
|
202
|
+
x: {
|
|
203
|
+
beginAtZero: !0,
|
|
204
|
+
offset: !B.value || D.value,
|
|
205
|
+
border: { display: !1 },
|
|
206
|
+
stacked: v.value,
|
|
207
|
+
// stack on top of each other
|
|
208
|
+
// ticks
|
|
209
|
+
ticks: {
|
|
210
|
+
color: M,
|
|
211
|
+
font: U,
|
|
212
|
+
padding: 4,
|
|
213
|
+
callback: function(e, i, a) {
|
|
214
|
+
const r = this.getLabelForValue(e), le = this.chart.width / a.length - (E.left + E.right + Ve);
|
|
215
|
+
return W({
|
|
216
|
+
label: r,
|
|
217
|
+
format: t.xAxisFormat,
|
|
218
|
+
availableSpace: le,
|
|
219
|
+
truncate: t.truncateTickLabels
|
|
220
|
+
});
|
|
221
|
+
}
|
|
180
222
|
},
|
|
181
|
-
|
|
182
|
-
|
|
223
|
+
// grid lines
|
|
224
|
+
grid: {
|
|
225
|
+
color: z,
|
|
226
|
+
drawOnChartArea: !1,
|
|
227
|
+
drawTicks: !0,
|
|
228
|
+
drawBorder: !1,
|
|
229
|
+
tickLength: 7
|
|
183
230
|
}
|
|
184
231
|
},
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
t.xAxisFormat
|
|
202
|
-
);
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
// grid lines
|
|
206
|
-
grid: {
|
|
207
|
-
color: M,
|
|
208
|
-
drawOnChartArea: !1,
|
|
209
|
-
drawTicks: !0,
|
|
210
|
-
drawBorder: !1,
|
|
211
|
-
tickLength: 7
|
|
212
|
-
}
|
|
232
|
+
// Vertical Axis (Y)
|
|
233
|
+
y: {
|
|
234
|
+
beginAtZero: !0,
|
|
235
|
+
border: { display: !1 },
|
|
236
|
+
// hide left borderline
|
|
237
|
+
stacked: v.value,
|
|
238
|
+
// stack on top of each other
|
|
239
|
+
// ticks
|
|
240
|
+
ticks: {
|
|
241
|
+
color: M,
|
|
242
|
+
font: U,
|
|
243
|
+
padding: 8,
|
|
244
|
+
stepSize: P.value,
|
|
245
|
+
min: N.value,
|
|
246
|
+
max: P.value * t.tickCount,
|
|
247
|
+
callback: (e) => Be(e, t.yAxisFormat)
|
|
213
248
|
},
|
|
214
|
-
//
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
stacked: p.value,
|
|
220
|
-
// stack on top of each other
|
|
221
|
-
// ticks
|
|
222
|
-
ticks: {
|
|
223
|
-
color: P,
|
|
224
|
-
font: N,
|
|
225
|
-
padding: 8,
|
|
226
|
-
stepSize: V.value,
|
|
227
|
-
min: D.value,
|
|
228
|
-
max: V.value * t.tickCount,
|
|
229
|
-
callback: (e) => F(e, t.yAxisFormat)
|
|
230
|
-
},
|
|
231
|
-
// grid lines
|
|
232
|
-
grid: {
|
|
233
|
-
color: M,
|
|
234
|
-
drawOnChartArea: !0,
|
|
235
|
-
drawTicks: !1
|
|
236
|
-
}
|
|
249
|
+
// grid lines
|
|
250
|
+
grid: {
|
|
251
|
+
color: z,
|
|
252
|
+
drawOnChartArea: !0,
|
|
253
|
+
drawTicks: !1
|
|
237
254
|
}
|
|
238
255
|
}
|
|
239
256
|
}
|
|
240
|
-
}
|
|
241
|
-
),
|
|
257
|
+
}
|
|
258
|
+
})), w = k(null), d = k(null), { position: I } = Fe(
|
|
259
|
+
m,
|
|
260
|
+
w,
|
|
242
261
|
d,
|
|
243
|
-
R,
|
|
244
|
-
l,
|
|
245
262
|
t.tooltipRespectsTopEdge
|
|
246
|
-
),
|
|
247
|
-
left: `${
|
|
248
|
-
top: `${
|
|
249
|
-
opacity:
|
|
250
|
-
})), { minValue:
|
|
251
|
-
parsingConfig:
|
|
252
|
-
dataSets:
|
|
253
|
-
isStacked:
|
|
254
|
-
}),
|
|
255
|
-
() =>
|
|
256
|
-
),
|
|
257
|
-
() => (t.compactHeader ?
|
|
263
|
+
), Q = l(() => ({
|
|
264
|
+
left: `${I.value.left}px`,
|
|
265
|
+
top: `${I.value.top}px`,
|
|
266
|
+
opacity: d.value?.opacity || 0
|
|
267
|
+
})), { minValue: N, maxValue: ee } = Ke({
|
|
268
|
+
parsingConfig: O.value,
|
|
269
|
+
dataSets: y,
|
|
270
|
+
isStacked: v
|
|
271
|
+
}), P = l(
|
|
272
|
+
() => Oe(N.value, ee.value, t.tickCount)
|
|
273
|
+
), te = l(
|
|
274
|
+
() => (t.compactHeader ? Ie : we) + "px"
|
|
258
275
|
);
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
276
|
+
T(
|
|
277
|
+
() => t.highlightedId,
|
|
278
|
+
(e) => {
|
|
279
|
+
n && (Ze(e) ? oe() : ae(e), n.update());
|
|
280
|
+
}
|
|
281
|
+
);
|
|
282
|
+
const ae = (e) => {
|
|
283
|
+
(n?.data.datasets || []).forEach((a) => {
|
|
284
|
+
Xe(a);
|
|
285
|
+
const r = a[K];
|
|
286
|
+
a.id === e ? t.chartType === c.StackedLine && (a.backgroundColor = f(
|
|
287
|
+
r,
|
|
288
|
+
Ne
|
|
289
|
+
)) : (a.backgroundColor = f(r, C), a.borderColor = f(r, C), a.pointBackgroundColor = f(r, C), a.pointHoverBorderColor = f(r, C));
|
|
290
|
+
});
|
|
291
|
+
}, oe = () => {
|
|
292
|
+
(n?.data.datasets || []).forEach(je);
|
|
293
|
+
};
|
|
294
|
+
return (e, i) => (p(), S("div", qe, [
|
|
295
|
+
s(u) || o.keepSubheaderVisible ? (p(), S("div", Je, [
|
|
296
|
+
ce(Me, {
|
|
297
|
+
"chart-type": s(g),
|
|
298
|
+
"onUpdate:chart-type": i[0] || (i[0] = (a) => de(g) ? g.value = a : null),
|
|
299
|
+
"type-switcher": s(u) ? o.typeSwitcher : !1,
|
|
300
|
+
header: s(u) ? o.header : null,
|
|
301
|
+
subheader: o.subheader,
|
|
302
|
+
"subheader-tooltip": o.subheaderTooltip,
|
|
303
|
+
"trend-tooltip": o.trendTooltip,
|
|
304
|
+
compact: o.compactHeader,
|
|
305
|
+
"trend-value": s(u) ? o.trendValue : null,
|
|
306
|
+
"trend-direction": o.trendDirection
|
|
307
|
+
}, ue({ _: 2 }, [
|
|
273
308
|
e.$slots["subheader-tooltip"] ? {
|
|
274
309
|
name: "subheader-tooltip",
|
|
275
|
-
fn:
|
|
276
|
-
|
|
310
|
+
fn: pe(() => [
|
|
311
|
+
fe(e.$slots, "subheader-tooltip", {}, void 0, !0)
|
|
277
312
|
]),
|
|
278
313
|
key: "0"
|
|
279
314
|
} : void 0
|
|
280
315
|
]), 1032, ["chart-type", "type-switcher", "header", "subheader", "subheader-tooltip", "trend-tooltip", "compact", "trend-value", "trend-direction"])
|
|
281
|
-
]),
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
316
|
+
])) : A("", !0),
|
|
317
|
+
s(u) ? (p(), S("section", Qe, [
|
|
318
|
+
x("div", et, [
|
|
319
|
+
x("canvas", {
|
|
320
|
+
ref_key: "chartRef",
|
|
321
|
+
ref: m,
|
|
322
|
+
class: "chart__canvas"
|
|
323
|
+
}, null, 512),
|
|
324
|
+
x("div", {
|
|
325
|
+
ref_key: "tooltipRef",
|
|
326
|
+
ref: w,
|
|
327
|
+
class: "chart__tooltip",
|
|
328
|
+
style: he(s(Q))
|
|
329
|
+
}, [
|
|
330
|
+
d.value ? (p(), L(_e, {
|
|
331
|
+
key: 0,
|
|
332
|
+
"totals-chart": s(h),
|
|
333
|
+
title: String(d.value.title),
|
|
334
|
+
"data-points": d.value.dataPoints,
|
|
335
|
+
"x-axis-format": o.xAxisFormat,
|
|
336
|
+
"y-axis-format": o.yAxisFormat,
|
|
337
|
+
"total-label": d.value.footer[0],
|
|
338
|
+
"total-value": Number(d.value.footer[1])
|
|
339
|
+
}, null, 8, ["totals-chart", "title", "data-points", "x-axis-format", "y-axis-format", "total-label", "total-value"])) : A("", !0)
|
|
340
|
+
], 4)
|
|
341
|
+
])
|
|
342
|
+
])) : o.loading ? (p(), L(Ye, {
|
|
343
|
+
key: 2,
|
|
344
|
+
class: "chart-loading"
|
|
345
|
+
})) : s(R) ? (p(), L(s(Ge), {
|
|
346
|
+
key: 3,
|
|
347
|
+
class: "chart-empty",
|
|
348
|
+
title: o.noDataTitle,
|
|
349
|
+
subtitle: o.noDataSubtitle,
|
|
350
|
+
"icon-name": o.noDataIcon
|
|
351
|
+
}, null, 8, ["title", "subtitle", "icon-name"])) : A("", !0)
|
|
352
|
+
]));
|
|
315
353
|
}
|
|
316
354
|
});
|
|
317
355
|
export {
|
|
318
|
-
|
|
356
|
+
Ct as default
|
|
319
357
|
};
|