@hybridcore/ui 1.5.88 → 1.5.90
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/README.md +20 -7
- package/dist/components/charts/candlestick/logic.js +6 -6
- package/dist/components/charts/candlestick/styled.js +1 -1
- package/dist/components/charts/highlighting-line-data/logic.js +1 -1
- package/dist/components/charts/highlighting-line-data/styled.js +1 -1
- package/dist/components/metric-card/MetricChart.js +210 -192
- package/dist/components/metric-card/index.js +101 -76
- package/dist/components/metric-card/logic.js +142 -65
- package/dist/components/metric-card/styled.js +69 -46
- package/dist/components/paginated-list/logic.js +13 -13
- package/dist/components/paginated-list/styled.js +12 -12
- package/dist/components/profile-card/logic.js +5 -5
- package/dist/components/profile-card/styled.js +4 -4
- package/dist/components/widget/index.js +4 -0
- package/dist/components/widget/styled.js +38 -0
- package/dist/main.d.ts +148 -68
- package/dist/main.js +13 -11
- package/package.json +34 -8
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { h as S, m as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { jsx as F } from "react/jsx-runtime";
|
|
2
|
+
import { h as S, m as k, i as p, j as b, k as L, l as X, V as z, b as Y, A as j, X as O, c as E, g as G, d as Z, f as R } from "../../AxisRendererY-kADUad00.js";
|
|
3
|
+
import { useTheme as q, alpha as B } from "@mui/material";
|
|
4
|
+
import { useRef as V, useLayoutEffect as W } from "react";
|
|
5
|
+
import { C as H } from "../../ColumnSeries-BTcqshjB.js";
|
|
6
|
+
import { L as J } from "../../LineSeries-CfcpoYla.js";
|
|
6
7
|
class P extends S {
|
|
7
8
|
constructor() {
|
|
8
9
|
super(...arguments), Object.defineProperty(this, "_frequency", {
|
|
@@ -18,7 +19,7 @@ class P extends S {
|
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
21
|
_afterNew() {
|
|
21
|
-
this._settings.themeTags =
|
|
22
|
+
this._settings.themeTags = k(this._settings.themeTags, ["axis"]), this.fields.push("category", "id", "cellSize"), this.setPrivateRaw("name", "category"), this.addTag("category"), super._afterNew();
|
|
22
23
|
}
|
|
23
24
|
_afterDataChange() {
|
|
24
25
|
super._afterDataChange();
|
|
@@ -29,11 +30,11 @@ class P extends S {
|
|
|
29
30
|
super._prepareChildren();
|
|
30
31
|
const t = this.dataItems.length;
|
|
31
32
|
let e = 0;
|
|
32
|
-
this._valuesDirty && (this._itemMap = {}, p(this.dataItems, (
|
|
33
|
-
|
|
33
|
+
this._valuesDirty && (this._itemMap = {}, p(this.dataItems, (n) => {
|
|
34
|
+
n.setRaw("index", e), this._itemMap[n.get("category")] = n, e++;
|
|
34
35
|
}), this.setPrivateRaw("maxZoomFactor", t));
|
|
35
|
-
let
|
|
36
|
-
this.setPrivateRaw("startIndex",
|
|
36
|
+
let s = this.get("start", 0), i = this.get("end", 1), a = this._getIndices(s, i);
|
|
37
|
+
this.setPrivateRaw("startIndex", a.startIndex), this.setPrivateRaw("endIndex", a.endIndex), (this._sizeDirty || this._valuesDirty || this.isDirty("start") || this.isDirty("end") || this.isPrivateDirty("endIndex") || this.isPrivateDirty("startIndex") || this.isPrivateDirty("width") || this.isPrivateDirty("height")) && this.dataItems.length > 0 && (this._handleRangeChange(), this._prepareAxisItems(), this._updateAxisRanges());
|
|
37
38
|
}
|
|
38
39
|
/**
|
|
39
40
|
* @ignore
|
|
@@ -41,96 +42,96 @@ class P extends S {
|
|
|
41
42
|
adjustZoom() {
|
|
42
43
|
const t = this.dataItems.length;
|
|
43
44
|
if (t > 1) {
|
|
44
|
-
let e = this.get("maxZoomCount", this.dataItems.length),
|
|
45
|
+
let e = this.get("maxZoomCount", this.dataItems.length), s = this.get("minZoomCount", 1), i = 0, a = this.getPrivate("startIndex", 0), n = this.getPrivate("endIndex", 0);
|
|
45
46
|
const d = this._sAnimation, o = this._eAnimation;
|
|
46
|
-
let l = this.get("start", 0),
|
|
47
|
-
d && !d.stopped && (l = Number(d.to),
|
|
48
|
-
let
|
|
49
|
-
if (o && !o.stopped && (
|
|
50
|
-
const
|
|
51
|
-
|
|
47
|
+
let l = this.get("start", 0), r = !1;
|
|
48
|
+
d && !d.stopped && (l = Number(d.to), r = !0);
|
|
49
|
+
let h = this.get("end", 1);
|
|
50
|
+
if (o && !o.stopped && (h = Number(o.to), r = !0), r) {
|
|
51
|
+
const g = this._getIndices(l, h);
|
|
52
|
+
a = g.startIndex, n = g.endIndex;
|
|
52
53
|
}
|
|
53
|
-
for (let
|
|
54
|
-
const
|
|
55
|
-
i +=
|
|
54
|
+
for (let g = a; g < n; g++) {
|
|
55
|
+
const m = this.dataItems[g];
|
|
56
|
+
i += m.get("finalCellSize", 1);
|
|
56
57
|
}
|
|
57
|
-
if (i <=
|
|
58
|
-
let
|
|
59
|
-
for (let
|
|
60
|
-
const f = this.dataItems[
|
|
61
|
-
if (
|
|
58
|
+
if (i <= s) {
|
|
59
|
+
let g = 0;
|
|
60
|
+
for (let m = a; m < t; m++) {
|
|
61
|
+
const f = this.dataItems[m];
|
|
62
|
+
if (g += f.get("finalCellSize", 1), n = m + 1, g >= s)
|
|
62
63
|
break;
|
|
63
64
|
}
|
|
64
|
-
if (
|
|
65
|
-
for (let
|
|
66
|
-
const f = this.dataItems[
|
|
67
|
-
if (
|
|
65
|
+
if (g < s)
|
|
66
|
+
for (let m = a - 1; m >= 0; m--) {
|
|
67
|
+
const f = this.dataItems[m];
|
|
68
|
+
if (g += f.get("finalCellSize", 1), a = m, g >= s)
|
|
68
69
|
break;
|
|
69
70
|
}
|
|
70
|
-
this.zoomToIndexes(
|
|
71
|
+
this.zoomToIndexes(a, n);
|
|
71
72
|
} else if (i >= e) {
|
|
72
|
-
let
|
|
73
|
-
for (let
|
|
74
|
-
const f = this.dataItems[
|
|
75
|
-
if (
|
|
76
|
-
|
|
73
|
+
let g = i;
|
|
74
|
+
for (let m = n - 1; m >= a; m--) {
|
|
75
|
+
const f = this.dataItems[m];
|
|
76
|
+
if (g -= f.get("finalCellSize", 1), g <= e) {
|
|
77
|
+
n = m + 1;
|
|
77
78
|
break;
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
|
-
this.zoomToIndexes(
|
|
81
|
+
this.zoomToIndexes(a, n);
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
_handleRangeChange() {
|
|
85
86
|
p(this.series, (t) => {
|
|
86
|
-
let e = this.dataItems[this.startIndex()].get("category"),
|
|
87
|
-
if (
|
|
87
|
+
let e = this.dataItems[this.startIndex()].get("category"), s = this.dataItems[this.endIndex() - 1].get("category"), i = t.get("baseAxis"), a = t.get("xAxis"), n = t.get("yAxis");
|
|
88
|
+
if (a instanceof P && n instanceof P)
|
|
88
89
|
t._markDirtyAxes();
|
|
89
90
|
else if (i === this) {
|
|
90
|
-
let d, o, l =
|
|
91
|
-
if (
|
|
92
|
-
let
|
|
91
|
+
let d, o, l = n;
|
|
92
|
+
if (a === i ? (t.get("categoryXField") && (d = "categoryX"), t.get("openCategoryXField") && (o = "openCategoryX")) : n === i && (t.get("categoryYField") && (d = "categoryY"), t.get("openCategoryYField") && (o = "openCategoryY"), l = a), l instanceof z && (d || o)) {
|
|
93
|
+
let g = function(c, y, u, v, N, w) {
|
|
93
94
|
let x, C = y.categoryToIndex(N);
|
|
94
95
|
for (; !x && C >= 0 && C < y.dataItems.length; ) {
|
|
95
96
|
let D = y.dataItems[C].get("category");
|
|
96
|
-
if (
|
|
97
|
-
for (let I =
|
|
98
|
-
let
|
|
99
|
-
if (
|
|
100
|
-
x =
|
|
97
|
+
if (w == "previous")
|
|
98
|
+
for (let I = c.dataItems.length - 1; I >= 0; I--) {
|
|
99
|
+
let _ = c.dataItems[I];
|
|
100
|
+
if (u && _.get(u) === D) {
|
|
101
|
+
x = _;
|
|
101
102
|
break;
|
|
102
103
|
}
|
|
103
|
-
if (
|
|
104
|
-
x =
|
|
104
|
+
if (v && _.get(v) === D) {
|
|
105
|
+
x = _;
|
|
105
106
|
break;
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
109
|
else
|
|
109
|
-
for (let I = 0,
|
|
110
|
-
let M =
|
|
111
|
-
if (
|
|
110
|
+
for (let I = 0, _ = c.dataItems.length; I < _; I++) {
|
|
111
|
+
let M = c.dataItems[I];
|
|
112
|
+
if (u && M.get(u) === D) {
|
|
112
113
|
x = M;
|
|
113
114
|
break;
|
|
114
115
|
}
|
|
115
|
-
if (
|
|
116
|
+
if (v && M.get(v) === D) {
|
|
116
117
|
x = M;
|
|
117
118
|
break;
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
|
-
x || (C +=
|
|
121
|
+
x || (C += w === "previous" ? -1 : 1);
|
|
121
122
|
}
|
|
122
123
|
return x;
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
let
|
|
126
|
-
|
|
124
|
+
}, r, h;
|
|
125
|
+
r = g(t, this, d, o, e, "next"), h = g(t, this, d, o, s, "previous");
|
|
126
|
+
let m = 0, f = t.dataItems.length;
|
|
127
|
+
r && (m = t.dataItems.indexOf(r)), h && (f = t.dataItems.indexOf(h) + 1), t.setPrivate("startIndex", m), t.setPrivate("endIndex", f);
|
|
127
128
|
let T = !1;
|
|
128
|
-
for (let
|
|
129
|
-
const y = t.dataItems[
|
|
130
|
-
if (p(t.__valueXShowFields, (
|
|
131
|
-
y.get(
|
|
132
|
-
}), p(t.__valueYShowFields, (
|
|
133
|
-
y.get(
|
|
129
|
+
for (let c = m; c < f; c++) {
|
|
130
|
+
const y = t.dataItems[c];
|
|
131
|
+
if (p(t.__valueXShowFields, (u) => {
|
|
132
|
+
y.get(u) != null && (T = !0);
|
|
133
|
+
}), p(t.__valueYShowFields, (u) => {
|
|
134
|
+
y.get(u) != null && (T = !0);
|
|
134
135
|
}), T)
|
|
135
136
|
break;
|
|
136
137
|
}
|
|
@@ -142,44 +143,44 @@ class P extends S {
|
|
|
142
143
|
}
|
|
143
144
|
_prepareAxisItems() {
|
|
144
145
|
var t;
|
|
145
|
-
const e = this.get("renderer"),
|
|
146
|
+
const e = this.get("renderer"), s = this.dataItems.length;
|
|
146
147
|
let i = this.startIndex();
|
|
147
148
|
i > 0 && i--;
|
|
148
|
-
let
|
|
149
|
-
|
|
150
|
-
const
|
|
151
|
-
let o = e.axisLength() / Math.max(e.get("minGridDistance"), 1), l = Math.max(1, Math.min(
|
|
149
|
+
let a = this.endIndex();
|
|
150
|
+
a < s && a++;
|
|
151
|
+
const n = e.get("minorLabelsEnabled"), d = e.get("minorGridEnabled", n);
|
|
152
|
+
let o = e.axisLength() / Math.max(e.get("minGridDistance"), 1), l = Math.max(1, Math.min(s, Math.ceil((a - i) / o)));
|
|
152
153
|
i = Math.floor(i / l) * l, this._frequency = l;
|
|
153
|
-
for (let
|
|
154
|
-
this._toggleDataItem(this.dataItems[
|
|
155
|
-
let
|
|
156
|
-
for (let
|
|
157
|
-
let
|
|
158
|
-
this._createAssets(
|
|
159
|
-
let
|
|
160
|
-
d && (
|
|
154
|
+
for (let h = 0; h < s; h++)
|
|
155
|
+
this._toggleDataItem(this.dataItems[h], !1);
|
|
156
|
+
let r = this.dataItems[i].get("index", 0);
|
|
157
|
+
for (let h = i; h < a; h = h + l) {
|
|
158
|
+
let g = this.dataItems[h];
|
|
159
|
+
this._createAssets(g, []), this._toggleDataItem(g, !0);
|
|
160
|
+
let m = l;
|
|
161
|
+
d && (m = 1), this._prepareDataItem(g, r, m), r++;
|
|
161
162
|
}
|
|
162
163
|
if (e.get("minorGridEnabled"))
|
|
163
|
-
for (let
|
|
164
|
-
let
|
|
165
|
-
|
|
164
|
+
for (let h = i; h < a; h++) {
|
|
165
|
+
let g = this.dataItems[h];
|
|
166
|
+
h % l != 0 && (this._createAssets(g, ["minor"], !0), this._toggleDataItem(g, !0), this._prepareDataItem(g, 0, 1), n || (t = g.get("label")) === null || t === void 0 || t.setPrivate("visible", !1));
|
|
166
167
|
}
|
|
167
168
|
this._updateGhost();
|
|
168
169
|
}
|
|
169
|
-
_prepareDataItem(t, e,
|
|
170
|
-
let i = this.get("renderer"),
|
|
171
|
-
|
|
172
|
-
let o = this.indexToPosition(d,
|
|
173
|
-
l ? (
|
|
174
|
-
let
|
|
170
|
+
_prepareDataItem(t, e, s) {
|
|
171
|
+
let i = this.get("renderer"), a = t.get("categoryLocation", 0), n = t.get("endCategoryLocation", 1), d = t.get("index");
|
|
172
|
+
b(d) || (d = this.categoryToIndex(t.get("category")));
|
|
173
|
+
let o = this.indexToPosition(d, a), l = t.get("endCategory"), r;
|
|
174
|
+
l ? (r = this.categoryToIndex(l), b(r) || (r = d)) : r = d;
|
|
175
|
+
let h = this.indexToPosition(r, n), g, m;
|
|
175
176
|
if (t.get("isRange")) {
|
|
176
|
-
if (
|
|
177
|
+
if (g = r, !b(d)) {
|
|
177
178
|
this._toggleDataItem(t, !1);
|
|
178
179
|
return;
|
|
179
180
|
}
|
|
180
181
|
} else
|
|
181
|
-
|
|
182
|
-
|
|
182
|
+
g = d + this._frequency - 1;
|
|
183
|
+
m = this.indexToPosition(g, n), i.updateLabel(t.get("label"), o, h, s), i.updateGrid(t.get("grid"), o, h), i.updateTick(t.get("tick"), o, h, s), i.updateFill(t.get("axisFill"), o, m), this._processBullet(t), i.updateBullet(t.get("bullet"), o, h);
|
|
183
184
|
const f = this.get("fillRule");
|
|
184
185
|
f && f(t, e);
|
|
185
186
|
}
|
|
@@ -225,28 +226,28 @@ class P extends S {
|
|
|
225
226
|
/**
|
|
226
227
|
* @ignore
|
|
227
228
|
*/
|
|
228
|
-
getDataItemPositionX(t, e,
|
|
229
|
-
const
|
|
230
|
-
return
|
|
229
|
+
getDataItemPositionX(t, e, s, i) {
|
|
230
|
+
const a = t.get(e), n = this._itemMap[a];
|
|
231
|
+
return n ? this.indexToPosition(n.get("index", 0), s) : NaN;
|
|
231
232
|
}
|
|
232
233
|
/**
|
|
233
234
|
* @ignore
|
|
234
235
|
*/
|
|
235
|
-
getDataItemCoordinateX(t, e,
|
|
236
|
-
return this._settings.renderer.positionToCoordinate(this.getDataItemPositionX(t, e,
|
|
236
|
+
getDataItemCoordinateX(t, e, s, i) {
|
|
237
|
+
return this._settings.renderer.positionToCoordinate(this.getDataItemPositionX(t, e, s, i));
|
|
237
238
|
}
|
|
238
239
|
/**
|
|
239
240
|
* @ignore
|
|
240
241
|
*/
|
|
241
|
-
getDataItemPositionY(t, e,
|
|
242
|
-
const
|
|
243
|
-
return
|
|
242
|
+
getDataItemPositionY(t, e, s, i) {
|
|
243
|
+
const a = t.get(e), n = this._itemMap[a];
|
|
244
|
+
return n ? this.indexToPosition(n.get("index", 0), s) : NaN;
|
|
244
245
|
}
|
|
245
246
|
/**
|
|
246
247
|
* @ignore
|
|
247
248
|
*/
|
|
248
|
-
getDataItemCoordinateY(t, e,
|
|
249
|
-
return this._settings.renderer.positionToCoordinate(this.getDataItemPositionY(t, e,
|
|
249
|
+
getDataItemCoordinateY(t, e, s, i) {
|
|
250
|
+
return this._settings.renderer.positionToCoordinate(this.getDataItemPositionY(t, e, s, i));
|
|
250
251
|
}
|
|
251
252
|
/**
|
|
252
253
|
* Converts category index to a relative position.
|
|
@@ -259,31 +260,31 @@ class P extends S {
|
|
|
259
260
|
* @param location Location
|
|
260
261
|
* @return Index
|
|
261
262
|
*/
|
|
262
|
-
indexToPosition(t, e,
|
|
263
|
-
let i = this.dataItems.length,
|
|
264
|
-
if (i == 0 || (t >= i && (t = i - 1, e = 1),
|
|
263
|
+
indexToPosition(t, e, s) {
|
|
264
|
+
let i = this.dataItems.length, a = 0;
|
|
265
|
+
if (i == 0 || (t >= i && (t = i - 1, e = 1), b(e) || (e = 0.5), !b(t)))
|
|
265
266
|
return 0;
|
|
266
|
-
let
|
|
267
|
+
let n = this.get("startLocation", 0), d = this.get("endLocation", 1);
|
|
267
268
|
if (!this.get("cellSizeField"))
|
|
268
|
-
i -=
|
|
269
|
+
i -= n, i -= 1 - d, a = (t + e - n) / i;
|
|
269
270
|
else {
|
|
270
|
-
let o =
|
|
271
|
+
let o = s ? "finalCellSize" : "cellSize";
|
|
271
272
|
const l = this.dataItems;
|
|
272
|
-
let
|
|
273
|
-
p(this.dataItems, (
|
|
274
|
-
|
|
275
|
-
}),
|
|
276
|
-
let
|
|
277
|
-
for (let
|
|
278
|
-
|
|
279
|
-
let
|
|
280
|
-
|
|
273
|
+
let r = 0;
|
|
274
|
+
p(this.dataItems, (m) => {
|
|
275
|
+
r += m.get(o, 1);
|
|
276
|
+
}), r -= n * l[0].get(o, 1), r -= (1 - d) * l[l.length - 1].get(o, 1);
|
|
277
|
+
let h = 0;
|
|
278
|
+
for (let m = 0; m < t; m++)
|
|
279
|
+
h += l[m].get(o, 1);
|
|
280
|
+
let g = l[t].get(o, 1);
|
|
281
|
+
a = (h + e * g - n * l[0].get(o, 1)) / r;
|
|
281
282
|
}
|
|
282
|
-
if (!
|
|
283
|
+
if (!s) {
|
|
283
284
|
let o = this.dataItems[t];
|
|
284
|
-
o && (
|
|
285
|
+
o && (a += o.get("deltaPosition", 0));
|
|
285
286
|
}
|
|
286
|
-
return
|
|
287
|
+
return a;
|
|
287
288
|
}
|
|
288
289
|
/**
|
|
289
290
|
* Returns a position of a category.
|
|
@@ -329,19 +330,19 @@ class P extends S {
|
|
|
329
330
|
if (e === 0)
|
|
330
331
|
return 0;
|
|
331
332
|
if (this.get("cellSizeField")) {
|
|
332
|
-
let
|
|
333
|
+
let s = 0, i = [];
|
|
333
334
|
p(this.dataItems, (l) => {
|
|
334
|
-
const
|
|
335
|
-
i.push(
|
|
335
|
+
const r = l.get("cellSize", 1);
|
|
336
|
+
i.push(r), s += r;
|
|
336
337
|
});
|
|
337
|
-
let
|
|
338
|
-
|
|
339
|
-
let d = t *
|
|
338
|
+
let a = this.get("startLocation", 0), n = this.get("endLocation", 1);
|
|
339
|
+
s -= a, s -= 1 - n;
|
|
340
|
+
let d = t * s + a, o = 0;
|
|
340
341
|
for (let l = 0; l < e; l++) {
|
|
341
|
-
const
|
|
342
|
-
if (d < o +
|
|
342
|
+
const r = i[l];
|
|
343
|
+
if (d < o + r)
|
|
343
344
|
return l;
|
|
344
|
-
o +=
|
|
345
|
+
o += r;
|
|
345
346
|
}
|
|
346
347
|
return e - 1;
|
|
347
348
|
} else
|
|
@@ -354,9 +355,9 @@ class P extends S {
|
|
|
354
355
|
* @return Tooltip text
|
|
355
356
|
*/
|
|
356
357
|
getTooltipText(t, e) {
|
|
357
|
-
const
|
|
358
|
-
if (
|
|
359
|
-
const i =
|
|
358
|
+
const s = this.dataItems[this.axisPositionToIndex(t)];
|
|
359
|
+
if (s) {
|
|
360
|
+
const i = s.get("label");
|
|
360
361
|
if (i)
|
|
361
362
|
return X(i, this.get("tooltipText", ""));
|
|
362
363
|
}
|
|
@@ -373,41 +374,41 @@ class P extends S {
|
|
|
373
374
|
*/
|
|
374
375
|
getSeriesItem(t, e) {
|
|
375
376
|
if (this.dataItems.length > 0) {
|
|
376
|
-
let
|
|
377
|
-
if (
|
|
378
|
-
return
|
|
377
|
+
let s = this.getPrivate("name") + this.get("renderer").getPrivate("letter"), i = this.axisPositionToIndex(e), a = t.dataItems[i], n = this.dataItems[i], d = n.get("category");
|
|
378
|
+
if (a && n && a.get(s) === d)
|
|
379
|
+
return a;
|
|
379
380
|
for (let o = 0, l = t.dataItems.length; o < l; o++) {
|
|
380
|
-
let
|
|
381
|
-
if (
|
|
382
|
-
return
|
|
381
|
+
let r = t.dataItems[o];
|
|
382
|
+
if (r.get(s) === d)
|
|
383
|
+
return r;
|
|
383
384
|
}
|
|
384
385
|
}
|
|
385
386
|
}
|
|
386
387
|
_getIndices(t, e) {
|
|
387
|
-
let
|
|
388
|
+
let s = this.dataItems.length, i = 0, a = s, n = "cellSize";
|
|
388
389
|
if (this.get("cellSizeField")) {
|
|
389
390
|
let d = 0;
|
|
390
391
|
const o = this.dataItems;
|
|
391
392
|
if (o.length == 0)
|
|
392
393
|
return { startIndex: 0, endIndex: 0 };
|
|
393
|
-
p(o, (
|
|
394
|
-
d +=
|
|
395
|
-
}), d -= this.get("startLocation", 0) * o[0].get(
|
|
394
|
+
p(o, (r) => {
|
|
395
|
+
d += r.get(n, 1);
|
|
396
|
+
}), d -= this.get("startLocation", 0) * o[0].get(n, 1), d -= (1 - this.get("endLocation", 1)) * o[o.length - 1].get(n, 1);
|
|
396
397
|
let l = 0;
|
|
397
|
-
for (let
|
|
398
|
-
if (l += this.dataItems[
|
|
399
|
-
i =
|
|
398
|
+
for (let r = 0; r < s; r++)
|
|
399
|
+
if (l += this.dataItems[r].get(n, 1), Math.round(l) > Math.round(t * d)) {
|
|
400
|
+
i = r;
|
|
400
401
|
break;
|
|
401
402
|
}
|
|
402
|
-
for (let
|
|
403
|
-
if (l += this.dataItems[
|
|
404
|
-
|
|
403
|
+
for (let r = i + 1; r < s; r++)
|
|
404
|
+
if (l += this.dataItems[r].get(n, 1), Math.round(l) >= Math.round(e * d)) {
|
|
405
|
+
a = r + 1;
|
|
405
406
|
break;
|
|
406
407
|
}
|
|
407
|
-
i = Math.max(i, 0),
|
|
408
|
+
i = Math.max(i, 0), a = Math.min(a, s);
|
|
408
409
|
} else
|
|
409
|
-
i = Math.max(Math.round(this.get("start", 0) *
|
|
410
|
-
return { startIndex: i, endIndex:
|
|
410
|
+
i = Math.max(Math.round(this.get("start", 0) * s), 0), a = Math.min(Math.round(this.get("end", 1) * s), s);
|
|
411
|
+
return { startIndex: i, endIndex: a };
|
|
411
412
|
}
|
|
412
413
|
/**
|
|
413
414
|
* Zooms the axis to specific `start` and `end` indexes.
|
|
@@ -418,12 +419,12 @@ class P extends S {
|
|
|
418
419
|
* @param end End index
|
|
419
420
|
* @param duration Duration in milliseconds
|
|
420
421
|
*/
|
|
421
|
-
zoomToIndexes(t, e,
|
|
422
|
+
zoomToIndexes(t, e, s) {
|
|
422
423
|
let i = this.dataItems.length;
|
|
423
|
-
this.get("cellSizeField") ? (t = Math.min(Math.max(t, 0), i), e = Math.max(Math.min(e, i), 1), this.setPrivateRaw("startIndex", t), this.setPrivateRaw("endIndex", e), this.zoom(this.indexToPosition(t, 0, !0), this.indexToPosition(e, 0, !0),
|
|
424
|
+
this.get("cellSizeField") ? (t = Math.min(Math.max(t, 0), i), e = Math.max(Math.min(e, i), 1), this.setPrivateRaw("startIndex", t), this.setPrivateRaw("endIndex", e), this.zoom(this.indexToPosition(t, 0, !0), this.indexToPosition(e, 0, !0), s)) : this.zoom(t / i, e / i, s);
|
|
424
425
|
}
|
|
425
|
-
zoomToCategories(t, e,
|
|
426
|
-
this.zoomToIndexes(this.categoryToIndex(t), this.categoryToIndex(e) + 1,
|
|
426
|
+
zoomToCategories(t, e, s) {
|
|
427
|
+
this.zoomToIndexes(this.categoryToIndex(t), this.categoryToIndex(e) + 1, s);
|
|
427
428
|
}
|
|
428
429
|
/**
|
|
429
430
|
* Returns position span between start and end of a single cell in axis.
|
|
@@ -439,8 +440,8 @@ class P extends S {
|
|
|
439
440
|
*/
|
|
440
441
|
nextPosition(t) {
|
|
441
442
|
t == null && (t = 1), this.get("renderer").getPrivate("letter") == "Y" && (t *= -1);
|
|
442
|
-
const e = this.getPrivate("tooltipPosition", 0),
|
|
443
|
-
return this.toGlobalPosition(this.indexToPosition(
|
|
443
|
+
const e = this.getPrivate("tooltipPosition", 0), s = L(this.axisPositionToIndex(e) + t, 0, this.dataItems.length - 1);
|
|
444
|
+
return this.toGlobalPosition(this.indexToPosition(s));
|
|
444
445
|
}
|
|
445
446
|
}
|
|
446
447
|
Object.defineProperty(P, "className", {
|
|
@@ -455,14 +456,14 @@ Object.defineProperty(P, "classNames", {
|
|
|
455
456
|
writable: !0,
|
|
456
457
|
value: S.classNames.concat([P.className])
|
|
457
458
|
});
|
|
458
|
-
const
|
|
459
|
-
const
|
|
460
|
-
return
|
|
461
|
-
if (!
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
const
|
|
465
|
-
|
|
459
|
+
const it = ({ data: A, type: t, color: e }) => {
|
|
460
|
+
const s = V(null), i = q();
|
|
461
|
+
return W(() => {
|
|
462
|
+
if (!s.current) return;
|
|
463
|
+
const a = Y.new(s.current);
|
|
464
|
+
a.setThemes([j.new(a)]);
|
|
465
|
+
const n = a.container.children.push(
|
|
466
|
+
O.new(a, {
|
|
466
467
|
panX: !1,
|
|
467
468
|
panY: !1,
|
|
468
469
|
wheelX: "none",
|
|
@@ -472,54 +473,71 @@ const $ = ({ data: A, type: t, color: e }) => {
|
|
|
472
473
|
paddingTop: 0,
|
|
473
474
|
paddingBottom: 0
|
|
474
475
|
})
|
|
475
|
-
),
|
|
476
|
-
P.new(
|
|
476
|
+
), d = n.xAxes.push(
|
|
477
|
+
P.new(a, {
|
|
477
478
|
categoryField: "t",
|
|
478
|
-
renderer:
|
|
479
|
+
renderer: E.new(a, {
|
|
479
480
|
minGridDistance: 10
|
|
480
481
|
}),
|
|
481
|
-
tooltip:
|
|
482
|
+
tooltip: G.new(a, {})
|
|
482
483
|
})
|
|
483
|
-
),
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
484
|
+
), o = d.get("renderer");
|
|
485
|
+
o.grid.template.set("visible", !1), o.labels.template.set("visible", !1), d.setAll({
|
|
486
|
+
startLocation: 0.5,
|
|
487
|
+
endLocation: 0.5
|
|
488
|
+
}), d.data.setAll(A);
|
|
489
|
+
const l = n.yAxes.push(
|
|
490
|
+
z.new(a, {
|
|
491
|
+
renderer: Z.new(a, {})
|
|
488
492
|
})
|
|
489
|
-
),
|
|
490
|
-
|
|
491
|
-
let
|
|
492
|
-
return t === "column" ? (
|
|
493
|
-
|
|
493
|
+
), r = l.get("renderer");
|
|
494
|
+
r.grid.template.set("visible", !1), r.labels.template.set("visible", !1);
|
|
495
|
+
let h;
|
|
496
|
+
return t === "column" ? (h = n.series.push(
|
|
497
|
+
H.new(a, {
|
|
494
498
|
name: "Series",
|
|
495
|
-
xAxis:
|
|
496
|
-
yAxis:
|
|
499
|
+
xAxis: d,
|
|
500
|
+
yAxis: l,
|
|
497
501
|
valueYField: "v",
|
|
498
502
|
categoryXField: "t",
|
|
499
|
-
fill:
|
|
500
|
-
stroke: w(e)
|
|
503
|
+
fill: R(i.palette.divider)
|
|
501
504
|
})
|
|
502
|
-
),
|
|
505
|
+
), h.columns.template.setAll({
|
|
503
506
|
cornerRadiusTL: 2,
|
|
504
507
|
cornerRadiusTR: 2,
|
|
505
508
|
strokeOpacity: 0
|
|
506
|
-
})) : (
|
|
507
|
-
|
|
509
|
+
})) : (h = n.series.push(
|
|
510
|
+
J.new(a, {
|
|
508
511
|
name: "Series",
|
|
509
|
-
xAxis:
|
|
510
|
-
yAxis:
|
|
512
|
+
xAxis: d,
|
|
513
|
+
yAxis: l,
|
|
511
514
|
valueYField: "v",
|
|
512
515
|
categoryXField: "t",
|
|
513
|
-
|
|
514
|
-
|
|
516
|
+
// @ts-expect-error amcharts5 typing accepts string/Color; alpha returns rgba string
|
|
517
|
+
fill: B(i.palette.divider, 0.25),
|
|
518
|
+
stroke: R(i.palette.divider)
|
|
515
519
|
})
|
|
516
|
-
),
|
|
517
|
-
strokeWidth:
|
|
518
|
-
})
|
|
519
|
-
|
|
520
|
+
), h.strokes.template.setAll({
|
|
521
|
+
strokeWidth: 1
|
|
522
|
+
}), h.fills.template.setAll({
|
|
523
|
+
fillOpacity: 1,
|
|
524
|
+
visible: !0
|
|
525
|
+
})), h.data.setAll(A), h.appear(1e3), n.appear(1e3, 100), () => {
|
|
526
|
+
a.dispose();
|
|
520
527
|
};
|
|
521
|
-
}, [A, t, e]), /* @__PURE__ */
|
|
528
|
+
}, [A, t, e, i.palette.mode, i.palette.divider]), /* @__PURE__ */ F(
|
|
529
|
+
"div",
|
|
530
|
+
{
|
|
531
|
+
ref: s,
|
|
532
|
+
style: {
|
|
533
|
+
width: "calc(100% + 10px)",
|
|
534
|
+
height: "100%",
|
|
535
|
+
marginBottom: -21,
|
|
536
|
+
marginLeft: -10
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
);
|
|
522
540
|
};
|
|
523
541
|
export {
|
|
524
|
-
|
|
542
|
+
it as MetricChart
|
|
525
543
|
};
|