@hybridcore/ui 1.6.22 → 1.6.23
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/components/charts/column-line-mix/logic.js +58 -62
- package/dist/components/charts/forecast-cone/index.js +58 -45
- package/dist/components/charts/forecast-cone/logic.js +347 -244
- package/dist/components/charts/logaritmic-scale/logic.js +257 -91
- package/dist/main.d.ts +17 -7
- package/package.json +1 -1
- package/dist/Scrollbar-CTI7_8Qw.js +0 -171
|
@@ -1,45 +1,44 @@
|
|
|
1
1
|
import { R as M, A as O } from "../../../AnimatedTheme-ktdO3Bel.js";
|
|
2
2
|
import { useThemeProps as B, useTheme as E } from "@mui/material";
|
|
3
3
|
import P from "lodash";
|
|
4
|
-
import { useId as V, useRef as
|
|
4
|
+
import { useId as V, useRef as G, useEffect as N } from "react";
|
|
5
5
|
import { humanizeLabel as C } from "../_common/format.js";
|
|
6
|
-
import { attachCombinedAxisTooltip as
|
|
7
|
-
import { colorSetFromPalette as
|
|
8
|
-
import { c as l, p as U, a as
|
|
6
|
+
import { attachCombinedAxisTooltip as W } from "../_common/tooltip.js";
|
|
7
|
+
import { colorSetFromPalette as q, applyDateAxisLabelFormat as z, applyValueFormat as H } from "../_common/utils.js";
|
|
8
|
+
import { c as l, p as U, a as D } from "../../../Entity-BJCuhdq_.js";
|
|
9
9
|
import { X as _, V as $ } from "../../../AxisRenderer-BCQoUJw6.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { C as K } from "../../../
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { L as oe } from "../../../Legend-CFvQiIfn.js";
|
|
10
|
+
import { A as b, a as j } from "../../../AxisRendererY-AXWvGU6r.js";
|
|
11
|
+
import { C as J } from "../../../CategoryAxis-B6NqW8qd.js";
|
|
12
|
+
import { C as K } from "../../../ColumnSeries-CtRTsn-E.js";
|
|
13
|
+
import { D as X, G as Q } from "../../../GaplessDateAxis-B2g2jgSG.js";
|
|
14
|
+
import { L as Z } from "../../../LineSeries-D_IL2qGF.js";
|
|
15
|
+
import { B as ee } from "../../../Bullet-Djj7Vs9T.js";
|
|
16
|
+
import { C as te } from "../../../Circle-BnfBNKBD.js";
|
|
17
|
+
import { X as re } from "../../../XYCursor-CVUSpqb9.js";
|
|
18
|
+
import { L as ae } from "../../../Legend-CFvQiIfn.js";
|
|
20
19
|
import { D as se } from "../../../DateAxis-DEXKps1S.js";
|
|
21
|
-
const
|
|
20
|
+
const Xe = (L) => {
|
|
22
21
|
const f = B({ props: L, name: "HCColumnLineMix" }), {
|
|
23
22
|
dimensions: t,
|
|
24
23
|
values: n,
|
|
25
24
|
data: p,
|
|
26
25
|
initDelay: Y = 0,
|
|
27
|
-
baseInterval:
|
|
28
|
-
colors:
|
|
26
|
+
baseInterval: x,
|
|
27
|
+
colors: h,
|
|
29
28
|
skipEmptyDates: A = !1,
|
|
30
|
-
sx:
|
|
31
|
-
...
|
|
32
|
-
} = f,
|
|
33
|
-
|
|
29
|
+
sx: T,
|
|
30
|
+
...R
|
|
31
|
+
} = f, o = E(), g = `hc-column-line-mix-${V().replace(/:/g, "")}`, d = G(null), y = t.length < 1 ? "ColumnLineMix requires at least 1 dimension" : null;
|
|
32
|
+
N(() => {
|
|
34
33
|
if (y) return;
|
|
35
34
|
let c;
|
|
36
35
|
return c = setTimeout(() => {
|
|
37
36
|
var w, F, v, k;
|
|
38
37
|
const e = M.new(g);
|
|
39
38
|
d.current = e, e.setThemes([O.new(e)]), e.interfaceColors.setAll({
|
|
40
|
-
text: l(
|
|
41
|
-
grid: l(
|
|
42
|
-
stroke: l(
|
|
39
|
+
text: l(o.palette.text.primary),
|
|
40
|
+
grid: l(o.palette.divider),
|
|
41
|
+
stroke: l(o.palette.divider)
|
|
43
42
|
});
|
|
44
43
|
const r = e.container.children.push(
|
|
45
44
|
_.new(e, {
|
|
@@ -52,33 +51,30 @@ const Ye = (L) => {
|
|
|
52
51
|
layout: e.verticalLayout
|
|
53
52
|
})
|
|
54
53
|
);
|
|
55
|
-
r.set("colors",
|
|
56
|
-
"scrollbarX",
|
|
57
|
-
j.new(e, { orientation: "horizontal" })
|
|
58
|
-
);
|
|
54
|
+
r.set("colors", q(e, h)), r.get("colors", {}).set("step", 3);
|
|
59
55
|
let a, m = p;
|
|
60
56
|
if (t[0].type === "date") {
|
|
61
57
|
m = P.orderBy(p, [t[0].value]);
|
|
62
|
-
const i = A ?
|
|
58
|
+
const i = A ? Q : se;
|
|
63
59
|
a = r.xAxes.push(
|
|
64
60
|
i.new(e, {
|
|
65
61
|
maxDeviation: 0.1,
|
|
66
62
|
groupData: !1,
|
|
67
|
-
baseInterval:
|
|
68
|
-
renderer:
|
|
63
|
+
baseInterval: x || { timeUnit: "day", count: 1 },
|
|
64
|
+
renderer: b.new(e, {})
|
|
69
65
|
})
|
|
70
66
|
), (w = a.get("renderer")) == null || w.grid.template.setAll({
|
|
71
|
-
stroke: l(
|
|
67
|
+
stroke: l(o.palette.divider),
|
|
72
68
|
strokeOpacity: 1
|
|
73
|
-
}),
|
|
69
|
+
}), z(a, t[0]);
|
|
74
70
|
} else
|
|
75
71
|
a = r.xAxes.push(
|
|
76
|
-
|
|
72
|
+
J.new(e, {
|
|
77
73
|
categoryField: t[0].value,
|
|
78
|
-
renderer:
|
|
74
|
+
renderer: b.new(e, {})
|
|
79
75
|
})
|
|
80
76
|
), (F = a.get("renderer")) == null || F.grid.template.setAll({
|
|
81
|
-
stroke: l(
|
|
77
|
+
stroke: l(o.palette.divider),
|
|
82
78
|
strokeOpacity: 1
|
|
83
79
|
}), e.numberFormatter.setAll({
|
|
84
80
|
numberFormat: "#",
|
|
@@ -88,16 +84,16 @@ const Ye = (L) => {
|
|
|
88
84
|
$.new(e, {
|
|
89
85
|
min: 0,
|
|
90
86
|
extraMax: 0.1,
|
|
91
|
-
renderer:
|
|
87
|
+
renderer: j.new(e, { strokeOpacity: 0.1 })
|
|
92
88
|
})
|
|
93
89
|
);
|
|
94
90
|
(v = u.get("renderer")) == null || v.grid.template.setAll({
|
|
95
|
-
stroke: l(
|
|
91
|
+
stroke: l(o.palette.divider),
|
|
96
92
|
strokeOpacity: 1
|
|
97
93
|
}), n.forEach((i, I) => {
|
|
98
94
|
if (I === 0) {
|
|
99
|
-
const
|
|
100
|
-
|
|
95
|
+
const s = r.series.push(
|
|
96
|
+
K.new(e, {
|
|
101
97
|
name: i.label ?? C(i.name),
|
|
102
98
|
xAxis: a,
|
|
103
99
|
yAxis: u,
|
|
@@ -105,16 +101,16 @@ const Ye = (L) => {
|
|
|
105
101
|
...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value }
|
|
106
102
|
})
|
|
107
103
|
);
|
|
108
|
-
|
|
104
|
+
s.columns.template.setAll({
|
|
109
105
|
tooltipY: U(10),
|
|
110
106
|
templateField: "columnSettings"
|
|
111
|
-
}), t[0].type === "date" && (
|
|
107
|
+
}), t[0].type === "date" && (s.data.processor = X.new(e, {
|
|
112
108
|
dateFormat: "i",
|
|
113
109
|
dateFields: [t[0].value]
|
|
114
|
-
})),
|
|
110
|
+
})), s.data.setAll(m), s.appear();
|
|
115
111
|
} else {
|
|
116
|
-
const
|
|
117
|
-
|
|
112
|
+
const s = r.series.push(
|
|
113
|
+
Z.new(e, {
|
|
118
114
|
name: i.label ?? C(i.name),
|
|
119
115
|
xAxis: a,
|
|
120
116
|
yAxis: u,
|
|
@@ -122,17 +118,17 @@ const Ye = (L) => {
|
|
|
122
118
|
...t[0].type === "date" ? { valueXField: t[0].value } : { categoryXField: t[0].value }
|
|
123
119
|
})
|
|
124
120
|
);
|
|
125
|
-
|
|
121
|
+
s.strokes.template.setAll({
|
|
126
122
|
strokeWidth: 3,
|
|
127
123
|
templateField: "strokeSettings"
|
|
128
|
-
}), t[0].type === "date" && (
|
|
124
|
+
}), t[0].type === "date" && (s.data.processor = X.new(e, {
|
|
129
125
|
dateFormat: "i",
|
|
130
126
|
dateFields: [t[0].value]
|
|
131
|
-
})),
|
|
132
|
-
return
|
|
133
|
-
sprite:
|
|
127
|
+
})), s.data.setAll(m), s.bullets.push(function() {
|
|
128
|
+
return ee.new(e, {
|
|
129
|
+
sprite: te.new(e, {
|
|
134
130
|
strokeWidth: 3,
|
|
135
|
-
stroke:
|
|
131
|
+
stroke: s.get("stroke"),
|
|
136
132
|
radius: 5,
|
|
137
133
|
fill: e.interfaceColors.get("background")
|
|
138
134
|
})
|
|
@@ -141,29 +137,29 @@ const Ye = (L) => {
|
|
|
141
137
|
}
|
|
142
138
|
}), r.set(
|
|
143
139
|
"cursor",
|
|
144
|
-
|
|
145
|
-
).lineY.set("visible", !1),
|
|
140
|
+
re.new(e, { xAxis: a, behavior: "none" })
|
|
141
|
+
).lineY.set("visible", !1), W({
|
|
146
142
|
root: e,
|
|
147
143
|
chart: r,
|
|
148
144
|
xAxis: a,
|
|
149
|
-
theme:
|
|
145
|
+
theme: o,
|
|
150
146
|
isDateAxis: t[0].type === "date",
|
|
151
|
-
baseInterval:
|
|
147
|
+
baseInterval: x,
|
|
152
148
|
follow: !0
|
|
153
149
|
}), r.children.push(
|
|
154
|
-
|
|
155
|
-
centerX:
|
|
156
|
-
x:
|
|
150
|
+
ae.new(e, {
|
|
151
|
+
centerX: D,
|
|
152
|
+
x: D
|
|
157
153
|
})
|
|
158
154
|
).data.setAll(r.series.values), H(e, (k = n == null ? void 0 : n[0]) == null ? void 0 : k.format), r.appear(1e3, 100);
|
|
159
155
|
}, Y), () => {
|
|
160
156
|
var e;
|
|
161
157
|
c && clearTimeout(c), (e = d.current) == null || e.dispose(), d.current = null;
|
|
162
158
|
};
|
|
163
|
-
}, [p, t, n,
|
|
164
|
-
const
|
|
165
|
-
return { chartId: g, ownerState:
|
|
159
|
+
}, [p, t, n, o.palette.mode, h, A]);
|
|
160
|
+
const S = { ...f };
|
|
161
|
+
return { chartId: g, ownerState: S, sx: T, error: y, other: R };
|
|
166
162
|
};
|
|
167
163
|
export {
|
|
168
|
-
|
|
164
|
+
Xe as useColumnLineMixLogic
|
|
169
165
|
};
|
|
@@ -1,47 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { i as
|
|
3
|
-
import { r as
|
|
4
|
-
import { IconButton as
|
|
5
|
-
import { useForecastConeChartLogic as
|
|
6
|
-
import { ForecastConeChartRoot as
|
|
7
|
-
var
|
|
8
|
-
Object.defineProperty(
|
|
1
|
+
import h, { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { i as u } from "../../../styled-Ckq8ALHh.js";
|
|
3
|
+
import { r as f } from "../../../createSvgIcon-jKAqRXE2.js";
|
|
4
|
+
import { IconButton as d, Typography as c } from "@mui/material";
|
|
5
|
+
import { useForecastConeChartLogic as R } from "./logic.js";
|
|
6
|
+
import { ForecastConeChartRoot as $, ForecastConeChartCanvas as S, ForecastConeChartPager as F } from "./styled.js";
|
|
7
|
+
var i = {}, L = u;
|
|
8
|
+
Object.defineProperty(i, "__esModule", {
|
|
9
9
|
value: !0
|
|
10
10
|
});
|
|
11
|
-
var
|
|
12
|
-
|
|
11
|
+
var v = i.default = void 0, M = L(f()), q = h;
|
|
12
|
+
v = i.default = (0, M.default)(/* @__PURE__ */ (0, q.jsx)("path", {
|
|
13
13
|
d: "M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"
|
|
14
14
|
}), "ChevronLeft");
|
|
15
|
-
var
|
|
16
|
-
Object.defineProperty(
|
|
15
|
+
var a = {}, w = u;
|
|
16
|
+
Object.defineProperty(a, "__esModule", {
|
|
17
17
|
value: !0
|
|
18
18
|
});
|
|
19
|
-
var
|
|
20
|
-
|
|
19
|
+
var p = a.default = void 0, O = w(f()), P = h;
|
|
20
|
+
p = a.default = (0, O.default)(/* @__PURE__ */ (0, P.jsx)("path", {
|
|
21
21
|
d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
|
|
22
22
|
}), "ChevronRight");
|
|
23
|
-
const
|
|
23
|
+
const A = (g) => {
|
|
24
24
|
const {
|
|
25
|
-
chartDivRef:
|
|
26
|
-
data:
|
|
27
|
-
chartId:
|
|
25
|
+
chartDivRef: m,
|
|
26
|
+
data: C,
|
|
27
|
+
chartId: x,
|
|
28
28
|
loading: n,
|
|
29
|
-
emptyMessage:
|
|
30
|
-
isMulti:
|
|
29
|
+
emptyMessage: y,
|
|
30
|
+
isMulti: _,
|
|
31
31
|
origins: r,
|
|
32
|
-
selectedOriginIndex:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
selectedOriginIndex: o,
|
|
33
|
+
shownOriginIndex: l,
|
|
34
|
+
isPreviewing: b,
|
|
35
|
+
onOriginChange: s,
|
|
36
|
+
sx: I,
|
|
37
|
+
other: j,
|
|
38
|
+
ownerState: z
|
|
39
|
+
} = R(g);
|
|
40
|
+
return /* @__PURE__ */ t($, { ownerState: z, sx: I, ...j, children: [
|
|
41
|
+
/* @__PURE__ */ t(S, { children: [
|
|
40
42
|
/* @__PURE__ */ e(
|
|
41
43
|
"div",
|
|
42
44
|
{
|
|
43
|
-
ref:
|
|
44
|
-
id:
|
|
45
|
+
ref: m,
|
|
46
|
+
id: x,
|
|
45
47
|
style: { width: "100%", height: "100%" }
|
|
46
48
|
}
|
|
47
49
|
),
|
|
@@ -62,7 +64,7 @@ const N = (p) => {
|
|
|
62
64
|
children: "Loading..."
|
|
63
65
|
}
|
|
64
66
|
),
|
|
65
|
-
!n &&
|
|
67
|
+
!n && C.length === 0 && /* @__PURE__ */ e(
|
|
66
68
|
"div",
|
|
67
69
|
{
|
|
68
70
|
style: {
|
|
@@ -75,38 +77,49 @@ const N = (p) => {
|
|
|
75
77
|
fontSize: "1.1rem",
|
|
76
78
|
zIndex: 10
|
|
77
79
|
},
|
|
78
|
-
children:
|
|
80
|
+
children: y
|
|
79
81
|
}
|
|
80
82
|
)
|
|
81
83
|
] }),
|
|
82
|
-
|
|
84
|
+
_ && r.length > 1 && /* @__PURE__ */ t(F, { children: [
|
|
83
85
|
/* @__PURE__ */ e(
|
|
84
|
-
|
|
86
|
+
d,
|
|
85
87
|
{
|
|
86
88
|
size: "small",
|
|
87
89
|
"aria-label": "Previous forecast",
|
|
88
|
-
disabled:
|
|
89
|
-
onClick: () =>
|
|
90
|
-
children: /* @__PURE__ */ e(
|
|
90
|
+
disabled: o <= 0,
|
|
91
|
+
onClick: () => s(o - 1),
|
|
92
|
+
children: /* @__PURE__ */ e(v, { fontSize: "small" })
|
|
91
93
|
}
|
|
92
94
|
),
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
`Forecast origin: ${r[
|
|
95
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ t(c, { variant: "caption", color: "text.secondary", component: "div", children: [
|
|
96
|
+
`Forecast origin: ${r[l] ?? ""}`,
|
|
97
|
+
/* @__PURE__ */ t(
|
|
98
|
+
c,
|
|
99
|
+
{
|
|
100
|
+
variant: "caption",
|
|
101
|
+
color: "text.disabled",
|
|
102
|
+
component: "span",
|
|
103
|
+
children: [
|
|
104
|
+
` (${l + 1} / ${r.length})`,
|
|
105
|
+
b ? " · preview" : ""
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
)
|
|
96
109
|
] }),
|
|
97
110
|
/* @__PURE__ */ e(
|
|
98
|
-
|
|
111
|
+
d,
|
|
99
112
|
{
|
|
100
113
|
size: "small",
|
|
101
114
|
"aria-label": "Next forecast",
|
|
102
|
-
disabled:
|
|
103
|
-
onClick: () =>
|
|
104
|
-
children: /* @__PURE__ */ e(
|
|
115
|
+
disabled: o >= r.length - 1,
|
|
116
|
+
onClick: () => s(o + 1),
|
|
117
|
+
children: /* @__PURE__ */ e(p, { fontSize: "small" })
|
|
105
118
|
}
|
|
106
119
|
)
|
|
107
120
|
] })
|
|
108
121
|
] });
|
|
109
122
|
};
|
|
110
123
|
export {
|
|
111
|
-
|
|
124
|
+
A as ForecastConeChart
|
|
112
125
|
};
|