UNPKG

igniteui-angular-charts

Version:

Ignite UI Angular charting components for building rich data visualizations for modern web apps.

563 lines (562 loc) 19.1 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 { Series } from "./Series"; import { DependencyProperty } from "igniteui-angular-core"; import { Point_$type, Boolean_$type, enumGetBox, runOn, delegateRemove, typeCast, delegateCombine, fromEnum, fromEn, markType, markDep } from "igniteui-angular-core"; import { AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode"; import { DoubleCollection } from "igniteui-angular-core"; import { PenLineCap_$type } from "igniteui-angular-core"; import { SeriesView } from "./SeriesView"; import { XamDataChart } from "./XamDataChart"; import { Brush } from "igniteui-angular-core"; import { Tuple$2 } from "igniteui-angular-core"; import { PropertyMetadata } from "igniteui-angular-core"; import { isNaN_, truncate } from "igniteui-angular-core"; import { BrushUtil } from "igniteui-angular-core"; import { Color } from "igniteui-angular-core"; /** * @hidden */ export let AnnotationLayer = /*@__PURE__*/ (() => { class AnnotationLayer extends Series { constructor() { super(); this.aar = null; this.xw = null; this.xv = null; this.xx = null; this.aap = { $type: Point_$type, x: NaN, y: NaN }; this.xy = false; this.aar = { $type: Point_$type, x: NaN, y: NaN }; this.zn(); } ct() { return new AnnotationLayerView(this); } rg(a) { super.rg(a); this.xu = a; } x3(a) { if (a == null) { return false; } if (a.ev) { return false; } if (a.isValueOverlay) { return false; } if (a == this) { return false; } return a.hk(a.cw.b9, a.cw.ca, a.cw); } get_e4() { return this.x0; } b3() { if (this.b4 == 0) { return 1; } else { return super.b3(); } } get_fj() { return this.x5 || this.x6; } get_isUsableInLegend() { return this.x6; } rp(a, b, c, d) { super.rp(a, b, c, d); switch (b) { case "SeriesViewer": let e = c; let f = d; if (e != null) { this.zm(e.b9); let g = e.b9; g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.zj)); if (typeCast(XamDataChart.$, e) !== null) { let h = e; this.zl(h.zq); let i = h.zq; i.collectionChanged = delegateRemove(i.collectionChanged, runOn(this, this.y9)); } } if (f != null) { this.zh(f.b9); let j = f.b9; j.collectionChanged = delegateCombine(j.collectionChanged, runOn(this, this.zj)); if (typeCast(XamDataChart.$, f) !== null) { let k = f; this.zg(k.zq); let l = k.zq; l.collectionChanged = delegateCombine(l.collectionChanged, runOn(this, this.y9)); } } break; case AnnotationLayer.$$p[19]: case AnnotationLayer.$$p[18]: if (this.fj) { if (this.index == -1) { this.index = XamDataChart.abr(this); } } else { this.index = -1; this.vs = null; this.vw = null; } if (this.dc != null) { this.dc.q3(); } this.r7(true); break; case "TransitionProgress": this.xx.d(this.jz, this.xw, this.xv); if (this.d7(this.cw)) { return; } if (this.jz == 1) { this.zi(this.xv, this.cw); this.q2(); } else { this.zi(this.xx, this.cw); } if (this.dc != null) { this.dc.st(this); } break; case AnnotationLayer.$$p[16]: if (this.dc != null) { this.dc.qx(); } break; case AnnotationLayer.$$p[11]: this.aar = this.aaq; this.q5(this.aaq); break; case "ShouldRenderAsOverlay": if (this.dc != null) { this.cw.at(this.dc); this.cw.ao(this.dc); } break; case AnnotationLayer.$$p[10]: case AnnotationLayer.$$p[17]: case "DashArray": case AnnotationLayer.$$p[13]: case AnnotationLayer.$$p[20]: case AnnotationLayer.$$p[15]: case AnnotationLayer.$$p[22]: case AnnotationLayer.$$p[14]: case AnnotationLayer.$$p[21]: this.zn(); break; case AnnotationLayer.$$p[0]: case AnnotationLayer.$$p[6]: case AnnotationLayer.$$p[3]: case AnnotationLayer.$$p[7]: case AnnotationLayer.$$p[5]: case AnnotationLayer.$$p[9]: case AnnotationLayer.$$p[4]: case AnnotationLayer.$$p[8]: this.r7(true); break; } } zm(a) { for (let b of fromEnum(a)) { if (!(b == this)) { b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.zk)); } } this.r7(true); } zl(a) { for (let b of fromEnum(a)) { b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.za)); } this.r7(true); } zh(a) { for (let b of fromEnum(a)) { if (!(b == this)) { b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.zk)); } } this.r7(true); } zg(a) { for (let b of fromEnum(a)) { b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.za)); } this.r7(true); } x1(a) { if (a == null) { return false; } return true; } za(a, b) { if (this.x1(a)) { this.zc(a, b.animate); } } x2(a) { if (a == null) { return false; } if (a.ev) { return false; } return true; } zk(a, b) { if (this.x2(a)) { this.zd(a, b.animate); } } zc(a, b) { } zd(a, b) { } zj(a, b) { this.ze(b); } y9(a, b) { this.zb(b); } aab() { if (this.vs != null) { return this.vs; } return this.vy; } aac() { if (this.vw != null) { return this.vw; } return this.we; } zb(a) { if (a.oldItems != null) { for (let b of fromEn(a.oldItems)) { b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.za)); } } if (a.newItems != null) { for (let c of fromEn(a.newItems)) { c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.za)); } } this.r7(true); } ze(a) { if (a.oldItems != null) { for (let b of fromEn(a.oldItems)) { b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.zk)); } } if (a.newItems != null) { for (let c of fromEn(a.newItems)) { c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.zk)); } } this.r7(true); } s8(a, b) { this.r7(false); } s7(a, b) { this.r7(true); } r8(a) { super.r8(a); if (this.d7(this.cw)) { return; } if (this.gl(a) && !this.gx) { let b = this.xw; if (this.d4()) { if (this.dd.g) { this.dd.t(); } this.xw = this.xx; this.xx = b; } else { this.xw = this.xv; this.xv = b; } this.zf(this.xv, this.cw); this.so(); } else { if (!this.gx) { this.zf(this.xv, this.cw); } this.zi(this.xv, this.cw); } } get_ev() { return true; } zf(a, b) { } zi(a, b) { this.rc(); this.xu.ch(); } y8(a) { let b = { $type: Point_$type, x: this.aap.x, y: this.aap.y }; if (a.isVertical) { if (isNaN_(this.aap.y)) { return new Tuple$2(Boolean_$type, Point_$type, false, b); } if (isNaN_(this.aap.x)) { b.x = 0; return new Tuple$2(Boolean_$type, Point_$type, true, b); } } else { if (isNaN_(this.aap.x)) { return new Tuple$2(Boolean_$type, Point_$type, false, b); } if (isNaN_(this.aap.y)) { b.y = 0; return new Tuple$2(Boolean_$type, Point_$type, true, b); } } return new Tuple$2(Boolean_$type, Point_$type, true, b); } q5(a) { if (!this.xz) { return; } super.q5(a); if (isNaN_(this.aar.x) && isNaN_(this.aar.y)) { if (isNaN_(a.x) && isNaN_(a.y)) { this.xu.cg(); return; } else { this.xu.ci(); this.aap = a; } } else { this.xu.ci(); this.aap = this.aar; } this.r7(true); } hk(a, b, c) { let d = super.hk(a, b, c); if (this.dc == null) { return false; } if (!this.cw.w()) { d = false; return d; } return d; } yg() { if (isNaN_(this.yj)) { switch (this.xi) { case 1: return this.ya(); case 2: return this.yd(); case 4: return this.yc(); } } return this.yj; } yf() { if (isNaN_(this.yi)) { return this.x8; } return this.yi; } yh() { if (isNaN_(this.yk)) { return this.x8; } return this.yk; } xp() { switch (this.xl) { case 0: return this.xm(); } return this.xl; } xq() { switch (this.xs) { case 0: return this.xi; } return this.xs; } xr() { switch (this.xt) { case 0: return this.xi; } return this.xt; } aak() { if (this.aam == null) { if (this.wl == null) { return this.aah(); } return this.wl; } return this.aam; } aal() { if (this.aan == null) { if (this.wl == null) { return this.aai(); } return this.wl; } return this.aan; } aaj() { if (this.wl == null) { return this.aag(); } return this.wl; } xm() { return 0; } xn() { return this.xm(); } xo() { return this.xm(); } ya() { return NaN; } yd() { return NaN; } yc() { return NaN; } yb() { return NaN; } ye() { return NaN; } aah() { return null; } aai() { return null; } aag() { return null; } zn() { this.xi = this.xp(); this.x8 = this.yg(); this.xj = this.xq(); this.x7 = this.yf(); this.xk = this.xr(); this.x9 = this.yh(); this.aae = this.aak(); this.aaf = this.aal(); this.aad = this.aaj(); } get_hg() { return this.x4; } get x4() { return this.xy; } set x4(a) { let b = this.xy; this.xy = a; this.raisePropertyChanged("ShouldRenderAsOverlay", b, this.xy); } } AnnotationLayer.$t = markType(AnnotationLayer, 'AnnotationLayer', Series.$); AnnotationLayer.$$p = markDep(DependencyProperty, PropertyMetadata, AnnotationLayer, 'raisePropertyChanged', ['ActualAppearanceMode:xi:zo', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualDashArray:aad:zp', [DoubleCollection.$], 'ActualDashCap:aao:zq', [PenLineCap_$type], 'ActualHorizontalAppearanceMode:xj:zr', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualHorizontalDashArray:aae:zs', [DoubleCollection.$], 'ActualHorizontalShiftAmount:x7:zt', [1, NaN], 'ActualShiftAmount:x8:zu', [1, NaN], 'ActualVerticalAppearanceMode:xk:zv', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualVerticalDashArray:aaf:zw', [DoubleCollection.$], 'ActualVerticalShiftAmount:x9:zx', [1, NaN], 'AppearanceMode:xl:zy', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'CursorPosition:aaq:zz', [Point_$type, { $type: Point_$type, x: NaN, y: NaN }], 'CursorPositionUpdatesOnMove:xz:z0', [0, true], 'HorizontalAppearanceMode:xs:z1', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'HorizontalDashArray:aam:z2', [DoubleCollection.$], 'HorizontalShiftAmount:yi:z3', [1, NaN], 'IsDefaultCrosshairDisabled:x0:z4', [0, true], 'ShiftAmount:yj:z5', [1, NaN], 'UseIndex:x5:z6', [0, false], 'UseLegend:x6:z7', [0, false], 'VerticalAppearanceMode:xt:z8', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'VerticalDashArray:aan:z9', [DoubleCollection.$], 'VerticalShiftAmount:yk:aaa', [1, NaN]]); return AnnotationLayer; })(); /** * @hidden */ export let AnnotationLayerView = /*@__PURE__*/ (() => { class AnnotationLayerView extends SeriesView { constructor(a) { super(a); this.cd = null; this.ce = false; this.cf = -1; this.cd = a; } cj() { if (this.ce) { this.ce = false; this.cf = -1; this.cd.aap = { $type: Point_$type, x: NaN, y: NaN }; this.cd.r7(true); } } cg() { this.ce = true; if (this.f.j8 != null) { this.f.j8.setTimeout(runOn(this, this.cj), 300); } else { this.cf = window.setTimeout(runOn(this, this.cj), 300); } } ci() { if (this.ce == true) { this.ce = false; if (this.cf != -1) { window.clearTimeout(this.cf); this.cf = -1; } } } ch() { this.a2(); } ck(a, b) { if (a == null) { return a; } return BrushUtil.o(a, b); } cm(a, b) { if (a == null) { return a; } return BrushUtil.q(a, b); } cl(a, b) { if (a == null) { return a; } let c = new Brush(); c.color = Color.u(truncate((a.color.l * b)), a.color.o, a.color.n, a.color.m); return c; } } AnnotationLayerView.$t = markType(AnnotationLayerView, 'AnnotationLayerView', SeriesView.$); return AnnotationLayerView; })();