igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
427 lines (426 loc) • 16.6 kB
JavaScript
/*
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 { RangeCategorySeries } from "./RangeCategorySeries";
import { IVerticalAnchoredCategorySeriesInteractionManager_$type } from "./IVerticalAnchoredCategorySeriesInteractionManager";
import { DVContainer } from "igniteui-react-core";
import { typeCast, fromEnum, Point_$type, runOn, markType, markDep } from "igniteui-react-core";
import { NumericXAxis } from "./NumericXAxis";
import { DependencyProperty } from "igniteui-react-core";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { VerticalRangeCategoryFramePreparer } from "./VerticalRangeCategoryFramePreparer";
import { Axis } from "./Axis";
import { Series } from "./Series";
import { CategorySeries } from "./CategorySeries";
import { List$1 } from "igniteui-react-core";
import { RangeValueList } from "./RangeValueList";
import { ScalerParams } from "./ScalerParams";
import { AxisRange } from "./AxisRange";
import { ISortingAxis_$type } from "./ISortingAxis";
import { DataLegendSeriesValueInfo } from "igniteui-react-core";
import { DataLegendSeriesContext } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { truncate, isNaN_, isInfinity } from "igniteui-react-core";
/**
* @hidden
*/
export let VerticalRangeCategorySeries = /*@__PURE__*/ (() => {
class VerticalRangeCategorySeries extends RangeCategorySeries {
constructor() {
super(...arguments);
this.aca = null;
}
get acb() {
if (this.aca == null) {
this.aca = DVContainer.instance.createInstance(IVerticalAnchoredCategorySeriesInteractionManager_$type, () => this.ds.n);
}
return this.aca;
}
preferredCategoryMode(a) {
return 2;
}
abl(a, b, c, d) {
return new VerticalRangeCategoryFramePreparer(1, this, a, b, c, d);
}
aao() {
if (this.bo != null) {
let a = this.bo;
return a.aao();
}
let b = 0;
let c = this.zi();
for (let d of fromEnum(this.dc.b9)) {
if (d == this) {
return b;
}
let e = typeCast(CategorySeries.$, d);
if (e != null && e.zi() == c && e.preferredCategoryMode(typeCast(CategoryAxisBase.$, c)) == 2) {
b++;
}
}
return -1;
}
fetchXAxis() {
return this.xAxis;
}
fetchYAxis() {
return this.yAxis;
}
get_isVertical() {
return true;
}
zi() {
return this.yAxis;
}
zz() {
return this.xAxis;
}
ph() {
super.ph();
this.xAxis = null;
this.yAxis = null;
}
cl() {
if (this.xAxis != null && this.xAxis.dn) {
return 4;
}
return 3;
}
cm() {
return 1;
}
aj(a) {
let b = this.an(this.zi(), this.zk.k, this.aal(this.cw), this.aam(this.cw), this.w4(a), true);
if (b == null) {
return null;
}
let c = b[0];
let d = b[1];
let e = new Array(1);
let f = new Array(2);
f[0] = { $type: Point_$type, x: c[2], y: c[0] };
f[1] = { $type: Point_$type, x: d[2], y: d[0] };
e[0] = f;
return e;
}
al(a) {
let b = this.an(this.zi(), this.zk.k, this.aal(this.cw), this.aam(this.cw), this.w4(a), true);
if (b == null) {
return null;
}
let c = b[0];
let d = b[1];
let e = new Array(1);
let f = new Array(2);
f[0] = { $type: Point_$type, x: c[1], y: c[0] };
f[1] = { $type: Point_$type, x: d[1], y: d[0] };
e[0] = f;
return e;
}
get_fy() {
return true;
}
b3() {
if (this.b4 == 0) {
return 1;
}
else {
return super.b3();
}
}
getOffsetValue() {
return this.RangeFramePreparer.r(this.yAxis, this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw));
}
getCategoryWidth() {
return this.yAxis.getCategorySize(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw));
}
aaj(a) {
return this.i2(a, this.zi());
}
i0(a) {
return this.acb.e$a(this, a);
}
ke(a) {
return truncate(Math.round(this.i0(a)));
}
ky(a) {
let b = this.ke(a);
return b >= 0 && this.dp != null && b < this.dp.count ? this.dp.item(b) : null;
}
kj(a, b) {
return this.kk(a, b, this.yAxis, runOn(this, this.aaj), new RangeValueList(this.highColumn, this.lowColumn));
}
kl(a, b) {
return this.km(a, b, this.yAxis, runOn(this, this.aaj), new RangeValueList(this.highColumn, this.lowColumn));
}
iy(a, b, c, d, e) {
if (c == null) {
return Number.POSITIVE_INFINITY;
}
let f = this.yAxis.qd;
return this.iz(a, b, this.yAxis, d, e, f, runOn(this, this.aaj));
}
jf(a, b, c) {
if (this.dc == null) {
return NaN;
}
let d = this.getEffectiveViewport1(this.cw);
let e = new ScalerParams(0, this.dc.yv, this.cw.b9, this.yAxis.dn, d);
let f = this.RangeFramePreparer.r(this.yAxis, this.dc.yv, this.cw.b9, d);
return this.jh(new RangeValueList(this.highColumn, this.lowColumn), a, this.yAxis, e, f, runOn(this, this.aaj), b, c);
}
jd(a, b, c) {
if (this.dc == null) {
return NaN;
}
let d = this.getEffectiveViewport1(this.cw);
let e = new ScalerParams(0, this.dc.yv, this.cw.b9, this.yAxis.dn, d);
let f = this.RangeFramePreparer.r(this.yAxis, this.dc.yv, this.cw.b9, d);
return this.jh(this.lowColumn, a, this.yAxis, e, f, runOn(this, this.aaj), b, c);
}
jb(a, b, c) {
if (this.dc == null) {
return NaN;
}
let d = this.getEffectiveViewport1(this.cw);
let e = new ScalerParams(0, this.dc.yv, this.cw.b9, this.yAxis.dn, d);
let f = this.RangeFramePreparer.r(this.yAxis, this.dc.yv, this.cw.b9, d);
return this.jh(this.highColumn, a, this.yAxis, e, f, runOn(this, this.aaj), b, c);
}
wu(a, b, c) {
return this.w0(a, b, c, this.RangeFramePreparer.r(this.yAxis, this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.xAxis, this.yAxis, runOn(this, this.jb), (d, e) => this.km(d, e, this.yAxis, runOn(this, this.aaj), this.highColumn), (d, e) => this.kk(d, e, this.yAxis, runOn(this, this.aaj), this.highColumn));
}
ww(a, b, c) {
return this.w0(a, b, c, this.RangeFramePreparer.r(this.yAxis, this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.xAxis, this.yAxis, runOn(this, this.jd), (d, e) => this.km(d, e, this.yAxis, runOn(this, this.aaj), this.lowColumn), (d, e) => this.kk(d, e, this.yAxis, runOn(this, this.aaj), this.lowColumn));
}
wy(a, b, c) {
return this.w0(a, b, c, this.RangeFramePreparer.r(this.yAxis, this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.xAxis, this.yAxis, null, null, null);
}
az(a) {
if (a.isEmpty && this.dc != null) {
a = this.dc.yv;
}
let b = this.zi();
if (this.lowColumn == null || this.highColumn == null) {
return null;
}
let c = this.w6(this.cw);
let d = new ScalerParams(0, a, this.dc.zd, b.dn, this.getEffectiveViewport());
let e = (b.ga(c.top, d));
let f = (b.ga(c.bottom, d));
if (!b.dn) {
let g = e;
e = f;
f = g;
}
let h = null;
if (b.dw) {
h = b;
e = h.i$f(e);
f = h.i$f(f);
}
else {
e = Math.floor(e);
f = Math.ceil(f);
}
if (isNaN_(e) || isNaN_(f)) {
return null;
}
e = Math.max(0, Math.min(this.lowColumn.count - 1, e));
f = Math.max(0, Math.min(this.lowColumn.count - 1, f));
let i = 1.7976931348623157E+308;
let j = -1.7976931348623157E+308;
if (truncate(e) <= truncate(f)) {
for (let k = truncate(e); k <= truncate(f); k++) {
let l = k;
if (h != null) {
l = h.i$b._inner[k];
}
let m = this.lowColumn.item(l);
if (this.lowColumn.mayContainUnknowns) {
if (isInfinity(m) || isNaN_(m)) {
continue;
}
}
let n = this.highColumn.item(l);
if (this.highColumn.mayContainUnknowns) {
if (isInfinity(n) || isNaN_(n)) {
continue;
}
}
i = Math.min(i, m);
j = Math.max(j, n);
}
}
let o = new AxisRange(i, j);
let p = this.zz();
o = this.ax(o, p, a);
return o;
}
i7() {
return Series.i8(this.lowColumn, typeCast(ISortingAxis_$type, this.fetchYAxis()));
}
ay(a) {
if (this.lowColumn == null || this.lowColumn.count == 0 || this.highColumn == null || this.highColumn.count == 0) {
return null;
}
if (a == this.fetchYAxis()) {
let b = Math.min(this.lowColumn.count, this.highColumn.count);
return new AxisRange(0, b - 1);
}
if (a == this.fetchXAxis()) {
let c = Math.min(this.lowColumn.minimum, this.highColumn.minimum);
let d = Math.max(this.lowColumn.maximum, this.highColumn.maximum);
return new AxisRange(Math.min(c, d), Math.max(c, d));
}
return null;
}
pq(a, b, c, d) {
if (this.fetchYAxis() != null && typeCast(ISortingAxis_$type, this.fetchYAxis()) !== null) {
this.fetchYAxis().i$i();
}
let e = this.fetchYAxis();
switch (a) {
case 3:
if (d == this.ab0 || d == this.abx) {
if (e != null) {
e.ee();
}
if (!this.aaf()) {
this.sa(true);
}
}
break;
case 1:
if (e != null) {
e.ee();
}
this.zt.c9.g(this.im);
if (!this.aaf()) {
this.sa(true);
}
break;
case 0:
if (e != null) {
e.ee();
}
this.zt.c9.g(this.im);
if (!this.aaf()) {
this.sa(true);
}
break;
case 2:
if (e != null) {
e.ee();
}
if (this.ab0 != null && this.abx != null && this.zt.c9.d > 0 && !this.aaf()) {
this.sa(true);
}
break;
case 4:
if (e != null) {
e.ee();
}
this.zt.c9.g(this.im);
if (!this.aaf()) {
this.sa(true);
}
break;
}
}
aaf() {
return this.xAxis != null && this.xAxis.ee();
}
rs(a, b, c, d) {
super.rs(a, b, c, d);
switch (b) {
case VerticalRangeCategorySeries.$$p[0]:
case VerticalRangeCategorySeries.$$p[1]:
case VerticalRangeCategorySeries.$$p[2]:
case VerticalRangeCategorySeries.$$p[3]:
this.qw();
break;
case VerticalRangeCategorySeries.$$p[4]:
this.pr(typeCast(Axis.$, c));
this.r0(typeCast(Axis.$, d));
this.zt.c9.g(this.im);
this.aaf();
this.sa(false);
this.q2();
break;
case VerticalRangeCategorySeries.$$p[5]:
this.pr(typeCast(Axis.$, c));
this.r0(typeCast(Axis.$, d));
this.zt.c9.g(this.im);
this.sa(false);
this.q2();
break;
}
}
ace(a) {
if (typeCast(CategoryAxisBase.$, a) !== null) {
return true;
}
return false;
}
acd(a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
}
getDataLegendSeriesContextAt(a, b) {
let c = { $type: Point_$type, x: a, y: b };
let d = this.jd(c, false, false);
let e = this.jb(c, false, false);
let f = new DataLegendSeriesValueInfo();
f.a = 1;
f.l = e > d ? d : e;
f.q = "Low";
f.r = this.ab0 != null ? this.ab0 : "Low";
f.s = this.acj != null ? this.acj : "L:";
f.t = this.acl != null ? this.acl : "";
let g = new DataLegendSeriesValueInfo();
g.a = 2;
g.l = e > d ? e : d;
g.q = "High";
g.r = this.abx != null ? this.abx : "High";
g.s = this.acf != null ? this.acf : "H:";
g.t = this.ach != null ? this.ach : "";
let h = new DataLegendSeriesValueInfo();
h.a = 7;
h.l = Math.abs(g.l - f.l);
h.q = "Range";
h.r = "Range";
h.s = "R:";
h.k = true;
let i = new DataLegendSeriesValueInfo();
i.a = 6;
i.l = f.l + (h.l / 2);
i.q = "Average";
i.r = "Average";
i.s = "A:";
i.k = true;
let j = new DataLegendSeriesContext();
j.e = ((() => {
let $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
$ret.add(g);
$ret.add(f);
$ret.add(h);
$ret.add(i);
return $ret;
})());
j.h = this.mp();
return j;
}
get useHighMarkerFidelity() {
return this.aag;
}
}
VerticalRangeCategorySeries.$t = /*@__PURE__*/ markType(VerticalRangeCategorySeries, 'VerticalRangeCategorySeries', RangeCategorySeries.$);
VerticalRangeCategorySeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, VerticalRangeCategorySeries, 'raisePropertyChanged', ['HighMemberAsLegendLabel:acf:acp', [2, null], 'HighMemberAsLegendUnit:ach:acq', [2, null], 'LowMemberAsLegendLabel:acj:acr', [2, null], 'LowMemberAsLegendUnit:acl:acs', [2, null], 'XAxis::act', [NumericXAxis.$, null], 'YAxis::acu', [CategoryAxisBase.$, null]]);
return VerticalRangeCategorySeries;
})();