UNPKG

igniteui-react-charts

Version:

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

457 lines (456 loc) 18.4 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 { __extends, __read, __spreadArray, __values } from "tslib"; import { RangeCategorySeries } from "./RangeCategorySeries"; import { IVerticalAnchoredCategorySeriesInteractionManager_$type } from "./IVerticalAnchoredCategorySeriesInteractionManager"; import { DVContainer } from "igniteui-react-core"; import { typeCast, fromEnum, Point_$type, runOn, markType, markDep } from "igniteui-react-core"; import { NumericXAxis } from "./NumericXAxis"; import { DependencyProperty } from "igniteui-react-core"; import { CategoryAxisBase } from "./CategoryAxisBase"; import { VerticalRangeCategoryFramePreparer } from "./VerticalRangeCategoryFramePreparer"; import { Axis } from "./Axis"; import { Series } from "./Series"; import { CategorySeries } from "./CategorySeries"; import { List$1 } from "igniteui-react-core"; import { RangeValueList } from "./RangeValueList"; import { ScalerParams } from "./ScalerParams"; import { AxisRange } from "./AxisRange"; import { ISortingAxis_$type } from "./ISortingAxis"; import { DataLegendSeriesValueInfo } from "igniteui-react-core"; import { DataLegendSeriesContext } from "igniteui-react-core"; import { PropertyMetadata } from "igniteui-react-core"; import { truncate, isNaN_, isInfinity } from "igniteui-react-core"; /** * @hidden */ var VerticalRangeCategorySeries = /** @class */ /*@__PURE__*/ (function (_super) { __extends(VerticalRangeCategorySeries, _super); function VerticalRangeCategorySeries() { var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this; _this.aca = null; return _this; } Object.defineProperty(VerticalRangeCategorySeries.prototype, "acb", { get: function () { var _this = this; if (this.aca == null) { this.aca = DVContainer.instance.createInstance(IVerticalAnchoredCategorySeriesInteractionManager_$type, function () { return _this.ds.n; }); } return this.aca; }, enumerable: false, configurable: true }); VerticalRangeCategorySeries.prototype.preferredCategoryMode = function (a) { return 2; }; VerticalRangeCategorySeries.prototype.abl = function (a, b, c, d) { return new VerticalRangeCategoryFramePreparer(1, this, a, b, c, d); }; VerticalRangeCategorySeries.prototype.aao = function () { var e_1, _a; if (this.bo != null) { var a = this.bo; return a.aao(); } var b = 0; var c = this.zi(); try { for (var _b = __values(fromEnum(this.dc.b9)), _c = _b.next(); !_c.done; _c = _b.next()) { var d = _c.value; if (d == this) { return b; } var e = typeCast(CategorySeries.$, d); if (e != null && e.zi() == c && e.preferredCategoryMode(typeCast(CategoryAxisBase.$, c)) == 2) { b++; } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_1) throw e_1.error; } } return -1; }; VerticalRangeCategorySeries.prototype.fetchXAxis = function () { return this.xAxis; }; VerticalRangeCategorySeries.prototype.fetchYAxis = function () { return this.yAxis; }; VerticalRangeCategorySeries.prototype.get_isVertical = function () { return true; }; VerticalRangeCategorySeries.prototype.zi = function () { return this.yAxis; }; VerticalRangeCategorySeries.prototype.zz = function () { return this.xAxis; }; VerticalRangeCategorySeries.prototype.ph = function () { _super.prototype.ph.call(this); this.xAxis = null; this.yAxis = null; }; VerticalRangeCategorySeries.prototype.cl = function () { if (this.xAxis != null && this.xAxis.dn) { return 4; } return 3; }; VerticalRangeCategorySeries.prototype.cm = function () { return 1; }; VerticalRangeCategorySeries.prototype.aj = function (a) { var b = this.an(this.zi(), this.zk.k, this.aal(this.cw), this.aam(this.cw), this.w4(a), true); if (b == null) { return null; } var c = b[0]; var d = b[1]; var e = new Array(1); var f = new Array(2); f[0] = { $type: Point_$type, x: c[2], y: c[0] }; f[1] = { $type: Point_$type, x: d[2], y: d[0] }; e[0] = f; return e; }; VerticalRangeCategorySeries.prototype.al = function (a) { var b = this.an(this.zi(), this.zk.k, this.aal(this.cw), this.aam(this.cw), this.w4(a), true); if (b == null) { return null; } var c = b[0]; var d = b[1]; var e = new Array(1); var f = new Array(2); f[0] = { $type: Point_$type, x: c[1], y: c[0] }; f[1] = { $type: Point_$type, x: d[1], y: d[0] }; e[0] = f; return e; }; VerticalRangeCategorySeries.prototype.get_fy = function () { return true; }; VerticalRangeCategorySeries.prototype.b3 = function () { if (this.b4 == 0) { return 1; } else { return _super.prototype.b3.call(this); } }; VerticalRangeCategorySeries.prototype.getOffsetValue = function () { return this.RangeFramePreparer.r(this.yAxis, this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)); }; VerticalRangeCategorySeries.prototype.getCategoryWidth = function () { return this.yAxis.getCategorySize(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)); }; VerticalRangeCategorySeries.prototype.aaj = function (a) { return this.i2(a, this.zi()); }; VerticalRangeCategorySeries.prototype.i0 = function (a) { return this.acb.e$a(this, a); }; VerticalRangeCategorySeries.prototype.ke = function (a) { return truncate(Math.round(this.i0(a))); }; VerticalRangeCategorySeries.prototype.ky = function (a) { var b = this.ke(a); return b >= 0 && this.dp != null && b < this.dp.count ? this.dp.item(b) : null; }; VerticalRangeCategorySeries.prototype.kj = function (a, b) { return this.kk(a, b, this.yAxis, runOn(this, this.aaj), new RangeValueList(this.highColumn, this.lowColumn)); }; VerticalRangeCategorySeries.prototype.kl = function (a, b) { return this.km(a, b, this.yAxis, runOn(this, this.aaj), new RangeValueList(this.highColumn, this.lowColumn)); }; VerticalRangeCategorySeries.prototype.iy = function (a, b, c, d, e) { if (c == null) { return Number.POSITIVE_INFINITY; } var f = this.yAxis.qd; return this.iz(a, b, this.yAxis, d, e, f, runOn(this, this.aaj)); }; VerticalRangeCategorySeries.prototype.jf = function (a, b, c) { if (this.dc == null) { return NaN; } var d = this.getEffectiveViewport1(this.cw); var e = new ScalerParams(0, this.dc.yv, this.cw.b9, this.yAxis.dn, d); var f = this.RangeFramePreparer.r(this.yAxis, this.dc.yv, this.cw.b9, d); return this.jh(new RangeValueList(this.highColumn, this.lowColumn), a, this.yAxis, e, f, runOn(this, this.aaj), b, c); }; VerticalRangeCategorySeries.prototype.jd = function (a, b, c) { if (this.dc == null) { return NaN; } var d = this.getEffectiveViewport1(this.cw); var e = new ScalerParams(0, this.dc.yv, this.cw.b9, this.yAxis.dn, d); var f = this.RangeFramePreparer.r(this.yAxis, this.dc.yv, this.cw.b9, d); return this.jh(this.lowColumn, a, this.yAxis, e, f, runOn(this, this.aaj), b, c); }; VerticalRangeCategorySeries.prototype.jb = function (a, b, c) { if (this.dc == null) { return NaN; } var d = this.getEffectiveViewport1(this.cw); var e = new ScalerParams(0, this.dc.yv, this.cw.b9, this.yAxis.dn, d); var f = this.RangeFramePreparer.r(this.yAxis, this.dc.yv, this.cw.b9, d); return this.jh(this.highColumn, a, this.yAxis, e, f, runOn(this, this.aaj), b, c); }; VerticalRangeCategorySeries.prototype.wu = function (a, b, c) { var _this = this; return this.w0(a, b, c, this.RangeFramePreparer.r(this.yAxis, this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.xAxis, this.yAxis, runOn(this, this.jb), function (d, e) { return _this.km(d, e, _this.yAxis, runOn(_this, _this.aaj), _this.highColumn); }, function (d, e) { return _this.kk(d, e, _this.yAxis, runOn(_this, _this.aaj), _this.highColumn); }); }; VerticalRangeCategorySeries.prototype.ww = function (a, b, c) { var _this = this; return this.w0(a, b, c, this.RangeFramePreparer.r(this.yAxis, this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.xAxis, this.yAxis, runOn(this, this.jd), function (d, e) { return _this.km(d, e, _this.yAxis, runOn(_this, _this.aaj), _this.lowColumn); }, function (d, e) { return _this.kk(d, e, _this.yAxis, runOn(_this, _this.aaj), _this.lowColumn); }); }; VerticalRangeCategorySeries.prototype.wy = function (a, b, c) { return this.w0(a, b, c, this.RangeFramePreparer.r(this.yAxis, this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.xAxis, this.yAxis, null, null, null); }; VerticalRangeCategorySeries.prototype.az = function (a) { if (a.isEmpty && this.dc != null) { a = this.dc.yv; } var b = this.zi(); if (this.lowColumn == null || this.highColumn == null) { return null; } var c = this.w6(this.cw); var d = new ScalerParams(0, a, this.dc.zd, b.dn, this.getEffectiveViewport()); var e = (b.ga(c.top, d)); var f = (b.ga(c.bottom, d)); if (!b.dn) { var g = e; e = f; f = g; } var h = null; if (b.dw) { h = b; e = h.i$f(e); f = h.i$f(f); } else { e = Math.floor(e); f = Math.ceil(f); } if (isNaN_(e) || isNaN_(f)) { return null; } e = Math.max(0, Math.min(this.lowColumn.count - 1, e)); f = Math.max(0, Math.min(this.lowColumn.count - 1, f)); var i = 1.7976931348623157E+308; var j = -1.7976931348623157E+308; if (truncate(e) <= truncate(f)) { for (var k = truncate(e); k <= truncate(f); k++) { var l = k; if (h != null) { l = h.i$b._inner[k]; } var m = this.lowColumn.item(l); if (this.lowColumn.mayContainUnknowns) { if (isInfinity(m) || isNaN_(m)) { continue; } } var n = this.highColumn.item(l); if (this.highColumn.mayContainUnknowns) { if (isInfinity(n) || isNaN_(n)) { continue; } } i = Math.min(i, m); j = Math.max(j, n); } } var o = new AxisRange(i, j); var p = this.zz(); o = this.ax(o, p, a); return o; }; VerticalRangeCategorySeries.prototype.i7 = function () { return Series.i8(this.lowColumn, typeCast(ISortingAxis_$type, this.fetchYAxis())); }; VerticalRangeCategorySeries.prototype.ay = function (a) { if (this.lowColumn == null || this.lowColumn.count == 0 || this.highColumn == null || this.highColumn.count == 0) { return null; } if (a == this.fetchYAxis()) { var b = Math.min(this.lowColumn.count, this.highColumn.count); return new AxisRange(0, b - 1); } if (a == this.fetchXAxis()) { var c = Math.min(this.lowColumn.minimum, this.highColumn.minimum); var d = Math.max(this.lowColumn.maximum, this.highColumn.maximum); return new AxisRange(Math.min(c, d), Math.max(c, d)); } return null; }; VerticalRangeCategorySeries.prototype.pq = function (a, b, c, d) { if (this.fetchYAxis() != null && typeCast(ISortingAxis_$type, this.fetchYAxis()) !== null) { this.fetchYAxis().i$i(); } var e = this.fetchYAxis(); switch (a) { case 3: if (d == this.ab0 || d == this.abx) { if (e != null) { e.ee(); } if (!this.aaf()) { this.sa(true); } } break; case 1: if (e != null) { e.ee(); } this.zt.c9.g(this.im); if (!this.aaf()) { this.sa(true); } break; case 0: if (e != null) { e.ee(); } this.zt.c9.g(this.im); if (!this.aaf()) { this.sa(true); } break; case 2: if (e != null) { e.ee(); } if (this.ab0 != null && this.abx != null && this.zt.c9.d > 0 && !this.aaf()) { this.sa(true); } break; case 4: if (e != null) { e.ee(); } this.zt.c9.g(this.im); if (!this.aaf()) { this.sa(true); } break; } }; VerticalRangeCategorySeries.prototype.aaf = function () { return this.xAxis != null && this.xAxis.ee(); }; VerticalRangeCategorySeries.prototype.rs = function (a, b, c, d) { _super.prototype.rs.call(this, a, b, c, d); switch (b) { case VerticalRangeCategorySeries.$$p[0]: case VerticalRangeCategorySeries.$$p[1]: case VerticalRangeCategorySeries.$$p[2]: case VerticalRangeCategorySeries.$$p[3]: this.qw(); break; case VerticalRangeCategorySeries.$$p[4]: this.pr(typeCast(Axis.$, c)); this.r0(typeCast(Axis.$, d)); this.zt.c9.g(this.im); this.aaf(); this.sa(false); this.q2(); break; case VerticalRangeCategorySeries.$$p[5]: this.pr(typeCast(Axis.$, c)); this.r0(typeCast(Axis.$, d)); this.zt.c9.g(this.im); this.sa(false); this.q2(); break; } }; VerticalRangeCategorySeries.prototype.ace = function (a) { if (typeCast(CategoryAxisBase.$, a) !== null) { return true; } return false; }; VerticalRangeCategorySeries.prototype.acd = function (a) { if (typeCast(NumericXAxis.$, a) !== null) { return true; } return false; }; VerticalRangeCategorySeries.prototype.getDataLegendSeriesContextAt = function (a, b) { var c = { $type: Point_$type, x: a, y: b }; var d = this.jd(c, false, false); var e = this.jb(c, false, false); var f = new DataLegendSeriesValueInfo(); f.a = 1; f.l = e > d ? d : e; f.q = "Low"; f.r = this.ab0 != null ? this.ab0 : "Low"; f.s = this.acj != null ? this.acj : "L:"; f.t = this.acl != null ? this.acl : ""; var g = new DataLegendSeriesValueInfo(); g.a = 2; g.l = e > d ? e : d; g.q = "High"; g.r = this.abx != null ? this.abx : "High"; g.s = this.acf != null ? this.acf : "H:"; g.t = this.ach != null ? this.ach : ""; var h = new DataLegendSeriesValueInfo(); h.a = 7; h.l = Math.abs(g.l - f.l); h.q = "Range"; h.r = "Range"; h.s = "R:"; h.k = true; var i = new DataLegendSeriesValueInfo(); i.a = 6; i.l = f.l + (h.l / 2); i.q = "Average"; i.r = "Average"; i.s = "A:"; i.k = true; var j = new DataLegendSeriesContext(); j.e = ((function () { var $ret = new List$1(DataLegendSeriesValueInfo.$, 0); $ret.add(g); $ret.add(f); $ret.add(h); $ret.add(i); return $ret; })()); j.h = this.mp(); return j; }; Object.defineProperty(VerticalRangeCategorySeries.prototype, "useHighMarkerFidelity", { get: function () { return this.aag; }, enumerable: false, configurable: true }); VerticalRangeCategorySeries.$t = markType(VerticalRangeCategorySeries, 'VerticalRangeCategorySeries', RangeCategorySeries.$); VerticalRangeCategorySeries.$$p = markDep(DependencyProperty, PropertyMetadata, VerticalRangeCategorySeries, 'raisePropertyChanged', ['HighMemberAsLegendLabel:acf:acp', [2, null], 'HighMemberAsLegendUnit:ach:acq', [2, null], 'LowMemberAsLegendLabel:acj:acr', [2, null], 'LowMemberAsLegendUnit:acl:acs', [2, null], 'XAxis::act', [NumericXAxis.$, null], 'YAxis::acu', [CategoryAxisBase.$, null]]); return VerticalRangeCategorySeries; }(RangeCategorySeries)); export { VerticalRangeCategorySeries };