@hybridcore/ui 1.6.14 → 1.6.16
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/_common/tooltip.js +44 -35
- package/dist/components/charts/chart-wrapper/index.js +44 -43
- package/dist/components/charts/donut-chart/logic.js +53 -40
- package/dist/components/charts/xy-chart/logic.js +135 -134
- package/dist/components/instance-form/components/composite-matrix/components/json-editor/index.js +8737 -8722
- package/dist/main.d.ts +9 -1
- package/package.json +1 -1
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { R as
|
|
2
|
-
import { useThemeProps as
|
|
3
|
-
import
|
|
4
|
-
import { useId as
|
|
5
|
-
import { humanizeLabel as
|
|
6
|
-
import { attachCombinedAxisTooltip as
|
|
7
|
-
import { colorSetFromPalette as
|
|
8
|
-
import { c, a as
|
|
9
|
-
import { X as
|
|
10
|
-
import { L as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { G as
|
|
16
|
-
import { D as
|
|
17
|
-
import { C as
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
sx:
|
|
29
|
-
...
|
|
30
|
-
} =
|
|
31
|
-
|
|
32
|
-
if (
|
|
33
|
-
let
|
|
34
|
-
return
|
|
35
|
-
var
|
|
36
|
-
const e =
|
|
37
|
-
|
|
38
|
-
text:
|
|
39
|
-
grid:
|
|
40
|
-
stroke:
|
|
1
|
+
import { R as K, A as Q } from "../../../AnimatedTheme-ktdO3Bel.js";
|
|
2
|
+
import { useThemeProps as Z, useTheme as ee } from "@mui/material";
|
|
3
|
+
import y from "lodash";
|
|
4
|
+
import { useId as te, useRef as re, useEffect as oe } from "react";
|
|
5
|
+
import { humanizeLabel as E } from "../_common/format.js";
|
|
6
|
+
import { attachCombinedAxisTooltip as ae } from "../_common/tooltip.js";
|
|
7
|
+
import { colorSetFromPalette as se, applyValueFormat as ie } from "../_common/utils.js";
|
|
8
|
+
import { c as p, a as S, p as z } from "../../../Entity-BJCuhdq_.js";
|
|
9
|
+
import { X as ne, V as le } from "../../../AxisRenderer-BCQoUJw6.js";
|
|
10
|
+
import { L as ce } from "../../../Legend-CFvQiIfn.js";
|
|
11
|
+
import { C as me } from "../../../CategoryAxis-B6NqW8qd.js";
|
|
12
|
+
import { T as pe, R as de } from "../../../Tooltip-vyZRZWih.js";
|
|
13
|
+
import { X as ue } from "../../../XYCursor-CVUSpqb9.js";
|
|
14
|
+
import { a as B, A as G } from "../../../AxisRendererY-AXWvGU6r.js";
|
|
15
|
+
import { G as fe, D as he } from "../../../GaplessDateAxis-B2g2jgSG.js";
|
|
16
|
+
import { D as xe } from "../../../DateAxis-DEXKps1S.js";
|
|
17
|
+
import { C as Ae } from "../../../ColumnSeries-CtRTsn-E.js";
|
|
18
|
+
const ze = (I) => {
|
|
19
|
+
const g = Z({ props: I, name: "HCXYChart" }), {
|
|
20
|
+
dimensions: l,
|
|
21
|
+
values: c,
|
|
22
|
+
data: f,
|
|
23
|
+
initDelay: V = 0,
|
|
24
|
+
baseInterval: v,
|
|
25
|
+
colors: w,
|
|
26
|
+
skipEmptyDates: b = !1,
|
|
27
|
+
orientation: D = "vertical",
|
|
28
|
+
sx: W,
|
|
29
|
+
...N
|
|
30
|
+
} = g, n = ee(), X = `hc-xy-chart-${te().replace(/:/g, "")}`, h = re(null), C = l.length < 1 ? "Missing dimensions config!" : null;
|
|
31
|
+
oe(() => {
|
|
32
|
+
if (C) return;
|
|
33
|
+
let x;
|
|
34
|
+
return x = setTimeout(() => {
|
|
35
|
+
var k, L, O;
|
|
36
|
+
const t = D === "horizontal", e = K.new(X);
|
|
37
|
+
h.current = e, e.setThemes([Q.new(e)]), e.interfaceColors.setAll({
|
|
38
|
+
text: p(n.palette.text.primary),
|
|
39
|
+
grid: p(n.palette.divider),
|
|
40
|
+
stroke: p(n.palette.divider)
|
|
41
41
|
});
|
|
42
|
-
const
|
|
43
|
-
|
|
42
|
+
const a = e.container.children.push(
|
|
43
|
+
ne.new(e, {
|
|
44
44
|
panX: !1,
|
|
45
45
|
panY: !1,
|
|
46
46
|
wheelX: "none",
|
|
@@ -50,137 +50,138 @@ const Fe = (R) => {
|
|
|
50
50
|
layout: e.verticalLayout
|
|
51
51
|
})
|
|
52
52
|
);
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
centerX:
|
|
57
|
-
x
|
|
53
|
+
a.set("colors", se(e, w));
|
|
54
|
+
const q = a.children.push(
|
|
55
|
+
ce.new(e, {
|
|
56
|
+
centerX: S,
|
|
57
|
+
x: S
|
|
58
58
|
})
|
|
59
|
-
),
|
|
60
|
-
let o,
|
|
61
|
-
if (
|
|
62
|
-
const
|
|
63
|
-
o =
|
|
64
|
-
|
|
59
|
+
), s = l[0], R = t ? B : G, H = t ? G : B, Y = t ? a.yAxes : a.xAxes, M = t ? a.xAxes : a.yAxes;
|
|
60
|
+
let o, d = f;
|
|
61
|
+
if (s.type === "date") {
|
|
62
|
+
const r = b ? fe : xe;
|
|
63
|
+
o = Y.push(
|
|
64
|
+
r.new(e, {
|
|
65
65
|
maxDeviation: 0,
|
|
66
|
-
baseInterval:
|
|
67
|
-
renderer:
|
|
66
|
+
baseInterval: v || { timeUnit: "day", count: 1 },
|
|
67
|
+
renderer: R.new(e, { minGridDistance: 60 })
|
|
68
68
|
})
|
|
69
|
-
),
|
|
69
|
+
), d = y.orderBy(f, [s.value]);
|
|
70
70
|
} else {
|
|
71
|
-
const
|
|
71
|
+
const r = R.new(e, {
|
|
72
72
|
cellStartLocation: 0.1,
|
|
73
73
|
cellEndLocation: 0.9,
|
|
74
74
|
minGridDistance: 30
|
|
75
75
|
});
|
|
76
|
-
o =
|
|
77
|
-
|
|
78
|
-
categoryField:
|
|
79
|
-
renderer:
|
|
76
|
+
o = Y.push(
|
|
77
|
+
me.new(e, {
|
|
78
|
+
categoryField: s.value,
|
|
79
|
+
renderer: r
|
|
80
80
|
})
|
|
81
|
-
),
|
|
81
|
+
), r.grid.template.setAll({ location: 1 }), o.labelsContainer.set(
|
|
82
82
|
"tooltip",
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
pe.new(e, {
|
|
84
|
+
pointerOrientation: t ? "right" : "down"
|
|
85
|
+
})
|
|
86
|
+
), r.labels.template.setAll({
|
|
85
87
|
oversizedBehavior: "truncate",
|
|
86
88
|
maxWidth: 150,
|
|
87
89
|
tooltipText: "{category}"
|
|
88
|
-
}),
|
|
89
|
-
|
|
90
|
+
}), r.labels.template.setup = function(i) {
|
|
91
|
+
i.set(
|
|
90
92
|
"background",
|
|
91
|
-
|
|
92
|
-
fill:
|
|
93
|
+
de.new(e, {
|
|
94
|
+
fill: p(0),
|
|
93
95
|
fillOpacity: 0
|
|
94
96
|
})
|
|
95
97
|
);
|
|
96
|
-
}, o.onPrivate("cellWidth", function(
|
|
97
|
-
|
|
98
|
+
}, t || o.onPrivate("cellWidth", function(i) {
|
|
99
|
+
r.labels.template.set("maxWidth", i);
|
|
98
100
|
}), e.numberFormatter.setAll({
|
|
99
101
|
numberFormat: "#",
|
|
100
|
-
numericFields: ["valueX"]
|
|
101
|
-
})
|
|
102
|
+
numericFields: [t ? "valueY" : "valueX"]
|
|
103
|
+
});
|
|
104
|
+
const m = l.length > 1 ? y.uniqBy(d, s.value) : d;
|
|
105
|
+
o.data.setAll(m);
|
|
102
106
|
}
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
renderer:
|
|
107
|
+
const A = M.push(
|
|
108
|
+
le.new(e, {
|
|
109
|
+
renderer: H.new(e, { strokeOpacity: 0.1 }),
|
|
110
|
+
// Horizontal bars must grow from a zero baseline; otherwise the auto
|
|
111
|
+
// min crops the axis (e.g. starting at 100) and distorts bar lengths.
|
|
112
|
+
...t ? { min: 0 } : {}
|
|
106
113
|
})
|
|
107
|
-
);
|
|
108
|
-
(
|
|
109
|
-
stroke:
|
|
114
|
+
), U = t ? A : o, _ = t ? o : A;
|
|
115
|
+
(k = o.get("renderer")) == null || k.grid.template.setAll({
|
|
116
|
+
stroke: p(n.palette.divider),
|
|
110
117
|
strokeOpacity: 1
|
|
111
|
-
}), (
|
|
112
|
-
stroke:
|
|
118
|
+
}), (L = A.get("renderer")) == null || L.grid.template.setAll({
|
|
119
|
+
stroke: p(n.palette.divider),
|
|
113
120
|
strokeOpacity: 1
|
|
114
121
|
});
|
|
115
|
-
function
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
name:
|
|
119
|
-
xAxis:
|
|
120
|
-
yAxis:
|
|
121
|
-
|
|
122
|
-
...
|
|
122
|
+
function F(r, m, i, P) {
|
|
123
|
+
const $ = t ? { valueXField: P } : { valueYField: P }, J = s.type === "date" ? t ? { valueYField: i } : { valueXField: i } : t ? { categoryYField: i } : { categoryXField: i }, u = a.series.push(
|
|
124
|
+
Ae.new(e, {
|
|
125
|
+
name: r,
|
|
126
|
+
xAxis: U,
|
|
127
|
+
yAxis: _,
|
|
128
|
+
...$,
|
|
129
|
+
...J
|
|
123
130
|
})
|
|
124
131
|
);
|
|
125
|
-
|
|
126
|
-
width:
|
|
132
|
+
u.columns.template.setAll({
|
|
133
|
+
...t ? { height: z(90) } : { width: z(90) },
|
|
127
134
|
strokeOpacity: 0
|
|
128
|
-
}),
|
|
135
|
+
}), s.type === "date" && (u.data.processor = he.new(e, {
|
|
129
136
|
dateFormat: "i",
|
|
130
|
-
dateFields: [
|
|
131
|
-
})),
|
|
132
|
-
return le.new(e, {
|
|
133
|
-
locationY: 0,
|
|
134
|
-
sprite: re.new(e, {
|
|
135
|
-
text: "{valueY}",
|
|
136
|
-
fill: e.interfaceColors.get("alternativeText"),
|
|
137
|
-
centerY: 0,
|
|
138
|
-
centerX: x,
|
|
139
|
-
populateText: !0
|
|
140
|
-
})
|
|
141
|
-
});
|
|
142
|
-
}), G.data.push(l);
|
|
137
|
+
dateFields: [i]
|
|
138
|
+
})), u.data.setAll(m), u.appear(), q.data.push(u);
|
|
143
139
|
}
|
|
144
|
-
if (
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
140
|
+
if (l.length === 1)
|
|
141
|
+
c.forEach((r) => {
|
|
142
|
+
F(
|
|
143
|
+
r.label ?? E(r.name),
|
|
144
|
+
d,
|
|
145
|
+
s.value,
|
|
146
|
+
r.dataFieldName
|
|
151
147
|
);
|
|
152
148
|
});
|
|
153
149
|
else {
|
|
154
|
-
const
|
|
155
|
-
Object.keys(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
150
|
+
const r = y.groupBy(d, l[1].value);
|
|
151
|
+
Object.keys(r).forEach((m) => {
|
|
152
|
+
F(
|
|
153
|
+
E(m),
|
|
154
|
+
r[m],
|
|
155
|
+
s.value,
|
|
156
|
+
c[0].dataFieldName
|
|
161
157
|
);
|
|
162
158
|
});
|
|
163
159
|
}
|
|
164
|
-
|
|
160
|
+
const T = a.set(
|
|
165
161
|
"cursor",
|
|
166
|
-
|
|
167
|
-
|
|
162
|
+
ue.new(
|
|
163
|
+
e,
|
|
164
|
+
t ? { yAxis: o, behavior: "none" } : { xAxis: o, behavior: "none" }
|
|
165
|
+
)
|
|
166
|
+
);
|
|
167
|
+
t ? T.lineX.set("visible", !1) : T.lineY.set("visible", !1), ae({
|
|
168
168
|
root: e,
|
|
169
|
-
chart:
|
|
169
|
+
chart: a,
|
|
170
170
|
xAxis: o,
|
|
171
|
-
theme:
|
|
172
|
-
isDateAxis:
|
|
173
|
-
baseInterval:
|
|
174
|
-
follow: !0
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
171
|
+
theme: n,
|
|
172
|
+
isDateAxis: s.type === "date",
|
|
173
|
+
baseInterval: v,
|
|
174
|
+
follow: !0,
|
|
175
|
+
horizontal: t
|
|
176
|
+
}), ie(e, (O = c == null ? void 0 : c[0]) == null ? void 0 : O.format), a.appear(1e3, 100);
|
|
177
|
+
}, V), () => {
|
|
178
|
+
var t;
|
|
179
|
+
x && clearTimeout(x), (t = h.current) == null || t.dispose(), h.current = null;
|
|
179
180
|
};
|
|
180
|
-
}, [
|
|
181
|
-
const
|
|
182
|
-
return { chartId:
|
|
181
|
+
}, [f, l, c, n.palette.mode, w, b, D]);
|
|
182
|
+
const j = { ...g };
|
|
183
|
+
return { chartId: X, ownerState: j, sx: W, error: C, other: N };
|
|
183
184
|
};
|
|
184
185
|
export {
|
|
185
|
-
|
|
186
|
+
ze as useXYChartLogic
|
|
186
187
|
};
|