UNPKG

igniteui-react-charts

Version:

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

282 lines (281 loc) 9.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 { 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 */ export let RangeColumnSeries = /*@__PURE__*/ (() => { class RangeColumnSeries extends HorizontalRangeCategorySeries { bk() { return new RangeColumnSeries(); } get_e0() { return true; } get_fl() { return true; } jk() { if (!isNaN_(this.jj)) { return super.jk(); } return Defaults.h; } ct() { return new RangeColumnSeriesView(this); } q1(a) { super.q1(a); this.ab1 = a; } constructor() { super(); this.ab = RangeColumnSeries.$; } get_ee() { return true; } preferredCategoryMode(a) { return 2; } wp(a) { if (this.xAxis == null || this.yAxis == null) { return Rect.empty; } let b = this.v9(a); let c = this.cw.b2; let d = this.cw.b1; let e = this.getEffectiveViewport1(this.cw); let f = new ScalerParams(0, c, d, this.yAxis.ch, e); f.b = this.iy(); let g = this.an(this.yu(), this.yw.h, this.zx(this.cw), this.zy(this.cw), a, true); if (g == null) { return Rect.empty; } let h = g[0]; let i = g[1]; let j = Math.abs(b.x - h[0]); let k = Math.abs(b.x - i[0]); let l = this.xAxis.k8(c, d, e); if (j < k) { let m = h[0] - 0.5 * l; let n = h[1]; let o = h[2]; return new Rect(0, m, Math.min(n, o), l, Math.max(n, o) - Math.min(n, o)); } else { let p = i[0] - 0.5 * l; let q = i[1]; let r = i[2]; return new Rect(0, p, Math.min(q, r), l, Math.max(q, r) - Math.min(q, r)); } } gw(a, b) { if (this.gz(a, b)) { return true; } if (this.xj(a, b)) { return true; } return false; } o5(a, b) { super.o5(a, b); let c = b; if (a && c.dc != null) { c.dc.count = 0; } } iw() { return this.xAxis.k8(this.cw.b2, this.cw.b1, this.getEffectiveViewport1(this.cw)); } aam(a, b) { super.aam(a, b); let c = typeCast(RangeColumnSeriesView.$, b); let d = a.h; let e = b.b2; let f = b.b1; let g = this.getEffectiveViewport1(b); let 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; let i = false; let j = this.y4.b; if (j != null) { i = true; } let k = this.xAxis.cn; let l = this.lowColumn.count; let m = this.xAxis; let n = new ScalerParams(0, e, f, this.xAxis.ch, g); let o = 0; for (let p = 0; p < d.count; ++p) { let q = d._inner[p][0] - 0.5 * h; let r = Math.min(d._inner[p][1], d._inner[p][2]); let s = Math.max(d._inner[p][1], d._inner[p][2]); let t = Math.abs(s - r); if (isInfinity(t) || isNaN_(t)) { continue; } let u = c.dc.item(o); o++; u.width = h; u.height = t; let 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); } 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; } } RangeColumnSeries.$t = /*@__PURE__*/ markType(RangeColumnSeries, 'RangeColumnSeries', HorizontalRangeCategorySeries.$); RangeColumnSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, RangeColumnSeries, 'raisePropertyChanged', ['RadiusX:ab2:ab6', [1, 0], 'RadiusY:ab3:ab7', [1, 0]]); return RangeColumnSeries; })(); /** * @hidden */ export let RangeColumnSeriesView = /*@__PURE__*/ (() => { class RangeColumnSeriesView extends RangeCategorySeriesView { constructor(a) { super(a); this.db = null; this.dc = null; this.dd = null; this.di = new Rectangle(); this.db = a; this.dc = ((() => { let $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; })()); } ax() { super.ax(); this.dd = new List$1(Rectangle.$, 0); if (!this.r) { this.db.xc = Defaults.c; this.db.jp = Defaults.i; } } dj() { let a = new Rectangle(); this.dd.add(a); a._visibility = 1; return a; } de(a) { a._visibility = 0; } dg(a) { a._visibility = 1; } df(a) { this.dd.remove(a); } dh(a, b, c) { if (!this.isDirty) { this.av(); } a.o = c; a.n = b; } af(a) { return this.dd._inner[a]; } ae(a) { let 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; let c = this.bw(a); this.di._fill = c; this.di._stroke = c; this.di.ad = this.f.ie + 3; return this.di; } bc(a, b) { super.bc(a, b); if (a.d) { for (let c = 0; c < this.dd.count; c++) { let d = this.ad(c, b); this.bj(d, c, b); a.w(d); } } } aq(a) { super.aq(a); let b = 0; let c = new List$1(Rectangle.$, 0); for (let d of fromEnum(this.dc.a)) { c.add(d); } c.aa((e, f) => { if (e.n < f.n) { return -1; } else if (e.n > f.n) { return 1; } else { return 0; } }); for (let e of fromEnum(c)) { this.f.bc.exportRectangleData(a, e, "column" + b, ["Main", "Fill"]); } b++; } } RangeColumnSeriesView.$t = /*@__PURE__*/ markType(RangeColumnSeriesView, 'RangeColumnSeriesView', RangeCategorySeriesView.$); return RangeColumnSeriesView; })();