@embeddable.com/remarkable-ui 0.1.19 → 0.1.22
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/BarChartDefaultHorizontalPro.js +35 -34
- package/dist/BarChartDefaultHorizontalPro.js.map +1 -1
- package/dist/BarChartDefaultPro.js +34 -33
- package/dist/BarChartDefaultPro.js.map +1 -1
- package/dist/BarChartGroupedHorizontalPro.js +52 -46
- package/dist/BarChartGroupedHorizontalPro.js.map +1 -1
- package/dist/BarChartGroupedPro.js +41 -35
- package/dist/BarChartGroupedPro.js.map +1 -1
- package/dist/BarChartStackedHorizontalPro.js +37 -31
- package/dist/BarChartStackedHorizontalPro.js.map +1 -1
- package/dist/BarChartStackedPro.js +38 -32
- package/dist/BarChartStackedPro.js.map +1 -1
- package/dist/{BaseButton-CuifBVsc.js → BaseButton-Cynr77gm.js} +2 -2
- package/dist/{BaseButton-CuifBVsc.js.map → BaseButton-Cynr77gm.js.map} +1 -1
- package/dist/{ChartCard-BkrK3C4a.js → ChartCard-DunjH70y.js} +29 -29
- package/dist/{ChartCard-BkrK3C4a.js.map → ChartCard-DunjH70y.js.map} +1 -1
- package/dist/{ComparisonPeriod.type.emb-Cli9Gpzq.js → ComparisonPeriod.type.emb-CARBg093.js} +2 -2
- package/dist/{ComparisonPeriod.type.emb-Cli9Gpzq.js.map → ComparisonPeriod.type.emb-CARBg093.js.map} +1 -1
- package/dist/ComparisonPeriodSelectFieldPro.js +9 -9
- package/dist/DateRangeSelectFieldPro.js +2 -2
- package/dist/DonutChartPro.js +2 -2
- package/dist/DonutLabelChartPro.js +2 -2
- package/dist/{EditorCard-BQnDPFzf.js → EditorCard-C9RDdL87.js} +11 -11
- package/dist/{EditorCard-BQnDPFzf.js.map → EditorCard-C9RDdL87.js.map} +1 -1
- package/dist/{KpiChart-ClxfTTJ4.js → KpiChart-DVJLPOzo.js} +2 -2
- package/dist/{KpiChart-ClxfTTJ4.js.map → KpiChart-DVJLPOzo.js.map} +1 -1
- package/dist/KpiChartNumberComparisonPro.js +61 -73
- package/dist/KpiChartNumberComparisonPro.js.map +1 -1
- package/dist/KpiChartNumberPro.js +4 -4
- package/dist/LineChartComparisonDefaultPro.js +404 -0
- package/dist/LineChartComparisonDefaultPro.js.map +1 -0
- package/dist/LineChartDefaultPro.js +183 -0
- package/dist/LineChartDefaultPro.js.map +1 -0
- package/dist/LineChartGroupedPro.js +184 -0
- package/dist/LineChartGroupedPro.js.map +1 -0
- package/dist/MultiSelectFieldPro.js +2 -2
- package/dist/PieChartPro.js +2 -2
- package/dist/{SingleSelectField-BAEvpk7-.js → SingleSelectField-k-5pYl1f.js} +21 -21
- package/dist/{SingleSelectField-BAEvpk7-.js.map → SingleSelectField-k-5pYl1f.js.map} +1 -1
- package/dist/SingleSelectFieldPro.js +2 -2
- package/dist/bars.utils-BAkV6I3P.js +311 -0
- package/dist/bars.utils-BAkV6I3P.js.map +1 -0
- package/dist/charts.newFillGaps.hooks-D6mnKJwQ.js +63 -0
- package/dist/charts.newFillGaps.hooks-D6mnKJwQ.js.map +1 -0
- package/dist/{object.utils-CaoDr05j.js → charts.utils-Dyj5e5HG.js} +1919 -1977
- package/dist/charts.utils-Dyj5e5HG.js.map +1 -0
- package/dist/color.utils-CVyp-fGP.js +1645 -0
- package/dist/color.utils-CVyp-fGP.js.map +1 -0
- package/dist/{component.constants-CL4mGURD.js → component.constants-D7F6GsHW.js} +4976 -3873
- package/dist/component.constants-D7F6GsHW.js.map +1 -0
- package/dist/embeddable-components.json +9 -6
- package/dist/embeddable-theme-2b917.js +19 -16
- package/dist/{formatter.utils-BaAiNARZ.js → formatter.utils--2w1e7GE.js} +2 -2
- package/dist/{formatter.utils-BaAiNARZ.js.map → formatter.utils--2w1e7GE.js.map} +1 -1
- package/dist/{index-9t6SPE91.js → index-B0xeoUyW.js} +9 -9
- package/dist/{index-9t6SPE91.js.map → index-B0xeoUyW.js.map} +1 -1
- package/dist/{index-BSbQYCwI.js → index-B4-i-g0Z.js} +24 -24
- package/dist/{index-BSbQYCwI.js.map → index-B4-i-g0Z.js.map} +1 -1
- package/dist/{index-CAGJqsS8.js → index-BGczJvRB.js} +12 -12
- package/dist/{index-CAGJqsS8.js.map → index-BGczJvRB.js.map} +1 -1
- package/dist/{index-BUwm0Ul3.js → index-CLVeA9pa.js} +8 -8
- package/dist/{index-BUwm0Ul3.js.map → index-CLVeA9pa.js.map} +1 -1
- package/dist/{index-BehaWXq-.js → index-DPGAAlWv.js} +4 -4
- package/dist/{index-BehaWXq-.js.map → index-DPGAAlWv.js.map} +1 -1
- package/dist/{index-RqtiYv1c.js → index-DmgDANxV.js} +13 -13
- package/dist/{index-RqtiYv1c.js.map → index-DmgDANxV.js.map} +1 -1
- package/dist/index.js +133 -125
- package/dist/index.js.map +1 -1
- package/dist/object.utils-BNKDL7Y9.js +67 -0
- package/dist/object.utils-BNKDL7Y9.js.map +1 -0
- package/dist/{pies.utils-hekLAU_r.js → pies.utils-CIFMn9ko.js} +9 -8
- package/dist/{pies.utils-hekLAU_r.js.map → pies.utils-CIFMn9ko.js.map} +1 -1
- package/dist/remarkable-pro/components/charts/bars/BarChartGroupedHorizontalPro/index.d.ts.map +1 -1
- package/dist/remarkable-pro/components/charts/bars/BarChartGroupedPro/index.d.ts.map +1 -1
- package/dist/remarkable-pro/components/charts/bars/BarChartStackedHorizontalPro/index.d.ts.map +1 -1
- package/dist/remarkable-pro/components/charts/bars/BarChartStackedPro/index.d.ts.map +1 -1
- package/dist/remarkable-pro/components/charts/bars/bars.utils.d.ts +1 -1
- package/dist/remarkable-pro/components/charts/bars/bars.utils.d.ts.map +1 -1
- package/dist/remarkable-pro/components/charts/charts.newFillGaps.hooks.d.ts +10 -0
- package/dist/remarkable-pro/components/charts/charts.newFillGaps.hooks.d.ts.map +1 -0
- package/dist/remarkable-pro/components/charts/lines/LineChartComparisonDefaultPro/LineChartComparisonDefaultPro.utils.d.ts +20 -0
- package/dist/remarkable-pro/components/charts/lines/LineChartComparisonDefaultPro/LineChartComparisonDefaultPro.utils.d.ts.map +1 -0
- package/dist/remarkable-pro/components/charts/lines/LineChartComparisonDefaultPro/index.d.ts +26 -0
- package/dist/remarkable-pro/components/charts/lines/LineChartComparisonDefaultPro/index.d.ts.map +1 -0
- package/dist/remarkable-pro/components/charts/lines/LineChartDefaultPro/LineChartDefaultPro.utils.d.ts +14 -0
- package/dist/remarkable-pro/components/charts/lines/LineChartDefaultPro/LineChartDefaultPro.utils.d.ts.map +1 -0
- package/dist/remarkable-pro/components/charts/lines/LineChartDefaultPro/index.d.ts +20 -0
- package/dist/remarkable-pro/components/charts/lines/LineChartDefaultPro/index.d.ts.map +1 -0
- package/dist/remarkable-pro/components/charts/lines/LineChartGroupedPro/LineChartGroupedPro.utils.d.ts +22 -0
- package/dist/remarkable-pro/components/charts/lines/LineChartGroupedPro/LineChartGroupedPro.utils.d.ts.map +1 -0
- package/dist/remarkable-pro/components/charts/lines/LineChartGroupedPro/index.d.ts +21 -0
- package/dist/remarkable-pro/components/charts/lines/LineChartGroupedPro/index.d.ts.map +1 -0
- package/dist/remarkable-pro/components/charts/lines/lines.utils.d.ts +14 -0
- package/dist/remarkable-pro/components/charts/lines/lines.utils.d.ts.map +1 -0
- package/dist/remarkable-pro/components/component.constants.d.ts +40 -24
- package/dist/remarkable-pro/components/component.constants.d.ts.map +1 -1
- package/dist/remarkable-pro/index.d.ts +1 -0
- package/dist/remarkable-pro/index.d.ts.map +1 -1
- package/dist/remarkable-pro/theme/formatter/formatter.constants.d.ts.map +1 -1
- package/dist/remarkable-pro/theme/i18n/translations/de.d.ts.map +1 -1
- package/dist/remarkable-pro/theme/i18n/translations/en.d.ts.map +1 -1
- package/dist/remarkable-pro/theme/theme.types.d.ts +9 -0
- package/dist/remarkable-pro/theme/theme.types.d.ts.map +1 -1
- package/dist/remarkable-pro/utils.ts/color.utils.d.ts +3 -0
- package/dist/remarkable-pro/utils.ts/color.utils.d.ts.map +1 -0
- package/dist/remarkable-ui/charts/lines/LineChart.d.ts.map +1 -1
- package/dist/remarkable-ui/charts/lines/lines.utils.d.ts.map +1 -1
- package/dist/remarkable-ui/index.d.ts +1 -0
- package/dist/remarkable-ui/index.d.ts.map +1 -1
- package/dist/remarkable-ui/styles/styles.constants.d.ts +4 -0
- package/dist/remarkable-ui/styles/styles.constants.d.ts.map +1 -1
- package/dist/remarkable-ui/styles/styles.utils.d.ts.map +1 -1
- package/dist/remarkable-ui.css +6 -2
- package/dist/timeRange.utils-KDn6xcVP.js +20 -0
- package/dist/timeRange.utils-KDn6xcVP.js.map +1 -0
- package/package.json +6 -4
- package/dist/charts.fillGaps.hooks-BvYoaRpE.js +0 -584
- package/dist/charts.fillGaps.hooks-BvYoaRpE.js.map +0 -1
- package/dist/component.constants-CL4mGURD.js.map +0 -1
- package/dist/object.utils-CaoDr05j.js.map +0 -1
- package/dist/remarkable-pro/components/charts/charts.fillGaps.hooks.d.ts +0 -25
- package/dist/remarkable-pro/components/charts/charts.fillGaps.hooks.d.ts.map +0 -1
- package/dist/remarkable-pro/components/charts/charts.fillGaps.utils.d.ts +0 -31
- package/dist/remarkable-pro/components/charts/charts.fillGaps.utils.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embeddable.com/remarkable-ui",
|
|
3
3
|
"author": "embeddable (https://embeddable.com)",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.22",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -55,20 +55,21 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@changesets/cli": "^2.29.6",
|
|
58
|
+
"@embeddable.com/core": "^2.11.1",
|
|
59
|
+
"@embeddable.com/react": "^2.11.0",
|
|
58
60
|
"@radix-ui/react-dropdown-menu": "^2.1.15",
|
|
59
61
|
"@tabler/icons-react": "^3.34.1",
|
|
60
62
|
"chart.js": "^4.5.0",
|
|
61
63
|
"chartjs-plugin-annotation": "^3.1.0",
|
|
62
64
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
65
|
+
"chroma-js": "^3.1.2",
|
|
63
66
|
"clsx": "^2.1.1",
|
|
64
67
|
"dayjs": "^1.11.14",
|
|
65
68
|
"dom-to-image-more": "^3.6.3",
|
|
66
69
|
"i18next": "^25.3.2",
|
|
67
70
|
"mergician": "^2.0.2",
|
|
68
71
|
"react-chartjs-2": "^5.3.0",
|
|
69
|
-
"xlsx": "^0.18.5"
|
|
70
|
-
"@embeddable.com/core": "^2.11.1",
|
|
71
|
-
"@embeddable.com/react": "^2.11.0"
|
|
72
|
+
"xlsx": "^0.18.5"
|
|
72
73
|
},
|
|
73
74
|
"devDependencies": {
|
|
74
75
|
"@embeddable.com/sdk-core": "^4.1.2",
|
|
@@ -80,6 +81,7 @@
|
|
|
80
81
|
"@storybook/react-webpack5": "^9.0.17",
|
|
81
82
|
"@swc/cli": "^0.4.0",
|
|
82
83
|
"@swc/core": "^1.4.0",
|
|
84
|
+
"@types/chroma-js": "^3.1.1",
|
|
83
85
|
"@types/react": "^19.1.9",
|
|
84
86
|
"@types/react-dom": "^19.1.7",
|
|
85
87
|
"eslint": "^9.31.0",
|
|
@@ -1,584 +0,0 @@
|
|
|
1
|
-
import { B as g, C as v, m as R, D as Q, E as I, F as J, G as X, L as tt, H as et, I as at, J as rt, K as st, M as nt, N as ot, j as N, O as lt, P as it, Q as ct, R as Y } from "./component.constants-CL4mGURD.js";
|
|
2
|
-
import { useRef as ut, useMemo as dt } from "react";
|
|
3
|
-
import { r as mt, g as G, a as ft, b as H } from "./object.utils-CaoDr05j.js";
|
|
4
|
-
import { g as B } from "./formatter.utils-BaAiNARZ.js";
|
|
5
|
-
import { d as b } from "./utc-B2gCnkBk.js";
|
|
6
|
-
import { useTheme as ht } from "@embeddable.com/react";
|
|
7
|
-
const gt = {
|
|
8
|
-
datalabels: {
|
|
9
|
-
labels: {
|
|
10
|
-
total: {
|
|
11
|
-
anchor: (t) => t.dataset.data[t.dataIndex] >= 0 ? "end" : "start",
|
|
12
|
-
align: (t) => t.dataset.data[t.dataIndex] >= 0 ? "top" : "bottom"
|
|
13
|
-
},
|
|
14
|
-
value: {
|
|
15
|
-
anchor: (t) => t.dataset.data[t.dataIndex] >= 0 ? "end" : "start",
|
|
16
|
-
align: (t) => t.dataset.data[t.dataIndex] >= 0 ? "top" : "bottom"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}, pt = {
|
|
21
|
-
display: !0,
|
|
22
|
-
color: v("--em-chart-grid-font-color-default"),
|
|
23
|
-
font: {
|
|
24
|
-
size: g("--em-chart-grid-font-subtitle-size"),
|
|
25
|
-
weight: g("--em-chart-grid-font-label-weight"),
|
|
26
|
-
lineHeight: `${g("--em-chart-grid-font-line-height")}px`
|
|
27
|
-
// TODO: fix family on dedicated ticket
|
|
28
|
-
// family: getStyle('--em-chart-grid-font-font-family'),
|
|
29
|
-
}
|
|
30
|
-
}, bt = {
|
|
31
|
-
display: !0,
|
|
32
|
-
color: v("--em-chart-grid-font-color-muted"),
|
|
33
|
-
font: {
|
|
34
|
-
size: g("--em-chart-grid-font-subtitle-size"),
|
|
35
|
-
weight: g("--em-chart-grid-font-label-weight"),
|
|
36
|
-
lineHeight: `${g("--em-chart-grid-font-line-height")}px`
|
|
37
|
-
// TODO: fix family on dedicated ticket
|
|
38
|
-
// family: getStyle('--em-chart-grid-font-font-family'),
|
|
39
|
-
}
|
|
40
|
-
}, U = {
|
|
41
|
-
color: v("--em-chart-grid-font-color-default"),
|
|
42
|
-
font: {
|
|
43
|
-
size: g("--em-chart-grid-font-title-size"),
|
|
44
|
-
weight: g("--em-chart-grid-font-title-weight"),
|
|
45
|
-
lineHeight: `${g("--em-chart-grid-font-line-height")}px`
|
|
46
|
-
// TODO: fix family on dedicated ticket
|
|
47
|
-
// family: getStyle('--em-chart-grid-font-font-family'),
|
|
48
|
-
}
|
|
49
|
-
}, _ = {
|
|
50
|
-
color: v("--em-chart-grid-line-color-light"),
|
|
51
|
-
lineWidth: g("--em-chart-grid-line-width-default")
|
|
52
|
-
}, Dt = {
|
|
53
|
-
x: {
|
|
54
|
-
grid: _,
|
|
55
|
-
title: U,
|
|
56
|
-
ticks: pt
|
|
57
|
-
},
|
|
58
|
-
y: {
|
|
59
|
-
grid: _,
|
|
60
|
-
title: U,
|
|
61
|
-
ticks: bt
|
|
62
|
-
}
|
|
63
|
-
}, yt = R(Q, {
|
|
64
|
-
plugins: gt,
|
|
65
|
-
scales: Dt
|
|
66
|
-
}), z = 30, Tt = (t) => {
|
|
67
|
-
var e;
|
|
68
|
-
return {
|
|
69
|
-
...t,
|
|
70
|
-
datasets: (e = t.datasets) == null ? void 0 : e.map((r, n) => {
|
|
71
|
-
const a = I[n % I.length], s = {
|
|
72
|
-
...r,
|
|
73
|
-
backgroundColor: a,
|
|
74
|
-
borderColor: a
|
|
75
|
-
};
|
|
76
|
-
return R(s, r);
|
|
77
|
-
})
|
|
78
|
-
};
|
|
79
|
-
}, Ot = (t, e) => e && t.datasetIndex === t.chart.data.datasets.length - 1 ? "auto" : !1, St = (t, e) => {
|
|
80
|
-
const { datasets: r } = e.chart.data, n = e.dataIndex, a = r.reduce((s, c) => {
|
|
81
|
-
const l = c.data[n];
|
|
82
|
-
return s + (l || 0);
|
|
83
|
-
}, 0);
|
|
84
|
-
return a > 0 ? a : "";
|
|
85
|
-
}, xt = (t) => ({
|
|
86
|
-
indexAxis: "x",
|
|
87
|
-
layout: {
|
|
88
|
-
padding: {
|
|
89
|
-
top: (t.stacked ? t.showTotalLabels : t.showValueLabels) ? z : 0
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
plugins: {
|
|
93
|
-
datalabels: {
|
|
94
|
-
labels: {
|
|
95
|
-
total: {
|
|
96
|
-
align: (e) => e.dataset.data[e.dataIndex] >= 0 ? "top" : "left"
|
|
97
|
-
},
|
|
98
|
-
value: {
|
|
99
|
-
align: (e) => t.stacked ? "center" : e.dataset.data[e.dataIndex] >= 0 ? "top" : "bottom"
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
scales: {
|
|
105
|
-
x: {
|
|
106
|
-
grid: { display: !1 },
|
|
107
|
-
ticks: {
|
|
108
|
-
color: v("--em-chart-grid-font-color-default")
|
|
109
|
-
},
|
|
110
|
-
reverse: t.reverseXAxis
|
|
111
|
-
},
|
|
112
|
-
y: {
|
|
113
|
-
grid: { display: !0 },
|
|
114
|
-
ticks: {
|
|
115
|
-
color: v("--em-chart-grid-font-color-muted")
|
|
116
|
-
},
|
|
117
|
-
min: t.yAxisRangeMin,
|
|
118
|
-
max: t.yAxisRangeMax,
|
|
119
|
-
type: t.showLogarithmicScale ? "logarithmic" : "linear"
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}), vt = (t) => ({
|
|
123
|
-
indexAxis: "y",
|
|
124
|
-
layout: {
|
|
125
|
-
padding: {
|
|
126
|
-
right: (t.stacked ? t.showTotalLabels : t.showValueLabels) ? z : 0
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
plugins: {
|
|
130
|
-
datalabels: {
|
|
131
|
-
labels: {
|
|
132
|
-
total: {
|
|
133
|
-
align: (e) => e.dataset.data[e.dataIndex] >= 0 ? "right" : "left"
|
|
134
|
-
},
|
|
135
|
-
value: {
|
|
136
|
-
align: (e) => t.stacked ? "center" : e.dataset.data[e.dataIndex] >= 0 ? "right" : "left"
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
scales: {
|
|
142
|
-
x: {
|
|
143
|
-
grid: { display: !0 },
|
|
144
|
-
ticks: {
|
|
145
|
-
color: v("--em-chart-grid-font-color-muted")
|
|
146
|
-
},
|
|
147
|
-
min: t.xAxisRangeMin,
|
|
148
|
-
max: t.xAxisRangeMax,
|
|
149
|
-
type: t.showLogarithmicScale ? "logarithmic" : "linear"
|
|
150
|
-
},
|
|
151
|
-
y: {
|
|
152
|
-
grid: { display: !1 },
|
|
153
|
-
ticks: {
|
|
154
|
-
color: v("--em-chart-grid-font-color-default")
|
|
155
|
-
},
|
|
156
|
-
reverse: t.reverseYAxis
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}), Ct = (t) => {
|
|
160
|
-
const e = {
|
|
161
|
-
elements: {
|
|
162
|
-
bar: {
|
|
163
|
-
borderRadius: g("--em-chart-style-border-radius-default")
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
plugins: {
|
|
167
|
-
legend: { display: t.showLegend },
|
|
168
|
-
tooltip: {
|
|
169
|
-
enabled: t.showTooltips
|
|
170
|
-
},
|
|
171
|
-
datalabels: {
|
|
172
|
-
display: (a) => t.showValueLabels && a.dataset.data[a.dataIndex] !== 0 ? "auto" : !1,
|
|
173
|
-
labels: {
|
|
174
|
-
total: {
|
|
175
|
-
display: (a) => Ot(a, t.showTotalLabels),
|
|
176
|
-
formatter: St,
|
|
177
|
-
anchor: (a) => a.dataset.data[a.dataIndex] >= 0 ? "end" : "start"
|
|
178
|
-
},
|
|
179
|
-
value: {
|
|
180
|
-
anchor: (a) => t.stacked ? "center" : a.dataset.data[a.dataIndex] >= 0 ? "end" : "start"
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
scales: {
|
|
186
|
-
x: {
|
|
187
|
-
stacked: !!t.stacked,
|
|
188
|
-
title: {
|
|
189
|
-
display: !!t.xAxisLabel,
|
|
190
|
-
text: t.xAxisLabel ?? ""
|
|
191
|
-
},
|
|
192
|
-
ticks: { display: !0 }
|
|
193
|
-
},
|
|
194
|
-
y: {
|
|
195
|
-
stacked: !!t.stacked,
|
|
196
|
-
title: {
|
|
197
|
-
display: !!t.yAxisLabel,
|
|
198
|
-
text: t.yAxisLabel ?? ""
|
|
199
|
-
},
|
|
200
|
-
ticks: { display: !0 }
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}, n = (t.horizontal ? vt : xt)(t);
|
|
204
|
-
return R(yt, e, n);
|
|
205
|
-
};
|
|
206
|
-
J.register(
|
|
207
|
-
X,
|
|
208
|
-
tt,
|
|
209
|
-
et,
|
|
210
|
-
at,
|
|
211
|
-
rt,
|
|
212
|
-
st,
|
|
213
|
-
nt,
|
|
214
|
-
ot
|
|
215
|
-
);
|
|
216
|
-
const zt = ({ data: t, onSegmentClick: e, options: r = {}, ...n }) => {
|
|
217
|
-
const a = ut(null), s = R(Ct(n), r), c = (l) => {
|
|
218
|
-
const o = ct(l, a);
|
|
219
|
-
e == null || e(o);
|
|
220
|
-
};
|
|
221
|
-
return /* @__PURE__ */ N.jsx("div", { className: lt.chartContainer, children: /* @__PURE__ */ N.jsx(
|
|
222
|
-
it,
|
|
223
|
-
{
|
|
224
|
-
ref: a,
|
|
225
|
-
data: Tt(t),
|
|
226
|
-
options: s,
|
|
227
|
-
onClick: c
|
|
228
|
-
}
|
|
229
|
-
) });
|
|
230
|
-
}, Kt = (t, e) => {
|
|
231
|
-
const r = B(e), { data: n = [], dimension: a, groupDimension: s, measure: c } = t, l = [...new Set(n.map((d) => d[a.name]).filter(Boolean))].sort(), o = [...new Set(n.map((d) => d[s.name]))], u = G(e), m = o.map((d, T) => {
|
|
232
|
-
const O = H(
|
|
233
|
-
`${u}.charts.backgroundColors`,
|
|
234
|
-
`${s.name}.${d}`,
|
|
235
|
-
e.charts.backgroundColors ?? I,
|
|
236
|
-
T
|
|
237
|
-
), C = H(
|
|
238
|
-
`${u}.charts.borderColors`,
|
|
239
|
-
`${s.name}.${d}`,
|
|
240
|
-
e.charts.borderColors ?? I,
|
|
241
|
-
T
|
|
242
|
-
);
|
|
243
|
-
return {
|
|
244
|
-
label: r.data(s, d),
|
|
245
|
-
rawLabel: d,
|
|
246
|
-
backgroundColor: O,
|
|
247
|
-
borderColor: C,
|
|
248
|
-
data: l.map((k) => {
|
|
249
|
-
const w = n.find(
|
|
250
|
-
(S) => S[s.name] === d && S[a.name] === k
|
|
251
|
-
);
|
|
252
|
-
return w ? Number(w[c.name]) : 0;
|
|
253
|
-
})
|
|
254
|
-
};
|
|
255
|
-
});
|
|
256
|
-
return {
|
|
257
|
-
labels: l,
|
|
258
|
-
datasets: m
|
|
259
|
-
};
|
|
260
|
-
}, Vt = (t, e = mt) => {
|
|
261
|
-
const r = B(e);
|
|
262
|
-
if (!t.data)
|
|
263
|
-
return {
|
|
264
|
-
labels: [],
|
|
265
|
-
datasets: [{ data: [] }]
|
|
266
|
-
};
|
|
267
|
-
const n = G(e), a = ft(t.data, t.dimension, t.measures, t.maxItems);
|
|
268
|
-
return {
|
|
269
|
-
labels: a.map((s) => s[t.dimension.name]),
|
|
270
|
-
datasets: t.measures.map((s, c) => {
|
|
271
|
-
const l = H(
|
|
272
|
-
`${n}.charts.backgroundColors`,
|
|
273
|
-
s.name,
|
|
274
|
-
e.charts.backgroundColors ?? Y,
|
|
275
|
-
c
|
|
276
|
-
), o = H(
|
|
277
|
-
`${n}.charts.borderColors`,
|
|
278
|
-
s.name,
|
|
279
|
-
e.charts.borderColors ?? Y,
|
|
280
|
-
c
|
|
281
|
-
);
|
|
282
|
-
return {
|
|
283
|
-
label: r.dimensionOrMeasureTitle(s),
|
|
284
|
-
data: a.map((u) => u[s.name]),
|
|
285
|
-
backgroundColor: l,
|
|
286
|
-
borderColor: o
|
|
287
|
-
};
|
|
288
|
-
})
|
|
289
|
-
};
|
|
290
|
-
}, kt = (t, e) => {
|
|
291
|
-
const { datasets: r } = t.chart.data, n = t.dataIndex, a = r.reduce((s, c) => {
|
|
292
|
-
const l = c.data[n];
|
|
293
|
-
return s + (l || 0);
|
|
294
|
-
}, 0);
|
|
295
|
-
return e(a);
|
|
296
|
-
}, Zt = (t, e) => {
|
|
297
|
-
const { onBarClicked: r, measure: n, dimension: a, horizontal: s, data: c } = t, l = B(e);
|
|
298
|
-
return {
|
|
299
|
-
plugins: {
|
|
300
|
-
legend: { position: e.charts.legendPosition ?? "bottom" },
|
|
301
|
-
datalabels: {
|
|
302
|
-
labels: {
|
|
303
|
-
total: {
|
|
304
|
-
formatter: (o, u) => kt(
|
|
305
|
-
u,
|
|
306
|
-
(m) => l.data(t.measure, m)
|
|
307
|
-
)
|
|
308
|
-
},
|
|
309
|
-
value: {
|
|
310
|
-
formatter: (o) => l.data(t.measure, o)
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
},
|
|
314
|
-
tooltip: {
|
|
315
|
-
callbacks: {
|
|
316
|
-
title: (o) => {
|
|
317
|
-
var m;
|
|
318
|
-
const u = (m = o[0]) == null ? void 0 : m.label;
|
|
319
|
-
return l.data(a, u);
|
|
320
|
-
},
|
|
321
|
-
label: (o) => {
|
|
322
|
-
const u = o.raw;
|
|
323
|
-
return `${l.data(a, o.dataset.label) || ""}: ${l.data(n, u)}`;
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
},
|
|
328
|
-
scales: {
|
|
329
|
-
x: {
|
|
330
|
-
ticks: {
|
|
331
|
-
callback: (o) => {
|
|
332
|
-
if (s)
|
|
333
|
-
return l.data(n, o);
|
|
334
|
-
if (!c || !c.labels) return;
|
|
335
|
-
const u = c.labels[Number(o)];
|
|
336
|
-
return l.data(a, u);
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
},
|
|
340
|
-
y: {
|
|
341
|
-
ticks: {
|
|
342
|
-
callback: (o) => {
|
|
343
|
-
if (!s)
|
|
344
|
-
return l.data(n, o);
|
|
345
|
-
if (!c || !c.labels) return;
|
|
346
|
-
const u = c.labels[Number(o)];
|
|
347
|
-
return l.data(a, u);
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
},
|
|
352
|
-
onClick: (o, u, m) => {
|
|
353
|
-
var C;
|
|
354
|
-
const d = u[0], T = d ? m.data.labels[d.index] : null, O = d ? (C = m.data.datasets[d.datasetIndex]) == null ? void 0 : C.rawLabel : null;
|
|
355
|
-
r({
|
|
356
|
-
axisDimensionValue: T,
|
|
357
|
-
groupingDimensionValue: O
|
|
358
|
-
});
|
|
359
|
-
}
|
|
360
|
-
};
|
|
361
|
-
}, y = {
|
|
362
|
-
DEFAULT: "YYYY-MM-DDTHH:mm:ss.SSS",
|
|
363
|
-
WITH_TIMEZONE: "YYYY-MM-DDTHH:mm:ss.SSS[Z]",
|
|
364
|
-
WITHOUT_TIMEZONE: "YYYY-MM-DDTHH:mm:ss.SSS",
|
|
365
|
-
WITHOUT_MILLISECONDS: "YYYY-MM-DDTHH:mm:ss"
|
|
366
|
-
}, j = {
|
|
367
|
-
second: "second",
|
|
368
|
-
minute: "minute",
|
|
369
|
-
hour: "hour",
|
|
370
|
-
day: "day",
|
|
371
|
-
week: "week",
|
|
372
|
-
month: "month",
|
|
373
|
-
quarter: "month",
|
|
374
|
-
// Will be handled specially
|
|
375
|
-
year: "year"
|
|
376
|
-
}, wt = (t) => `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`, At = (t) => `${t.getUTCFullYear()}-${String(t.getUTCMonth() + 1).padStart(2, "0")}-${String(t.getUTCDate()).padStart(2, "0")}`, Mt = (t) => t.toISOString().includes("Z"), F = (t) => Mt(t) ? At(t) : wt(t), Et = (t) => t.startOf("month").month(Math.floor(t.month() / 3) * 3).startOf("month"), $ = (t, e) => {
|
|
377
|
-
const r = K(e);
|
|
378
|
-
return e === "week" ? t.startOf("week") : e === "quarter" ? Et(t) : t.startOf(r);
|
|
379
|
-
}, It = (t, e) => {
|
|
380
|
-
var a, s;
|
|
381
|
-
const r = (a = t.inputs) == null ? void 0 : a.dateBounds;
|
|
382
|
-
if (!r) return;
|
|
383
|
-
if (r.from && r.to)
|
|
384
|
-
return r;
|
|
385
|
-
const n = r.relativeTimeString;
|
|
386
|
-
if (n) {
|
|
387
|
-
const l = (((s = e == null ? void 0 : e.defaults) == null ? void 0 : s.dateRangesOptions) ?? []).find((o) => o.value === n);
|
|
388
|
-
if (l) {
|
|
389
|
-
const o = l.getRange();
|
|
390
|
-
return {
|
|
391
|
-
from: o.from,
|
|
392
|
-
to: o.to,
|
|
393
|
-
relativeTimeString: n
|
|
394
|
-
};
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
}, Ht = (t, e) => {
|
|
398
|
-
const { dimension: r, granularity: n = "day", sortOrder: a = "asc", dateBounds: s, theme: c } = e, l = s || It(r, c);
|
|
399
|
-
if (!t || t.length === 0)
|
|
400
|
-
return t;
|
|
401
|
-
if (!(r != null && r.name))
|
|
402
|
-
throw new Error("dimension.name is required");
|
|
403
|
-
const o = Rt(r.name, n, t), u = t.map((i) => {
|
|
404
|
-
const f = i[o];
|
|
405
|
-
if (typeof f != "string")
|
|
406
|
-
return null;
|
|
407
|
-
const h = b(f);
|
|
408
|
-
return h.isValid() ? { ...i, _parsedDate: h } : null;
|
|
409
|
-
}).filter(
|
|
410
|
-
(i) => i !== null
|
|
411
|
-
);
|
|
412
|
-
if (u.length === 0)
|
|
413
|
-
return console.warn("fillGaps: No valid dates found in data"), t;
|
|
414
|
-
let m, d;
|
|
415
|
-
if (l) {
|
|
416
|
-
const i = l.from instanceof Date ? l.from : new Date(l.from), f = l.to instanceof Date ? l.to : new Date(l.to);
|
|
417
|
-
if (n === "second" || n === "minute" || n === "hour")
|
|
418
|
-
m = b(i), d = b(f);
|
|
419
|
-
else {
|
|
420
|
-
const h = F(i), p = F(f);
|
|
421
|
-
m = b(h), d = b(p);
|
|
422
|
-
}
|
|
423
|
-
m = $(m, n), d = $(d, n);
|
|
424
|
-
} else {
|
|
425
|
-
const i = u[0];
|
|
426
|
-
if (!i)
|
|
427
|
-
return t;
|
|
428
|
-
let f = i._parsedDate, h = i._parsedDate;
|
|
429
|
-
for (let p = 1; p < u.length; p++) {
|
|
430
|
-
const A = u[p];
|
|
431
|
-
if (A) {
|
|
432
|
-
const x = A._parsedDate;
|
|
433
|
-
x.isBefore(f) && (f = x), x.isAfter(h) && (h = x);
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
m = f, d = h;
|
|
437
|
-
}
|
|
438
|
-
const T = [], O = K(n), C = m.startOf(O), k = d.startOf(O);
|
|
439
|
-
if (n === "week") {
|
|
440
|
-
let i = C;
|
|
441
|
-
for (; i.isBefore(k) || i.isSame(k, "day"); )
|
|
442
|
-
T.push(i), i = i.add(7, "day");
|
|
443
|
-
} else {
|
|
444
|
-
let i = C;
|
|
445
|
-
for (; i.isBefore(k) || i.isSame(k, O); )
|
|
446
|
-
T.push(i), n === "quarter" ? i = i.add(3, "month") : i = i.add(1, O);
|
|
447
|
-
}
|
|
448
|
-
const w = /* @__PURE__ */ new Map();
|
|
449
|
-
u.forEach((i) => {
|
|
450
|
-
const f = W(i._parsedDate);
|
|
451
|
-
w.set(f, i);
|
|
452
|
-
});
|
|
453
|
-
const S = [];
|
|
454
|
-
return T.forEach((i) => {
|
|
455
|
-
const f = W(i), h = w.get(f);
|
|
456
|
-
if (h) {
|
|
457
|
-
const p = { ...h };
|
|
458
|
-
delete p._parsedDate, S.push(p);
|
|
459
|
-
} else {
|
|
460
|
-
const p = Bt(t), A = Lt(i, p), x = {
|
|
461
|
-
[o]: A
|
|
462
|
-
}, q = r.name, L = t[0];
|
|
463
|
-
if (L)
|
|
464
|
-
for (const M of Object.keys(L))
|
|
465
|
-
M !== o && (M.startsWith(q) && M !== o ? x[M] = A : x[M] = null);
|
|
466
|
-
S.push(x);
|
|
467
|
-
}
|
|
468
|
-
}), a === "desc" ? S.sort(
|
|
469
|
-
(i, f) => b(f[o]).valueOf() - b(i[o]).valueOf()
|
|
470
|
-
) : S.sort(
|
|
471
|
-
(i, f) => b(i[o]).valueOf() - b(f[o]).valueOf()
|
|
472
|
-
), S;
|
|
473
|
-
}, W = (t) => t.format("YYYY-MM-DDTHH:mm:ss"), Rt = (t, e, r) => {
|
|
474
|
-
if (!r || r.length === 0) return t;
|
|
475
|
-
const n = r[0];
|
|
476
|
-
if (!n) return t;
|
|
477
|
-
const a = `${t}.${e}`;
|
|
478
|
-
return a in n ? a : t;
|
|
479
|
-
}, Bt = (t) => {
|
|
480
|
-
if (!(t != null && t.length)) return y.DEFAULT;
|
|
481
|
-
const e = t[0];
|
|
482
|
-
if (!e) return y.DEFAULT;
|
|
483
|
-
for (const r of Object.values(e))
|
|
484
|
-
if (typeof r == "string" && r.includes("T") && r.includes(":"))
|
|
485
|
-
return r.endsWith("Z") ? y.WITH_TIMEZONE : r.includes(".") ? y.WITHOUT_TIMEZONE : y.WITHOUT_MILLISECONDS;
|
|
486
|
-
return y.DEFAULT;
|
|
487
|
-
}, Lt = (t, e) => e.includes("[Z]") ? t.format(y.WITH_TIMEZONE) : e.includes(".SSS") ? t.format(y.WITHOUT_TIMEZONE) : t.format(y.WITHOUT_MILLISECONDS), K = (t) => j[t] || j.day, Pt = (t, e) => {
|
|
488
|
-
const r = ht(), n = dt(() => {
|
|
489
|
-
var u, m;
|
|
490
|
-
const a = t.data;
|
|
491
|
-
if (e.nativeType !== "time" || !a || a.length === 0)
|
|
492
|
-
return a;
|
|
493
|
-
const s = ((u = e.inputs) == null ? void 0 : u.granularity) || Yt(a, e);
|
|
494
|
-
if (!s || !(((m = e.inputs) == null ? void 0 : m.dateBounds) ?? Nt(a, e, s)))
|
|
495
|
-
return a;
|
|
496
|
-
const o = {
|
|
497
|
-
dimension: e,
|
|
498
|
-
granularity: s,
|
|
499
|
-
sortOrder: "asc",
|
|
500
|
-
theme: r
|
|
501
|
-
};
|
|
502
|
-
try {
|
|
503
|
-
return Ht(a, o);
|
|
504
|
-
} catch (d) {
|
|
505
|
-
return console.warn("Failed to apply fillGaps to chart data:", d), a;
|
|
506
|
-
}
|
|
507
|
-
}, [t.data, e, r]);
|
|
508
|
-
return {
|
|
509
|
-
...t,
|
|
510
|
-
data: n
|
|
511
|
-
};
|
|
512
|
-
}, Nt = (t, e, r) => {
|
|
513
|
-
if (!t || t.length < 2)
|
|
514
|
-
return !1;
|
|
515
|
-
const n = e.name, a = t.map((c) => c[n]).filter(Boolean).map((c) => new Date(c)).filter((c) => !isNaN(c.getTime())).sort((c, l) => c.getTime() - l.getTime());
|
|
516
|
-
if (a.length < 2)
|
|
517
|
-
return !1;
|
|
518
|
-
const s = Ut(r);
|
|
519
|
-
for (let c = 1; c < a.length; c++) {
|
|
520
|
-
const l = a[c], o = a[c - 1];
|
|
521
|
-
if (l && o && l.getTime() - o.getTime() > s * 1.5)
|
|
522
|
-
return !0;
|
|
523
|
-
}
|
|
524
|
-
return !1;
|
|
525
|
-
}, Yt = (t, e) => {
|
|
526
|
-
if (!t || t.length === 0) return null;
|
|
527
|
-
const r = t[0];
|
|
528
|
-
if (!r) return null;
|
|
529
|
-
const n = e.name, a = Object.keys(r).filter(
|
|
530
|
-
(s) => s.startsWith(n) && s !== n
|
|
531
|
-
);
|
|
532
|
-
for (const s of a) {
|
|
533
|
-
if (s.includes(".second")) return "second";
|
|
534
|
-
if (s.includes(".minute")) return "minute";
|
|
535
|
-
if (s.includes(".hour")) return "hour";
|
|
536
|
-
if (s.includes(".day")) return "day";
|
|
537
|
-
if (s.includes(".week")) return "week";
|
|
538
|
-
if (s.includes(".month")) return "month";
|
|
539
|
-
if (s.includes(".quarter")) return "quarter";
|
|
540
|
-
if (s.includes(".year")) return "year";
|
|
541
|
-
}
|
|
542
|
-
return null;
|
|
543
|
-
}, V = 1e3, Z = 60 * V, P = 60 * Z, E = 24 * P, D = {
|
|
544
|
-
SECOND: V,
|
|
545
|
-
MINUTE: Z,
|
|
546
|
-
HOUR: P,
|
|
547
|
-
DAY: E,
|
|
548
|
-
WEEK: 7 * E,
|
|
549
|
-
MONTH: 30 * E,
|
|
550
|
-
// Approximate
|
|
551
|
-
QUARTER: 90 * E,
|
|
552
|
-
// Approximate
|
|
553
|
-
YEAR: 365 * E
|
|
554
|
-
// Approximate
|
|
555
|
-
}, Ut = (t) => {
|
|
556
|
-
switch (t) {
|
|
557
|
-
case "second":
|
|
558
|
-
return D.SECOND;
|
|
559
|
-
case "minute":
|
|
560
|
-
return D.MINUTE;
|
|
561
|
-
case "hour":
|
|
562
|
-
return D.HOUR;
|
|
563
|
-
case "day":
|
|
564
|
-
return D.DAY;
|
|
565
|
-
case "week":
|
|
566
|
-
return D.WEEK;
|
|
567
|
-
case "month":
|
|
568
|
-
return D.MONTH;
|
|
569
|
-
case "quarter":
|
|
570
|
-
return D.QUARTER;
|
|
571
|
-
case "year":
|
|
572
|
-
return D.YEAR;
|
|
573
|
-
default:
|
|
574
|
-
return D.DAY;
|
|
575
|
-
}
|
|
576
|
-
};
|
|
577
|
-
export {
|
|
578
|
-
zt as B,
|
|
579
|
-
Zt as a,
|
|
580
|
-
Kt as b,
|
|
581
|
-
Vt as g,
|
|
582
|
-
Pt as u
|
|
583
|
-
};
|
|
584
|
-
//# sourceMappingURL=charts.fillGaps.hooks-BvYoaRpE.js.map
|