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.z9 = null; this.xh = null; this.xg = null; this.xi = null; this.z7 = { $type: Point_$type, x: NaN, y: NaN }; this.xj = false; this.z9 = { $type: Point_$type, x: NaN, y: NaN }; this.y6(); } ct() { return new AnnotationLayerView(this); } q3(a) { super.q3(a); this.xf = a; } xn(a) { if (a == null) { return false; } if (a.eu) { return false; } if (a.isValueOverlay) { return false; } if (a == this) { return false; } return a.hf(a.cw.b9, a.cw.ca, a.cw); } get_e3() { return this.xk; } b3() { if (this.b4 == 0) { return 1; } else { return super.b3(); } } get_fh() { return this.xp || this.xq; } get_isUsableInLegend() { return this.xq; } rc(a, b, c, d) { super.rc(a, b, c, d); switch (b) { case "SeriesViewer": let e = c; let f = d; if (e != null) { this.y5(e.series); let g = e.series; g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.y2)); if (typeCast(XamDataChart.$, e) !== null) { let h = e; this.y4(h.axes); let i = h.axes; i.collectionChanged = delegateRemove(i.collectionChanged, runOn(this, this.ys)); } } if (f != null) { this.y0(f.series); let j = f.series; j.collectionChanged = delegateCombine(j.collectionChanged, runOn(this, this.y2)); if (typeCast(XamDataChart.$, f) !== null) { let k = f; this.yz(k.axes); let l = k.axes; l.collectionChanged = delegateCombine(l.collectionChanged, runOn(this, this.ys)); } } break; case AnnotationLayer.$$p[18]: case AnnotationLayer.$$p[17]: if (this.fh) { if (this.index == -1) { this.index = XamDataChart.zi(this); } } else { this.index = -1; this.ve = null; this.vi = null; } if (this.dc != null) { this.dc.px(); } this.ru(true); break; case "TransitionProgress": this.xi.c(this.jr, this.xh, this.xg); if (this.d7(this.cw)) { return; } if (this.jr == 1) { this.y1(this.xg, this.cw); this.qq(); } else { this.y1(this.xi, this.cw); } if (this.dc != null) { this.dc.q7(this); } break; case AnnotationLayer.$$p[15]: if (this.dc != null) { this.dc.pr(); } break; case AnnotationLayer.$$p[11]: this.z9 = this.z8; this.qt(this.z8); 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[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.y6(); 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.ru(true); break; } } y5(a) { for (let b of fromEnum(a)) { if (!(b == this)) { b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.y3)); } } this.ru(true); } y4(a) { for (let b of fromEnum(a)) { b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.yt)); } this.ru(true); } y0(a) { for (let b of fromEnum(a)) { if (!(b == this)) { b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.y3)); } } this.ru(true); } yz(a) { for (let b of fromEnum(a)) { b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.yt)); } this.ru(true); } xl(a) { if (a == null) { return false; } return true; } yt(a, b) { if (this.xl(a)) { this.yv(a, b.animate); } } xm(a) { if (a == null) { return false; } if (a.eu) { return false; } return true; } y3(a, b) { if (this.xm(a)) { this.yw(a, b.animate); } } yv(a, b) { } yw(a, b) { } y2(a, b) { this.yx(b); } ys(a, b) { this.yu(b); } zt() { if (this.ve != null) { return this.ve; } return this.vk; } zu() { if (this.vi != null) { return this.vi; } return this.v0; } yu(a) { if (a.oldItems != null) { for (let b of fromEn(a.oldItems)) { b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.yt)); } } if (a.newItems != null) { for (let c of fromEn(a.newItems)) { c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.yt)); } } this.ru(true); } yx(a) { if (a.oldItems != null) { for (let b of fromEn(a.oldItems)) { b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.y3)); } } if (a.newItems != null) { for (let c of fromEn(a.newItems)) { c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.y3)); } } this.ru(true); } sv(a, b) { this.ru(false); } su(a, b) { this.ru(true); } rv(a) { super.rv(a); if (this.d7(this.cw)) { return; } if (this.gg(a) && !this.gs) { let b = this.xh; if (this.d4()) { if (this.dd.g) { this.dd.t(); } this.xh = this.xi; this.xi = b; } else { this.xh = this.xg; this.xg = b; } this.yy(this.xg, this.cw); this.sb(); } else { if (!this.gs) { this.yy(this.xg, this.cw); } this.y1(this.xg, this.cw); } } get_eu() { return true; } yy(a, b) { } y1(a, b) { this.qz(); this.xf.ch(); } yr(a) { let b = { $type: Point_$type, x: this.z7.x, y: this.z7.y }; if (a.isVertical) { if (isNaN_(this.z7.y)) { return new Tuple$2(Boolean_$type, Point_$type, false, b); } if (isNaN_(this.z7.x)) { b.x = 0; return new Tuple$2(Boolean_$type, Point_$type, true, b); } } else { if (isNaN_(this.z7.x)) { return new Tuple$2(Boolean_$type, Point_$type, false, b); } if (isNaN_(this.z7.y)) { b.y = 0; return new Tuple$2(Boolean_$type, Point_$type, true, b); } } return new Tuple$2(Boolean_$type, Point_$type, true, b); } qt(a) { super.qt(a); if (isNaN_(this.z9.x) && isNaN_(this.z9.y)) { if (isNaN_(a.x) && isNaN_(a.y)) { this.xf.cg(); return; } else { this.xf.ci(); this.z7 = a; } } else { this.xf.ci(); this.z7 = this.z9; } this.ru(true); } hf(a, b, c) { let d = super.hf(a, b, c); if (this.dc == null) { return false; } if (!this.cw.w()) { d = false; return d; } return d; } x0() { if (isNaN_(this.x3)) { switch (this.w3) { case 1: return this.xu(); case 2: return this.xx(); case 4: return this.xw(); } } return this.x3; } xz() { if (isNaN_(this.x2)) { return this.xs; } return this.x2; } x1() { if (isNaN_(this.x4)) { return this.xs; } return this.x4; } xa() { switch (this.w6) { case 0: return this.w7(); } return this.w6; } xb() { switch (this.xd) { case 0: return this.w3; } return this.xd; } xc() { switch (this.xe) { case 0: return this.w3; } return this.xe; } z2() { if (this.z4 == null) { if (this.v7 == null) { return this.zz(); } return this.v7; } return this.z4; } z3() { if (this.z5 == null) { if (this.v7 == null) { return this.z0(); } return this.v7; } return this.z5; } z1() { if (this.v7 == null) { return this.zy(); } return this.v7; } w7() { return 0; } w8() { return this.w7(); } w9() { return this.w7(); } xu() { return NaN; } xx() { return NaN; } xw() { return NaN; } xv() { return NaN; } xy() { return NaN; } zz() { return null; } z0() { return null; } zy() { return null; } y6() { this.w3 = this.xa(); this.xs = this.x0(); this.w4 = this.xb(); this.xr = this.xz(); this.w5 = this.xc(); this.xt = this.x1(); this.zw = this.z2(); this.zx = this.z3(); this.zv = this.z1(); } get_hb() { return this.xo; } get xo() { return this.xj; } set xo(a) { let b = this.xj; this.xj = a; this.raisePropertyChanged("ShouldRenderAsOverlay", b, this.xj); } } AnnotationLayer.$t = /*@__PURE__*/ markType(AnnotationLayer, 'AnnotationLayer', Series.$); AnnotationLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, AnnotationLayer, 'raisePropertyChanged', ['ActualAppearanceMode:w3:y7', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualDashArray:zv:y8', [DoubleCollection.$], 'ActualDashCap:z6:y9', [PenLineCap_$type], 'ActualHorizontalAppearanceMode:w4:za', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualHorizontalDashArray:zw:zb', [DoubleCollection.$], 'ActualHorizontalShiftAmount:xr:zc', [1, NaN], 'ActualShiftAmount:xs:zd', [1, NaN], 'ActualVerticalAppearanceMode:w5:ze', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualVerticalDashArray:zx:zf', [DoubleCollection.$], 'ActualVerticalShiftAmount:xt:zg', [1, NaN], 'AppearanceMode:w6:zh', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'CursorPosition:z8:zi', [Point_$type, { $type: Point_$type, x: NaN, y: NaN }], 'HorizontalAppearanceMode:xd:zj', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'HorizontalDashArray:z4:zk', [DoubleCollection.$], 'HorizontalShiftAmount:x2:zl', [1, NaN], 'IsDefaultCrosshairDisabled:xk:zm', [0, true], 'ShiftAmount:x3:zn', [1, NaN], 'UseIndex:xp:zo', [0, false], 'UseLegend:xq:zp', [0, false], 'VerticalAppearanceMode:xe:zq', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'VerticalDashArray:z5:zr', [DoubleCollection.$], 'VerticalShiftAmount:x4:zs', [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.z7 = { $type: Point_$type, x: NaN, y: NaN }; this.cd.ru(true); } } cg() { this.ce = true; if (this.f.j0 != null) { this.f.j0.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 = /*@__PURE__*/ markType(AnnotationLayerView, 'AnnotationLayerView', SeriesView.$); return AnnotationLayerView; })();