@hybridcore/ui 1.5.80 → 1.5.82

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.
@@ -1,332 +1,9 @@
1
- import { X as se, e as k, v as K, P as V, i as Q, a as O, _ as $, R as W, G as ie, L as E, T as H, m as U, b as oe, A as ne, c as le, d as ae, D as re, f as he, g as I, V as ee, h as te, j as M, p as ce } from "../../../AxisRendererY-CFo972D5.js";
2
- import { useThemeProps as ge } from "@mui/material";
3
- import { useRef as q, useLayoutEffect as ue, useEffect as pe } from "react";
4
- class T extends se {
5
- constructor() {
6
- super(...arguments), Object.defineProperty(this, "_ph", {
7
- enumerable: !0,
8
- configurable: !0,
9
- writable: !0,
10
- value: 0
11
- }), Object.defineProperty(this, "_pw", {
12
- enumerable: !0,
13
- configurable: !0,
14
- writable: !0,
15
- value: 0
16
- }), Object.defineProperty(this, "_columnsUpdated", {
17
- enumerable: !0,
18
- configurable: !0,
19
- writable: !0,
20
- value: !1
21
- });
22
- }
23
- _makeGraphics(e, t) {
24
- return this.makeColumn(t, e);
25
- }
26
- _makeFieldNames() {
27
- super._makeFieldNames();
28
- const e = this.get("xAxis"), t = this.get("yAxis"), s = "CategoryAxis", o = "ValueAxis";
29
- e.isType(s) && (this.get("openCategoryXField") || (this._xOpenField = this._xField)), e.isType(o) && (this.get("openValueXField") || (this._xOpenField = this._xField)), t.isType(s) && (this.get("openCategoryYField") || (this._yOpenField = this._yField)), t.isType(o) && (this.get("openValueYField") || (this._yOpenField = this._yField));
30
- }
31
- _prepareChildren() {
32
- super._prepareChildren();
33
- const e = this.get("xAxis"), t = this.get("yAxis"), s = this.dataItems.length, o = Math.max(0, this.startIndex() - 2), i = Math.min(this.endIndex() + 2, s - 1);
34
- if (e.inited && t.inited)
35
- for (let n = o; n <= i; n++) {
36
- let l = this.dataItems[n];
37
- this._createGraphics(l);
38
- }
39
- }
40
- _updateChildren() {
41
- const e = this.chart;
42
- e && (this._ph = e.plotContainer.height(), this._pw = e.plotContainer.width());
43
- const t = this.get("xAxis"), s = this.get("yAxis"), o = this.get("baseAxis"), i = this.columns.template;
44
- this.isDirty("fill") && i.get("fill") == null && i.set("fill", this.get("fill")), this.isDirty("fillPattern") && i.get("fillPattern") == null && i.set("fillPattern", this.get("fillPattern")), this.isDirty("stroke") && i.get("stroke") == null && i.set("stroke", this.get("stroke"));
45
- let n = 0, l = 0, d = 0;
46
- k(o.series, (f) => {
47
- if (f instanceof T) {
48
- const c = f.get("stacked");
49
- c && d == 0 && l++, !c && f.get("clustered") && l++;
50
- }
51
- f === this && (n = l - 1), d++;
52
- }), this.get("clustered") || (n = 0, l = 1), l === 0 && (l = 1, n = 0);
53
- const m = t.get("renderer"), x = s.get("renderer"), h = "cellStartLocation", u = "cellEndLocation", p = m.get(h, 0), _ = m.get(u, 1), g = x.get(h, 0), a = x.get(u, 1);
54
- if (this._aLocationX0 = p + n / l * (_ - p), this._aLocationX1 = p + (n + 1) / l * (_ - p), this._aLocationY0 = g + n / l * (a - g), this._aLocationY1 = g + (n + 1) / l * (a - g), t.inited && s.inited) {
55
- if (this._axesDirty || this._valuesDirty || this._stackDirty || this.isDirty("vcx") || this.isDirty("vcy") || this._sizeDirty) {
56
- const f = this.dataItems.length;
57
- let c = Math.max(0, this.startIndex() - 2), r = Math.min(this.endIndex() + 2, f - 1);
58
- for (let y = 0; y < c; y++)
59
- this._toggleColumn(this.dataItems[y], !1);
60
- let w = this.dataItems[c];
61
- for (let y = c; y <= r; y++) {
62
- let b = this.dataItems[y];
63
- if (b.get("valueX") != null && b.get("valueY") != null) {
64
- if (w = b, y > 0 && c > 0)
65
- for (let C = y - 1; C >= 0; C--) {
66
- let Y = this.dataItems[C];
67
- if (Y.get("valueX") != null && Y.get("valueY") != null) {
68
- w = Y;
69
- break;
70
- }
71
- }
72
- break;
73
- } else
74
- this._toggleColumn(b, !1);
75
- }
76
- this._beforeColumnsDraw();
77
- let X = 0;
78
- s.isType("CategoryAxis") && t.isType("CategoryAxis") ? X = 2 : t === o ? X = 0 : s === o && (X = 1);
79
- for (let y = c; y <= r; y++) {
80
- let b = this.dataItems[y];
81
- this._updateGraphics(b, w, X), b.get("valueX") != null && b.get("valueY") != null && (w = b);
82
- }
83
- this._afterColumnsDraw();
84
- for (let y = r + 1; y < f; y++)
85
- this._toggleColumn(this.dataItems[y], !1);
86
- this._columnsUpdated = !0;
87
- }
88
- } else
89
- this._skipped = !0;
90
- this.getPrivate("doNotUpdateLegend") || this.updateLegendMarker(this.get("tooltipDataItem")), super._updateChildren();
91
- }
92
- _afterChanged() {
93
- super._afterChanged(), this._columnsUpdated = !1;
94
- }
95
- _beforeColumnsDraw() {
96
- }
97
- _afterColumnsDraw() {
98
- }
99
- _createGraphics(e) {
100
- let t = e.get("graphics");
101
- if (!t) {
102
- t = this._makeGraphics(this.columns, e), e.set("graphics", t), t._setDataItem(e);
103
- const s = e.get("legendDataItem");
104
- if (s) {
105
- const i = s.get("markerRectangle");
106
- if (i) {
107
- const n = i.states.lookup("default");
108
- k(K, (l) => {
109
- const d = t.get(l, this.get(l));
110
- i.set(l, d), n.set(l, d);
111
- });
112
- }
113
- }
114
- let o = e.get("rangeGraphics");
115
- o && k(o, (i) => {
116
- i.dispose();
117
- }), o = [], e.setRaw("rangeGraphics", o), this.axisRanges.each((i) => {
118
- const n = i.container, l = this._makeGraphics(i.columns, e);
119
- o && o.push(l), l.setPrivate("list", i.columns), n.children.push(l);
120
- });
121
- }
122
- }
123
- createAxisRange(e) {
124
- return k(this.dataItems, (t) => {
125
- const s = t.get("graphics");
126
- s && (s.dispose(), t.set("graphics", void 0));
127
- }), super.createAxisRange(e);
128
- }
129
- _updateGraphics(e, t, s) {
130
- let o = e.get("graphics");
131
- const i = this._xField, n = this._yField, l = e.get(i), d = e.get(n), m = this.get("exactLocationX", !1);
132
- if (l != null && d != null) {
133
- const x = this._xOpenField, h = this._yOpenField, u = this.get("locationX", e.get("locationX", 0.5)), p = this.get("locationY", e.get("locationY", 0.5)), _ = this.get("openLocationX", e.get("openLocationX", u)), g = this.get("openLocationY", e.get("openLocationY", p)), a = o.get("width"), f = o.get("height"), c = this.get("stacked"), r = this.get("xAxis"), w = this.get("yAxis"), X = r.get("start"), y = r.get("end"), b = w.get("start"), C = w.get("end");
134
- let Y, L, F, A, G = this.get("vcy", 1), R = this.get("vcx", 1), B = !1, Z = !1;
135
- if (s == 0) {
136
- let P = this._aLocationX0 + _ - 0.5, D = this._aLocationX1 + u - 0.5;
137
- if (a instanceof V) {
138
- let v = (D - P) * (1 - a.value) / 2;
139
- P += v, D -= v;
140
- }
141
- if (Y = r.getDataItemPositionX(e, x, P, R, m), L = r.getDataItemPositionX(e, i, D, R, m), F = w.getDataItemPositionY(e, n, p, G), this._yOpenField !== this._yField)
142
- A = w.getDataItemPositionY(e, h, g, G);
143
- else if (c) {
144
- let v = e.get("stackToItemY");
145
- v ? A = w.getDataItemPositionY(v, n, g, v.component.get("vcy")) : A = w.basePosition();
146
- } else
147
- A = w.basePosition();
148
- e.setRaw("point", { x: Y + (L - Y) / 2, y: F }), Z = !0;
149
- } else if (s == 1) {
150
- let P = this._aLocationY0 + g - 0.5, D = this._aLocationY1 + p - 0.5;
151
- if (f instanceof V) {
152
- let v = (D - P) * (1 - f.value) / 2;
153
- P += v, D -= v;
154
- }
155
- if (F = w.getDataItemPositionY(e, h, P, G), A = w.getDataItemPositionY(e, n, D, G), L = r.getDataItemPositionX(e, i, u, R, m), this._xOpenField !== this._xField)
156
- Y = r.getDataItemPositionX(e, x, _, R, m);
157
- else if (c) {
158
- let v = e.get("stackToItemX");
159
- v ? Y = r.getDataItemPositionX(v, i, _, v.component.get("vcx"), m) : Y = r.basePosition();
160
- } else
161
- Y = r.basePosition();
162
- B = !0, e.setRaw("point", { x: L, y: F + (A - F) / 2 });
163
- } else if (s == 2) {
164
- let P = this._aLocationX0 + _ - 0.5, D = this._aLocationX1 + u - 0.5;
165
- if (a instanceof V) {
166
- let v = (D - P) * (1 - a.value) / 2;
167
- P += v, D -= v;
168
- }
169
- if (Y = r.getDataItemPositionX(e, x, P, R), L = r.getDataItemPositionX(e, i, D, R), P = this._aLocationY0 + g - 0.5, D = this._aLocationY1 + p - 0.5, f instanceof V) {
170
- let v = (D - P) * (1 - f.value) / 2;
171
- P += v, D -= v;
172
- }
173
- F = w.getDataItemPositionY(e, h, P, G), A = w.getDataItemPositionY(e, n, D, G), e.setRaw("point", { x: Y + (L - Y) / 2, y: F + (A - F) / 2 });
174
- }
175
- this._applyGraphicsStates(e, t), this._updateSeriesGraphics(e, o, Y, L, F, A, B, Z), Y < X && L < X || Y > y && L > y || F < b && A <= b || F >= C && A > C || Q(Y) || Q(F) ? this._toggleColumn(e, !1) : this._toggleColumn(e, !0);
176
- let J = e.get("rangeGraphics");
177
- J && k(J, (P) => {
178
- this._updateSeriesGraphics(e, P, Y, L, F, A, B, Z);
179
- });
180
- } else
181
- this._toggleColumn(e, !1);
182
- }
183
- _updateSeriesGraphics(e, t, s, o, i, n, l, d) {
184
- const m = t.get("width"), x = t.get("height"), h = t.get("maxWidth"), u = t.get("maxHeight"), p = this.getPoint(s, i), _ = this.getPoint(o, n), g = e.get("point");
185
- if (g) {
186
- const a = this.getPoint(g.x, g.y);
187
- g.x = a.x + this._x, g.y = a.y + this._y;
188
- }
189
- if (s = p.x, o = _.x, i = p.y, n = _.y, O(m)) {
190
- const a = (o - s - m) / 2;
191
- s += a, o -= a;
192
- }
193
- if (O(h) && h < Math.abs(o - s)) {
194
- const a = (o - s - h) / 2;
195
- s += a, o -= a;
196
- }
197
- if (O(x)) {
198
- const a = (n - i - x) / 2;
199
- i += a, n -= a;
200
- }
201
- if (O(u) && u < Math.abs(n - i)) {
202
- const a = (n - i - u) / 2;
203
- i += a, n -= a;
204
- }
205
- this.get("adjustBulletPosition") && (l && (o = Math.min(Math.max(0, o), this._pw), s = Math.min(Math.max(0, s), this._pw)), d && (i = Math.min(Math.max(0, i), this._ph), n = Math.min(Math.max(0, n), this._ph))), e.setRaw("left", s), e.setRaw("right", o), e.setRaw("top", i), e.setRaw("bottom", n), t.setPrivate("width", o - s), t.setPrivate("height", n - i), t.set("x", s), t.set("y", n - (n - i));
206
- }
207
- _handleDataSetChange() {
208
- super._handleDataSetChange(), k(this._dataItems, (e) => {
209
- this._toggleColumn(e, !1);
210
- });
211
- }
212
- _applyGraphicsStates(e, t) {
213
- const s = e.get("graphics"), o = s.states.lookup("dropFromOpen"), i = s.states.lookup("riseFromOpen"), n = s.states.lookup("dropFromPrevious"), l = s.states.lookup("riseFromPrevious");
214
- if (o || n || i || l) {
215
- const d = this.get("xAxis"), m = this.get("yAxis"), x = this.get("baseAxis");
216
- let h, u, p;
217
- x === d && m.isType("ValueAxis") ? (h = e.get(this._yOpenField), u = e.get(this._yField), p = t.get(this._yField)) : x === m && d.isType("ValueAxis") && (h = e.get(this._xOpenField), u = e.get(this._xField), p = t.get(this._xField)), O(h) && O(u) && (u < h ? o && o.apply() : i && i.apply(), O(p) && (u < p ? n && n.apply() : l && l.apply()));
218
- }
219
- }
220
- /**
221
- * @ignore
222
- */
223
- disposeDataItem(e) {
224
- super.disposeDataItem(e);
225
- const t = e.get("graphics");
226
- t && (this.columns.removeValue(t), t.dispose());
227
- const s = e.get("rangeGraphics");
228
- s && k(s, (o) => {
229
- const i = o.getPrivate("list");
230
- i && i.removeValue(o), o.dispose();
231
- });
232
- }
233
- /**
234
- * Hides series's data item.
235
- *
236
- * @param dataItem Data item
237
- * @param duration Animation duration in milliseconds
238
- * @return Promise
239
- */
240
- hideDataItem(e, t) {
241
- const s = Object.create(null, {
242
- hideDataItem: { get: () => super.hideDataItem }
243
- });
244
- return $(this, void 0, void 0, function* () {
245
- const o = [s.hideDataItem.call(this, e, t)], i = e.get("graphics");
246
- i && o.push(i.hide(t));
247
- const n = e.get("rangeGraphics");
248
- n && k(n, (l) => {
249
- o.push(l.hide(t));
250
- }), yield Promise.all(o);
251
- });
252
- }
253
- _toggleColumn(e, t) {
254
- const s = e.get("graphics");
255
- s && s.setPrivate("visible", t);
256
- const o = e.get("rangeGraphics");
257
- o && k(o, (n) => {
258
- n.setPrivate("visible", t);
259
- });
260
- const i = e.bullets;
261
- i && k(i, (n) => {
262
- n.setPrivate("hidden", !t);
263
- });
264
- }
265
- /**
266
- * Shows series's data item.
267
- *
268
- * @param dataItem Data item
269
- * @param duration Animation duration in milliseconds
270
- * @return Promise
271
- */
272
- showDataItem(e, t) {
273
- const s = Object.create(null, {
274
- showDataItem: { get: () => super.showDataItem }
275
- });
276
- return $(this, void 0, void 0, function* () {
277
- const o = [s.showDataItem.call(this, e, t)], i = e.get("graphics");
278
- i && o.push(i.show(t));
279
- const n = e.get("rangeGraphics");
280
- n && k(n, (l) => {
281
- o.push(l.show(t));
282
- }), yield Promise.all(o);
283
- });
284
- }
285
- /**
286
- * @ignore
287
- */
288
- updateLegendMarker(e) {
289
- let t = this.get("legendDataItem");
290
- if (this.get("useLastColorForLegendMarker") && !e) {
291
- const s = this.dataItems[this.endIndex() - 1];
292
- s && (e = s);
293
- }
294
- if (t) {
295
- let s = this.columns.template;
296
- if (e) {
297
- let i = e.get("graphics");
298
- i && (s = i);
299
- }
300
- const o = t.get("markerRectangle");
301
- if (o && !t.get("itemContainer").get("disabled")) {
302
- const i = o.states.lookup("default");
303
- k(K, (n) => {
304
- const l = s.get(n, this.get(n));
305
- o.set(n, l), i.set(n, l);
306
- });
307
- }
308
- }
309
- }
310
- _getTooltipTarget(e) {
311
- if (this.get("seriesTooltipTarget") == "bullet")
312
- return super._getTooltipTarget(e);
313
- let t = e.get("graphics");
314
- return t || this;
315
- }
316
- }
317
- Object.defineProperty(T, "className", {
318
- enumerable: !0,
319
- configurable: !0,
320
- writable: !0,
321
- value: "BaseColumnSeries"
322
- });
323
- Object.defineProperty(T, "classNames", {
324
- enumerable: !0,
325
- configurable: !0,
326
- writable: !0,
327
- value: se.classNames.concat([T.className])
328
- });
329
- class N extends W {
1
+ import { R as M, L, T as k, m as T, i as V, b as G, A as S, X as j, c as z, g as O, V as R, d as N, f as _, p as E } from "../../../AxisRendererY-kADUad00.js";
2
+ import { useThemeProps as H } from "@mui/material";
3
+ import { useRef as A, useLayoutEffect as W, useEffect as U } from "react";
4
+ import { X as Z, D as q } from "../../../DateAxis-CMum47iz.js";
5
+ import { C as F } from "../../../ColumnSeries-BTcqshjB.js";
6
+ class D extends M {
330
7
  _beforeChanged() {
331
8
  super._beforeChanged(), (this.isDirty("lowX0") || this.isDirty("lowY0") || this.isDirty("lowX1") || this.isDirty("lowY1") || this.isDirty("highX0") || this.isDirty("highX1") || this.isDirty("highY0") || this.isDirty("highY1")) && (this._clear = !0);
332
9
  }
@@ -336,98 +13,28 @@ class N extends W {
336
13
  e.moveTo(this.get("lowX0", 0), this.get("lowY0", 0)), e.lineTo(this.get("lowX1", 0), this.get("lowY1", 0)), e.moveTo(this.get("highX0", 0), this.get("highY0", 0)), e.lineTo(this.get("highX1", 0), this.get("highY1", 0));
337
14
  }
338
15
  }
339
- Object.defineProperty(N, "className", {
16
+ Object.defineProperty(D, "className", {
340
17
  enumerable: !0,
341
18
  configurable: !0,
342
19
  writable: !0,
343
20
  value: "Candlestick"
344
21
  });
345
- Object.defineProperty(N, "classNames", {
346
- enumerable: !0,
347
- configurable: !0,
348
- writable: !0,
349
- value: W.classNames.concat([N.className])
350
- });
351
- class S extends T {
352
- constructor() {
353
- super(...arguments), Object.defineProperty(this, "allColumns", {
354
- enumerable: !0,
355
- configurable: !0,
356
- writable: !0,
357
- value: this.children.push(ie.new(this._root, {}))
358
- }), Object.defineProperty(this, "allColumnsData", {
359
- enumerable: !0,
360
- configurable: !0,
361
- writable: !0,
362
- value: []
363
- }), Object.defineProperty(this, "columns", {
364
- enumerable: !0,
365
- configurable: !0,
366
- writable: !0,
367
- value: this.addDisposer(new E(H.new({}), () => W._new(this._root, {
368
- position: "absolute",
369
- themeTags: U(this.columns.template.get("themeTags", []), ["series", "column"])
370
- }, [this.columns.template])))
371
- });
372
- }
373
- /**
374
- * @ignore
375
- */
376
- makeColumn(e, t) {
377
- const s = t.make();
378
- return this.get("turboMode") ? s.virtualParent = this.chart : this.mainContainer.children.push(s), s._setDataItem(e), t.push(s), s;
379
- }
380
- _processAxisRange(e) {
381
- super._processAxisRange(e), e.columns = new E(H.new({}), () => W._new(this._root, {
382
- position: "absolute",
383
- themeTags: U(e.columns.template.get("themeTags", []), ["series", "column"])
384
- }, [this.columns.template, e.columns.template]));
385
- }
386
- _beforeColumnsDraw() {
387
- this.allColumnsData = [];
388
- }
389
- _afterColumnsDraw() {
390
- this.get("turboMode") && this.allColumns.set("draw", (e) => {
391
- e.clear(), k(this.allColumnsData, (t) => {
392
- const s = t.width, o = t.height, i = t.x, n = t.y, l = t.stroke, d = t.fill, m = t.strokeWidth, x = t.strokeOpacity, h = t.fillOpacity;
393
- e.beginFill(d, h), e.beginPath(), e.lineStyle(m, l, x), e.drawRect(i, n, s, o), e.endStroke(), e.endFill();
394
- });
395
- });
396
- }
397
- _updateSeriesGraphics(e, t, s, o, i, n, l, d) {
398
- if (this.get("turboMode")) {
399
- const m = t.get("stroke"), x = t.get("fillOpacity", 1), h = t.get("strokeOpacity", 1), u = t.get("strokeWidth", 1), p = t.get("fill"), _ = this.getPoint(s, i), g = this.getPoint(o, n), a = e.get("point");
400
- if (a) {
401
- const f = this.getPoint(a.x, a.y);
402
- a.x = f.x + this._x, a.y = f.y + this._y;
403
- }
404
- s = _.x, o = g.x, i = _.y, n = g.y, e.setRaw("left", s), e.setRaw("right", o), e.setRaw("top", i), e.setRaw("bottom", n), this.allColumnsData.push({ width: o - s, height: n - i, x: s, y: i, stroke: m, fill: p, strokeWidth: u, strokeOpacity: h, fillOpacity: x });
405
- } else
406
- super._updateSeriesGraphics(e, t, s, o, i, n, l, d);
407
- }
408
- }
409
- Object.defineProperty(S, "className", {
410
- enumerable: !0,
411
- configurable: !0,
412
- writable: !0,
413
- value: "ColumnSeries"
414
- });
415
- Object.defineProperty(S, "classNames", {
22
+ Object.defineProperty(D, "classNames", {
416
23
  enumerable: !0,
417
24
  configurable: !0,
418
25
  writable: !0,
419
- value: T.classNames.concat([S.className])
26
+ value: M.classNames.concat([D.className])
420
27
  });
421
- class z extends S {
28
+ class C extends F {
422
29
  constructor() {
423
30
  super(...arguments), Object.defineProperty(this, "columns", {
424
31
  enumerable: !0,
425
32
  configurable: !0,
426
33
  writable: !0,
427
- value: this.addDisposer(new E(H.new({
34
+ value: this.addDisposer(new L(k.new({
428
35
  themeTags: ["autocolor"]
429
- }), () => N._new(this._root, {
430
- themeTags: U(this.columns.template.get("themeTags", []), ["candlestick", "series", "column"])
36
+ }), () => D._new(this._root, {
37
+ themeTags: T(this.columns.template.get("themeTags", []), ["candlestick", "series", "column"])
431
38
  }, [this.columns.template])))
432
39
  });
433
40
  }
@@ -435,143 +42,143 @@ class z extends S {
435
42
  * @ignore
436
43
  */
437
44
  makeColumn(e, t) {
438
- const s = t.make();
439
- return this.get("turboMode") ? s.virtualParent = this.chart : this.mainContainer.children.push(s), s._setDataItem(e), t.push(s), s;
440
- }
441
- _updateGraphics(e, t, s) {
442
- super._updateGraphics(e, t, s);
443
- const o = this.getRaw("xAxis"), i = this.getRaw("yAxis");
444
- let n = this.get("vcy", 1), l = this.get("vcx", 1), d, m, x, h, u, p, _, g, a = this.get("locationX", e.get("locationX", 0.5)), f = this.get("locationY", e.get("locationY", 0.5)), c = this.get("openLocationX", e.get("openLocationX", a)), r = this.get("openLocationY", e.get("openLocationY", f)), w;
445
- if (s == 0) {
446
- let X = i.getDataItemPositionY(e, this._yOpenField, 1, n), y = i.getDataItemPositionY(e, this._yField, 1, n);
447
- h = i.getDataItemPositionY(e, this._yLowField, 1, n), g = i.getDataItemPositionY(e, this._yHighField, 1, n), _ = Math.max(X, y), x = Math.min(X, y);
448
- let b = this._aLocationX0 + c - 0.5, C = this._aLocationX1 + a - 0.5;
449
- d = o.getDataItemPositionX(e, this._xField, b + (C - b) / 2, l), m = d, u = d, p = d, w = "vertical";
45
+ const h = t.make();
46
+ return this.get("turboMode") ? h.virtualParent = this.chart : this.mainContainer.children.push(h), h._setDataItem(e), t.push(h), h;
47
+ }
48
+ _updateGraphics(e, t, h) {
49
+ super._updateGraphics(e, t, h);
50
+ const m = this.getRaw("xAxis"), d = this.getRaw("yAxis");
51
+ let Y = this.get("vcy", 1), n = this.get("vcx", 1), c, x, u, l, g, p, w, a, o = this.get("locationX", e.get("locationX", 0.5)), r = this.get("locationY", e.get("locationY", 0.5)), s = this.get("openLocationX", e.get("openLocationX", o)), i = this.get("openLocationY", e.get("openLocationY", r)), b;
52
+ if (h == 0) {
53
+ let y = d.getDataItemPositionY(e, this._yOpenField, 1, Y), f = d.getDataItemPositionY(e, this._yField, 1, Y);
54
+ l = d.getDataItemPositionY(e, this._yLowField, 1, Y), a = d.getDataItemPositionY(e, this._yHighField, 1, Y), w = Math.max(y, f), u = Math.min(y, f);
55
+ let X = this._aLocationX0 + s - 0.5, v = this._aLocationX1 + o - 0.5;
56
+ c = m.getDataItemPositionX(e, this._xField, X + (v - X) / 2, n), x = c, g = c, p = c, b = "vertical";
450
57
  } else {
451
- let X = o.getDataItemPositionX(e, this._xOpenField, 1, l), y = o.getDataItemPositionX(e, this._xField, 1, l);
452
- m = o.getDataItemPositionX(e, this._xLowField, 1, l), p = o.getDataItemPositionX(e, this._xHighField, 1, l), u = Math.max(X, y), d = Math.min(X, y);
453
- let b = this._aLocationY0 + r - 0.5, C = this._aLocationY1 + f - 0.5;
454
- x = i.getDataItemPositionY(e, this._yField, b + (C - b) / 2, n), h = x, _ = x, g = x, w = "horizontal";
58
+ let y = m.getDataItemPositionX(e, this._xOpenField, 1, n), f = m.getDataItemPositionX(e, this._xField, 1, n);
59
+ x = m.getDataItemPositionX(e, this._xLowField, 1, n), p = m.getDataItemPositionX(e, this._xHighField, 1, n), g = Math.max(y, f), c = Math.min(y, f);
60
+ let X = this._aLocationY0 + i - 0.5, v = this._aLocationY1 + r - 0.5;
61
+ u = d.getDataItemPositionY(e, this._yField, X + (v - X) / 2, Y), l = u, w = u, a = u, b = "horizontal";
455
62
  }
456
- this._updateCandleGraphics(e, d, m, x, h, u, p, _, g, w);
63
+ this._updateCandleGraphics(e, c, x, u, l, g, p, w, a, b);
457
64
  }
458
- _updateCandleGraphics(e, t, s, o, i, n, l, d, m, x) {
459
- let h = e.get("graphics");
460
- if (h) {
461
- let u = this.getPoint(t, o), p = this.getPoint(s, i), _ = this.getPoint(n, d), g = this.getPoint(l, m);
65
+ _updateCandleGraphics(e, t, h, m, d, Y, n, c, x, u) {
66
+ let l = e.get("graphics");
67
+ if (l) {
68
+ let g = this.getPoint(t, m), p = this.getPoint(h, d), w = this.getPoint(Y, c), a = this.getPoint(n, x);
462
69
  if (this.get("turboMode")) {
463
- const a = this.allColumnsData[this.allColumnsData.length - 1];
464
- a.lowX0 = u.x, a.lowY0 = u.y, a.lowX1 = p.x, a.lowY1 = p.y, a.highX0 = _.x, a.highY0 = _.y, a.highX1 = g.x, a.highY1 = g.y;
70
+ const o = this.allColumnsData[this.allColumnsData.length - 1];
71
+ o.lowX0 = g.x, o.lowY0 = g.y, o.lowX1 = p.x, o.lowY1 = p.y, o.highX0 = w.x, o.highY0 = w.y, o.highX1 = a.x, o.highY1 = a.y;
465
72
  } else {
466
- let a = h.x(), f = h.y();
467
- h.set("lowX0", u.x - a), h.set("lowY0", u.y - f), h.set("lowX1", p.x - a), h.set("lowY1", p.y - f), h.set("highX0", _.x - a), h.set("highY0", _.y - f), h.set("highX1", g.x - a), h.set("highY1", g.y - f), h.set("orientation", x);
468
- let c = e.get("rangeGraphics");
469
- c && k(c, (r) => {
470
- r.set("lowX0", u.x - a), r.set("lowY0", u.y - f), r.set("lowX1", p.x - a), r.set("lowY1", p.y - f), r.set("highX0", _.x - a), r.set("highY0", _.y - f), r.set("highX1", g.x - a), r.set("highY1", g.y - f), r.set("orientation", x);
73
+ let o = l.x(), r = l.y();
74
+ l.set("lowX0", g.x - o), l.set("lowY0", g.y - r), l.set("lowX1", p.x - o), l.set("lowY1", p.y - r), l.set("highX0", w.x - o), l.set("highY0", w.y - r), l.set("highX1", a.x - o), l.set("highY1", a.y - r), l.set("orientation", u);
75
+ let s = e.get("rangeGraphics");
76
+ s && V(s, (i) => {
77
+ i.set("lowX0", g.x - o), i.set("lowY0", g.y - r), i.set("lowX1", p.x - o), i.set("lowY1", p.y - r), i.set("highX0", w.x - o), i.set("highY0", w.y - r), i.set("highX1", a.x - o), i.set("highY1", a.y - r), i.set("orientation", u);
471
78
  });
472
79
  }
473
80
  }
474
81
  }
475
82
  _afterColumnsDraw() {
476
83
  this.get("turboMode") && this.allColumns.set("draw", (e) => {
477
- e.clear(), k(this.allColumnsData, (t) => {
84
+ e.clear(), V(this.allColumnsData, (t) => {
478
85
  e.beginPath();
479
- const s = t.width, o = t.height, i = t.x, n = t.y, l = t.stroke, d = t.fill, m = t.strokeWidth, x = t.strokeOpacity, h = t.fillOpacity, u = t.lowX0, p = t.lowY0, _ = t.lowX1, g = t.lowY1, a = t.highX0, f = t.highY0, c = t.highX1, r = t.highY1;
480
- e.beginFill(d, h), e.beginPath(), e.lineStyle(m, l, x), e.drawRect(i, n, s, o), e.moveTo(u, p), e.lineTo(_, g), e.moveTo(a, f), e.lineTo(c, r), e.endStroke(), e.endFill();
86
+ const h = t.width, m = t.height, d = t.x, Y = t.y, n = t.stroke, c = t.fill, x = t.strokeWidth, u = t.strokeOpacity, l = t.fillOpacity, g = t.lowX0, p = t.lowY0, w = t.lowX1, a = t.lowY1, o = t.highX0, r = t.highY0, s = t.highX1, i = t.highY1;
87
+ e.beginFill(c, l), e.beginPath(), e.lineStyle(x, n, u), e.drawRect(d, Y, h, m), e.moveTo(g, p), e.lineTo(w, a), e.moveTo(o, r), e.lineTo(s, i), e.endStroke(), e.endFill();
481
88
  });
482
89
  });
483
90
  }
484
91
  _processAxisRange(e) {
485
- super._processAxisRange(e), e.columns = new E(H.new({}), () => N._new(this._root, {
486
- themeTags: U(e.columns.template.get("themeTags", []), ["candlestick", "series", "column"])
92
+ super._processAxisRange(e), e.columns = new L(k.new({}), () => D._new(this._root, {
93
+ themeTags: T(e.columns.template.get("themeTags", []), ["candlestick", "series", "column"])
487
94
  }, [this.columns.template, e.columns.template]));
488
95
  }
489
96
  }
490
- Object.defineProperty(z, "className", {
97
+ Object.defineProperty(C, "className", {
491
98
  enumerable: !0,
492
99
  configurable: !0,
493
100
  writable: !0,
494
101
  value: "CandlestickSeries"
495
102
  });
496
- Object.defineProperty(z, "classNames", {
103
+ Object.defineProperty(C, "classNames", {
497
104
  enumerable: !0,
498
105
  configurable: !0,
499
106
  writable: !0,
500
- value: S.classNames.concat([z.className])
107
+ value: F.classNames.concat([C.className])
501
108
  });
502
- const xe = (j) => {
503
- const e = ge({
504
- props: j,
109
+ const $ = (P) => {
110
+ const e = H({
111
+ props: P,
505
112
  name: "MuiCandlestickChart"
506
113
  }), {
507
114
  data: t,
508
- seriesName: s,
509
- height: o = "500px",
510
- width: i = "100%",
511
- chartId: n = "candlestick-chart",
512
- showVolume: l = !1,
513
- risingColor: d = "#00b050",
514
- fallingColor: m = "#ff3b30",
515
- loading: x = !1,
516
- emptyMessage: h = "No data available",
517
- sx: u,
115
+ seriesName: h,
116
+ height: m = "500px",
117
+ width: d = "100%",
118
+ chartId: Y = "candlestick-chart",
119
+ showVolume: n = !1,
120
+ risingColor: c = "#00b050",
121
+ fallingColor: x = "#ff3b30",
122
+ loading: u = !1,
123
+ emptyMessage: l = "No data available",
124
+ sx: g,
518
125
  ...p
519
- } = e, _ = {
126
+ } = e, w = {
520
127
  ...e,
521
- height: o,
522
- width: i,
523
- chartId: n,
524
- showVolume: l,
525
- risingColor: d,
526
- fallingColor: m,
527
- loading: x,
528
- emptyMessage: h
529
- }, g = q(null), a = q(null), f = q(null);
530
- return ue(() => {
531
- if (!f.current) return;
532
- const c = oe.new(f.current);
533
- a.current = c, c.setThemes([ne.new(c)]);
534
- const r = c.container.children.push(
535
- le.new(c, {
128
+ height: m,
129
+ width: d,
130
+ chartId: Y,
131
+ showVolume: n,
132
+ risingColor: c,
133
+ fallingColor: x,
134
+ loading: u,
135
+ emptyMessage: l
136
+ }, a = A(null), o = A(null), r = A(null);
137
+ return W(() => {
138
+ if (!r.current) return;
139
+ const s = G.new(r.current);
140
+ o.current = s, s.setThemes([S.new(s)]);
141
+ const i = s.container.children.push(
142
+ j.new(s, {
536
143
  panX: !0,
537
144
  panY: !0,
538
145
  wheelX: "panX",
539
146
  wheelY: "zoomX",
540
147
  pinchZoomX: !0,
541
- layout: c.verticalLayout
148
+ layout: s.verticalLayout
542
149
  })
543
150
  );
544
- g.current = r, r.set(
151
+ a.current = i, i.set(
545
152
  "cursor",
546
- ae.new(c, {
153
+ Z.new(s, {
547
154
  behavior: "zoomX"
548
155
  })
549
156
  ).lineY.set("visible", !1);
550
- const w = r.xAxes.push(
551
- re.new(c, {
157
+ const b = i.xAxes.push(
158
+ q.new(s, {
552
159
  maxDeviation: 0.3,
553
160
  groupData: !0,
554
161
  baseInterval: { timeUnit: "day", count: 1 },
555
- renderer: he.new(c, {
162
+ renderer: z.new(s, {
556
163
  minorGridEnabled: !0
557
164
  }),
558
- tooltip: I.new(c, {})
165
+ tooltip: O.new(s, {})
559
166
  })
560
- ), X = r.yAxes.push(
561
- ee.new(c, {
562
- renderer: te.new(c, {})
167
+ ), y = i.yAxes.push(
168
+ R.new(s, {
169
+ renderer: N.new(s, {})
563
170
  })
564
- ), y = r.series.push(
565
- z.new(c, {
566
- name: s || "Price",
567
- xAxis: w,
568
- yAxis: X,
171
+ ), f = i.series.push(
172
+ C.new(s, {
173
+ name: h || "Price",
174
+ xAxis: b,
175
+ yAxis: y,
569
176
  valueXField: "date",
570
177
  openValueYField: "open",
571
178
  highValueYField: "high",
572
179
  lowValueYField: "low",
573
180
  valueYField: "close",
574
- tooltip: I.new(c, {
181
+ tooltip: O.new(s, {
575
182
  labelText: `
576
183
  Open: {openValueY}
577
184
  High: {highValueY}
@@ -582,61 +189,61 @@ const xe = (j) => {
582
189
  })
583
190
  })
584
191
  );
585
- y.columns.template.states.create("riseFromPrevious", {
586
- fill: M(d),
587
- stroke: M(d)
588
- }), y.columns.template.states.create("dropFromPrevious", {
589
- fill: M(m),
590
- stroke: M(m)
192
+ f.columns.template.states.create("riseFromPrevious", {
193
+ fill: _(c),
194
+ stroke: _(c)
195
+ }), f.columns.template.states.create("dropFromPrevious", {
196
+ fill: _(x),
197
+ stroke: _(x)
591
198
  });
592
- let b = null, C = null;
593
- return l && (C = r.yAxes.push(
594
- ee.new(c, {
595
- renderer: te.new(c, {
199
+ let X = null, v = null;
200
+ return n && (v = i.yAxes.push(
201
+ R.new(s, {
202
+ renderer: N.new(s, {
596
203
  opposite: !0
597
204
  }),
598
205
  numberFormat: "#a"
599
206
  })
600
- ), b = r.series.push(
601
- S.new(c, {
207
+ ), X = i.series.push(
208
+ F.new(s, {
602
209
  name: "Volume",
603
- xAxis: w,
604
- yAxis: C,
210
+ xAxis: b,
211
+ yAxis: v,
605
212
  valueYField: "volume",
606
213
  valueXField: "date",
607
- fill: M("#2962ff"),
608
- stroke: M("#2962ff"),
214
+ fill: _("#2962ff"),
215
+ stroke: _("#2962ff"),
609
216
  opacity: 0.6
610
217
  })
611
- ), b.columns.template.setAll({
612
- width: ce(80)
613
- })), y.data.setAll(t), l && b && b.data.setAll(t), r.appear(1e3), y.appear(1e3), () => {
614
- c.dispose();
218
+ ), X.columns.template.setAll({
219
+ width: E(80)
220
+ })), f.data.setAll(t), n && X && X.data.setAll(t), i.appear(1e3), f.appear(1e3), () => {
221
+ s.dispose();
615
222
  };
616
- }, []), pe(() => {
617
- if (g.current && a.current) {
618
- const c = g.current.series.getIndex(
223
+ }, []), U(() => {
224
+ if (a.current && o.current) {
225
+ const s = a.current.series.getIndex(
619
226
  0
620
- ), r = l ? g.current.series.getIndex(1) : null;
621
- c == null || c.data.setAll(t), r == null || r.data.setAll(t);
227
+ ), i = n ? a.current.series.getIndex(1) : null;
228
+ s == null || s.data.setAll(t), i == null || i.data.setAll(t);
622
229
  }
623
- }, [t, l]), {
624
- chartDivRef: f,
230
+ }, [t, n]), {
231
+ chartDivRef: r,
625
232
  data: t,
626
- seriesName: s,
627
- height: o,
628
- width: i,
629
- chartId: n,
630
- showVolume: l,
631
- risingColor: d,
632
- fallingColor: m,
633
- loading: x,
634
- emptyMessage: h,
635
- sx: u,
233
+ seriesName: h,
234
+ height: m,
235
+ width: d,
236
+ chartId: Y,
237
+ showVolume: n,
238
+ risingColor: c,
239
+ fallingColor: x,
240
+ loading: u,
241
+ emptyMessage: l,
242
+ sx: g,
636
243
  other: p,
637
- ownerState: _
244
+ ownerState: w
638
245
  };
639
246
  };
640
247
  export {
641
- xe as useCandlestickChartLogic
248
+ $ as useCandlestickChartLogic
642
249
  };