UNPKG

igniteui-react-charts

Version:

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

560 lines (559 loc) 18.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 { Series } from "./Series"; import { DependencyProperty } from "igniteui-react-core"; import { Point_$type, Boolean_$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 { Tuple$2 } 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.z6 = null; this.xe = null; this.xd = null; this.xf = null; this.z4 = { $type: Point_$type, x: NaN, y: NaN }; this.xg = false; this.z6 = { $type: Point_$type, x: NaN, y: NaN }; this.y3(); } ct() { return new AnnotationLayerView(this); } q1(a) { super.q1(a); this.xc = a; } xk(a) { if (a == null) { return false; } if (a.et) { return false; } if (a.isValueOverlay) { return false; } if (a == this) { return false; } return a.he(a.cw.b1, a.cw.b2, a.cw); } get_e2() { return this.xh; } b3() { if (this.b4 == 0) { return 1; } else { return super.b3(); } } get_fg() { return this.xm || this.xn; } get_isUsableInLegend() { return this.xn; } ra(a, b, c, d) { super.ra(a, b, c, d); switch (b) { case "SeriesViewer": let e = c; let f = d; if (e != null) { this.y2(e.series); let g = e.series; g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.yz)); if (typeCast(XamDataChart.$, e) !== null) { let h = e; this.y1(h.axes); let i = h.axes; i.collectionChanged = delegateRemove(i.collectionChanged, runOn(this, this.yp)); } } if (f != null) { this.yx(f.series); let j = f.series; j.collectionChanged = delegateCombine(j.collectionChanged, runOn(this, this.yz)); if (typeCast(XamDataChart.$, f) !== null) { let k = f; this.yw(k.axes); let l = k.axes; l.collectionChanged = delegateCombine(l.collectionChanged, runOn(this, this.yp)); } } break; case AnnotationLayer.$$p[18]: case AnnotationLayer.$$p[17]: if (this.fg) { if (this.index == -1) { this.index = XamDataChart.yu(this); } } else { this.index = -1; this.vb = null; this.vf = null; } if (this.dc != null) { this.dc.pf(); } this.rs(true); break; case "TransitionProgress": this.xf.c(this.jq, this.xe, this.xd); if (this.d6(this.cw)) { return; } if (this.jq == 1) { this.yy(this.xd, this.cw); this.qo(); } else { this.yy(this.xf, this.cw); } if (this.dc != null) { this.dc.qp(this); } break; case AnnotationLayer.$$p[15]: if (this.dc != null) { this.dc.o9(); } break; case AnnotationLayer.$$p[11]: this.z6 = this.z5; this.qr(this.z5); break; case "ShouldRenderAsOverlay": if (this.dc != null) { this.cw.ao(this.dc); this.cw.aj(this.dc); } break; case AnnotationLayer.$$p[10]: case AnnotationLayer.$$p[16]: case "DashArray": case AnnotationLayer.$$p[12]: case AnnotationLayer.$$p[19]: case AnnotationLayer.$$p[14]: case AnnotationLayer.$$p[21]: case AnnotationLayer.$$p[13]: case AnnotationLayer.$$p[20]: this.y3(); 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.rs(true); break; } } y2(a) { for (let b of fromEnum(a)) { if (!(b == this)) { b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.y0)); } } this.rs(true); } y1(a) { for (let b of fromEnum(a)) { b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.yq)); } this.rs(true); } yx(a) { for (let b of fromEnum(a)) { if (!(b == this)) { b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.y0)); } } this.rs(true); } yw(a) { for (let b of fromEnum(a)) { b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.yq)); } this.rs(true); } xi(a) { if (a == null) { return false; } return true; } yq(a, b) { if (this.xi(a)) { this.ys(a, b.animate); } } xj(a) { if (a == null) { return false; } if (a.et) { return false; } return true; } y0(a, b) { if (this.xj(a)) { this.yt(a, b.animate); } } ys(a, b) { } yt(a, b) { } yz(a, b) { this.yu(b); } yp(a, b) { this.yr(b); } zq() { if (this.vb != null) { return this.vb; } return this.vh; } zr() { if (this.vf != null) { return this.vf; } return this.vx; } yr(a) { if (a.oldItems != null) { for (let b of fromEn(a.oldItems)) { b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.yq)); } } if (a.newItems != null) { for (let c of fromEn(a.newItems)) { c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.yq)); } } this.rs(true); } yu(a) { if (a.oldItems != null) { for (let b of fromEn(a.oldItems)) { b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.y0)); } } if (a.newItems != null) { for (let c of fromEn(a.newItems)) { c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.y0)); } } this.rs(true); } st(a, b) { this.rs(false); } ss(a, b) { this.rs(true); } rt(a) { super.rt(a); if (this.d6(this.cw)) { return; } if (this.gf(a) && !this.gr) { let b = this.xe; if (this.d4()) { if (this.dd.g) { this.dd.t(); } this.xe = this.xf; this.xf = b; } else { this.xe = this.xd; this.xd = b; } this.yv(this.xd, this.cw); this.r9(); } else { if (!this.gr) { this.yv(this.xd, this.cw); } this.yy(this.xd, this.cw); } } get_et() { return true; } yv(a, b) { } yy(a, b) { this.qx(); this.xc.b8(); } yo(a) { let b = { $type: Point_$type, x: this.z4.x, y: this.z4.y }; if (a.isVertical) { if (isNaN_(this.z4.y)) { return new Tuple$2(Boolean_$type, Point_$type, false, b); } if (isNaN_(this.z4.x)) { b.x = 0; return new Tuple$2(Boolean_$type, Point_$type, true, b); } } else { if (isNaN_(this.z4.x)) { return new Tuple$2(Boolean_$type, Point_$type, false, b); } if (isNaN_(this.z4.y)) { b.y = 0; return new Tuple$2(Boolean_$type, Point_$type, true, b); } } return new Tuple$2(Boolean_$type, Point_$type, true, b); } qr(a) { super.qr(a); if (isNaN_(this.z6.x) && isNaN_(this.z6.y)) { if (isNaN_(a.x) && isNaN_(a.y)) { this.xc.b7(); return; } else { this.xc.b9(); this.z4 = a; } } else { this.xc.b9(); this.z4 = this.z6; } this.rs(true); } he(a, b, c) { let d = super.he(a, b, c); if (this.dc == null) { return false; } if (!this.cw.u()) { d = false; return d; } return d; } xx() { if (isNaN_(this.x0)) { switch (this.w0) { case 1: return this.xr(); case 2: return this.xu(); case 4: return this.xt(); } } return this.x0; } xw() { if (isNaN_(this.xz)) { return this.xp; } return this.xz; } xy() { if (isNaN_(this.x1)) { return this.xp; } return this.x1; } w7() { switch (this.w3) { case 0: return this.w4(); } return this.w3; } w8() { switch (this.xa) { case 0: return this.w0; } return this.xa; } w9() { switch (this.xb) { case 0: return this.w0; } return this.xb; } zz() { if (this.z1 == null) { if (this.v4 == null) { return this.zw(); } return this.v4; } return this.z1; } z0() { if (this.z2 == null) { if (this.v4 == null) { return this.zx(); } return this.v4; } return this.z2; } zy() { if (this.v4 == null) { return this.zv(); } return this.v4; } w4() { return 0; } w5() { return this.w4(); } w6() { return this.w4(); } xr() { return NaN; } xu() { return NaN; } xt() { return NaN; } xs() { return NaN; } xv() { return NaN; } zw() { return null; } zx() { return null; } zv() { return null; } y3() { this.w0 = this.w7(); this.xp = this.xx(); this.w1 = this.w8(); this.xo = this.xw(); this.w2 = this.w9(); this.xq = this.xy(); this.zt = this.zz(); this.zu = this.z0(); this.zs = this.zy(); } get_ha() { return this.xl; } get xl() { return this.xg; } set xl(a) { let b = this.xg; this.xg = a; this.raisePropertyChanged("ShouldRenderAsOverlay", b, this.xg); } } AnnotationLayer.$t = /*@__PURE__*/ markType(AnnotationLayer, 'AnnotationLayer', Series.$); AnnotationLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, AnnotationLayer, 'raisePropertyChanged', ['ActualAppearanceMode:w0:y4', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualDashArray:zs:y5', [DoubleCollection.$], 'ActualDashCap:z3:y6', [PenLineCap_$type], 'ActualHorizontalAppearanceMode:w1:y7', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualHorizontalDashArray:zt:y8', [DoubleCollection.$], 'ActualHorizontalShiftAmount:xo:y9', [1, NaN], 'ActualShiftAmount:xp:za', [1, NaN], 'ActualVerticalAppearanceMode:w2:zb', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualVerticalDashArray:zu:zc', [DoubleCollection.$], 'ActualVerticalShiftAmount:xq:zd', [1, NaN], 'AppearanceMode:w3:ze', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'CursorPosition:z5:zf', [Point_$type, { $type: Point_$type, x: NaN, y: NaN }], 'HorizontalAppearanceMode:xa:zg', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'HorizontalDashArray:z1:zh', [DoubleCollection.$], 'HorizontalShiftAmount:xz:zi', [1, NaN], 'IsDefaultCrosshairDisabled:xh:zj', [0, true], 'ShiftAmount:x0:zk', [1, NaN], 'UseIndex:xm:zl', [0, false], 'UseLegend:xn:zm', [0, false], 'VerticalAppearanceMode:xb:zn', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'VerticalDashArray:z2:zo', [DoubleCollection.$], 'VerticalShiftAmount:x1:zp', [1, NaN]]); return AnnotationLayer; })(); /** * @hidden */ export let AnnotationLayerView = /*@__PURE__*/ (() => { class AnnotationLayerView extends SeriesView { constructor(a) { super(a); this.b4 = null; this.b5 = false; this.b6 = -1; this.b4 = a; } ca() { if (this.b5) { this.b5 = false; this.b6 = -1; this.b4.z4 = { $type: Point_$type, x: NaN, y: NaN }; this.b4.rs(true); } } b7() { this.b5 = true; if (this.f.jz != null) { this.f.jz.setTimeout(runOn(this, this.ca), 300); } else { this.b6 = window.setTimeout(runOn(this, this.ca), 300); } } b9() { if (this.b5 == true) { this.b5 = false; if (this.b6 != -1) { window.clearTimeout(this.b6); this.b6 = -1; } } } b8() { this.av(); } cb(a, b) { if (a == null) { return a; } return BrushUtil.m(a, b); } cd(a, b) { if (a == null) { return a; } return BrushUtil.o(a, b); } cc(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; })();