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.acf = null;
}
cl() {
if (this.xAxis != null && this.xAxis.ch) {
return 4;
}
return 3;
}
cm() {
return 1;
}
o2() {
super.o2();
this.xAxis = null;
this.yAxis = null;
}
get acg() {
if (this.acf == null) {
this.acf = DVContainer.instance.createInstance(IVerticalAnchoredCategorySeriesInteractionManager_$type, () => this.ds.n);
}
return this.acf;
}
get_isVertical() {
return true;
}
yu() {
return this.yAxis;
}
zb() {
return this.xAxis;
}
getOffsetValue() {
return this.y1.r(this.yu(), this.cw.b2, this.cw.b1, this.getEffectiveViewport1(this.cw));
}
getCategoryWidth() {
return this.yAxis.getCategorySize(this.cw.b2, this.cw.b1, this.getEffectiveViewport1(this.cw));
}
j8(a, b) {
return this.j9(a, b, this.yu(), runOn(this, this.zv), this.valueColumn);
}
ka(a, b) {
return this.kb(a, b, this.yu(), runOn(this, this.zv), this.valueColumn);
}
ip(a, b, c, d, e) {
if (this.valueColumn == null) {
return Number.POSITIVE_INFINITY;
}
return this.iq(a, b, this.yAxis, d, e, this.valueColumn.count, runOn(this, this.zv));
}
az(a) {
if (a.isEmpty && this.dc != null) {
a = this.dc.v5;
}
if (this.valueColumn == null) {
return null;
}
let b = this.wl(this.cw);
let c = this.yu();
let d = new ScalerParams(0, a, this.dc.wn, c.ch, this.getEffectiveViewport());
let e = (c.eo(b.top, d));
let f = (c.eo(b.bottom, d));
if (!c.ch) {
let g = e;
e = f;
f = g;
}
e -= this.abc;
f += this.abc;
let h = null;
if (c.cn) {
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.zb(), a);
return n;
}
b3() {
if (this.b4 == 0) {
return 1;
}
else {
return super.b3();
}
}
wr(a) {
if (!this.hasMarkers || !this.xi()) {
return Rect.empty;
}
return this.acg.e$b(this, this.yw.p, a, runOn(this, this.aco));
}
aco(a) {
return this.aaw.di(a);
}
gw(a, b) {
if (this.gv(a, b)) {
return true;
}
if (this.xj(a, b)) {
return true;
}
return false;
}
i5(a, b, c) {
if (this.dc == null) {
return NaN;
}
let d = this.getEffectiveViewport1(this.cw);
let e = this.yu();
let f = new ScalerParams(0, this.dc.v5, this.cw.b1, e.ch, d);
let g = this.y1.r(e, this.dc.v5, this.cw.b1, d);
return this.i7(this.valueColumn, a, e, f, g, runOn(this, this.zv), b, c);
}
we(a, b, c) {
let d = this.yu();
return this.wg(a, b, c, this.y1.r(d, this.cw.b2, this.cw.b1, this.getEffectiveViewport1(this.cw)), this.zb(), d, null, null, null);
}
fetchXAxis() {
return this.xAxis;
}
fetchYAxis() {
return this.yAxis;
}
abs(a) {
this.xAxis = typeCast(NumericXAxis.$, a);
}
abt(a) {
this.yAxis = typeCast(CategoryYAxis.$, a);
}
zr() {
return this.xAxis != null && this.xAxis.c1();
}
yo(a, b) {
return this.aat(a, b, this.yAxis);
}
ir(a) {
return this.acg.e$a(this, a);
}
zv(a) {
return this.it(a, this.yu());
}
j3(a) {
return truncate(Math.round(this.ir(a)));
}
kn(a) {
let b = this.j3(a);
return b >= 0 && this.dp != null && b < this.dp.count ? this.dp.item(b) : null;
}
ra(a, b, c, d) {
super.ra(a, b, c, d);
switch (b) {
case VerticalAnchoredCategorySeries.$$p[0]:
if (c != d) {
this.pc(typeCast(Axis.$, c));
this.ri(typeCast(Axis.$, d));
this.y5.c0.g(this.id);
if (this.dc != null) {
this.dc.n3();
}
this.rs(false);
this.ql();
}
break;
case VerticalAnchoredCategorySeries.$$p[1]:
if (c != d) {
this.pc(typeCast(Axis.$, c));
this.ri(typeCast(Axis.$, d));
this.y5.c0.g(this.id);
this.zr();
this.rs(false);
this.ql();
}
break;
case "TrendLineType":
let e = EnumUtil.getEnumValue(TrendLineType_$type, d);
if (e != 0) {
this.aaw.db = CategoryTrendLineManagerFactory.a(this.aaw.db, this.yAxis, this.sx, this, this.ds);
}
break;
}
}
acj(a) {
if (typeCast(CategoryYAxis.$, a) !== null) {
return true;
}
return false;
}
aci(a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
}
get useHighMarkerFidelity() {
return this.zs;
}
}
VerticalAnchoredCategorySeries.$t = /*@__PURE__*/ markType(VerticalAnchoredCategorySeries, 'VerticalAnchoredCategorySeries', AnchoredCategorySeries.$);
VerticalAnchoredCategorySeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, VerticalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::acm', [NumericXAxis.$, null], 'YAxis::acn', [CategoryYAxis.$, null]]);
return VerticalAnchoredCategorySeries;
})();