UNPKG

igniteui-react-charts

Version:

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

322 lines (321 loc) 10.9 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, __values } from "tslib"; import { HorizontalRangeCategorySeries } from "./HorizontalRangeCategorySeries"; import { DependencyProperty } from "igniteui-react-core"; import { Defaults } from "./Defaults"; import { typeCast, runOn, markType, markDep, fromEnum } from "igniteui-react-core"; import { Rect } from "igniteui-react-core"; import { ScalerParams } from "./ScalerParams"; import { List$1 } from "igniteui-react-core"; import { Pool$1 } from "igniteui-react-core"; import { Rectangle } from "igniteui-react-core"; import { ChartSelection } from "./ChartSelection"; import { PropertyMetadata } from "igniteui-react-core"; import { truncate, isNaN_, isInfinity } from "igniteui-react-core"; import { RangeCategorySeriesView } from "./RangeCategorySeriesView"; /** * @hidden */ var RangeColumnSeries = /** @class */ /*@__PURE__*/ (function (_super) { __extends(RangeColumnSeries, _super); function RangeColumnSeries() { var _this = _super.call(this) || this; _this.ab = RangeColumnSeries.$; return _this; } RangeColumnSeries.prototype.bk = function () { return new RangeColumnSeries(); }; RangeColumnSeries.prototype.get_e0 = function () { return true; }; RangeColumnSeries.prototype.get_fl = function () { return true; }; RangeColumnSeries.prototype.jk = function () { if (!isNaN_(this.jj)) { return _super.prototype.jk.call(this); } return Defaults.h; }; RangeColumnSeries.prototype.ct = function () { return new RangeColumnSeriesView(this); }; RangeColumnSeries.prototype.q1 = function (a) { _super.prototype.q1.call(this, a); this.ab1 = a; }; RangeColumnSeries.prototype.get_ee = function () { return true; }; RangeColumnSeries.prototype.preferredCategoryMode = function (a) { return 2; }; RangeColumnSeries.prototype.wp = function (a) { if (this.xAxis == null || this.yAxis == null) { return Rect.empty; } var b = this.v9(a); var c = this.cw.b2; var d = this.cw.b1; var e = this.getEffectiveViewport1(this.cw); var f = new ScalerParams(0, c, d, this.yAxis.ch, e); f.b = this.iy(); var g = this.an(this.yu(), this.yw.h, this.zx(this.cw), this.zy(this.cw), a, true); if (g == null) { return Rect.empty; } var h = g[0]; var i = g[1]; var j = Math.abs(b.x - h[0]); var k = Math.abs(b.x - i[0]); var l = this.xAxis.k8(c, d, e); if (j < k) { var m = h[0] - 0.5 * l; var n = h[1]; var o = h[2]; return new Rect(0, m, Math.min(n, o), l, Math.max(n, o) - Math.min(n, o)); } else { var p = i[0] - 0.5 * l; var q = i[1]; var r = i[2]; return new Rect(0, p, Math.min(q, r), l, Math.max(q, r) - Math.min(q, r)); } }; RangeColumnSeries.prototype.gw = function (a, b) { if (this.gz(a, b)) { return true; } if (this.xj(a, b)) { return true; } return false; }; RangeColumnSeries.prototype.o5 = function (a, b) { _super.prototype.o5.call(this, a, b); var c = b; if (a && c.dc != null) { c.dc.count = 0; } }; RangeColumnSeries.prototype.iw = function () { return this.xAxis.k8(this.cw.b2, this.cw.b1, this.getEffectiveViewport1(this.cw)); }; RangeColumnSeries.prototype.aam = function (a, b) { _super.prototype.aam.call(this, a, b); var c = typeCast(RangeColumnSeriesView.$, b); var d = a.h; var e = b.b2; var f = b.b1; var g = this.getEffectiveViewport1(b); var h = this.xAxis.k8(e, f, g); if (isNaN_(h) || isInfinity(h)) { c.dc.count = 0; return; } this.y4.a2(this, this.zo(), runOn(this, this.yo), this.zx(b), this.zy(b)); this.y4.r = this.ab2; this.y4.s = this.ab3; this.y4.k = this.ab2; this.y4.l = this.ab3; var i = false; var j = this.y4.b; if (j != null) { i = true; } var k = this.xAxis.cn; var l = this.lowColumn.count; var m = this.xAxis; var n = new ScalerParams(0, e, f, this.xAxis.ch, g); var o = 0; for (var p = 0; p < d.count; ++p) { var q = d._inner[p][0] - 0.5 * h; var r = Math.min(d._inner[p][1], d._inner[p][2]); var s = Math.max(d._inner[p][1], d._inner[p][2]); var t = Math.abs(s - r); if (isInfinity(t) || isNaN_(t)) { continue; } var u = c.dc.item(o); o++; u.width = h; u.height = t; var v = this.y4.aw(l, p)[0]; if (k && a.o != null && p >= 0 && p < a.o.count) { v = truncate(Math.round(a.o._inner[p])); } if (i) { this.aai(d, p, l, m, n, b.r, v); } this.y4.ad(u, false, false, false, false); u.ap = this.y4.k; u.aq = this.y4.l; c.dh(u, q, r); } c.dc.count = o; b.c7(a); }; RangeColumnSeries.prototype.p4 = function (a, b, c) { this.aae(a, b, c, this.yv, 1); }; RangeColumnSeries.prototype.ak = function (a, b) { var c = new List$1(ChartSelection.$, 0); this.p4(a, c, b); return c.toArray(); }; Object.defineProperty(RangeColumnSeries.prototype, "useHighMarkerFidelity", { get: function () { return this.zs; }, enumerable: false, configurable: true }); RangeColumnSeries.$t = markType(RangeColumnSeries, 'RangeColumnSeries', HorizontalRangeCategorySeries.$); RangeColumnSeries.$$p = markDep(DependencyProperty, PropertyMetadata, RangeColumnSeries, 'raisePropertyChanged', ['RadiusX:ab2:ab6', [1, 0], 'RadiusY:ab3:ab7', [1, 0]]); return RangeColumnSeries; }(HorizontalRangeCategorySeries)); export { RangeColumnSeries }; /** * @hidden */ var RangeColumnSeriesView = /** @class */ /*@__PURE__*/ (function (_super) { __extends(RangeColumnSeriesView, _super); function RangeColumnSeriesView(a) { var _this = _super.call(this, a) || this; _this.db = null; _this.dc = null; _this.dd = null; _this.di = new Rectangle(); _this.db = a; _this.dc = ((function () { var $ret = new Pool$1(Rectangle.$); $ret.create = runOn(_this, _this.dj); $ret.activate = runOn(_this, _this.de); $ret.disactivate = runOn(_this, _this.dg); $ret.destroy = runOn(_this, _this.df); return $ret; })()); return _this; } RangeColumnSeriesView.prototype.ax = function () { _super.prototype.ax.call(this); this.dd = new List$1(Rectangle.$, 0); if (!this.r) { this.db.xc = Defaults.c; this.db.jp = Defaults.i; } }; RangeColumnSeriesView.prototype.dj = function () { var a = new Rectangle(); this.dd.add(a); a._visibility = 1; return a; }; RangeColumnSeriesView.prototype.de = function (a) { a._visibility = 0; }; RangeColumnSeriesView.prototype.dg = function (a) { a._visibility = 1; }; RangeColumnSeriesView.prototype.df = function (a) { this.dd.remove(a); }; RangeColumnSeriesView.prototype.dh = function (a, b, c) { if (!this.isDirty) { this.av(); } a.o = c; a.n = b; }; RangeColumnSeriesView.prototype.af = function (a) { return this.dd._inner[a]; }; RangeColumnSeriesView.prototype.ae = function (a) { var b = this.dd._inner[a]; this.di._visibility = b._visibility; this.di.n = b.n; this.di.o = b.o; this.di.width = b.width; this.di.height = b.height; var c = this.bw(a); this.di._fill = c; this.di._stroke = c; this.di.ad = this.f.ie + 3; return this.di; }; RangeColumnSeriesView.prototype.bc = function (a, b) { _super.prototype.bc.call(this, a, b); if (a.d) { for (var c = 0; c < this.dd.count; c++) { var d = this.ad(c, b); this.bj(d, c, b); a.w(d); } } }; RangeColumnSeriesView.prototype.aq = function (a) { var e_1, _a, e_2, _b; _super.prototype.aq.call(this, a); var b = 0; var c = new List$1(Rectangle.$, 0); try { for (var _c = __values(fromEnum(this.dc.a)), _d = _c.next(); !_d.done; _d = _c.next()) { var d = _d.value; c.add(d); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_d && !_d.done && (_a = _c.return)) _a.call(_c); } finally { if (e_1) throw e_1.error; } } c.aa(function (e, f) { if (e.n < f.n) { return -1; } else if (e.n > f.n) { return 1; } else { return 0; } }); try { for (var _e = __values(fromEnum(c)), _f = _e.next(); !_f.done; _f = _e.next()) { var e = _f.value; this.f.bc.exportRectangleData(a, e, "column" + b, ["Main", "Fill"]); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_f && !_f.done && (_b = _e.return)) _b.call(_e); } finally { if (e_2) throw e_2.error; } } b++; }; RangeColumnSeriesView.$t = markType(RangeColumnSeriesView, 'RangeColumnSeriesView', RangeCategorySeriesView.$); return RangeColumnSeriesView; }(RangeCategorySeriesView)); export { RangeColumnSeriesView };