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