UNPKG

igniteui-react-charts

Version:

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

334 lines (333 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 { ValueOverlay } from "./ValueOverlay"; 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.aaw = null; _this.aax = 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.q8 = function (a) { _super.prototype.q8.call(this, a); this.aai = a; }; TrendLineLayer.prototype.get_eu = function () { return true; }; TrendLineLayer.prototype.get_fl = function () { return true; }; TrendLineLayer.prototype.get_isUsableInLegend = function () { return this.xw && this.aag != null; }; TrendLineLayer.prototype.y2 = function (a, b) { if (this.aag == null || this.aag == a) { if (!this.a1.c) { this.rz(b); } } }; TrendLineLayer.prototype.xt = 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.r1 = function (a, b) { _super.prototype.r1.call(this, a, b); if (this.aag != null && this.aag.cv == null) { this.aag.r2(); } this.cw.be(b); var c = typeCast(TrendLineLayerView.$, this.cv); if (this.aag != null && c.cp) { this.aag.r2(); c.cp = false; } }; TrendLineLayer.prototype.ry = function (a, b, c, d, e) { _super.prototype.ry.call(this, a, b, c, d, e); var f = typeCast(TrendLineLayerView.$, this.cv); if (this.aag != null) { this.aag.ry(a, b, c, d, e); } this.cw.bd(c); }; TrendLineLayer.prototype.y3 = function (a) { _super.prototype.y3.call(this, a); if (this.aag == null) { this.aar(); } else { if (a.oldItems != null && a.oldItems.contains(this.aag)) { this.aag = null; } } }; TrendLineLayer.prototype.aam = function () { switch (this.aaj) { 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.aar = function () { if (this.aah != null && this.xt(this.aah)) { this.aag = this.aah; return; } }; TrendLineLayer.prototype.aao = function (a, b) { this.aai.ct(a, b); if (b != null) { b.rz(true); } this.o2(this.a5, this.a5); }; TrendLineLayer.prototype.aaq = function () { if (this.aag != null && this.aai.cn != null) { this.aai.cn.g$b = this.aaj; this.aag.rz(true); } }; TrendLineLayer.prototype.aap = function () { if (this.aag != null && this.aai.cn != null) { this.aai.cn.g$f = this.aak; this.aag.rz(true); } }; TrendLineLayer.prototype.sq = function () { _super.prototype.sq.call(this); this.qs(); this.zc(); }; TrendLineLayer.prototype.zc = function () { _super.prototype.zc.call(this); var a = this.vk; if (!this.xv) { if (this.aag != null) { a = this.vq != null ? this.vq : this.aag.vk; if (this.aaw == null) { this.aaw = this.vk; } } else { if (this.aaw != null) { a = this.aaw; } } } switch (this.w9) { case 0: case 1: a = this.aai.ck(a, this.xy); break; case 2: a = this.aai.cm(a, this.xy); break; case 4: a = this.aai.cl(a, this.xy); break; } this.vk = a; }; TrendLineLayer.prototype.xd = function () { return 3; }; TrendLineLayer.prototype.x0 = function () { return 0.3; }; TrendLineLayer.prototype.x3 = function () { return -0.4; }; TrendLineLayer.prototype.x2 = function () { return 0.5; }; TrendLineLayer.prototype.z4 = function () { return this.w9 == 3 ? this.aay() : null; }; TrendLineLayer.prototype.aay = function () { if (this.aax == null) { this.aax = new DoubleCollection(); this.aax.add(DeviceUtils.g(5)); this.aax.add(DeviceUtils.g(5)); } return this.aax; }; TrendLineLayer.prototype.rh = function (a, b, c, d) { _super.prototype.rh.call(this, a, b, c, d); switch (b) { case "SeriesViewer": this.aar(); break; case "TrendLineType": this.aaq(); break; case "TrendLinePeriod": this.aap(); break; case TrendLineLayer.$$p[0]: this.aao(c, d); this.zc(); this.aai.cs(); break; case TrendLineLayer.$$p[1]: this.aar(); break; case "ActualBrush": case "ActualThickness": case AnnotationLayer.$$p[1]: case "DashCap": this.aai.cs(); break; case "UseItemWiseColors": this.zc(); break; } }; TrendLineLayer.prototype.p5 = function (a) { _super.prototype.p5.call(this, a); this.aai.ax(a); }; TrendLineLayer.$t = markType(TrendLineLayer, 'TrendLineLayer', AnnotationLayer.$); TrendLineLayer.$$p = markDep(DependencyProperty, PropertyMetadata, TrendLineLayer, 'raisePropertyChanged', ['ActualTargetSeries:aag:aas', [Series.$, null], 'TargetSeries:aah:aat', [Series.$, null], 'TrendLineType:aaj:aav', [TrendLineType_$type, enumGetBox(TrendLineType_$type, 0)], 'TrendLinePeriod:aak:aau', [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.aag != null) { if (this.t) { var a = this.co.aag.cv; this.cn = a.e(); this.cp = true; } else if (this.s) { var b = this.co.aag.ba.a$j.item(this.al); this.cn = b.e(); } else { var c = this.co.aag.cw; this.cn = c.e(); } if (this.cn != null) { this.cn.g$b = this.co.aaj; this.cn.g$f = this.co.aak; this.cs(); } } }; TrendLineLayerView.prototype.bj = function (a, b) { _super.prototype.bj.call(this, a, b); if (this.cn != null && a.d) { if (this.co.aaj != 0 && !b) { var c = this.cn.g$n; c.ad = this.co.ig; c._stroke = this.co.vk; c.ai = this.co.z1; c.aj = this.co.we; 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.vk; this.cn.g$n.ai = this.co.z1; this.cn.g$n.aj = this.co.we; } }; 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 };