UNPKG

igniteui-react-charts

Version:

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

346 lines (345 loc) 11.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 { 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.aaq = null; _this.aar = 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.q1 = function (a) { _super.prototype.q1.call(this, a); this.z9 = a; }; TrendLineLayer.prototype.get_et = function () { return true; }; TrendLineLayer.prototype.get_fk = function () { return true; }; TrendLineLayer.prototype.yt = function (a, b) { if (this.z7 == null || this.z7 == a) { if (!this.a1.c) { this.rs(b); } } }; TrendLineLayer.prototype.xk = function (a) { if (a == null) { return false; } if (a == this) { return false; } if (a.et || a.isStacked) { return false; } return true; }; TrendLineLayer.prototype.ru = function (a, b) { _super.prototype.ru.call(this, a, b); if (this.z7 != null && this.z7.cv == null) { this.z7.rv(); } this.cw.a7(b); var c = typeCast(TrendLineLayerView.$, this.cv); if (this.z7 != null && c.cg) { this.z7.rv(); c.cg = false; } }; TrendLineLayer.prototype.rr = function (a, b, c, d, e) { _super.prototype.rr.call(this, a, b, c, d, e); var f = typeCast(TrendLineLayerView.$, this.cv); if (this.z7 != null) { this.z7.rr(a, b, c, d, e); } this.cw.a6(c); }; TrendLineLayer.prototype.yu = function (a) { _super.prototype.yu.call(this, a); this.aak(); }; TrendLineLayer.prototype.aad = function () { switch (this.aaa) { 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.aak = function () { var e_1, _a; if (this.z8 != null && this.xk(this.z8)) { this.z7 = this.z8; return; } if (this.aae != 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.xk(a)) { continue; } if (Base.equalsStatic(this.aae, a.name)) { this.z7 = 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.aah = function (a, b) { this.z9.ck(a, b); }; TrendLineLayer.prototype.aaj = function () { if (this.z7 != null && this.z9.ce != null) { this.z9.ce.g$b = this.aaa; this.z7.rs(true); } }; TrendLineLayer.prototype.aai = function () { if (this.z7 != null && this.z9.ce != null) { this.z9.ce.g$f = this.aab; this.z7.rs(true); } }; TrendLineLayer.prototype.sj = function () { _super.prototype.sj.call(this); this.ql(); this.y3(); }; TrendLineLayer.prototype.y3 = function () { _super.prototype.y3.call(this); var a = this.vb; if (!this.g9) { if (this.z7 != null) { a = this.vh != null ? this.vh : this.z7.vb; if (this.aaq == null) { this.aaq = this.vb; } } else { if (this.aaq != null) { a = this.aaq; } } } switch (this.w0) { case 0: case 1: a = this.z9.cb(a, this.xp); break; case 2: a = this.z9.cd(a, this.xp); break; case 4: a = this.z9.cc(a, this.xp); break; } this.vb = a; }; TrendLineLayer.prototype.w4 = function () { return 3; }; TrendLineLayer.prototype.xr = function () { return 0.3; }; TrendLineLayer.prototype.xu = function () { return -0.4; }; TrendLineLayer.prototype.xt = function () { return 0.5; }; TrendLineLayer.prototype.zv = function () { return this.w0 == 3 ? this.aas() : null; }; TrendLineLayer.prototype.aas = function () { if (this.aar == null) { this.aar = new DoubleCollection(); this.aar.add(DeviceUtils.g(5)); this.aar.add(DeviceUtils.g(5)); } return this.aar; }; TrendLineLayer.prototype.ra = function (a, b, c, d) { _super.prototype.ra.call(this, a, b, c, d); switch (b) { case "SeriesViewer": this.aak(); break; case "TrendLineType": this.aaj(); break; case "TrendLinePeriod": this.aai(); break; case TrendLineLayer.$$p[0]: this.aah(c, d); this.y3(); this.z9.cj(); break; case TrendLineLayer.$$p[2]: case TrendLineLayer.$$p[1]: this.aak(); break; case "ActualBrush": case "ActualThickness": case AnnotationLayer.$$p[1]: case "DashCap": this.z9.cj(); break; case "UseItemWiseColors": this.y3(); break; } }; TrendLineLayer.prototype.pz = function (a) { _super.prototype.pz.call(this, a); this.z9.aq(a); }; TrendLineLayer.$t = markType(TrendLineLayer, 'TrendLineLayer', AnnotationLayer.$); TrendLineLayer.$$p = markDep(DependencyProperty, PropertyMetadata, TrendLineLayer, 'raisePropertyChanged', ['ActualTargetSeries:z7:aal', [Series.$, null], 'TargetSeriesName:aae:aam', [2, null], 'TargetSeries:z8:aan', [Series.$, null], 'TrendLineType:aaa:aap', [TrendLineType_$type, enumGetBox(TrendLineType_$type, 0)], 'TrendLinePeriod:aab:aao', [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.ch = 0; _this.cf = null; _this.ce = null; _this.cg = false; _this.cf = a; _this.ch = TrendLineLayerView.ci++; return _this; } TrendLineLayerView.prototype.cl = function () { if (this.ce == null && this.cf.z7 != null) { if (this.r) { var a = this.cf.z7.cv; this.ce = a.e(); this.cg = true; } else if (this.q) { var b = this.cf.z7.ba.a$j.item(this.ag); this.ce = b.e(); } else { var c = this.cf.z7.cw; this.ce = c.e(); } if (this.ce != null) { this.ce.g$b = this.cf.aaa; this.ce.g$f = this.cf.aab; this.cj(); } } }; TrendLineLayerView.prototype.bc = function (a, b) { _super.prototype.bc.call(this, a, b); if (this.ce != null && a.d) { if (this.cf.aaa != 0 && !b) { var c = this.ce.g$n; c.ad = this.cf.ie; c._stroke = this.cf.vb; c.ai = this.cf.zs; c.aj = this.cf.v5; a.v(c); } } }; TrendLineLayerView.prototype.ck = function (a, b) { if (a != null) { var c = null; if (this.r) { c = a.cv; } else if (this.q) { c = a.ba.a$j.item(this.ag); } else { c = a.cw; } if (this.ce != null) { c.a8(this.ce); this.ce = null; } } this.cl(); }; TrendLineLayerView.prototype.cj = function () { if (this.ce != null) { this.ce.g$n.ad = this.cf.ie; this.ce.g$n._stroke = this.cf.vb; this.ce.g$n.ai = this.cf.zs; this.ce.g$n.aj = this.cf.v5; } }; TrendLineLayerView.prototype.aq = function (a) { _super.prototype.aq.call(this, a); if (this.ce != null) { this.cf.bc.exportTrendlineData(this.cf, a, this.ce.g$n); } }; TrendLineLayerView.$t = markType(TrendLineLayerView, 'TrendLineLayerView', AnnotationLayerView.$); TrendLineLayerView.ci = 0; return TrendLineLayerView; }(AnnotationLayerView)); export { TrendLineLayerView };