UNPKG

igniteui-react-charts

Version:

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

276 lines (275 loc) 9.13 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 { 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 */ export let StepAreaSeries = /*@__PURE__*/ (() => { class StepAreaSeries extends HorizontalAnchoredCategorySeries { bk() { return new StepAreaSeries(); } ct() { return new StepAreaSeriesView(this); } q1(a) { super.q1(a); this.acy = a; } get_ew() { return true; } get_ev() { return true; } get_f1() { return true; } get_fl() { return true; } cz() { if (this.c0 == 0) { return 2; } return super.cz(); } constructor() { super(); this.acx = null; this.acx = new CategoryLineRasterizer(); this.ab = StepAreaSeries.$; } preferredCategoryMode(a) { return typeCast(ISortingAxis_$type, a) !== null ? 0 : 1; } o5(a, b) { super.o5(a, b); let c = b; c.dk(); } acz(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); } y6() { return 1; } iv(a, b, c, d, e, f, g, h) { let i = NaN; if (c >= 0 && c < b.count) { i = b.item(c); } let 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; } b3() { if (this.b4 == 0) { return 2; } else { return super.b3(); } } aam(a, b) { super.aam(a, b); let c = b.b2; let d = b.b1; let e = this.getEffectiveViewport1(b); let f = typeCast(ISortingAxis_$type, this.ace) != null; let g = this.ace != null ? 0.5 * this.ace.getCategorySize(c, d, e) : 0; if (this.ace != null && this.ace.ch) { g = -g; } let h = a.h.count * 2; let i = new List$1(Array_$type, 2, h); this.y4.a2(this, this.zo(), runOn(this, this.yo), this.zx(b), this.zy(b)); let j = false; let k = this.y4.b; if (k != null) { j = true; } for (let l = 0; l < h; l++) { let 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); } let n = this.y5.c0.d; if (j) { let 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); } let p = typeCast(StepAreaSeriesView.$, b); let q = p.dy; let r = p.dz; let s = p.dw; let 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, (u, v, w, x, y) => this.abu(u, 2 * a.h.count, b), 1, this.aav(i, i.count - 1, b.b1, b.b2, true)); b.c7(a); } let u = this.fetchYAxis(); p.dw._opacity = this.y4.j * this.h9; p.dx._opacity = 0.5 * this.y4.j * this.h9; } p4(a, b, c) { this.aae(a, b, c, this.yv, 1); } ak(a, b) { let c = new List$1(ChartSelection.$, 0); this.p4(a, c, b); return c.toArray(); } get useHighMarkerFidelity() { return this.zs; } } StepAreaSeries.$t = /*@__PURE__*/ markType(StepAreaSeries, 'StepAreaSeries', HorizontalAnchoredCategorySeries.$); return StepAreaSeries; })(); /** * @hidden */ export let StepAreaSeriesView = /*@__PURE__*/ (() => { class StepAreaSeriesView extends AnchoredCategorySeriesView { constructor(a) { super(a); 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; } ax() { super.ax(); if (!this.r) { this.dj.xc = Defaults.c; } } get dw() { return this.ds; } get dy() { return this.du; } get dx() { return this.dt; } get dz() { return this.dv; } dk() { this.ds.an = null; this.dt.an = null; this.du.an = null; this.dv.an = null; this.av(); } dl(a, b, c, d, e, f, g) { this.dl(a, b, c, d, e, f, g); } dm(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(); } bi() { super.bi(); this.dn.an = this.ds.an; this.dq.an = this.du.an; this.dp.an = this.dt.an; this.dr.an = this.dv.an; let 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; } bc(a, b) { super.bc(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); } } aq(a) { super.aq(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 = /*@__PURE__*/ markType(StepAreaSeriesView, 'StepAreaSeriesView', AnchoredCategorySeriesView.$); return StepAreaSeriesView; })();