igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
258 lines (257 loc) • 9.27 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 { AnchoredCategorySeries } from "./AnchoredCategorySeries";
import { NumericXAxis } from "./NumericXAxis";
import { DependencyProperty } from "igniteui-react-core";
import { CategoryYAxis } from "./CategoryYAxis";
import { IVerticalAnchoredCategorySeriesInteractionManager_$type } from "./IVerticalAnchoredCategorySeriesInteractionManager";
import { DVContainer } from "igniteui-react-core";
import { runOn, typeCast, EnumUtil, markType, markDep } from "igniteui-react-core";
import { Axis } from "./Axis";
import { ScalerParams } from "./ScalerParams";
import { AxisRange } from "./AxisRange";
import { Rect } from "igniteui-react-core";
import { TrendLineType_$type } from "igniteui-react-core";
import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory";
import { PropertyMetadata } from "igniteui-react-core";
import { truncate, isNaN_, isInfinity } from "igniteui-react-core";
/**
* @hidden
*/
export let VerticalAnchoredCategorySeries = /*@__PURE__*/ (() => {
class VerticalAnchoredCategorySeries extends AnchoredCategorySeries {
constructor() {
super(...arguments);
this.acr = null;
}
cl() {
if (this.xAxis != null && this.xAxis.df) {
return 4;
}
return 3;
}
cm() {
return 1;
}
o8() {
super.o8();
this.xAxis = null;
this.yAxis = null;
}
get acs() {
if (this.acr == null) {
this.acr = DVContainer.instance.createInstance(IVerticalAnchoredCategorySeriesInteractionManager_$type, () => this.ds.n);
}
return this.acr;
}
get_isVertical() {
return true;
}
y3() {
return this.yAxis;
}
zk() {
return this.xAxis;
}
getOffsetValue() {
return this.za.r(this.y3(), 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));
}
kc(a, b) {
return this.kd(a, b, this.y3(), runOn(this, this.z4), this.valueColumn);
}
ke(a, b) {
return this.kf(a, b, this.y3(), runOn(this, this.z4), this.valueColumn);
}
ir(a, b, c, d, e) {
if (this.valueColumn == null) {
return Number.POSITIVE_INFINITY;
}
return this.is(a, b, this.yAxis, d, e, this.valueColumn.count, runOn(this, this.z4));
}
az(a) {
if (a.isEmpty && this.dc != null) {
a = this.dc.xn;
}
if (this.valueColumn == null) {
return null;
}
let b = this.wu(this.cw);
let c = this.y3();
let d = new ScalerParams(0, a, this.dc.x5, c.df, this.getEffectiveViewport());
let e = (c.fw(b.top, d));
let f = (c.fw(b.bottom, d));
if (!c.df) {
let g = e;
e = f;
f = g;
}
e -= this.abo;
f += this.abo;
let h = null;
if (c.dm) {
h = c;
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.valueColumn.count - 1, e));
f = Math.max(0, Math.min(this.valueColumn.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.valueColumn.item(l);
if (this.valueColumn.mayContainUnknowns) {
if (isInfinity(m) || isNaN_(m)) {
continue;
}
}
i = Math.min(i, m);
j = Math.max(j, m);
}
}
let n = new AxisRange(i, j);
n = this.ax(n, this.zk(), a);
return n;
}
b3() {
if (this.b4 == 0) {
return 1;
}
else {
return super.b3();
}
}
w0(a) {
if (!this.hasMarkers || !this.xr()) {
return Rect.empty;
}
return this.acs.e$b(this, this.y5.p, a, runOn(this, this.ac0));
}
ac0(a) {
return this.aa8.ds(a);
}
gx(a, b) {
if (this.gw(a, b)) {
return true;
}
if (this.xs(a, b)) {
return true;
}
return false;
}
i8(a, b, c) {
if (this.dc == null) {
return NaN;
}
let d = this.getEffectiveViewport1(this.cw);
let e = this.y3();
let f = new ScalerParams(0, this.dc.xn, this.cw.b9, e.df, d);
let g = this.za.r(e, this.dc.xn, this.cw.b9, d);
return this.ja(this.valueColumn, a, e, f, g, runOn(this, this.z4), b, c);
}
wn(a, b, c) {
let d = this.y3();
return this.wp(a, b, c, this.za.r(d, this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.zk(), d, null, null, null);
}
fetchXAxis() {
return this.xAxis;
}
fetchYAxis() {
return this.yAxis;
}
ab4(a) {
this.xAxis = typeCast(NumericXAxis.$, a);
}
ab5(a) {
this.yAxis = typeCast(CategoryYAxis.$, a);
}
z0() {
return this.xAxis != null && this.xAxis.d2();
}
yx(a, b) {
return this.aa5(a, b, this.yAxis);
}
it(a) {
return this.acs.e$a(this, a);
}
z4(a) {
return this.iv(a, this.y3());
}
j7(a) {
return truncate(Math.round(this.it(a)));
}
kr(a) {
let b = this.j7(a);
return b >= 0 && this.dp != null && b < this.dp.count ? this.dp.item(b) : null;
}
rh(a, b, c, d) {
super.rh(a, b, c, d);
switch (b) {
case VerticalAnchoredCategorySeries.$$p[0]:
if (c != d) {
this.pi(typeCast(Axis.$, c));
this.rp(typeCast(Axis.$, d));
this.ze.c9.g(this.ie);
if (this.dc != null) {
this.dc.o1();
}
this.rz(false);
this.qs();
}
break;
case VerticalAnchoredCategorySeries.$$p[1]:
if (c != d) {
this.pi(typeCast(Axis.$, c));
this.rp(typeCast(Axis.$, d));
this.ze.c9.g(this.ie);
this.z0();
this.rz(false);
this.qs();
}
break;
case "TrendLineType":
let e = EnumUtil.getEnumValue(TrendLineType_$type, d);
if (e != 0) {
this.aa8.dk = CategoryTrendLineManagerFactory.a(this.aa8.dk, this.yAxis, this.s4, this, this.ds);
}
break;
}
}
acv(a) {
if (typeCast(CategoryYAxis.$, a) !== null) {
return true;
}
return false;
}
acu(a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
}
get useHighMarkerFidelity() {
return this.z1;
}
}
VerticalAnchoredCategorySeries.$t = /*@__PURE__*/ markType(VerticalAnchoredCategorySeries, 'VerticalAnchoredCategorySeries', AnchoredCategorySeries.$);
VerticalAnchoredCategorySeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, VerticalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::acy', [NumericXAxis.$, null], 'YAxis::acz', [CategoryYAxis.$, null]]);
return VerticalAnchoredCategorySeries;
})();