igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
258 lines (257 loc) • 9.28 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.ac2 = null;
}
cl() {
if (this.xAxis != null && this.xAxis.dn) {
return 4;
}
return 3;
}
cm() {
return 1;
}
pg() {
super.pg();
this.xAxis = null;
this.yAxis = null;
}
get ac3() {
if (this.ac2 == null) {
this.ac2 = DVContainer.instance.createInstance(IVerticalAnchoredCategorySeriesInteractionManager_$type, () => this.ds.n);
}
return this.ac2;
}
get_isVertical() {
return true;
}
ze() {
return this.yAxis;
}
zv() {
return this.xAxis;
}
getOffsetValue() {
return this.zl.r(this.ze(), 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));
}
ki(a, b) {
return this.kj(a, b, this.ze(), runOn(this, this.aaf), this.valueColumn);
}
kk(a, b) {
return this.kl(a, b, this.ze(), runOn(this, this.aaf), this.valueColumn);
}
ix(a, b, c, d, e) {
if (this.valueColumn == null) {
return Number.POSITIVE_INFINITY;
}
return this.iy(a, b, this.yAxis, d, e, this.valueColumn.count, runOn(this, this.aaf));
}
az(a) {
if (a.isEmpty && this.dc != null) {
a = this.dc.ys;
}
if (this.valueColumn == null) {
return null;
}
let b = this.w5(this.cw);
let c = this.ze();
let d = new ScalerParams(0, a, this.dc.za, c.dn, this.getEffectiveViewport());
let e = (c.ga(b.top, d));
let f = (c.ga(b.bottom, d));
if (!c.dn) {
let g = e;
e = f;
f = g;
}
e -= this.abz;
f += this.abz;
let h = null;
if (c.dw) {
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.zv(), a);
return n;
}
b3() {
if (this.b4 == 0) {
return 1;
}
else {
return super.b3();
}
}
xb(a) {
if (!this.hasMarkers || !this.x2()) {
return Rect.empty;
}
return this.ac3.e$b(this, this.zg.s, a, runOn(this, this.adb));
}
adb(a) {
return this.abj.ds(a);
}
g3(a, b) {
if (this.g2(a, b)) {
return true;
}
if (this.x3(a, b)) {
return true;
}
return false;
}
je(a, b, c) {
if (this.dc == null) {
return NaN;
}
let d = this.getEffectiveViewport1(this.cw);
let e = this.ze();
let f = new ScalerParams(0, this.dc.ys, this.cw.b9, e.dn, d);
let g = this.zl.r(e, this.dc.ys, this.cw.b9, d);
return this.jg(this.valueColumn, a, e, f, g, runOn(this, this.aaf), b, c);
}
wx(a, b, c) {
let d = this.ze();
return this.wz(a, b, c, this.zl.r(d, this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.zv(), d, null, null, null);
}
fetchXAxis() {
return this.xAxis;
}
fetchYAxis() {
return this.yAxis;
}
acf(a) {
this.xAxis = typeCast(NumericXAxis.$, a);
}
acg(a) {
this.yAxis = typeCast(CategoryYAxis.$, a);
}
aab() {
return this.xAxis != null && this.xAxis.ee();
}
y8(a, b) {
return this.abg(a, b, this.yAxis);
}
iz(a) {
return this.ac3.e$a(this, a);
}
aaf(a) {
return this.i1(a, this.ze());
}
kd(a) {
return truncate(Math.round(this.iz(a)));
}
kx(a) {
let b = this.kd(a);
return b >= 0 && this.dp != null && b < this.dp.count ? this.dp.item(b) : null;
}
rr(a, b, c, d) {
super.rr(a, b, c, d);
switch (b) {
case VerticalAnchoredCategorySeries.$$p[0]:
if (c != d) {
this.pq(typeCast(Axis.$, c));
this.rz(typeCast(Axis.$, d));
this.zp.c9.g(this.il);
if (this.dc != null) {
this.dc.pr();
}
this.r9(false);
this.q1();
}
break;
case VerticalAnchoredCategorySeries.$$p[1]:
if (c != d) {
this.pq(typeCast(Axis.$, c));
this.rz(typeCast(Axis.$, d));
this.zp.c9.g(this.il);
this.aab();
this.r9(false);
this.q1();
}
break;
case "TrendLineType":
let e = EnumUtil.getEnumValue(TrendLineType_$type, d);
if (e != 0) {
this.abj.dk = CategoryTrendLineManagerFactory.a(this.abj.dk, this.yAxis, this.te, this, this.ds);
}
break;
}
}
ac6(a) {
if (typeCast(CategoryYAxis.$, a) !== null) {
return true;
}
return false;
}
ac5(a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
}
get useHighMarkerFidelity() {
return this.aac;
}
}
VerticalAnchoredCategorySeries.$t = /*@__PURE__*/ markType(VerticalAnchoredCategorySeries, 'VerticalAnchoredCategorySeries', AnchoredCategorySeries.$);
VerticalAnchoredCategorySeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, VerticalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::ac9', [NumericXAxis.$, null], 'YAxis::ada', [CategoryYAxis.$, null]]);
return VerticalAnchoredCategorySeries;
})();