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.aaw = null; this.aax = null; this.ab = TrendLineLayer.$; } ac() { super.ac(); } ct() { return new TrendLineLayerView(this); } q8(a) { super.q8(a); this.aai = a; } get_eu() { return true; } get_fl() { return true; } get_isUsableInLegend() { return this.xw && this.aag != null; } y2(a, b) { if (this.aag == null || this.aag == a) { if (!this.a1.c) { this.rz(b); } } } xt(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; } r1(a, b) { super.r1(a, b); if (this.aag != null && this.aag.cv == null) { this.aag.r2(); } this.cw.be(b); let c = typeCast(TrendLineLayerView.$, this.cv); if (this.aag != null && c.cp) { this.aag.r2(); c.cp = false; } } ry(a, b, c, d, e) { super.ry(a, b, c, d, e); let f = typeCast(TrendLineLayerView.$, this.cv); if (this.aag != null) { this.aag.ry(a, b, c, d, e); } this.cw.bd(c); } y3(a) { super.y3(a); if (this.aag == null) { this.aar(); } else { if (a.oldItems != null && a.oldItems.contains(this.aag)) { this.aag = null; } } } aam() { 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; } aar() { if (this.aah != null && this.xt(this.aah)) { this.aag = this.aah; return; } } aao(a, b) { this.aai.ct(a, b); if (b != null) { b.rz(true); } this.o2(this.a5, this.a5); } aaq() { if (this.aag != null && this.aai.cn != null) { this.aai.cn.g$b = this.aaj; this.aag.rz(true); } } aap() { if (this.aag != null && this.aai.cn != null) { this.aai.cn.g$f = this.aak; this.aag.rz(true); } } sq() { super.sq(); this.qs(); this.zc(); } zc() { super.zc(); let 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; } xd() { return 3; } x0() { return 0.3; } x3() { return -0.4; } x2() { return 0.5; } z4() { return this.w9 == 3 ? this.aay() : null; } aay() { if (this.aax == null) { this.aax = new DoubleCollection(); this.aax.add(DeviceUtils.g(5)); this.aax.add(DeviceUtils.g(5)); } return this.aax; } rh(a, b, c, d) { super.rh(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; } } p5(a) { super.p5(a); this.aai.ax(a); } } TrendLineLayer.$t = /*@__PURE__*/ markType(TrendLineLayer, 'TrendLineLayer', AnnotationLayer.$); TrendLineLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, TrendLineLayer, 'raisePropertyChanged', ['ActualTargetSeries:aag:aas', [Series.$, null], 'TargetSeries:aah:aat', [Series.$, null], 'TrendLineType:aaj:aav', [TrendLineType_$type, /*@__PURE__*/ enumGetBox(TrendLineType_$type, 0)], 'TrendLinePeriod:aak:aau', [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.aag != null) { if (this.t) { let a = this.co.aag.cv; this.cn = a.e(); this.cp = true; } else if (this.s) { let b = this.co.aag.ba.a$j.item(this.al); this.cn = b.e(); } else { let 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(); } } } bj(a, b) { super.bj(a, b); if (this.cn != null && a.d) { if (this.co.aaj != 0 && !b) { let 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); } } } ct(a, b) { if (a != null) { let 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(); } cs() { 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; } } 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; })();