UNPKG

igniteui-react-charts

Version:

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

363 lines (362 loc) 12.1 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 { AnnotationLayer } from "./AnnotationLayer"; import { DependencyProperty } from "igniteui-react-core"; import { Series } from "./Series"; import { TrendLineType_$type } from "igniteui-react-core"; import { ValueOverlay } from "./ValueOverlay"; import { Base, enumGetBox, typeCast, fromEnum, markType, markDep } from "igniteui-react-core"; import { AnnotationLayerView } from "./AnnotationLayerView"; import { DoubleCollection } from "igniteui-react-core"; import { DeviceUtils } from "igniteui-react-core"; import { PropertyMetadata } from "igniteui-react-core"; /** * @hidden */ var TrendLineLayer = /** @class */ /*@__PURE__*/ (function (_super) { __extends(TrendLineLayer, _super); function TrendLineLayer() { var _this = _super.call(this) || this; _this.aat = null; _this.aau = null; _this.ab = TrendLineLayer.$; return _this; } TrendLineLayer.prototype.bk = function () { return new ValueOverlay(); }; TrendLineLayer.prototype.ac = function () { _super.prototype.ac.call(this); }; TrendLineLayer.prototype.ct = function () { return new TrendLineLayerView(this); }; TrendLineLayer.prototype.q3 = function (a) { _super.prototype.q3.call(this, a); this.aac = a; }; TrendLineLayer.prototype.get_eu = function () { return true; }; TrendLineLayer.prototype.get_fl = function () { return true; }; TrendLineLayer.prototype.get_isUsableInLegend = function () { return this.xq && this.aaa != null; }; TrendLineLayer.prototype.yw = function (a, b) { if (this.aaa == null || this.aaa == a) { if (!this.a1.c) { this.ru(b); } } }; TrendLineLayer.prototype.xn = function (a) { if (a == null) { return false; } if (a == this) { return false; } if (a.dc != this.dc) { return false; } if (a.eu || a.isStacked) { return false; } return true; }; TrendLineLayer.prototype.rw = function (a, b) { _super.prototype.rw.call(this, a, b); if (this.aaa != null && this.aaa.cv == null) { this.aaa.rx(); } this.cw.be(b); var c = typeCast(TrendLineLayerView.$, this.cv); if (this.aaa != null && c.cp) { this.aaa.rx(); c.cp = false; } }; TrendLineLayer.prototype.rt = function (a, b, c, d, e) { _super.prototype.rt.call(this, a, b, c, d, e); var f = typeCast(TrendLineLayerView.$, this.cv); if (this.aaa != null) { this.aaa.rt(a, b, c, d, e); } this.cw.bd(c); }; TrendLineLayer.prototype.yx = function (a) { _super.prototype.yx.call(this, a); if (this.aaa == null) { this.aan(); } else { if (a.oldItems != null && a.oldItems.contains(this.aaa)) { this.aaa = null; } } }; TrendLineLayer.prototype.aag = function () { switch (this.aad) { case 3: return "TrendLineLayer_CubicFit"; case 12: return "TrendLineLayer_CumulativeAverage"; case 10: return "TrendLineLayer_ExponentialAverage"; case 7: return "TrendLineLayer_ExponentialAverage"; case 1: return "TrendLineLayer_LinearFit"; case 6: return "TrendLineLayer_LogarithmicFit"; case 11: return "TrendLineLayer_ModifiedAverage"; case 8: return "TrendLineLayer_PowerLawFit"; case 2: return "TrendLineLayer_QuadraticFit"; case 4: return "TrendLineLayer_QuarticFit"; case 5: return "TrendLineLayer_QuinticFit"; case 9: return "TrendLineLayer_SimpleAverage"; case 13: return "TrendLineLayer_WeightedAverage"; } return null; }; TrendLineLayer.prototype.aan = function () { var e_1, _a; if (this.aab != null && this.xn(this.aab)) { this.aaa = this.aab; return; } if (this.aah != null && this.dc != null) { try { for (var _b = __values(fromEnum(this.dc.series)), _c = _b.next(); !_c.done; _c = _b.next()) { var a = _c.value; if (!this.xn(a)) { continue; } if (Base.equalsStatic(this.aah, a.name)) { this.aaa = a; break; } } } 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; } } } }; TrendLineLayer.prototype.aak = function (a, b) { this.aac.ct(a, b); if (b != null) { b.ru(true); } this.oy(this.a5, this.a5); }; TrendLineLayer.prototype.aam = function () { if (this.aaa != null && this.aac.cn != null) { this.aac.cn.g$b = this.aad; this.aaa.ru(true); } }; TrendLineLayer.prototype.aal = function () { if (this.aaa != null && this.aac.cn != null) { this.aac.cn.g$f = this.aae; this.aaa.ru(true); } }; TrendLineLayer.prototype.sl = function () { _super.prototype.sl.call(this); this.qn(); this.y6(); }; TrendLineLayer.prototype.y6 = function () { _super.prototype.y6.call(this); var a = this.ve; if (!this.xp) { if (this.aaa != null) { a = this.vk != null ? this.vk : this.aaa.ve; if (this.aat == null) { this.aat = this.ve; } } else { if (this.aat != null) { a = this.aat; } } } switch (this.w3) { case 0: case 1: a = this.aac.ck(a, this.xs); break; case 2: a = this.aac.cm(a, this.xs); break; case 4: a = this.aac.cl(a, this.xs); break; } this.ve = a; }; TrendLineLayer.prototype.w7 = function () { return 3; }; TrendLineLayer.prototype.xu = function () { return 0.3; }; TrendLineLayer.prototype.xx = function () { return -0.4; }; TrendLineLayer.prototype.xw = function () { return 0.5; }; TrendLineLayer.prototype.zy = function () { return this.w3 == 3 ? this.aav() : null; }; TrendLineLayer.prototype.aav = function () { if (this.aau == null) { this.aau = new DoubleCollection(); this.aau.add(DeviceUtils.g(5)); this.aau.add(DeviceUtils.g(5)); } return this.aau; }; TrendLineLayer.prototype.rc = function (a, b, c, d) { _super.prototype.rc.call(this, a, b, c, d); switch (b) { case "SeriesViewer": this.aan(); break; case "TrendLineType": this.aam(); break; case "TrendLinePeriod": this.aal(); break; case TrendLineLayer.$$p[0]: this.aak(c, d); this.y6(); this.aac.cs(); break; case TrendLineLayer.$$p[2]: case TrendLineLayer.$$p[1]: this.aan(); break; case "ActualBrush": case "ActualThickness": case AnnotationLayer.$$p[1]: case "DashCap": this.aac.cs(); break; case "UseItemWiseColors": this.y6(); break; } }; TrendLineLayer.prototype.p1 = function (a) { _super.prototype.p1.call(this, a); this.aac.ax(a); }; TrendLineLayer.$t = markType(TrendLineLayer, 'TrendLineLayer', AnnotationLayer.$); TrendLineLayer.$$p = markDep(DependencyProperty, PropertyMetadata, TrendLineLayer, 'raisePropertyChanged', ['ActualTargetSeries:aaa:aao', [Series.$, null], 'TargetSeriesName:aah:aap', [2, null], 'TargetSeries:aab:aaq', [Series.$, null], 'TrendLineType:aad:aas', [TrendLineType_$type, enumGetBox(TrendLineType_$type, 0)], 'TrendLinePeriod:aae:aar', [1, 7]]); return TrendLineLayer; }(AnnotationLayer)); export { TrendLineLayer }; /** * @hidden */ var TrendLineLayerView = /** @class */ /*@__PURE__*/ (function (_super) { __extends(TrendLineLayerView, _super); function TrendLineLayerView(a) { var _this = _super.call(this, a) || this; _this.cq = 0; _this.co = null; _this.cn = null; _this.cp = false; _this.co = a; _this.cq = TrendLineLayerView.cr++; return _this; } TrendLineLayerView.prototype.cu = function () { if (this.cn == null && this.co.aaa != null) { if (this.t) { var a = this.co.aaa.cv; this.cn = a.e(); this.cp = true; } else if (this.s) { var b = this.co.aaa.ba.a$j.item(this.al); this.cn = b.e(); } else { var c = this.co.aaa.cw; this.cn = c.e(); } if (this.cn != null) { this.cn.g$b = this.co.aad; this.cn.g$f = this.co.aae; this.cs(); } } }; TrendLineLayerView.prototype.bj = function (a, b) { _super.prototype.bj.call(this, a, b); if (this.cn != null && a.d) { if (this.co.aad != 0 && !b) { var c = this.cn.g$n; c.ad = this.co.ig; c._stroke = this.co.ve; c.ai = this.co.zv; c.aj = this.co.v8; a.v(c); } } }; TrendLineLayerView.prototype.ct = function (a, b) { if (a != null) { var c = null; if (this.t) { c = a.cv; } else if (this.s) { c = a.ba.a$j.item(this.al); } else { c = a.cw; } if (this.cn != null) { c.bf(this.cn); this.cn = null; } } this.cu(); }; TrendLineLayerView.prototype.cs = function () { if (this.cn != null) { this.cn.g$n.ad = this.co.ig; this.cn.g$n._stroke = this.co.ve; this.cn.g$n.ai = this.co.zv; this.cn.g$n.aj = this.co.v8; } }; TrendLineLayerView.prototype.ax = function (a) { _super.prototype.ax.call(this, a); if (this.cn != null) { this.co.bc.exportTrendlineData(this.co, a, this.cn.g$n); } }; TrendLineLayerView.$t = markType(TrendLineLayerView, 'TrendLineLayerView', AnnotationLayerView.$); TrendLineLayerView.cr = 0; return TrendLineLayerView; }(AnnotationLayerView)); export { TrendLineLayerView };