UNPKG

igniteui-react-charts

Version:

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

333 lines (332 loc) 11 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 } from "tslib"; import { AnnotationLayer } from "./AnnotationLayer"; import { Series } from "./Series"; import { DependencyProperty } from "igniteui-react-core"; import { TrendLineType_$type } from "igniteui-react-core"; import { enumGetBox, typeCast, 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.aba = null; _this.abb = null; _this.ab = TrendLineLayer.$; return _this; } TrendLineLayer.prototype.bk = function () { return new TrendLineLayer(); }; TrendLineLayer.prototype.ac = function () { _super.prototype.ac.call(this); }; TrendLineLayer.prototype.ct = function () { return new TrendLineLayerView(this); }; TrendLineLayer.prototype.rj = function (a) { _super.prototype.rj.call(this, a); this.aaw = a; }; TrendLineLayer.prototype.get_ev = function () { return true; }; TrendLineLayer.prototype.get_fo = function () { return true; }; TrendLineLayer.prototype.get_isUsableInLegend = function () { return this.x9 && this.aau != null; }; TrendLineLayer.prototype.zf = function (a, b) { if (this.aau == null || this.aau == a) { if (!this.a1.c) { this.sa(b); } } }; TrendLineLayer.prototype.x6 = function (a) { if (a == null) { return false; } if (a == this) { return false; } if (a.dc != this.dc) { return false; } if (a.ev || a.isStacked) { return false; } return true; }; TrendLineLayer.prototype.sc = function (a, b) { _super.prototype.sc.call(this, a, b); if (this.aau != null && this.aau.cv == null) { this.aau.sd(); } this.cw.be(b); var c = typeCast(TrendLineLayerView.$, this.cv); if (this.aau != null && c.cp) { this.aau.sd(); c.cp = false; } }; TrendLineLayer.prototype.r9 = function (a, b, c, d, e) { _super.prototype.r9.call(this, a, b, c, d, e); var f = typeCast(TrendLineLayerView.$, this.cv); if (this.aau != null) { this.aau.r9(a, b, c, d, e); } this.cw.bd(c); }; TrendLineLayer.prototype.zg = function (a) { _super.prototype.zg.call(this, a); if (this.aau == null) { this.aa5(); } else { if (a.oldItems != null && a.oldItems.contains(this.aau)) { this.aau = null; } } }; TrendLineLayer.prototype.aa0 = function () { switch (this.aax) { 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.aa5 = function () { if (this.aav != null && this.x6(this.aav)) { this.aau = this.aav; return; } }; TrendLineLayer.prototype.aa2 = function (a, b) { this.aaw.ct(a, b); if (b != null) { b.sa(true); } this.pb(this.a5, this.a5); }; TrendLineLayer.prototype.aa4 = function () { if (this.aau != null && this.aaw.cn != null) { this.aaw.cn.g$b = this.aax; this.aau.sa(true); } }; TrendLineLayer.prototype.aa3 = function () { if (this.aau != null && this.aaw.cn != null) { this.aaw.cn.g$f = this.aay; this.aau.sa(true); } }; TrendLineLayer.prototype.s1 = function () { _super.prototype.s1.call(this); this.q2(); this.zp(); }; TrendLineLayer.prototype.zp = function () { _super.prototype.zp.call(this); var a = this.vv; if (!this.x8) { if (this.aau != null) { a = this.v1 != null ? this.v1 : this.aau.vv; if (this.aba == null) { this.aba = this.vv; } } else { if (this.aba != null) { a = this.aba; } } } switch (this.xl) { case 0: case 1: a = this.aaw.ck(a, this.yb); break; case 2: a = this.aaw.cm(a, this.yb); break; case 4: a = this.aaw.cl(a, this.yb); break; } this.vv = a; }; TrendLineLayer.prototype.xp = function () { return 3; }; TrendLineLayer.prototype.yd = function () { return 0.3; }; TrendLineLayer.prototype.yg = function () { return -0.4; }; TrendLineLayer.prototype.yf = function () { return 0.5; }; TrendLineLayer.prototype.aai = function () { return this.xl == 3 ? this.abc() : null; }; TrendLineLayer.prototype.abc = function () { if (this.abb == null) { this.abb = new DoubleCollection(); this.abb.add(DeviceUtils.g(5)); this.abb.add(DeviceUtils.g(5)); } return this.abb; }; TrendLineLayer.prototype.rs = function (a, b, c, d) { _super.prototype.rs.call(this, a, b, c, d); switch (b) { case "SeriesViewer": this.aa5(); break; case "TrendLineType": this.aa4(); break; case "TrendLinePeriod": this.aa3(); break; case TrendLineLayer.$$p[0]: this.aa2(c, d); this.zp(); this.aaw.cs(); break; case TrendLineLayer.$$p[1]: this.aa5(); break; case "ActualBrush": case "ActualThickness": case AnnotationLayer.$$p[1]: case "DashCap": this.aaw.cs(); break; case "UseItemWiseColors": this.zp(); break; } }; TrendLineLayer.prototype.qf = function (a) { _super.prototype.qf.call(this, a); this.aaw.ax(a); }; TrendLineLayer.$t = markType(TrendLineLayer, 'TrendLineLayer', AnnotationLayer.$); TrendLineLayer.$$p = markDep(DependencyProperty, PropertyMetadata, TrendLineLayer, 'raisePropertyChanged', ['ActualTargetSeries:aau:aa6', [Series.$, null], 'TargetSeries:aav:aa7', [Series.$, null], 'TrendLineType:aax:aa9', [TrendLineType_$type, enumGetBox(TrendLineType_$type, 0)], 'TrendLinePeriod:aay:aa8', [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.aau != null) { if (this.t) { var a = this.co.aau.cv; this.cn = a.e(); this.cp = true; } else if (this.s) { var b = this.co.aau.ba.a$k.item(this.al); this.cn = b.e(); } else { var c = this.co.aau.cw; this.cn = c.e(); } if (this.cn != null) { this.cn.g$b = this.co.aax; this.cn.g$f = this.co.aay; this.cs(); } } }; TrendLineLayerView.prototype.bj = function (a, b) { _super.prototype.bj.call(this, a, b); if (this.cn != null && a.d) { if (this.co.aax != 0 && !b) { var c = this.cn.g$n; c.ad = this.co.io; c._stroke = this.co.vv; c.ai = this.co.aaf; c.aj = this.co.wp; 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$k.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.io; this.cn.g$n._stroke = this.co.vv; this.cn.g$n.ai = this.co.aaf; this.cn.g$n.aj = this.co.wp; } }; 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 };