UNPKG

igniteui-react-charts

Version:

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

331 lines (330 loc) 10.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 { 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 */ export let TrendLineLayer = /*@__PURE__*/ (() => { class TrendLineLayer extends AnnotationLayer { bk() { return new ValueOverlay(); } constructor() { super(); this.aa9 = null; this.aba = null; this.ab = TrendLineLayer.$; } ac() { super.ac(); } ct() { return new TrendLineLayerView(this); } ri(a) { super.ri(a); this.aav = a; } get_ev() { return true; } get_fo() { return true; } get_isUsableInLegend() { return this.x8 && this.aat != null; } ze(a, b) { if (this.aat == null || this.aat == a) { if (!this.a1.c) { this.r9(b); } } } x5(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; } sb(a, b) { super.sb(a, b); if (this.aat != null && this.aat.cv == null) { this.aat.sc(); } this.cw.be(b); let c = typeCast(TrendLineLayerView.$, this.cv); if (this.aat != null && c.cp) { this.aat.sc(); c.cp = false; } } r8(a, b, c, d, e) { super.r8(a, b, c, d, e); let f = typeCast(TrendLineLayerView.$, this.cv); if (this.aat != null) { this.aat.r8(a, b, c, d, e); } this.cw.bd(c); } zf(a) { super.zf(a); if (this.aat == null) { this.aa4(); } else { if (a.oldItems != null && a.oldItems.contains(this.aat)) { this.aat = null; } } } aaz() { switch (this.aaw) { 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; } aa4() { if (this.aau != null && this.x5(this.aau)) { this.aat = this.aau; return; } } aa1(a, b) { this.aav.ct(a, b); if (b != null) { b.r9(true); } this.pa(this.a5, this.a5); } aa3() { if (this.aat != null && this.aav.cn != null) { this.aav.cn.g$b = this.aaw; this.aat.r9(true); } } aa2() { if (this.aat != null && this.aav.cn != null) { this.aav.cn.g$f = this.aax; this.aat.r9(true); } } s0() { super.s0(); this.q1(); this.zo(); } zo() { super.zo(); let a = this.vu; if (!this.x7) { if (this.aat != null) { a = this.v0 != null ? this.v0 : this.aat.vu; if (this.aa9 == null) { this.aa9 = this.vu; } } else { if (this.aa9 != null) { a = this.aa9; } } } switch (this.xk) { case 0: case 1: a = this.aav.ck(a, this.ya); break; case 2: a = this.aav.cm(a, this.ya); break; case 4: a = this.aav.cl(a, this.ya); break; } this.vu = a; } xo() { return 3; } yc() { return 0.3; } yf() { return -0.4; } ye() { return 0.5; } aah() { return this.xk == 3 ? this.abb() : null; } abb() { if (this.aba == null) { this.aba = new DoubleCollection(); this.aba.add(DeviceUtils.g(5)); this.aba.add(DeviceUtils.g(5)); } return this.aba; } rr(a, b, c, d) { super.rr(a, b, c, d); switch (b) { case "SeriesViewer": this.aa4(); break; case "TrendLineType": this.aa3(); break; case "TrendLinePeriod": this.aa2(); break; case TrendLineLayer.$$p[0]: this.aa1(c, d); this.zo(); this.aav.cs(); break; case TrendLineLayer.$$p[1]: this.aa4(); break; case "ActualBrush": case "ActualThickness": case AnnotationLayer.$$p[1]: case "DashCap": this.aav.cs(); break; case "UseItemWiseColors": this.zo(); break; } } qe(a) { super.qe(a); this.aav.ax(a); } } TrendLineLayer.$t = /*@__PURE__*/ markType(TrendLineLayer, 'TrendLineLayer', AnnotationLayer.$); TrendLineLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, TrendLineLayer, 'raisePropertyChanged', ['ActualTargetSeries:aat:aa5', [Series.$, null], 'TargetSeries:aau:aa6', [Series.$, null], 'TrendLineType:aaw:aa8', [TrendLineType_$type, /*@__PURE__*/ enumGetBox(TrendLineType_$type, 0)], 'TrendLinePeriod:aax:aa7', [1, 7]]); return TrendLineLayer; })(); /** * @hidden */ export let TrendLineLayerView = /*@__PURE__*/ (() => { class TrendLineLayerView extends AnnotationLayerView { constructor(a) { super(a); this.cq = 0; this.co = null; this.cn = null; this.cp = false; this.co = a; this.cq = TrendLineLayerView.cr++; } cu() { if (this.cn == null && this.co.aat != null) { if (this.t) { let a = this.co.aat.cv; this.cn = a.e(); this.cp = true; } else if (this.s) { let b = this.co.aat.ba.a$k.item(this.al); this.cn = b.e(); } else { let c = this.co.aat.cw; this.cn = c.e(); } if (this.cn != null) { this.cn.g$b = this.co.aaw; this.cn.g$f = this.co.aax; this.cs(); } } } bj(a, b) { super.bj(a, b); if (this.cn != null && a.d) { if (this.co.aaw != 0 && !b) { let c = this.cn.g$n; c.ad = this.co.im; c._stroke = this.co.vu; c.ai = this.co.aae; c.aj = this.co.wo; a.v(c); } } } ct(a, b) { if (a != null) { let 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(); } cs() { if (this.cn != null) { this.cn.g$n.ad = this.co.im; this.cn.g$n._stroke = this.co.vu; this.cn.g$n.ai = this.co.aae; this.cn.g$n.aj = this.co.wo; } } ax(a) { super.ax(a); if (this.cn != null) { this.co.bc.exportTrendlineData(this.co, a, this.cn.g$n); } } } TrendLineLayerView.$t = /*@__PURE__*/ markType(TrendLineLayerView, 'TrendLineLayerView', AnnotationLayerView.$); TrendLineLayerView.cr = 0; return TrendLineLayerView; })();