UNPKG

igniteui-react-charts

Version:

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

300 lines (299 loc) 10.3 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 } from "tslib"; import { HorizontalAnchoredCategorySeries } from "./HorizontalAnchoredCategorySeries"; import { CategoryLineRasterizer } from "./CategoryLineRasterizer"; import { typeCast, Array_$type, runOn, markType } from "igniteui-react-core"; import { ISortingAxis_$type } from "./ISortingAxis"; import { List$1 } from "igniteui-react-core"; import { Path } from "igniteui-react-core"; import { ScalerParams } from "./ScalerParams"; import { ChartSelection } from "./ChartSelection"; import { intDivide, isNaN_ } from "igniteui-react-core"; import { AnchoredCategorySeriesView } from "./AnchoredCategorySeriesView"; import { Defaults } from "./Defaults"; /** * @hidden */ var StepAreaSeries = /** @class */ /*@__PURE__*/ (function (_super) { __extends(StepAreaSeries, _super); function StepAreaSeries() { var _this = _super.call(this) || this; _this.acx = null; _this.acx = new CategoryLineRasterizer(); _this.ab = StepAreaSeries.$; return _this; } StepAreaSeries.prototype.bk = function () { return new StepAreaSeries(); }; StepAreaSeries.prototype.ct = function () { return new StepAreaSeriesView(this); }; StepAreaSeries.prototype.q1 = function (a) { _super.prototype.q1.call(this, a); this.acy = a; }; StepAreaSeries.prototype.get_ew = function () { return true; }; StepAreaSeries.prototype.get_ev = function () { return true; }; StepAreaSeries.prototype.get_f1 = function () { return true; }; StepAreaSeries.prototype.get_fl = function () { return true; }; StepAreaSeries.prototype.cz = function () { if (this.c0 == 0) { return 2; } return _super.prototype.cz.call(this); }; StepAreaSeries.prototype.preferredCategoryMode = function (a) { return typeCast(ISortingAxis_$type, a) !== null ? 0 : 1; }; StepAreaSeries.prototype.o5 = function (a, b) { _super.prototype.o5.call(this, a, b); var c = b; c.dk(); }; StepAreaSeries.prototype.acz = function (a, b, c, d, e) { if (b) { if (e) { if ((a & 1) == 0 || ((intDivide(a, 2)) + 1) >= c.h.count) { return c.h._inner[(intDivide(a, 2))][0]; } return c.h._inner[(intDivide(a, 2)) + 1][0]; } return c.h._inner[(intDivide(a, 2))][0] + ((a & 1) == 1 ? -d : d); } if (e) { if ((a & 1) == 0 || ((intDivide(a, 2)) + 1) >= c.h.count) { return c.h._inner[(intDivide(a, 2))][0]; } return c.h._inner[(intDivide(a, 2)) + 1][0]; } return c.h._inner[(intDivide(a, 2))][0] + ((a & 1) == 0 ? -d : d); }; StepAreaSeries.prototype.y6 = function () { return 1; }; StepAreaSeries.prototype.iv = function (a, b, c, d, e, f, g, h) { var i = NaN; if (c >= 0 && c < b.count) { i = b.item(c); } var j = NaN; if (d >= 0 && d < b.count) { j = b.item(d); } if (f == 0) { return j; } if (e == b.count - 1) { return i; } if (isNaN_(j) && g != 0 && a <= 0.5 && !h) { return i; } if (isNaN_(i) && g != 0 && a >= 0.5 && !h) { return j; } if (a > 0.5) { return j; } return i; }; StepAreaSeries.prototype.b3 = function () { if (this.b4 == 0) { return 2; } else { return _super.prototype.b3.call(this); } }; StepAreaSeries.prototype.aam = function (a, b) { var _this = this; _super.prototype.aam.call(this, a, b); var c = b.b2; var d = b.b1; var e = this.getEffectiveViewport1(b); var f = typeCast(ISortingAxis_$type, this.ace) != null; var g = this.ace != null ? 0.5 * this.ace.getCategorySize(c, d, e) : 0; if (this.ace != null && this.ace.ch) { g = -g; } var h = a.h.count * 2; var i = new List$1(Array_$type, 2, h); this.y4.a2(this, this.zo(), runOn(this, this.yo), this.zx(b), this.zy(b)); var j = false; var k = this.y4.b; if (k != null) { j = true; } for (var l = 0; l < h; l++) { var m = new Array(4); m[0] = this.acz(l, false, a, g, f); m[1] = a.h._inner[(intDivide(l, 2))][1]; m[2] = this.acz(l, true, a, g, f); m[3] = a.h._inner[(intDivide(l, 2))][2]; i.add(m); } var n = this.y5.c0.d; if (j) { var o = new ScalerParams(0, b.b2, b.b1, this.ace.ch, e); this.aai(i, -1, this.valueColumn.count, this.ace, o, b.r, -1); } var p = typeCast(StepAreaSeriesView.$, b); var q = p.dy; var r = p.dz; var s = p.dw; var t = p.dx; this.y4.ad(q, true, false, true, true); this.y4.ad(r, true, false, true, true); this.y4.ad(s, false, true, false, false); this.y4.ad(t, false, true, false, false); if (b.c4(a)) { p.dm(h, i, false, n, this.id, function (u, v, w, x, y) { return _this.abu(u, 2 * a.h.count, b); }, 1, this.aav(i, i.count - 1, b.b1, b.b2, true)); b.c7(a); } var u = this.fetchYAxis(); p.dw._opacity = this.y4.j * this.h9; p.dx._opacity = 0.5 * this.y4.j * this.h9; }; StepAreaSeries.prototype.p4 = function (a, b, c) { this.aae(a, b, c, this.yv, 1); }; StepAreaSeries.prototype.ak = function (a, b) { var c = new List$1(ChartSelection.$, 0); this.p4(a, c, b); return c.toArray(); }; Object.defineProperty(StepAreaSeries.prototype, "useHighMarkerFidelity", { get: function () { return this.zs; }, enumerable: false, configurable: true }); StepAreaSeries.$t = markType(StepAreaSeries, 'StepAreaSeries', HorizontalAnchoredCategorySeries.$); return StepAreaSeries; }(HorizontalAnchoredCategorySeries)); export { StepAreaSeries }; /** * @hidden */ var StepAreaSeriesView = /** @class */ /*@__PURE__*/ (function (_super) { __extends(StepAreaSeriesView, _super); function StepAreaSeriesView(a) { var _this = _super.call(this, a) || this; _this.dj = null; _this.ds = new Path(); _this.du = new Path(); _this.dt = new Path(); _this.dv = new Path(); _this.dn = new Path(); _this.dq = new Path(); _this.dp = new Path(); _this.dr = new Path(); _this.dj = a; return _this; } StepAreaSeriesView.prototype.ax = function () { _super.prototype.ax.call(this); if (!this.r) { this.dj.xc = Defaults.c; } }; Object.defineProperty(StepAreaSeriesView.prototype, "dw", { get: function () { return this.ds; }, enumerable: false, configurable: true }); Object.defineProperty(StepAreaSeriesView.prototype, "dy", { get: function () { return this.du; }, enumerable: false, configurable: true }); Object.defineProperty(StepAreaSeriesView.prototype, "dx", { get: function () { return this.dt; }, enumerable: false, configurable: true }); Object.defineProperty(StepAreaSeriesView.prototype, "dz", { get: function () { return this.dv; }, enumerable: false, configurable: true }); StepAreaSeriesView.prototype.dk = function () { this.ds.an = null; this.dt.an = null; this.du.an = null; this.dv.an = null; this.av(); }; StepAreaSeriesView.prototype.dl = function (a, b, c, d, e, f, g) { this.dl(a, b, c, d, e, f, g); }; StepAreaSeriesView.prototype.dm = function (a, b, c, d, e, f, g, h) { this.dj.acx.a = typeCast(ISortingAxis_$type, this.c2.fetchXAxis()) !== null ? true : false; this.dj.acx.j(this.ds, this.du, this.dt, this.dv, a, b, c, d, e, f, g, h); this.av(); }; StepAreaSeriesView.prototype.bi = function () { _super.prototype.bi.call(this); this.dn.an = this.ds.an; this.dq.an = this.du.an; this.dp.an = this.dt.an; this.dr.an = this.dv.an; var a = this.bv(); this.dn._fill = a; this.dn._opacity = 1; this.dp._fill = a; this.dp._opacity = 1; this.dq._stroke = a; this.dq.ad = this.f.ie + 3; this.dr._stroke = a; this.dr.ad = this.f.ie + 3; }; StepAreaSeriesView.prototype.bc = function (a, b) { _super.prototype.bc.call(this, a, b); if (b) { a.t(this.dn); a.t(this.dp); a.t(this.dq); a.t(this.dr); } else { a.t(this.ds); a.t(this.dt); a.t(this.du); a.t(this.dv); } }; StepAreaSeriesView.prototype.aq = function (a) { _super.prototype.aq.call(this, a); this.f.bc.exportPathData(a, this.du, "lowerShape", ["Lower"]); this.f.bc.exportPathData(a, this.dv, "upperShape", ["Upper", "Main"]); this.f.bc.exportPathData(a, this.dt, "translucentShape", ["Translucent"]); this.f.bc.exportPathData(a, this.ds, "fillShape", ["Fill"]); }; StepAreaSeriesView.$t = markType(StepAreaSeriesView, 'StepAreaSeriesView', AnchoredCategorySeriesView.$); return StepAreaSeriesView; }(AnchoredCategorySeriesView)); export { StepAreaSeriesView };