@hybridcore/ui 1.5.70 → 1.5.73

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.
@@ -0,0 +1,851 @@
1
+ import { jsxs as we, jsx as W } from "react/jsx-runtime";
2
+ import { S as oe, L as $, T as F, C as te, m as P, R as ie, k as se, X as ue, G as S, e as N, i as ne, l as Te, j as he, n as Pe, a as le, b as Fe, A as Le, c as Ae, d as De, D as Ce, f as Oe, V as Xe, h as $e, o as Ye, g as Se, p as re } from "../../../AxisRendererY-CFo972D5.js";
3
+ import { useRef as ae, useLayoutEffect as Me, useEffect as je } from "react";
4
+ class V extends oe {
5
+ constructor() {
6
+ super(...arguments), Object.defineProperty(this, "itemContainers", {
7
+ enumerable: !0,
8
+ configurable: !0,
9
+ writable: !0,
10
+ value: this.addDisposer(new $(F.new({}), () => te._new(this._root, {
11
+ themeTags: P(this.itemContainers.template.get("themeTags", []), ["legend", "item"]),
12
+ themeTagsSelf: P(this.itemContainers.template.get("themeTagsSelf", []), ["itemcontainer"]),
13
+ background: ie.new(this._root, {
14
+ themeTags: P(this.itemContainers.template.get("themeTags", []), ["legend", "item", "background"]),
15
+ themeTagsSelf: P(this.itemContainers.template.get("themeTagsSelf", []), ["itemcontainer"])
16
+ })
17
+ }, [this.itemContainers.template])))
18
+ }), Object.defineProperty(this, "markers", {
19
+ enumerable: !0,
20
+ configurable: !0,
21
+ writable: !0,
22
+ value: this.addDisposer(new $(F.new({}), () => te._new(this._root, {
23
+ themeTags: P(this.markers.template.get("themeTags", []), ["legend", "marker"])
24
+ }, [this.markers.template])))
25
+ }), Object.defineProperty(this, "labels", {
26
+ enumerable: !0,
27
+ configurable: !0,
28
+ writable: !0,
29
+ value: this.addDisposer(new $(F.new({}), () => se._new(this._root, {
30
+ themeTags: P(this.labels.template.get("themeTags", []), ["legend", "label"])
31
+ }, [this.labels.template])))
32
+ }), Object.defineProperty(this, "valueLabels", {
33
+ enumerable: !0,
34
+ configurable: !0,
35
+ writable: !0,
36
+ value: this.addDisposer(new $(F.new({}), () => se._new(this._root, {
37
+ themeTags: P(this.valueLabels.template.get("themeTags", []), ["legend", "label", "value"])
38
+ }, [this.valueLabels.template])))
39
+ }), Object.defineProperty(this, "markerRectangles", {
40
+ enumerable: !0,
41
+ configurable: !0,
42
+ writable: !0,
43
+ value: this.addDisposer(new $(F.new({}), () => ie._new(this._root, {
44
+ themeTags: P(this.markerRectangles.template.get("themeTags", []), ["legend", "marker", "rectangle"])
45
+ }, [this.markerRectangles.template])))
46
+ });
47
+ }
48
+ _afterNew() {
49
+ this._settings.themeTags = P(this._settings.themeTags, ["legend"]), this.fields.push("name", "stroke", "fill"), super._afterNew();
50
+ }
51
+ /**
52
+ * @ignore
53
+ */
54
+ makeItemContainer(e) {
55
+ const t = this.children.push(this.itemContainers.make());
56
+ return t._setDataItem(e), this.itemContainers.push(t), t.states.create("disabled", {}), t;
57
+ }
58
+ /**
59
+ * @ignore
60
+ */
61
+ makeMarker() {
62
+ const e = this.markers.make();
63
+ return this.markers.push(e), e.states.create("disabled", {}), e;
64
+ }
65
+ /**
66
+ * @ignore
67
+ */
68
+ makeLabel() {
69
+ const e = this.labels.make();
70
+ return e.states.create("disabled", {}), e;
71
+ }
72
+ /**
73
+ * @ignore
74
+ */
75
+ makeValueLabel() {
76
+ const e = this.valueLabels.make();
77
+ return e.states.create("disabled", {}), e;
78
+ }
79
+ /**
80
+ * @ignore
81
+ */
82
+ makeMarkerRectangle() {
83
+ const e = this.markerRectangles.make();
84
+ return e.states.create("disabled", {}), e;
85
+ }
86
+ processDataItem(e) {
87
+ super.processDataItem(e);
88
+ const t = this.makeItemContainer(e), i = this.get("nameField"), r = this.get("fillField"), h = this.get("strokeField");
89
+ if (t) {
90
+ const d = this.get("clickTarget", "itemContainer"), n = e.dataContext;
91
+ n && n.set && n.set("legendDataItem", e), t._setDataItem(e), e.set("itemContainer", t);
92
+ const c = this.makeMarker();
93
+ if (c) {
94
+ t.children.push(c), c._setDataItem(e), e.set("marker", c);
95
+ const s = this.get("useDefaultMarker"), o = c.children.push(this.makeMarkerRectangle());
96
+ let f = e.get("fill"), p = e.get("stroke");
97
+ e.set("markerRectangle", o), n && n.get && (f = n.get(r, f), p = n.get(h, p)), p || (p = f), s ? n.on && (n.on(r, () => {
98
+ o.set("fill", n.get(r));
99
+ }), n.on(h, () => {
100
+ o.set("stroke", n.get(h));
101
+ })) : n && n.createLegendMarker && n.createLegendMarker(), o.setAll({ fill: f, stroke: p });
102
+ const m = n.component;
103
+ m && m.updateLegendMarker && m.updateLegendMarker(n);
104
+ }
105
+ const l = this.makeLabel();
106
+ if (l) {
107
+ t.children.push(l), l._setDataItem(e), e.set("label", l), l.text.on("text", () => {
108
+ t.setRaw("ariaLabel", l.text._getText() + (this.get("clickTarget") !== "none" ? "; " + this._t("Press ENTER to toggle") : "")), t.markDirtyAccessibility();
109
+ }), n && n.get && e.set("name", n.get(i));
110
+ let s = e.get("name");
111
+ s && l.set("text", s);
112
+ }
113
+ const a = this.makeValueLabel();
114
+ if (a && (t.children.push(a), a._setDataItem(e), e.set("valueLabel", a)), n && n.show && (n.on("visible", (s) => {
115
+ t.set("disabled", !s);
116
+ }), n.get("visible") || t.set("disabled", !0), d != "none")) {
117
+ let s = t;
118
+ d == "marker" && (s = c), this._addClickEvents(s, n, e);
119
+ }
120
+ this.children.values.sort((s, o) => {
121
+ const f = s.dataItem.dataContext, p = o.dataItem.dataContext;
122
+ if (f && p) {
123
+ const m = this.data.indexOf(f), b = this.data.indexOf(p);
124
+ if (m > b)
125
+ return 1;
126
+ if (m < b)
127
+ return -1;
128
+ }
129
+ return 0;
130
+ }), n && n.updateLegendValue && n.updateLegendValue();
131
+ }
132
+ }
133
+ _addClickEvents(e, t, i) {
134
+ e.set("cursorOverStyle", "pointer"), e.events.on("pointerover", () => {
135
+ const r = t.component;
136
+ r && r.hoverDataItem && r.hoverDataItem(t);
137
+ }), e.events.on("pointerout", () => {
138
+ const r = t.component;
139
+ r && r.hoverDataItem && r.unhoverDataItem(t);
140
+ }), e.events.on("click", () => {
141
+ const r = i.get("label").text._getText();
142
+ t.show && t.isHidden && (t.isHidden() || t.get("visible") === !1) ? (t.show(), e.set("disabled", !1), this._root.readerAlert(this._t("%1 shown", this._root.locale, r))) : t.hide && (t.hide(), e.set("disabled", !0), this._root.readerAlert(this._t("%1 hidden", this._root.locale, r)));
143
+ });
144
+ }
145
+ /**
146
+ * @ignore
147
+ */
148
+ disposeDataItem(e) {
149
+ super.disposeDataItem(e);
150
+ const t = e.dataContext;
151
+ t && t.get && t.get("legendDataItem") == e && t.set("legendDataItem", void 0);
152
+ let i = e.get("itemContainer");
153
+ i && (this.itemContainers.removeValue(i), i.dispose());
154
+ let r = e.get("marker");
155
+ r && (this.markers.removeValue(r), r.dispose());
156
+ let h = e.get("markerRectangle");
157
+ h && (this.markerRectangles.removeValue(h), h.dispose());
158
+ let d = e.get("label");
159
+ d && (this.labels.removeValue(d), d.dispose());
160
+ let n = e.get("valueLabel");
161
+ n && (this.valueLabels.removeValue(n), n.dispose());
162
+ }
163
+ }
164
+ Object.defineProperty(V, "className", {
165
+ enumerable: !0,
166
+ configurable: !0,
167
+ writable: !0,
168
+ value: "Legend"
169
+ });
170
+ Object.defineProperty(V, "classNames", {
171
+ enumerable: !0,
172
+ configurable: !0,
173
+ writable: !0,
174
+ value: oe.classNames.concat([V.className])
175
+ });
176
+ function v(u) {
177
+ return function() {
178
+ return u;
179
+ };
180
+ }
181
+ const q = Math.PI, Z = 2 * q, M = 1e-6, Re = Z - M;
182
+ function ce(u) {
183
+ this._ += u[0];
184
+ for (let e = 1, t = u.length; e < t; ++e)
185
+ this._ += arguments[e] + u[e];
186
+ }
187
+ function Ee(u) {
188
+ let e = Math.floor(u);
189
+ if (!(e >= 0)) throw new Error(`invalid digits: ${u}`);
190
+ if (e > 15) return ce;
191
+ const t = 10 ** e;
192
+ return function(i) {
193
+ this._ += i[0];
194
+ for (let r = 1, h = i.length; r < h; ++r)
195
+ this._ += Math.round(arguments[r] * t) / t + i[r];
196
+ };
197
+ }
198
+ class Ge {
199
+ constructor(e) {
200
+ this._x0 = this._y0 = // start of current subpath
201
+ this._x1 = this._y1 = null, this._ = "", this._append = e == null ? ce : Ee(e);
202
+ }
203
+ moveTo(e, t) {
204
+ this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +t}`;
205
+ }
206
+ closePath() {
207
+ this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`);
208
+ }
209
+ lineTo(e, t) {
210
+ this._append`L${this._x1 = +e},${this._y1 = +t}`;
211
+ }
212
+ quadraticCurveTo(e, t, i, r) {
213
+ this._append`Q${+e},${+t},${this._x1 = +i},${this._y1 = +r}`;
214
+ }
215
+ bezierCurveTo(e, t, i, r, h, d) {
216
+ this._append`C${+e},${+t},${+i},${+r},${this._x1 = +h},${this._y1 = +d}`;
217
+ }
218
+ arcTo(e, t, i, r, h) {
219
+ if (e = +e, t = +t, i = +i, r = +r, h = +h, h < 0) throw new Error(`negative radius: ${h}`);
220
+ let d = this._x1, n = this._y1, c = i - e, l = r - t, a = d - e, s = n - t, o = a * a + s * s;
221
+ if (this._x1 === null)
222
+ this._append`M${this._x1 = e},${this._y1 = t}`;
223
+ else if (o > M) if (!(Math.abs(s * c - l * a) > M) || !h)
224
+ this._append`L${this._x1 = e},${this._y1 = t}`;
225
+ else {
226
+ let f = i - d, p = r - n, m = c * c + l * l, b = f * f + p * p, k = Math.sqrt(m), x = Math.sqrt(o), y = h * Math.tan((q - Math.acos((m + o - b) / (2 * k * x))) / 2), _ = y / x, w = y / k;
227
+ Math.abs(_ - 1) > M && this._append`L${e + _ * a},${t + _ * s}`, this._append`A${h},${h},0,0,${+(s * f > a * p)},${this._x1 = e + w * c},${this._y1 = t + w * l}`;
228
+ }
229
+ }
230
+ arc(e, t, i, r, h, d) {
231
+ if (e = +e, t = +t, i = +i, d = !!d, i < 0) throw new Error(`negative radius: ${i}`);
232
+ let n = i * Math.cos(r), c = i * Math.sin(r), l = e + n, a = t + c, s = 1 ^ d, o = d ? r - h : h - r;
233
+ this._x1 === null ? this._append`M${l},${a}` : (Math.abs(this._x1 - l) > M || Math.abs(this._y1 - a) > M) && this._append`L${l},${a}`, i && (o < 0 && (o = o % Z + Z), o > Re ? this._append`A${i},${i},0,1,${s},${e - n},${t - c}A${i},${i},0,1,${s},${this._x1 = l},${this._y1 = a}` : o > M && this._append`A${i},${i},0,${+(o >= q)},${s},${this._x1 = e + i * Math.cos(h)},${this._y1 = t + i * Math.sin(h)}`);
234
+ }
235
+ rect(e, t, i, r) {
236
+ this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +t}h${i = +i}v${+r}h${-i}Z`;
237
+ }
238
+ toString() {
239
+ return this._;
240
+ }
241
+ }
242
+ function fe(u) {
243
+ let e = 3;
244
+ return u.digits = function(t) {
245
+ if (!arguments.length) return e;
246
+ if (t == null)
247
+ e = null;
248
+ else {
249
+ const i = Math.floor(t);
250
+ if (!(i >= 0)) throw new RangeError(`invalid digits: ${t}`);
251
+ e = i;
252
+ }
253
+ return u;
254
+ }, () => new Ge(e);
255
+ }
256
+ function de(u) {
257
+ return typeof u == "object" && "length" in u ? u : Array.from(u);
258
+ }
259
+ function pe(u) {
260
+ this._context = u;
261
+ }
262
+ pe.prototype = {
263
+ areaStart: function() {
264
+ this._line = 0;
265
+ },
266
+ areaEnd: function() {
267
+ this._line = NaN;
268
+ },
269
+ lineStart: function() {
270
+ this._point = 0;
271
+ },
272
+ lineEnd: function() {
273
+ (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
274
+ },
275
+ point: function(u, e) {
276
+ switch (u = +u, e = +e, this._point) {
277
+ case 0:
278
+ this._point = 1, this._line ? this._context.lineTo(u, e) : this._context.moveTo(u, e);
279
+ break;
280
+ case 1:
281
+ this._point = 2;
282
+ default:
283
+ this._context.lineTo(u, e);
284
+ break;
285
+ }
286
+ }
287
+ };
288
+ function me(u) {
289
+ return new pe(u);
290
+ }
291
+ function ge(u) {
292
+ return u[0];
293
+ }
294
+ function be(u) {
295
+ return u[1];
296
+ }
297
+ function ke(u, e) {
298
+ var t = v(!0), i = null, r = me, h = null, d = fe(n);
299
+ u = typeof u == "function" ? u : u === void 0 ? ge : v(u), e = typeof e == "function" ? e : e === void 0 ? be : v(e);
300
+ function n(c) {
301
+ var l, a = (c = de(c)).length, s, o = !1, f;
302
+ for (i == null && (h = r(f = d())), l = 0; l <= a; ++l)
303
+ !(l < a && t(s = c[l], l, c)) === o && ((o = !o) ? h.lineStart() : h.lineEnd()), o && h.point(+u(s, l, c), +e(s, l, c));
304
+ if (f) return h = null, f + "" || null;
305
+ }
306
+ return n.x = function(c) {
307
+ return arguments.length ? (u = typeof c == "function" ? c : v(+c), n) : u;
308
+ }, n.y = function(c) {
309
+ return arguments.length ? (e = typeof c == "function" ? c : v(+c), n) : e;
310
+ }, n.defined = function(c) {
311
+ return arguments.length ? (t = typeof c == "function" ? c : v(!!c), n) : t;
312
+ }, n.curve = function(c) {
313
+ return arguments.length ? (r = c, i != null && (h = r(i)), n) : r;
314
+ }, n.context = function(c) {
315
+ return arguments.length ? (c == null ? i = h = null : h = r(i = c), n) : i;
316
+ }, n;
317
+ }
318
+ function Ne(u, e, t) {
319
+ var i = null, r = v(!0), h = null, d = me, n = null, c = fe(l);
320
+ u = typeof u == "function" ? u : u === void 0 ? ge : v(+u), e = typeof e == "function" ? e : v(e === void 0 ? 0 : +e), t = typeof t == "function" ? t : t === void 0 ? be : v(+t);
321
+ function l(s) {
322
+ var o, f, p, m = (s = de(s)).length, b, k = !1, x, y = new Array(m), _ = new Array(m);
323
+ for (h == null && (n = d(x = c())), o = 0; o <= m; ++o) {
324
+ if (!(o < m && r(b = s[o], o, s)) === k)
325
+ if (k = !k)
326
+ f = o, n.areaStart(), n.lineStart();
327
+ else {
328
+ for (n.lineEnd(), n.lineStart(), p = o - 1; p >= f; --p)
329
+ n.point(y[p], _[p]);
330
+ n.lineEnd(), n.areaEnd();
331
+ }
332
+ k && (y[o] = +u(b, o, s), _[o] = +e(b, o, s), n.point(i ? +i(b, o, s) : y[o], t ? +t(b, o, s) : _[o]));
333
+ }
334
+ if (x) return n = null, x + "" || null;
335
+ }
336
+ function a() {
337
+ return ke().defined(r).curve(d).context(h);
338
+ }
339
+ return l.x = function(s) {
340
+ return arguments.length ? (u = typeof s == "function" ? s : v(+s), i = null, l) : u;
341
+ }, l.x0 = function(s) {
342
+ return arguments.length ? (u = typeof s == "function" ? s : v(+s), l) : u;
343
+ }, l.x1 = function(s) {
344
+ return arguments.length ? (i = s == null ? null : typeof s == "function" ? s : v(+s), l) : i;
345
+ }, l.y = function(s) {
346
+ return arguments.length ? (e = typeof s == "function" ? s : v(+s), t = null, l) : e;
347
+ }, l.y0 = function(s) {
348
+ return arguments.length ? (e = typeof s == "function" ? s : v(+s), l) : e;
349
+ }, l.y1 = function(s) {
350
+ return arguments.length ? (t = s == null ? null : typeof s == "function" ? s : v(+s), l) : t;
351
+ }, l.lineX0 = l.lineY0 = function() {
352
+ return a().x(u).y(e);
353
+ }, l.lineY1 = function() {
354
+ return a().x(u).y(t);
355
+ }, l.lineX1 = function() {
356
+ return a().x(i).y(e);
357
+ }, l.defined = function(s) {
358
+ return arguments.length ? (r = typeof s == "function" ? s : v(!!s), l) : r;
359
+ }, l.curve = function(s) {
360
+ return arguments.length ? (d = s, h != null && (n = d(h)), l) : d;
361
+ }, l.context = function(s) {
362
+ return arguments.length ? (s == null ? h = n = null : n = d(h = s), l) : h;
363
+ }, l;
364
+ }
365
+ class I extends ue {
366
+ constructor() {
367
+ super(...arguments), Object.defineProperty(this, "_endIndex", {
368
+ enumerable: !0,
369
+ configurable: !0,
370
+ writable: !0,
371
+ value: void 0
372
+ }), Object.defineProperty(this, "_strokeGenerator", {
373
+ enumerable: !0,
374
+ configurable: !0,
375
+ writable: !0,
376
+ value: ke()
377
+ }), Object.defineProperty(this, "_fillGenerator", {
378
+ enumerable: !0,
379
+ configurable: !0,
380
+ writable: !0,
381
+ value: Ne()
382
+ }), Object.defineProperty(this, "_legendStroke", {
383
+ enumerable: !0,
384
+ configurable: !0,
385
+ writable: !0,
386
+ value: void 0
387
+ }), Object.defineProperty(this, "_legendFill", {
388
+ enumerable: !0,
389
+ configurable: !0,
390
+ writable: !0,
391
+ value: void 0
392
+ }), Object.defineProperty(this, "strokes", {
393
+ enumerable: !0,
394
+ configurable: !0,
395
+ writable: !0,
396
+ value: this.addDisposer(new $(F.new({}), () => S._new(this._root, {
397
+ themeTags: P(this.strokes.template.get("themeTags", []), ["line", "series", "stroke"])
398
+ }, [this.strokes.template])))
399
+ }), Object.defineProperty(this, "fills", {
400
+ enumerable: !0,
401
+ configurable: !0,
402
+ writable: !0,
403
+ value: this.addDisposer(new $(F.new({}), () => S._new(this._root, {
404
+ themeTags: P(this.strokes.template.get("themeTags", []), ["line", "series", "fill"])
405
+ }, [this.fills.template])))
406
+ }), Object.defineProperty(this, "_fillTemplate", {
407
+ enumerable: !0,
408
+ configurable: !0,
409
+ writable: !0,
410
+ value: void 0
411
+ }), Object.defineProperty(this, "_strokeTemplate", {
412
+ enumerable: !0,
413
+ configurable: !0,
414
+ writable: !0,
415
+ value: void 0
416
+ }), Object.defineProperty(this, "_previousPoint", {
417
+ enumerable: !0,
418
+ configurable: !0,
419
+ writable: !0,
420
+ value: [0, 0, 0, 0]
421
+ }), Object.defineProperty(this, "_dindex", {
422
+ enumerable: !0,
423
+ configurable: !0,
424
+ writable: !0,
425
+ value: 0
426
+ }), Object.defineProperty(this, "_sindex", {
427
+ enumerable: !0,
428
+ configurable: !0,
429
+ writable: !0,
430
+ value: 0
431
+ });
432
+ }
433
+ _afterNew() {
434
+ this._fillGenerator.y0(function(e) {
435
+ return e[3];
436
+ }), this._fillGenerator.x0(function(e) {
437
+ return e[2];
438
+ }), this._fillGenerator.y1(function(e) {
439
+ return e[1];
440
+ }), this._fillGenerator.x1(function(e) {
441
+ return e[0];
442
+ }), super._afterNew();
443
+ }
444
+ /**
445
+ * @ignore
446
+ */
447
+ makeStroke(e) {
448
+ const t = this.mainContainer.children.push(e.make());
449
+ return e.push(t), t;
450
+ }
451
+ /**
452
+ * @ignore
453
+ */
454
+ makeFill(e) {
455
+ const t = this.mainContainer.children.push(e.make());
456
+ return e.push(t), t;
457
+ }
458
+ _updateChildren() {
459
+ this._strokeTemplate = void 0, this._fillTemplate = void 0;
460
+ let e = this.get("xAxis"), t = this.get("yAxis");
461
+ if (this.isDirty("stroke")) {
462
+ const i = this.get("stroke");
463
+ this.strokes.template.set("stroke", i);
464
+ const r = this._legendStroke;
465
+ r && r.states.lookup("default").set("stroke", i);
466
+ }
467
+ if (this.isDirty("fill")) {
468
+ const i = this.get("fill");
469
+ this.fills.template.set("fill", i);
470
+ const r = this._legendFill;
471
+ r && r.states.lookup("default").set("fill", i);
472
+ }
473
+ if (this.isDirty("fillPattern")) {
474
+ const i = this.get("fillPattern");
475
+ this.fills.template.set("fillPattern", i);
476
+ const r = this._legendFill;
477
+ r && r.states.lookup("default").set("fillPattern", i);
478
+ }
479
+ if (this.isDirty("curveFactory")) {
480
+ const i = this.get("curveFactory");
481
+ i && (this._strokeGenerator.curve(i), this._fillGenerator.curve(i));
482
+ }
483
+ if (e.inited && t.inited) {
484
+ if (this._axesDirty || this._valuesDirty || this._stackDirty || this.isDirty("vcx") || this.isDirty("vcy") || this._sizeDirty || this.isDirty("connect") || this.isDirty("curveFactory")) {
485
+ this.fills.each((a) => {
486
+ a.setPrivate("visible", !1);
487
+ }), this.strokes.each((a) => {
488
+ a.setPrivate("visible", !1);
489
+ }), this.axisRanges.each((a) => {
490
+ let s = a.fills;
491
+ s && s.each((f) => {
492
+ f.setPrivate("visible", !1);
493
+ });
494
+ let o = a.strokes;
495
+ o && o.each((f) => {
496
+ f.setPrivate("visible", !1);
497
+ });
498
+ });
499
+ let i = this.startIndex(), r = this.strokes.template.get("templateField"), h = this.fills.template.get("templateField"), d = !0, n = !0;
500
+ r && (d = !1), h && (n = !1);
501
+ for (let a = i - 1; a >= 0; a--) {
502
+ let s = this.dataItems[a], o = !0, f = s.dataContext;
503
+ if (r && f[r] && (d = !0), h && f[h] && (n = !0), N(this._valueFields, (p) => {
504
+ le(s.get(p)) || (o = !1);
505
+ }), o && d && n) {
506
+ i = a;
507
+ break;
508
+ }
509
+ }
510
+ let c = this.dataItems.length, l = this.endIndex();
511
+ if (l < c) {
512
+ l++;
513
+ for (let a = l; a < c; a++) {
514
+ let s = this.dataItems[a], o = !0;
515
+ if (N(this._valueFields, (f) => {
516
+ le(s.get(f)) || (o = !1);
517
+ }), o) {
518
+ l = a + 1;
519
+ break;
520
+ }
521
+ }
522
+ }
523
+ if (i > 0 && i--, this._endIndex = l, this._clearGraphics(), this._sindex = 0, this._dindex = i, this.dataItems.length == 1)
524
+ this._startSegment(0);
525
+ else
526
+ for (; this._dindex < l - 1; )
527
+ this._startSegment(this._dindex), this._sindex++;
528
+ }
529
+ } else
530
+ this._skipped = !0;
531
+ super._updateChildren();
532
+ }
533
+ _clearGraphics() {
534
+ this.strokes.clear(), this.fills.clear(), this.axisRanges.each((e) => {
535
+ e.fills.clear(), e.strokes.clear();
536
+ });
537
+ }
538
+ _startSegment(e) {
539
+ let t = this._endIndex, i = t;
540
+ const r = this.get("autoGapCount"), h = this.get("connect"), d = this.makeFill(this.fills), n = this._fillTemplate, c = this.fills.template;
541
+ n && n != c && (d.template = n), d.setPrivate("visible", !0);
542
+ const l = this.makeStroke(this.strokes), a = this._strokeTemplate;
543
+ a && a != this.strokes.template && (l.template = a), l.setPrivate("visible", !0);
544
+ let s = this.get("xAxis"), o = this.get("yAxis"), f = this.get("baseAxis"), p = this.get("vcx", 1), m = this.get("vcy", 1), b = this._xField, k = this._yField, x = this._xOpenField, y = this._yOpenField;
545
+ const _ = this.get("openValueXField"), w = this.get("openValueYField");
546
+ _ || (x = this._xField), w || (y = this._yField);
547
+ const Y = this.get("stacked"), A = s.basePosition(), L = o.basePosition();
548
+ let D;
549
+ f === o ? D = this._yField : D = this._xField;
550
+ const O = [];
551
+ let X = [];
552
+ O.push(X);
553
+ const B = this.strokes.template.get("templateField"), Q = this.fills.template.get("templateField");
554
+ let U = this.get("locationX", 0.5), J = this.get("locationY", 0.5), _e = this.get("openLocationX", U), ve = this.get("openLocationY", J);
555
+ const xe = this.get("minDistance", 0);
556
+ let T, K = this.fills.template.get("visible");
557
+ this.axisRanges.length > 0 && (K = !0);
558
+ let ee = !1;
559
+ (Y || _ || w) && (ee = !0);
560
+ const z = {
561
+ points: X,
562
+ segments: O,
563
+ stacked: Y,
564
+ getOpen: ee,
565
+ basePosX: A,
566
+ basePosY: L,
567
+ fillVisible: K,
568
+ xField: b,
569
+ yField: k,
570
+ xOpenField: x,
571
+ yOpenField: y,
572
+ vcx: p,
573
+ vcy: m,
574
+ baseAxis: f,
575
+ xAxis: s,
576
+ yAxis: o,
577
+ locationX: U,
578
+ locationY: J,
579
+ openLocationX: _e,
580
+ openLocationY: ve,
581
+ minDistance: xe
582
+ };
583
+ let E = this._strokeTemplate, G = this._fillTemplate;
584
+ for (T = e; T < i; T++) {
585
+ this._dindex = T;
586
+ const C = this._dataItems[T];
587
+ let j = C.get(b), H = C.get(k);
588
+ if (j == null || H == null ? h || (X = [], O.push(X), z.points = X) : this._getPoints(C, z), B) {
589
+ let g = C.dataContext[B];
590
+ if (g)
591
+ if (g instanceof F || (g = F.new(g)), this._strokeTemplate = g, T > e) {
592
+ i = T;
593
+ break;
594
+ } else
595
+ E = g, l.template = g;
596
+ }
597
+ if (Q) {
598
+ let g = C.dataContext[Q];
599
+ if (g)
600
+ if (g instanceof F || (g = F.new(g)), this._fillTemplate = g, T > e) {
601
+ i = T;
602
+ break;
603
+ } else
604
+ G = g, d.template = g;
605
+ }
606
+ if (!h) {
607
+ let g = this.dataItems[T + 1];
608
+ g && f.shouldGap(C, g, r, D) && (X = [], O.push(X), z.points = X);
609
+ }
610
+ }
611
+ d.setRaw("userData", [e, T]), l.setRaw("userData", [e, T]), T === t && this._endLine(X, O[0][0]), l && this._drawStroke(l, O), d && this._drawFill(d, O), this.axisRanges.each((C) => {
612
+ const j = C.container, H = C.fills, g = this.makeFill(H);
613
+ j && j.children.push(g), g.setPrivate("visible", !0), this._drawFill(g, O);
614
+ const ye = C.strokes, R = this.makeStroke(ye);
615
+ j && j.children.push(R), E && E != this.strokes.template && (R.template = E), G && G != this.fills.template && (g.template = G), R.setPrivate("visible", !0), this._drawStroke(R, O), g.setRaw("userData", [e, T]), R.setRaw("userData", [e, T]);
616
+ });
617
+ }
618
+ _getPoints(e, t) {
619
+ let i = t.points, r = e.get("locationX", t.locationX), h = e.get("locationY", t.locationY);
620
+ const d = this.get("exactLocationX", !1), n = this.get("exactLocationY", !1);
621
+ let c = t.xAxis.getDataItemPositionX(e, t.xField, r, t.vcx, d), l = t.yAxis.getDataItemPositionY(e, t.yField, h, t.vcy, n);
622
+ if (this._shouldInclude(c)) {
623
+ const a = this.getPoint(c, l), s = [a.x, a.y];
624
+ if (a.x += this._x, a.y += this._y, e.set("point", a), t.fillVisible) {
625
+ let o = c, f = l;
626
+ if (t.baseAxis === t.xAxis ? f = t.basePosY : t.baseAxis === t.yAxis && (o = t.basePosX), t.getOpen) {
627
+ let m = e.get(t.xOpenField), b = e.get(t.yOpenField);
628
+ if (m != null && b != null) {
629
+ let k = e.get("openLocationX", t.openLocationX), x = e.get("openLocationY", t.openLocationY);
630
+ if (t.stacked) {
631
+ let y = e.get("stackToItemX"), _ = e.get("stackToItemY");
632
+ y ? (o = t.xAxis.getDataItemPositionX(y, t.xField, k, y.component.get("vcx"), d), ne(o) && (o = t.basePosX)) : t.yAxis === t.baseAxis ? o = t.basePosX : o = t.xAxis.getDataItemPositionX(e, t.xOpenField, k, t.vcx, d), _ ? (f = t.yAxis.getDataItemPositionY(_, t.yField, x, _.component.get("vcy"), n), ne(f) && (f = t.basePosY)) : t.xAxis === t.baseAxis ? f = t.basePosY : f = t.yAxis.getDataItemPositionY(e, t.yOpenField, x, t.vcy, n);
633
+ } else
634
+ o = t.xAxis.getDataItemPositionX(e, t.xOpenField, k, t.vcx, d), f = t.yAxis.getDataItemPositionY(e, t.yOpenField, x, t.vcy, n);
635
+ }
636
+ }
637
+ let p = this.getPoint(o, f);
638
+ s[2] = p.x, s[3] = p.y;
639
+ }
640
+ if (t.minDistance > 0) {
641
+ const o = s[0], f = s[1], p = s[2], m = s[3], b = this._previousPoint, k = b[0], x = b[1], y = b[2], _ = b[3];
642
+ (Math.hypot(o - k, f - x) > t.minDistance || p && m && Math.hypot(p - y, m - _) > t.minDistance) && (i.push(s), this._previousPoint = s);
643
+ } else
644
+ i.push(s);
645
+ }
646
+ }
647
+ _endLine(e, t) {
648
+ }
649
+ _drawStroke(e, t) {
650
+ e.get("visible") && !e.get("forceHidden") && e.set("draw", (i) => {
651
+ N(t, (r) => {
652
+ this._strokeGenerator.context(i), this._strokeGenerator(r);
653
+ });
654
+ });
655
+ }
656
+ _drawFill(e, t) {
657
+ e.get("visible") && !e.get("forceHidden") && e.set("draw", (i) => {
658
+ N(t, (r) => {
659
+ this._fillGenerator.context(i), this._fillGenerator(r);
660
+ });
661
+ });
662
+ }
663
+ _processAxisRange(e) {
664
+ super._processAxisRange(e), e.fills = new $(F.new({}), () => S._new(this._root, {
665
+ themeTags: P(e.fills.template.get("themeTags", []), ["line", "series", "fill"])
666
+ }, [this.fills.template, e.fills.template])), e.strokes = new $(F.new({}), () => S._new(this._root, {
667
+ themeTags: P(e.strokes.template.get("themeTags", []), ["line", "series", "stroke"])
668
+ }, [this.strokes.template, e.strokes.template]));
669
+ }
670
+ /**
671
+ * @ignore
672
+ */
673
+ createLegendMarker(e) {
674
+ const t = this.get("legendDataItem");
675
+ if (t) {
676
+ const i = t.get("marker"), r = t.get("markerRectangle");
677
+ r && r.setPrivate("visible", !1), i.set("background", Te.new(i._root, { fillOpacity: 0, fill: he(0) }));
678
+ const h = i.children.push(S._new(i._root, {
679
+ themeTags: ["line", "series", "legend", "marker", "stroke"],
680
+ interactive: !1
681
+ }, [this.strokes.template]));
682
+ this._legendStroke = h;
683
+ const d = i.children.push(S._new(i._root, {
684
+ themeTags: ["line", "series", "legend", "marker", "fill"]
685
+ }, [this.fills.template]));
686
+ this._legendFill = d;
687
+ const n = this._root.interfaceColors.get("disabled");
688
+ if (h.states.create("disabled", { fill: n, stroke: n }), d.states.create("disabled", { fill: n, stroke: n }), this.bullets.length > 0) {
689
+ const c = this.bullets.getIndex(0);
690
+ if (c) {
691
+ const l = c(i._root, this, new Pe(this, { legend: !0 }, {}));
692
+ if (l) {
693
+ const a = l.get("sprite");
694
+ a instanceof S && a.states.create("disabled", { fill: n, stroke: n }), a && (a.setAll({
695
+ tooltipText: void 0,
696
+ tooltipHTML: void 0,
697
+ focusable: void 0,
698
+ focusableGroup: void 0,
699
+ ariaLabel: void 0
700
+ }), i.children.push(a), a.setAll({ x: i.width() / 2, y: i.height() / 2 }), i.events.on("boundschanged", () => {
701
+ a.setAll({ x: i.width() / 2, y: i.height() / 2 });
702
+ }));
703
+ }
704
+ }
705
+ }
706
+ }
707
+ }
708
+ }
709
+ Object.defineProperty(I, "className", {
710
+ enumerable: !0,
711
+ configurable: !0,
712
+ writable: !0,
713
+ value: "LineSeries"
714
+ });
715
+ Object.defineProperty(I, "classNames", {
716
+ enumerable: !0,
717
+ configurable: !0,
718
+ writable: !0,
719
+ value: ue.classNames.concat([I.className])
720
+ });
721
+ function He({
722
+ seriesData: u,
723
+ height: e = "500px",
724
+ width: t = "100%",
725
+ chartId: i = "highlight-line-chart",
726
+ showLegend: r = !0,
727
+ loading: h = !1,
728
+ emptyMessage: d = "No data available"
729
+ }) {
730
+ const n = ae(null), c = ae(null);
731
+ return Me(() => {
732
+ const l = Fe.new(i);
733
+ c.current = l, l.setThemes([Le.new(l)]);
734
+ const a = l.container.children.push(
735
+ Ae.new(l, {
736
+ panX: !0,
737
+ panY: !0,
738
+ wheelX: "panX",
739
+ wheelY: "zoomX",
740
+ pinchZoomX: !0
741
+ })
742
+ );
743
+ n.current = a, a.set(
744
+ "cursor",
745
+ De.new(l, {
746
+ behavior: "zoomX"
747
+ })
748
+ ).lineY.set("visible", !1);
749
+ const s = a.xAxes.push(
750
+ Ce.new(l, {
751
+ maxDeviation: 0.3,
752
+ baseInterval: { timeUnit: "day", count: 1 },
753
+ renderer: Oe.new(l, {
754
+ minorGridEnabled: !0
755
+ })
756
+ })
757
+ ), o = a.yAxes.push(
758
+ Xe.new(l, {
759
+ renderer: $e.new(l, {})
760
+ })
761
+ ), f = [], p = Ye.new(l, {});
762
+ u.forEach((w, Y) => {
763
+ const A = w.color ? he(w.color) : p.getIndex(Y), L = a.series.push(
764
+ I.new(l, {
765
+ name: w.name,
766
+ xAxis: s,
767
+ yAxis: o,
768
+ valueYField: "value",
769
+ valueXField: "date",
770
+ categoryXField: "date",
771
+ stroke: A,
772
+ fill: A,
773
+ tooltip: Se.new(l, {
774
+ labelText: "{name}: {valueY}"
775
+ })
776
+ })
777
+ );
778
+ L.strokes.template.setAll({
779
+ strokeWidth: 2
780
+ }), L.data.setAll(w.data), f.push(L);
781
+ });
782
+ let m = null;
783
+ r && (m = a.children.push(
784
+ V.new(l, {
785
+ centerX: re(50),
786
+ x: re(50),
787
+ layout: l.horizontalLayout
788
+ })
789
+ ), m.data.setAll(a.series.values));
790
+ const b = 1, k = 0.2, x = 4, y = (w) => {
791
+ var L;
792
+ const A = (L = w.target.dataItem) == null ? void 0 : L.dataContext;
793
+ A && (A.strokes.template.set("strokeOpacity", 1), A.strokes.template.set("strokeWidth", x), f.forEach((D) => {
794
+ D !== A && (D.strokes.template.set("strokeOpacity", k), D.strokes.template.set("strokeWidth", 1));
795
+ }));
796
+ }, _ = (w) => {
797
+ var L;
798
+ ((L = w.target.dataItem) == null ? void 0 : L.dataContext) && f.forEach((D) => {
799
+ D.strokes.template.set("strokeOpacity", b), D.strokes.template.set("strokeWidth", 2);
800
+ });
801
+ };
802
+ return m && (m.markers.template.events.on("pointerover", y), m.markers.template.events.on("pointerout", _)), a.appear(1e3, 100), f.forEach((w, Y) => {
803
+ w.appear(1e3, 100 * (Y + 1));
804
+ }), () => {
805
+ l.dispose();
806
+ };
807
+ }, []), je(() => {
808
+ n.current && c.current && (n.current.series.clear(), u.forEach((l, a) => {
809
+ const s = n.current.series.getIndex(
810
+ a
811
+ );
812
+ s && s.data.setAll(l.data);
813
+ }));
814
+ }, [u]), /* @__PURE__ */ we("div", { style: { position: "relative", width: t, height: e }, children: [
815
+ /* @__PURE__ */ W("div", { id: i, style: { width: "100%", height: "100%" } }),
816
+ h && /* @__PURE__ */ W(
817
+ "div",
818
+ {
819
+ style: {
820
+ position: "absolute",
821
+ inset: 0,
822
+ background: "rgba(255,255,255,0.8)",
823
+ display: "flex",
824
+ alignItems: "center",
825
+ justifyContent: "center",
826
+ fontSize: "1.2rem",
827
+ color: "#555"
828
+ },
829
+ children: "Yükleniyor..."
830
+ }
831
+ ),
832
+ !h && u.length === 0 && /* @__PURE__ */ W(
833
+ "div",
834
+ {
835
+ style: {
836
+ position: "absolute",
837
+ inset: 0,
838
+ display: "flex",
839
+ alignItems: "center",
840
+ justifyContent: "center",
841
+ color: "#999",
842
+ fontSize: "1.1rem"
843
+ },
844
+ children: d
845
+ }
846
+ )
847
+ ] });
848
+ }
849
+ export {
850
+ He as HighlightLineChart
851
+ };