UNPKG

igniteui-angular-charts

Version:

Ignite UI Angular charting components for building rich data visualizations for modern web apps.

276 lines (275 loc) 9.39 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-angular-core"; import { ISortingAxis_$type } from "./ISortingAxis"; import { List$1 } from "igniteui-angular-core"; import { Path } from "igniteui-angular-core"; import { ScalerParams } from "./ScalerParams"; import { ChartSelection } from "./ChartSelection"; import { intDivide, isNaN_ } from "igniteui-angular-core"; import { AnchoredCategorySeriesView } from "./AnchoredCategorySeriesView"; import { Defaults } from "./Defaults"; /** * @hidden */ export let StepAreaSeries = /*@__PURE__*/ (() => { class StepAreaSeries extends HorizontalAnchoredCategorySeries { constructor() { super(); this.acv = null; this.acv = new CategoryLineRasterizer(); this.ab = StepAreaSeries.$; } bj() { return new StepAreaSeries(); } cs() { return new StepAreaSeriesView(this); } q0(a) { super.q0(a); this.acw = a; } get_ev() { return true; } get_eu() { return true; } get_f0() { return true; } get_fk() { return true; } cy() { if (this.cz == 0) { return 2; } return super.cy(); } preferredCategoryMode(a) { return typeCast(ISortingAxis_$type, a) !== null ? 0 : 1; } o4(a, b) { super.o4(a, b); let c = b; c.dg(); } acx(a, b, c, d, e) { if (b) { if (e) { if ((a & 1) == 0 || ((intDivide(a, 2)) + 1) >= c.f.count) { return c.f._inner[(intDivide(a, 2))][0]; } return c.f._inner[(intDivide(a, 2)) + 1][0]; } return c.f._inner[(intDivide(a, 2))][0] + ((a & 1) == 1 ? -d : d); } if (e) { if ((a & 1) == 0 || ((intDivide(a, 2)) + 1) >= c.f.count) { return c.f._inner[(intDivide(a, 2))][0]; } return c.f._inner[(intDivide(a, 2)) + 1][0]; } return c.f._inner[(intDivide(a, 2))][0] + ((a & 1) == 0 ? -d : d); } y3() { return 1; } iu(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; } b2() { if (this.b3 == 0) { return 2; } else { return super.b2(); } } aaj(a, b) { super.aaj(a, b); let c = b.by; let d = b.bx; let e = this.getEffectiveViewport1(b); let f = typeCast(ISortingAxis_$type, this.acc) != null; let g = this.acc != null ? 0.5 * this.acc.getCategorySize(c, d, e) : 0; if (this.acc != null && this.acc.ch) { g = -g; } let h = a.f.count * 2; let i = new List$1(Array_$type, 2, h); this.y1.a2(this, this.zl(), runOn(this, this.yl), this.zu(b), this.zv(b)); let j = false; let k = this.y1.b; if (k != null) { j = true; } for (let l = 0; l < h; l++) { let m = new Array(4); m[0] = this.acx(l, false, a, g, f); m[1] = a.f._inner[(intDivide(l, 2))][1]; m[2] = this.acx(l, true, a, g, f); m[3] = a.f._inner[(intDivide(l, 2))][2]; i.add(m); } let n = this.y2.cw.d; if (j) { let o = new ScalerParams(0, b.by, b.bx, this.acc.ch, e); this.aaf(i, -1, this.valueColumn.count, this.acc, o, b.q, -1); } let p = typeCast(StepAreaSeriesView.$, b); let q = p.du; let r = p.dv; let s = p.ds; let t = p.dt; this.y1.ad(q, true, false, true, true); this.y1.ad(r, true, false, true, true); this.y1.ad(s, false, true, false, false); this.y1.ad(t, false, true, false, false); if (b.c0(a)) { p.di(h, i, false, n, this.ic, (u, v, w, x, y) => this.abs(u, 2 * a.f.count, b), 1, this.aat(i, i.count - 1, b.bx, b.by, true)); b.c3(a); } let u = this.fetchYAxis(); p.ds._opacity = this.y1.j * this.h8; p.dt._opacity = 0.5 * this.y1.j * this.h8; } p3(a, b, c) { this.aab(a, b, c, this.ys, 1); } ak(a, b) { let c = new List$1(ChartSelection.$, 0); this.p3(a, c, b); return c.toArray(); } get useHighMarkerFidelity() { return this.zp; } } StepAreaSeries.$t = markType(StepAreaSeries, 'StepAreaSeries', HorizontalAnchoredCategorySeries.$); return StepAreaSeries; })(); /** * @hidden */ export let StepAreaSeriesView = /*@__PURE__*/ (() => { class StepAreaSeriesView extends AnchoredCategorySeriesView { constructor(a) { super(a); this.df = null; this.dn = new Path(); this.dq = new Path(); this.dp = new Path(); this.dr = new Path(); this.dj = new Path(); this.dl = new Path(); this.dk = new Path(); this.dm = new Path(); this.df = a; } au() { super.au(); if (!this.q) { this.df.w9 = Defaults.c; } } get ds() { return this.dn; } get du() { return this.dq; } get dt() { return this.dp; } get dv() { return this.dr; } dg() { this.dn.an = null; this.dp.an = null; this.dq.an = null; this.dr.an = null; this.as(); } dh(a, b, c, d, e, f, g) { this.dh(a, b, c, d, e, f, g); } di(a, b, c, d, e, f, g, h) { this.df.acv.a = typeCast(ISortingAxis_$type, this.cy.fetchXAxis()) !== null ? true : false; this.df.acv.j(this.dn, this.dq, this.dp, this.dr, a, b, c, d, e, f, g, h); this.as(); } be() { super.be(); this.dj.an = this.dn.an; this.dl.an = this.dq.an; this.dk.an = this.dp.an; this.dm.an = this.dr.an; let a = this.br(); this.dj._fill = a; this.dj._opacity = 1; this.dk._fill = a; this.dk._opacity = 1; this.dl._stroke = a; this.dl.ad = this.e.id + 3; this.dm._stroke = a; this.dm.ad = this.e.id + 3; } a8(a, b) { super.a8(a, b); if (b) { a.t(this.dj); a.t(this.dk); a.t(this.dl); a.t(this.dm); } else { a.t(this.dn); a.t(this.dp); a.t(this.dq); a.t(this.dr); } } an(a) { super.an(a); this.e.bc.exportPathData(a, this.dq, "lowerShape", ["Lower"]); this.e.bc.exportPathData(a, this.dr, "upperShape", ["Upper", "Main"]); this.e.bc.exportPathData(a, this.dp, "translucentShape", ["Translucent"]); this.e.bc.exportPathData(a, this.dn, "fillShape", ["Fill"]); } } StepAreaSeriesView.$t = markType(StepAreaSeriesView, 'StepAreaSeriesView', AnchoredCategorySeriesView.$); return StepAreaSeriesView; })();