UNPKG

igniteui-react-charts

Version:

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

540 lines (539 loc) 17.7 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-react-core"; import { Point_$type, enumGetBox, runOn, delegateRemove, typeCast, delegateCombine, fromEnum, fromEn, markType, markDep } from "igniteui-react-core"; import { AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode"; import { DoubleCollection } from "igniteui-react-core"; import { PenLineCap_$type } from "igniteui-react-core"; import { SeriesView } from "./SeriesView"; import { XamDataChart } from "./XamDataChart"; import { Brush } from "igniteui-react-core"; import { PropertyMetadata } from "igniteui-react-core"; import { isNaN_, truncate } from "igniteui-react-core"; import { BrushUtil } from "igniteui-react-core"; import { Color } from "igniteui-react-core"; /** * @hidden */ export let AnnotationLayer = /*@__PURE__*/ (() => { class AnnotationLayer extends Series { constructor() { super(); this.aas = null; this.xy = null; this.xx = null; this.xz = null; this.aaq = { $type: Point_$type, x: NaN, y: NaN }; this.x0 = false; this.aas = { $type: Point_$type, x: NaN, y: NaN }; this.zo(); } ct() { return new AnnotationLayerView(this); } ri(a) { super.ri(a); this.xw = a; } x5(a) { if (a == null) { return false; } if (a.ev) { return false; } if (a.isValueOverlay) { return false; } if (a == this) { return false; } return a.hl(a.cw.b9, a.cw.ca, a.cw); } get_e4() { return this.x2; } b3() { if (this.b4 == 0) { return 1; } else { return super.b3(); } } get_fj() { return this.x7 || this.x8; } get_isUsableInLegend() { return this.x8; } rr(a, b, c, d) { super.rr(a, b, c, d); switch (b) { case "SeriesViewer": let e = c; let f = d; if (e != null) { this.zn(e.b9); let g = e.b9; g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.zk)); if (typeCast(XamDataChart.$, e) !== null) { let h = e; this.zm(h.zr); let i = h.zr; i.collectionChanged = delegateRemove(i.collectionChanged, runOn(this, this.za)); } } if (f != null) { this.zi(f.b9); let j = f.b9; j.collectionChanged = delegateCombine(j.collectionChanged, runOn(this, this.zk)); if (typeCast(XamDataChart.$, f) !== null) { let k = f; this.zh(k.zr); let l = k.zr; l.collectionChanged = delegateCombine(l.collectionChanged, runOn(this, this.za)); } } break; case AnnotationLayer.$$p[19]: case AnnotationLayer.$$p[18]: if (this.fj) { if (this.index == -1) { this.index = XamDataChart.abs(this); } } else { this.index = -1; this.vu = null; this.vy = null; } if (this.dc != null) { this.dc.q4(); } this.r9(true); break; case "TransitionProgress": this.xz.d(this.j0, this.xy, this.xx); if (this.d7(this.cw)) { return; } if (this.j0 == 1) { this.zj(this.xx, this.cw); this.q4(); } else { this.zj(this.xz, this.cw); } if (this.dc != null) { this.dc.su(this); } break; case AnnotationLayer.$$p[16]: if (this.dc != null) { this.dc.qy(); } break; case AnnotationLayer.$$p[11]: this.aas = this.aar; this.q7(this.aar); 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.zo(); 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.r9(true); break; } } zn(a) { for (let b of fromEnum(a)) { if (!(b == this)) { b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.zl)); } } this.r9(true); } zm(a) { for (let b of fromEnum(a)) { b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.zb)); } this.r9(true); } zi(a) { for (let b of fromEnum(a)) { if (!(b == this)) { b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.zl)); } } this.r9(true); } zh(a) { for (let b of fromEnum(a)) { b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.zb)); } this.r9(true); } x3(a) { if (a == null) { return false; } return true; } zb(a, b) { if (this.x3(a)) { this.zd(a, b.animate); } } x4(a) { if (a == null) { return false; } if (a.ev) { return false; } return true; } zl(a, b) { if (this.x4(a)) { this.ze(a, b.animate); } } zd(a, b) { } ze(a, b) { } zk(a, b) { this.zf(b); } za(a, b) { this.zc(b); } aac() { if (this.vu != null) { return this.vu; } return this.v0; } aad() { if (this.vy != null) { return this.vy; } return this.wg; } zc(a) { if (a.oldItems != null) { for (let b of fromEn(a.oldItems)) { b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.zb)); } } if (a.newItems != null) { for (let c of fromEn(a.newItems)) { c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.zb)); } } this.r9(true); } zf(a) { if (a.oldItems != null) { for (let b of fromEn(a.oldItems)) { b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.zl)); } } if (a.newItems != null) { for (let c of fromEn(a.newItems)) { c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.zl)); } } this.r9(true); } ta(a, b) { this.r9(false); } s9(a, b) { this.r9(true); } sa(a) { super.sa(a); if (this.d7(this.cw)) { return; } if (this.gm(a) && !this.gy) { let b = this.xy; if (this.d4()) { if (this.dd.g) { this.dd.t(); } this.xy = this.xz; this.xz = b; } else { this.xy = this.xx; this.xx = b; } this.zg(this.xx, this.cw); this.sq(); } else { if (!this.gy) { this.zg(this.xx, this.cw); } this.zj(this.xx, this.cw); } } get_ev() { return true; } zg(a, b) { } zj(a, b) { this.re(); this.xw.ch(); } q7(a) { if (!this.x1) { return; } super.q7(a); if (isNaN_(this.aas.x) && isNaN_(this.aas.y)) { if (isNaN_(a.x) && isNaN_(a.y)) { this.xw.cg(); return; } else { this.xw.ci(); this.aaq = a; } } else { this.xw.ci(); this.aaq = this.aas; } this.r9(true); } hl(a, b, c) { let d = super.hl(a, b, c); if (this.dc == null) { return false; } if (!this.cw.w()) { d = false; return d; } return d; } yi() { if (isNaN_(this.yl)) { switch (this.xk) { case 1: return this.yc(); case 2: return this.yf(); case 4: return this.ye(); } } return this.yl; } yh() { if (isNaN_(this.yk)) { return this.ya; } return this.yk; } yj() { if (isNaN_(this.ym)) { return this.ya; } return this.ym; } xr() { switch (this.xn) { case 0: return this.xo(); } return this.xn; } xs() { switch (this.xu) { case 0: return this.xk; } return this.xu; } xt() { switch (this.xv) { case 0: return this.xk; } return this.xv; } aal() { if (this.aan == null) { if (this.wn == null) { return this.aai(); } return this.wn; } return this.aan; } aam() { if (this.aao == null) { if (this.wn == null) { return this.aaj(); } return this.wn; } return this.aao; } aak() { if (this.wn == null) { return this.aah(); } return this.wn; } xo() { return 0; } xp() { return this.xo(); } xq() { return this.xo(); } yc() { return NaN; } yf() { return NaN; } ye() { return NaN; } yd() { return NaN; } yg() { return NaN; } aai() { return null; } aaj() { return null; } aah() { return null; } zo() { this.xk = this.xr(); this.ya = this.yi(); this.xl = this.xs(); this.x9 = this.yh(); this.xm = this.xt(); this.yb = this.yj(); this.aaf = this.aal(); this.aag = this.aam(); this.aae = this.aak(); } get_hh() { return this.x6; } get x6() { return this.x0; } set x6(a) { let b = this.x0; this.x0 = a; this.raisePropertyChanged("ShouldRenderAsOverlay", b, this.x0); } } AnnotationLayer.$t = /*@__PURE__*/ markType(AnnotationLayer, 'AnnotationLayer', Series.$); AnnotationLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, AnnotationLayer, 'raisePropertyChanged', ['ActualAppearanceMode:xk:zp', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualDashArray:aae:zq', [DoubleCollection.$], 'ActualDashCap:aap:zr', [PenLineCap_$type], 'ActualHorizontalAppearanceMode:xl:zs', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualHorizontalDashArray:aaf:zt', [DoubleCollection.$], 'ActualHorizontalShiftAmount:x9:zu', [1, NaN], 'ActualShiftAmount:ya:zv', [1, NaN], 'ActualVerticalAppearanceMode:xm:zw', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualVerticalDashArray:aag:zx', [DoubleCollection.$], 'ActualVerticalShiftAmount:yb:zy', [1, NaN], 'AppearanceMode:xn:zz', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'CursorPosition:aar:z0', [Point_$type, { $type: Point_$type, x: NaN, y: NaN }], 'CursorPositionUpdatesOnMove:x1:z1', [0, true], 'HorizontalAppearanceMode:xu:z2', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'HorizontalDashArray:aan:z3', [DoubleCollection.$], 'HorizontalShiftAmount:yk:z4', [1, NaN], 'IsDefaultCrosshairDisabled:x2:z5', [0, true], 'ShiftAmount:yl:z6', [1, NaN], 'UseIndex:x7:z7', [0, false], 'UseLegend:x8:z8', [0, false], 'VerticalAppearanceMode:xv:z9', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'VerticalDashArray:aao:aaa', [DoubleCollection.$], 'VerticalShiftAmount:ym:aab', [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.aaq = { $type: Point_$type, x: NaN, y: NaN }; this.cd.r9(true); } } cg() { this.ce = true; if (this.f.j9 != null) { this.f.j9.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.q(a, b); } cm(a, b) { if (a == null) { return a; } return BrushUtil.s(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 = /*@__PURE__*/ markType(AnnotationLayerView, 'AnnotationLayerView', SeriesView.$); return AnnotationLayerView; })();