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.aat = null; _this.xz = null; _this.xy = null; _this.x0 = null; _this.aar = { $type: Point_$type, x: NaN, y: NaN }; _this.x1 = false; _this.aat = { $type: Point_$type, x: NaN, y: NaN }; _this.zp(); return _this; } AnnotationLayer.prototype.ct = function () { return new AnnotationLayerView(this); }; AnnotationLayer.prototype.rj = function (a) { _super.prototype.rj.call(this, a); this.xx = a; }; AnnotationLayer.prototype.x6 = function (a) { if (a == null) { return false; } if (a.ev) { return false; } if (a.isValueOverlay) { return false; } if (a == this) { return false; } return a.hm(a.cw.b9, a.cw.ca, a.cw); }; AnnotationLayer.prototype.get_e4 = function () { return this.x3; }; AnnotationLayer.prototype.b3 = function () { if (this.b4 == 0) { return 1; } else { return _super.prototype.b3.call(this); } }; AnnotationLayer.prototype.get_fj = function () { return this.x8 || this.x9; }; AnnotationLayer.prototype.get_isUsableInLegend = function () { return this.x9; }; AnnotationLayer.prototype.rs = function (a, b, c, d) { _super.prototype.rs.call(this, a, b, c, d); switch (b) { case "SeriesViewer": var e = c; var f = d; if (e != null) { this.zo(e.b9); var g = e.b9; g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.zl)); if (typeCast(XamDataChart.$, e) !== null) { var h = e; this.zn(h.zu); var i = h.zu; i.collectionChanged = delegateRemove(i.collectionChanged, runOn(this, this.zb)); } } if (f != null) { this.zj(f.b9); var j = f.b9; j.collectionChanged = delegateCombine(j.collectionChanged, runOn(this, this.zl)); if (typeCast(XamDataChart.$, f) !== null) { var k = f; this.zi(k.zu); var l = k.zu; l.collectionChanged = delegateCombine(l.collectionChanged, runOn(this, this.zb)); } } break; case AnnotationLayer.$$p[19]: case AnnotationLayer.$$p[18]: if (this.fj) { if (this.index == -1) { this.index = XamDataChart.abv(this); } } else { this.index = -1; this.vv = null; this.vz = null; } if (this.dc != null) { this.dc.q5(); } this.sa(true); break; case "TransitionProgress": this.x0.d(this.j1, this.xz, this.xy); if (this.d7(this.cw)) { return; } if (this.j1 == 1) { this.zk(this.xy, this.cw); this.q5(); } else { this.zk(this.x0, this.cw); } if (this.dc != null) { this.dc.sv(this); } break; case AnnotationLayer.$$p[16]: if (this.dc != null) { this.dc.qz(); } break; case AnnotationLayer.$$p[11]: this.aat = this.aas; this.q8(this.aas); 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.zp(); 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.sa(true); break; } }; AnnotationLayer.prototype.zo = 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.zm)); } } } 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.sa(true); }; AnnotationLayer.prototype.zn = 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.zc)); } } 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.sa(true); }; AnnotationLayer.prototype.zj = 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.zm)); } } } 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.sa(true); }; AnnotationLayer.prototype.zi = 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.zc)); } } 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.sa(true); }; AnnotationLayer.prototype.x4 = function (a) { if (a == null) { return false; } return true; }; AnnotationLayer.prototype.zc = function (a, b) { if (this.x4(a)) { this.ze(a, b.animate); } }; AnnotationLayer.prototype.x5 = function (a) { if (a == null) { return false; } if (a.ev) { return false; } return true; }; AnnotationLayer.prototype.zm = function (a, b) { if (this.x5(a)) { this.zf(a, b.animate); } }; AnnotationLayer.prototype.ze = function (a, b) { }; AnnotationLayer.prototype.zf = function (a, b) { }; AnnotationLayer.prototype.zl = function (a, b) { this.zg(b); }; AnnotationLayer.prototype.zb = function (a, b) { this.zd(b); }; AnnotationLayer.prototype.aad = function () { if (this.vv != null) { return this.vv; } return this.v1; }; AnnotationLayer.prototype.aae = function () { if (this.vz != null) { return this.vz; } return this.wh; }; AnnotationLayer.prototype.zd = 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.zc)); } } 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.zc)); } } 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.sa(true); }; AnnotationLayer.prototype.zg = 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.zm)); } } 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.zm)); } } 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.sa(true); }; AnnotationLayer.prototype.tb = function (a, b) { this.sa(false); }; AnnotationLayer.prototype.ta = function (a, b) { this.sa(true); }; AnnotationLayer.prototype.sb = function (a) { _super.prototype.sb.call(this, a); if (this.d7(this.cw)) { return; } if (this.gn(a) && !this.gz) { var b = this.xz; if (this.d4()) { if (this.dd.g) { this.dd.t(); } this.xz = this.x0; this.x0 = b; } else { this.xz = this.xy; this.xy = b; } this.zh(this.xy, this.cw); this.sr(); } else { if (!this.gz) { this.zh(this.xy, this.cw); } this.zk(this.xy, this.cw); } }; AnnotationLayer.prototype.get_ev = function () { return true; }; AnnotationLayer.prototype.zh = function (a, b) { }; AnnotationLayer.prototype.zk = function (a, b) { this.rf(); this.xx.ch(); }; AnnotationLayer.prototype.q8 = function (a) { if (!this.x2) { return; } _super.prototype.q8.call(this, a); if (isNaN_(this.aat.x) && isNaN_(this.aat.y)) { if (isNaN_(a.x) && isNaN_(a.y)) { this.xx.cg(); return; } else { this.xx.ci(); this.aar = a; } } else { this.xx.ci(); this.aar = this.aat; } this.sa(true); }; AnnotationLayer.prototype.hm = function (a, b, c) { var d = _super.prototype.hm.call(this, a, b, c); if (this.dc == null) { return false; } if (!this.cw.w()) { d = false; return d; } return d; }; AnnotationLayer.prototype.yj = function () { if (isNaN_(this.ym)) { switch (this.xl) { case 1: return this.yd(); case 2: return this.yg(); case 4: return this.yf(); } } return this.ym; }; AnnotationLayer.prototype.yi = function () { if (isNaN_(this.yl)) { return this.yb; } return this.yl; }; AnnotationLayer.prototype.yk = function () { if (isNaN_(this.yn)) { return this.yb; } return this.yn; }; AnnotationLayer.prototype.xs = function () { switch (this.xo) { case 0: return this.xp(); } return this.xo; }; AnnotationLayer.prototype.xt = function () { switch (this.xv) { case 0: return this.xl; } return this.xv; }; AnnotationLayer.prototype.xu = function () { switch (this.xw) { case 0: return this.xl; } return this.xw; }; AnnotationLayer.prototype.aam = function () { if (this.aao == null) { if (this.wo == null) { return this.aaj(); } return this.wo; } return this.aao; }; AnnotationLayer.prototype.aan = function () { if (this.aap == null) { if (this.wo == null) { return this.aak(); } return this.wo; } return this.aap; }; AnnotationLayer.prototype.aal = function () { if (this.wo == null) { return this.aai(); } return this.wo; }; AnnotationLayer.prototype.xp = function () { return 0; }; AnnotationLayer.prototype.xq = function () { return this.xp(); }; AnnotationLayer.prototype.xr = function () { return this.xp(); }; AnnotationLayer.prototype.yd = function () { return NaN; }; AnnotationLayer.prototype.yg = function () { return NaN; }; AnnotationLayer.prototype.yf = function () { return NaN; }; AnnotationLayer.prototype.ye = function () { return NaN; }; AnnotationLayer.prototype.yh = function () { return NaN; }; AnnotationLayer.prototype.aaj = function () { return null; }; AnnotationLayer.prototype.aak = function () { return null; }; AnnotationLayer.prototype.aai = function () { return null; }; AnnotationLayer.prototype.zp = function () { this.xl = this.xs(); this.yb = this.yj(); this.xm = this.xt(); this.ya = this.yi(); this.xn = this.xu(); this.yc = this.yk(); this.aag = this.aam(); this.aah = this.aan(); this.aaf = this.aal(); }; AnnotationLayer.prototype.get_hi = function () { return this.x7; }; Object.defineProperty(AnnotationLayer.prototype, "x7", { get: function () { return this.x1; }, set: function (a) { var b = this.x1; this.x1 = a; this.raisePropertyChanged("ShouldRenderAsOverlay", b, this.x1); }, enumerable: false, configurable: true }); AnnotationLayer.$t = markType(AnnotationLayer, 'AnnotationLayer', Series.$); AnnotationLayer.$$p = markDep(DependencyProperty, PropertyMetadata, AnnotationLayer, 'raisePropertyChanged', ['ActualAppearanceMode:xl:zq', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualDashArray:aaf:zr', [DoubleCollection.$], 'ActualDashCap:aaq:zs', [PenLineCap_$type], 'ActualHorizontalAppearanceMode:xm:zt', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualHorizontalDashArray:aag:zu', [DoubleCollection.$], 'ActualHorizontalShiftAmount:ya:zv', [1, NaN], 'ActualShiftAmount:yb:zw', [1, NaN], 'ActualVerticalAppearanceMode:xn:zx', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualVerticalDashArray:aah:zy', [DoubleCollection.$], 'ActualVerticalShiftAmount:yc:zz', [1, NaN], 'AppearanceMode:xo:z0', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'CursorPosition:aas:z1', [Point_$type, { $type: Point_$type, x: NaN, y: NaN }], 'CursorPositionUpdatesOnMove:x2:z2', [0, true], 'HorizontalAppearanceMode:xv:z3', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'HorizontalDashArray:aao:z4', [DoubleCollection.$], 'HorizontalShiftAmount:yl:z5', [1, NaN], 'IsDefaultCrosshairDisabled:x3:z6', [0, true], 'ShiftAmount:ym:z7', [1, NaN], 'UseIndex:x8:z8', [0, false], 'UseLegend:x9:z9', [0, false], 'VerticalAppearanceMode:xw:aaa', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'VerticalDashArray:aap:aab', [DoubleCollection.$], 'VerticalShiftAmount:yn:aac', [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.aar = { $type: Point_$type, x: NaN, y: NaN }; this.cd.sa(true); } }; AnnotationLayerView.prototype.cg = function () { this.ce = true; if (this.f.ka != null) { this.f.ka.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 };