UNPKG

igniteui-react-charts

Version:

Ignite UI React charting components for building rich data visualizations using TypeScript APIs.

681 lines (680 loc) 22.5 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { __extends, __values } from "tslib"; import { Series } from "./Series"; import { DependencyProperty } from "igniteui-react-core"; import { Point_$type, enumGetBox, runOn, delegateRemove, typeCast, delegateCombine, fromEnum, fromEn, markType, markDep } from "igniteui-react-core"; import { AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode"; import { DoubleCollection } from "igniteui-react-core"; import { PenLineCap_$type } from "igniteui-react-core"; import { SeriesView } from "./SeriesView"; import { XamDataChart } from "./XamDataChart"; import { Brush } from "igniteui-react-core"; import { PropertyMetadata } from "igniteui-react-core"; import { isNaN_, truncate } from "igniteui-react-core"; import { BrushUtil } from "igniteui-react-core"; import { Color } from "igniteui-react-core"; /** * @hidden */ var AnnotationLayer = /** @class */ /*@__PURE__*/ (function (_super) { __extends(AnnotationLayer, _super); function AnnotationLayer() { var _this = _super.call(this) || this; _this.aas = null; _this.xy = null; _this.xx = null; _this.xz = null; _this.aaq = { $type: Point_$type, x: NaN, y: NaN }; _this.x0 = false; _this.aas = { $type: Point_$type, x: NaN, y: NaN }; _this.zo(); return _this; } AnnotationLayer.prototype.ct = function () { return new AnnotationLayerView(this); }; AnnotationLayer.prototype.ri = function (a) { _super.prototype.ri.call(this, a); this.xw = a; }; AnnotationLayer.prototype.x5 = function (a) { if (a == null) { return false; } if (a.ev) { return false; } if (a.isValueOverlay) { return false; } if (a == this) { return false; } return a.hl(a.cw.b9, a.cw.ca, a.cw); }; AnnotationLayer.prototype.get_e4 = function () { return this.x2; }; AnnotationLayer.prototype.b3 = function () { if (this.b4 == 0) { return 1; } else { return _super.prototype.b3.call(this); } }; AnnotationLayer.prototype.get_fj = function () { return this.x7 || this.x8; }; AnnotationLayer.prototype.get_isUsableInLegend = function () { return this.x8; }; AnnotationLayer.prototype.rr = function (a, b, c, d) { _super.prototype.rr.call(this, a, b, c, d); switch (b) { case "SeriesViewer": var e = c; var f = d; if (e != null) { this.zn(e.b9); var g = e.b9; g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.zk)); if (typeCast(XamDataChart.$, e) !== null) { var h = e; this.zm(h.zr); var i = h.zr; i.collectionChanged = delegateRemove(i.collectionChanged, runOn(this, this.za)); } } if (f != null) { this.zi(f.b9); var j = f.b9; j.collectionChanged = delegateCombine(j.collectionChanged, runOn(this, this.zk)); if (typeCast(XamDataChart.$, f) !== null) { var k = f; this.zh(k.zr); var l = k.zr; l.collectionChanged = delegateCombine(l.collectionChanged, runOn(this, this.za)); } } break; case AnnotationLayer.$$p[19]: case AnnotationLayer.$$p[18]: if (this.fj) { if (this.index == -1) { this.index = XamDataChart.abs(this); } } else { this.index = -1; this.vu = null; this.vy = null; } if (this.dc != null) { this.dc.q4(); } this.r9(true); break; case "TransitionProgress": this.xz.d(this.j0, this.xy, this.xx); if (this.d7(this.cw)) { return; } if (this.j0 == 1) { this.zj(this.xx, this.cw); this.q4(); } else { this.zj(this.xz, this.cw); } if (this.dc != null) { this.dc.su(this); } break; case AnnotationLayer.$$p[16]: if (this.dc != null) { this.dc.qy(); } break; case AnnotationLayer.$$p[11]: this.aas = this.aar; this.q7(this.aar); break; case "ShouldRenderAsOverlay": if (this.dc != null) { this.cw.at(this.dc); this.cw.ao(this.dc); } break; case AnnotationLayer.$$p[10]: case AnnotationLayer.$$p[17]: case "DashArray": case AnnotationLayer.$$p[13]: case AnnotationLayer.$$p[20]: case AnnotationLayer.$$p[15]: case AnnotationLayer.$$p[22]: case AnnotationLayer.$$p[14]: case AnnotationLayer.$$p[21]: this.zo(); break; case AnnotationLayer.$$p[0]: case AnnotationLayer.$$p[6]: case AnnotationLayer.$$p[3]: case AnnotationLayer.$$p[7]: case AnnotationLayer.$$p[5]: case AnnotationLayer.$$p[9]: case AnnotationLayer.$$p[4]: case AnnotationLayer.$$p[8]: this.r9(true); break; } }; AnnotationLayer.prototype.zn = function (a) { var e_1, _a; try { for (var _b = __values(fromEnum(a)), _c = _b.next(); !_c.done; _c = _b.next()) { var b = _c.value; if (!(b == this)) { b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.zl)); } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_1) throw e_1.error; } } this.r9(true); }; AnnotationLayer.prototype.zm = function (a) { var e_2, _a; try { for (var _b = __values(fromEnum(a)), _c = _b.next(); !_c.done; _c = _b.next()) { var b = _c.value; b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.zb)); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_2) throw e_2.error; } } this.r9(true); }; AnnotationLayer.prototype.zi = function (a) { var e_3, _a; try { for (var _b = __values(fromEnum(a)), _c = _b.next(); !_c.done; _c = _b.next()) { var b = _c.value; if (!(b == this)) { b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.zl)); } } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_3) throw e_3.error; } } this.r9(true); }; AnnotationLayer.prototype.zh = function (a) { var e_4, _a; try { for (var _b = __values(fromEnum(a)), _c = _b.next(); !_c.done; _c = _b.next()) { var b = _c.value; b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.zb)); } } catch (e_4_1) { e_4 = { error: e_4_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_4) throw e_4.error; } } this.r9(true); }; AnnotationLayer.prototype.x3 = function (a) { if (a == null) { return false; } return true; }; AnnotationLayer.prototype.zb = function (a, b) { if (this.x3(a)) { this.zd(a, b.animate); } }; AnnotationLayer.prototype.x4 = function (a) { if (a == null) { return false; } if (a.ev) { return false; } return true; }; AnnotationLayer.prototype.zl = function (a, b) { if (this.x4(a)) { this.ze(a, b.animate); } }; AnnotationLayer.prototype.zd = function (a, b) { }; AnnotationLayer.prototype.ze = function (a, b) { }; AnnotationLayer.prototype.zk = function (a, b) { this.zf(b); }; AnnotationLayer.prototype.za = function (a, b) { this.zc(b); }; AnnotationLayer.prototype.aac = function () { if (this.vu != null) { return this.vu; } return this.v0; }; AnnotationLayer.prototype.aad = function () { if (this.vy != null) { return this.vy; } return this.wg; }; AnnotationLayer.prototype.zc = function (a) { var e_5, _a, e_6, _b; if (a.oldItems != null) { try { for (var _c = __values(fromEn(a.oldItems)), _d = _c.next(); !_d.done; _d = _c.next()) { var b = _d.value; b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.zb)); } } catch (e_5_1) { e_5 = { error: e_5_1 }; } finally { try { if (_d && !_d.done && (_a = _c.return)) _a.call(_c); } finally { if (e_5) throw e_5.error; } } } if (a.newItems != null) { try { for (var _e = __values(fromEn(a.newItems)), _f = _e.next(); !_f.done; _f = _e.next()) { var c = _f.value; c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.zb)); } } catch (e_6_1) { e_6 = { error: e_6_1 }; } finally { try { if (_f && !_f.done && (_b = _e.return)) _b.call(_e); } finally { if (e_6) throw e_6.error; } } } this.r9(true); }; AnnotationLayer.prototype.zf = function (a) { var e_7, _a, e_8, _b; if (a.oldItems != null) { try { for (var _c = __values(fromEn(a.oldItems)), _d = _c.next(); !_d.done; _d = _c.next()) { var b = _d.value; b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.zl)); } } catch (e_7_1) { e_7 = { error: e_7_1 }; } finally { try { if (_d && !_d.done && (_a = _c.return)) _a.call(_c); } finally { if (e_7) throw e_7.error; } } } if (a.newItems != null) { try { for (var _e = __values(fromEn(a.newItems)), _f = _e.next(); !_f.done; _f = _e.next()) { var c = _f.value; c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.zl)); } } catch (e_8_1) { e_8 = { error: e_8_1 }; } finally { try { if (_f && !_f.done && (_b = _e.return)) _b.call(_e); } finally { if (e_8) throw e_8.error; } } } this.r9(true); }; AnnotationLayer.prototype.ta = function (a, b) { this.r9(false); }; AnnotationLayer.prototype.s9 = function (a, b) { this.r9(true); }; AnnotationLayer.prototype.sa = function (a) { _super.prototype.sa.call(this, a); if (this.d7(this.cw)) { return; } if (this.gm(a) && !this.gy) { var b = this.xy; if (this.d4()) { if (this.dd.g) { this.dd.t(); } this.xy = this.xz; this.xz = b; } else { this.xy = this.xx; this.xx = b; } this.zg(this.xx, this.cw); this.sq(); } else { if (!this.gy) { this.zg(this.xx, this.cw); } this.zj(this.xx, this.cw); } }; AnnotationLayer.prototype.get_ev = function () { return true; }; AnnotationLayer.prototype.zg = function (a, b) { }; AnnotationLayer.prototype.zj = function (a, b) { this.re(); this.xw.ch(); }; AnnotationLayer.prototype.q7 = function (a) { if (!this.x1) { return; } _super.prototype.q7.call(this, a); if (isNaN_(this.aas.x) && isNaN_(this.aas.y)) { if (isNaN_(a.x) && isNaN_(a.y)) { this.xw.cg(); return; } else { this.xw.ci(); this.aaq = a; } } else { this.xw.ci(); this.aaq = this.aas; } this.r9(true); }; AnnotationLayer.prototype.hl = function (a, b, c) { var d = _super.prototype.hl.call(this, a, b, c); if (this.dc == null) { return false; } if (!this.cw.w()) { d = false; return d; } return d; }; AnnotationLayer.prototype.yi = function () { if (isNaN_(this.yl)) { switch (this.xk) { case 1: return this.yc(); case 2: return this.yf(); case 4: return this.ye(); } } return this.yl; }; AnnotationLayer.prototype.yh = function () { if (isNaN_(this.yk)) { return this.ya; } return this.yk; }; AnnotationLayer.prototype.yj = function () { if (isNaN_(this.ym)) { return this.ya; } return this.ym; }; AnnotationLayer.prototype.xr = function () { switch (this.xn) { case 0: return this.xo(); } return this.xn; }; AnnotationLayer.prototype.xs = function () { switch (this.xu) { case 0: return this.xk; } return this.xu; }; AnnotationLayer.prototype.xt = function () { switch (this.xv) { case 0: return this.xk; } return this.xv; }; AnnotationLayer.prototype.aal = function () { if (this.aan == null) { if (this.wn == null) { return this.aai(); } return this.wn; } return this.aan; }; AnnotationLayer.prototype.aam = function () { if (this.aao == null) { if (this.wn == null) { return this.aaj(); } return this.wn; } return this.aao; }; AnnotationLayer.prototype.aak = function () { if (this.wn == null) { return this.aah(); } return this.wn; }; AnnotationLayer.prototype.xo = function () { return 0; }; AnnotationLayer.prototype.xp = function () { return this.xo(); }; AnnotationLayer.prototype.xq = function () { return this.xo(); }; AnnotationLayer.prototype.yc = function () { return NaN; }; AnnotationLayer.prototype.yf = function () { return NaN; }; AnnotationLayer.prototype.ye = function () { return NaN; }; AnnotationLayer.prototype.yd = function () { return NaN; }; AnnotationLayer.prototype.yg = function () { return NaN; }; AnnotationLayer.prototype.aai = function () { return null; }; AnnotationLayer.prototype.aaj = function () { return null; }; AnnotationLayer.prototype.aah = function () { return null; }; AnnotationLayer.prototype.zo = function () { this.xk = this.xr(); this.ya = this.yi(); this.xl = this.xs(); this.x9 = this.yh(); this.xm = this.xt(); this.yb = this.yj(); this.aaf = this.aal(); this.aag = this.aam(); this.aae = this.aak(); }; AnnotationLayer.prototype.get_hh = function () { return this.x6; }; Object.defineProperty(AnnotationLayer.prototype, "x6", { get: function () { return this.x0; }, set: function (a) { var b = this.x0; this.x0 = a; this.raisePropertyChanged("ShouldRenderAsOverlay", b, this.x0); }, enumerable: false, configurable: true }); AnnotationLayer.$t = markType(AnnotationLayer, 'AnnotationLayer', Series.$); AnnotationLayer.$$p = markDep(DependencyProperty, PropertyMetadata, AnnotationLayer, 'raisePropertyChanged', ['ActualAppearanceMode:xk:zp', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualDashArray:aae:zq', [DoubleCollection.$], 'ActualDashCap:aap:zr', [PenLineCap_$type], 'ActualHorizontalAppearanceMode:xl:zs', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualHorizontalDashArray:aaf:zt', [DoubleCollection.$], 'ActualHorizontalShiftAmount:x9:zu', [1, NaN], 'ActualShiftAmount:ya:zv', [1, NaN], 'ActualVerticalAppearanceMode:xm:zw', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualVerticalDashArray:aag:zx', [DoubleCollection.$], 'ActualVerticalShiftAmount:yb:zy', [1, NaN], 'AppearanceMode:xn:zz', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'CursorPosition:aar:z0', [Point_$type, { $type: Point_$type, x: NaN, y: NaN }], 'CursorPositionUpdatesOnMove:x1:z1', [0, true], 'HorizontalAppearanceMode:xu:z2', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'HorizontalDashArray:aan:z3', [DoubleCollection.$], 'HorizontalShiftAmount:yk:z4', [1, NaN], 'IsDefaultCrosshairDisabled:x2:z5', [0, true], 'ShiftAmount:yl:z6', [1, NaN], 'UseIndex:x7:z7', [0, false], 'UseLegend:x8:z8', [0, false], 'VerticalAppearanceMode:xv:z9', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'VerticalDashArray:aao:aaa', [DoubleCollection.$], 'VerticalShiftAmount:ym:aab', [1, NaN]]); return AnnotationLayer; }(Series)); export { AnnotationLayer }; /** * @hidden */ var AnnotationLayerView = /** @class */ /*@__PURE__*/ (function (_super) { __extends(AnnotationLayerView, _super); function AnnotationLayerView(a) { var _this = _super.call(this, a) || this; _this.cd = null; _this.ce = false; _this.cf = -1; _this.cd = a; return _this; } AnnotationLayerView.prototype.cj = function () { if (this.ce) { this.ce = false; this.cf = -1; this.cd.aaq = { $type: Point_$type, x: NaN, y: NaN }; this.cd.r9(true); } }; AnnotationLayerView.prototype.cg = function () { this.ce = true; if (this.f.j9 != null) { this.f.j9.setTimeout(runOn(this, this.cj), 300); } else { this.cf = window.setTimeout(runOn(this, this.cj), 300); } }; AnnotationLayerView.prototype.ci = function () { if (this.ce == true) { this.ce = false; if (this.cf != -1) { window.clearTimeout(this.cf); this.cf = -1; } } }; AnnotationLayerView.prototype.ch = function () { this.a2(); }; AnnotationLayerView.prototype.ck = function (a, b) { if (a == null) { return a; } return BrushUtil.q(a, b); }; AnnotationLayerView.prototype.cm = function (a, b) { if (a == null) { return a; } return BrushUtil.s(a, b); }; AnnotationLayerView.prototype.cl = function (a, b) { if (a == null) { return a; } var c = new Brush(); c.color = Color.u(truncate((a.color.l * b)), a.color.o, a.color.n, a.color.m); return c; }; AnnotationLayerView.$t = markType(AnnotationLayerView, 'AnnotationLayerView', SeriesView.$); return AnnotationLayerView; }(SeriesView)); export { AnnotationLayerView };