UNPKG

igniteui-react-charts

Version:

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

291 lines (290 loc) 9.59 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"; import { Color } from "igniteui-react-core"; /** * @hidden */ export let StepLineSeries = /*@__PURE__*/ (() => { class StepLineSeries extends HorizontalAnchoredCategorySeries { bk() { return new StepLineSeries(); } get_fk() { return true; } get_f1() { return true; } get_fl() { return true; } ct() { return new StepLineSeriesView(this); } zq() { return true; } q1(a) { super.q1(a); this.acy = a; } constructor() { super(); this.acx = null; this.acx = new CategoryLineRasterizer(); this.ab = StepLineSeries.$; } ac() { super.ac(); } preferredCategoryMode(a) { return typeCast(ISortingAxis_$type, a) !== null ? 0 : 1; } get_ew() { return true; } o5(a, b) { super.o5(a, b); let c = b; c.dk(); } b3() { if (this.b4 == 0) { return 2; } else { return super.b3(); } } 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; } acz(a, b, c, d, e, f) { let g; if (b) { if (f) { g = (a & 1) == 0; if (g || (intDivide(a, 2)) + 1 < 0) { return c.h._inner[(intDivide(a, 2))][0]; } if (c.h.count == (intDivide(a, 2)) + 1) { return c.h._inner[(intDivide(a, 2))][0]; } return c.h._inner[(intDivide(a, 2)) + 1][0]; } g = (a & 1) == 0; return c.h._inner[(intDivide(a, 2))][0] + (g ? d : -d); } if (f) { g = (a & 1) == 0; if (g || ((intDivide(a, 2)) + 1) >= c.h.count) { return c.h._inner[(intDivide(a, 2))][0]; } if (c.h.count == (intDivide(a, 2)) + 1) { return c.h._inner[(intDivide(a, 2))][0]; } return c.h._inner[(intDivide(a, 2)) + 1][0]; } g = (a & 1) == 0; return c.h._inner[(intDivide(a, 2))][0] + (g ? -d : d); } 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.ch; let h = 0; if (this.ace != null) { h = 0.5 * this.ace.getCategorySize(c, d, e); } let i = a.h; let j = 2 * i.count; let k = new List$1(Array_$type, 2, j); if (!this.ace.ch) { for (let l = 0; l < j; l++) { let m = new Array(4); m[0] = this.acz(l, false, a, h, g, f); m[1] = a.h._inner[(intDivide(l, 2))][1]; m[2] = this.acz(l, true, a, h, g, f); m[3] = a.h._inner[(intDivide(l, 2))][2]; k.add(m); } } else { for (let n = 0; n < j; n++) { let o = new Array(4); o[0] = this.acz(n, true, a, h, g, f); o[1] = a.h._inner[(intDivide(n, 2))][1]; o[2] = this.acz(n, true, a, h, g, f); o[3] = a.h._inner[(intDivide(n, 2))][2]; k.add(o); } } let p = typeCast(StepLineSeriesView.$, b); let q = p.c0.d; this.y4.a2(this, this.zo(), runOn(this, this.yo), this.zx(b), this.zy(b)); let r = false; let s = this.y4.b; if (s != null) { r = true; } if (r) { let t = new ScalerParams(0, b.b2, b.b1, this.ace.ch, e); this.aai(i, -1, this.valueColumn.count, this.ace, t, b.r, -1); } let u = p.dr; let v = p.ds; let w = p.dq; this.y4.ad(u, true, false, true, false); this.y4.ad(v, true, false, true, false); this.y4.ad(w, false, true, false, false); w._opacity = 0.75 * this.y4.j; if (b.c4(a)) { p.dl(j, k, false, 1, this.aau(k, j - 1, b.b1, b.b2), q, this.id); b.c7(a); } } p4(a, b, c) { this.aae(a, b, c, this.yv, 0); } ak(a, b) { let c = new List$1(ChartSelection.$, 0); this.p4(a, c, b); return c.toArray(); } get useHighMarkerFidelity() { return this.zs; } } StepLineSeries.$t = /*@__PURE__*/ markType(StepLineSeries, 'StepLineSeries', HorizontalAnchoredCategorySeries.$); return StepLineSeries; })(); /** * @hidden */ export let StepLineSeriesView = /*@__PURE__*/ (() => { class StepLineSeriesView extends AnchoredCategorySeriesView { constructor(a) { super(a); this.dj = null; this.du = new Path(); this.dt = new Path(); this.dv = new Path(); this.dp = new Path(); this.dn = new Path(); this.dm = new Path(); this.dj = a; } ax() { super.ax(); if (!this.r) { this.dj.xc = Defaults.c; } } get dr() { return this.du; } get ds() { return this.dv; } get dq() { return this.dt; } dk() { this.dt.an = null; this.du.an = null; this.dv.an = null; this.av(); } dl(a, b, c, d, e, f, g) { this.dj.acx.a = typeCast(ISortingAxis_$type, this.c2.fetchXAxis()) !== null ? true : false; this.dj.acx.m(this.du, this.dt, this.dv, a, b, c, d, e, f, g); this.av(); } bi() { super.bi(); this.dn.an = this.du.an; this.dp.an = this.dv.an; this.dm.an = this.dt.an; let a = this.bv(); this.dn._stroke = a; this.dn.ad = this.f.ie + 3; this.dp._stroke = a; this.dp.ad = this.f.ie + 3; this.dm._fill = a; this.dm._opacity = 1; } bc(a, b) { super.bc(a, b); if (a.d) { if (b) { a.t(this.dm); a.t(this.dn); a.t(this.dp); } else { 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", "Main"]); this.f.bc.exportPathData(a, this.dv, "upperShape", ["Upper"]); this.f.bc.exportPathData(a, this.dt, "translucentShape", ["Translucent"]); } ai() { let a = new Color(); a.colorString = "rgba(95,95,95,0.5)"; this.f.v3 = a; this.f.jm = 3; this.f.jn = 1; this.f.jo = 4; this.f.hc = false; } } StepLineSeriesView.$t = /*@__PURE__*/ markType(StepLineSeriesView, 'StepLineSeriesView', AnchoredCategorySeriesView.$); return StepLineSeriesView; })();