igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
255 lines (254 loc) • 8.22 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-angular-core";
import { CategoryYAxis } from "./CategoryYAxis";
import { IVerticalAnchoredCategorySeriesInteractionManager_$type } from "./IVerticalAnchoredCategorySeriesInteractionManager";
import { DVContainer } from "igniteui-angular-core";
import { runOn, typeCast, EnumUtil, markType, markDep } from "igniteui-angular-core";
import { Axis } from "./Axis";
import { ScalerParams } from "./ScalerParams";
import { AxisRange } from "./AxisRange";
import { Rect } from "igniteui-angular-core";
import { TrendLineType_$type } from "igniteui-angular-core";
import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory";
import { PropertyMetadata } from "igniteui-angular-core";
import { truncate, isNaN_, isInfinity } from "igniteui-angular-core";
/**
* @hidden
*/
export class VerticalAnchoredCategorySeries extends AnchoredCategorySeries {
constructor() {
super(...arguments);
this.ads = null;
}
static { this.$t = markType(VerticalAnchoredCategorySeries, 'VerticalAnchoredCategorySeries', AnchoredCategorySeries.$); }
cl() {
if (this.xAxis != null && this.xAxis.dr) {
return 4;
}
return 3;
}
cm() {
return 1;
}
ph() {
super.ph();
this.xAxis = null;
this.yAxis = null;
}
get adt() {
if (this.ads == null) {
this.ads = DVContainer.instance.createInstance(IVerticalAnchoredCategorySeriesInteractionManager_$type, () => this.ds.n);
}
return this.ads;
}
get_isVertical() {
return true;
}
z4() {
return this.yAxis;
}
aal() {
return this.xAxis;
}
getOffsetValue() {
return this.aab.r(this.z4(), 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));
}
kj(a, b) {
return this.kk(a, b, this.z4(), runOn(this, this.aa5), this.valueColumn);
}
kl(a, b) {
return this.km(a, b, this.z4(), runOn(this, this.aa5), this.valueColumn);
}
iy(a, b, c, d, e) {
if (this.valueColumn == null) {
return Number.POSITIVE_INFINITY;
}
return this.iz(a, b, this.yAxis, d, e, this.valueColumn.count, runOn(this, this.aa5));
}
az(a) {
if (a.isEmpty && this.dc != null) {
a = this.dc.yv;
}
if (this.valueColumn == null) {
return null;
}
let b = this.w6(this.cw);
let c = this.z4();
let d = new ScalerParams(0, a, this.dc.zd, c.dr, this.getEffectiveViewport());
let e = (c.gf(b.top, d));
let f = (c.gf(b.bottom, d));
if (!c.dr) {
let g = e;
e = f;
f = g;
}
e -= this.acp;
f += this.acp;
let h = null;
if (c.d0) {
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.aal(), a);
return n;
}
b3() {
if (this.b4 == 0) {
return 1;
}
else {
return super.b3();
}
}
xc(a) {
if (!this.hasMarkers || !this.x4()) {
return Rect.empty;
}
return this.adt.e$b(this, this.z6.s, a, runOn(this, this.ad1));
}
ad1(a) {
return this.ab9.ds(a);
}
g4(a, b) {
if (this.g3(a, b)) {
return true;
}
if (this.x5(a, b)) {
return true;
}
return false;
}
jf(a, b, c) {
if (this.dc == null) {
return NaN;
}
let d = this.getEffectiveViewport1(this.cw);
let e = this.z4();
let f = new ScalerParams(0, this.dc.yv, this.cw.b9, e.dr, d);
let g = this.aab.r(e, this.dc.yv, this.cw.b9, d);
return this.jh(this.valueColumn, a, e, f, g, runOn(this, this.aa5), b, c);
}
wy(a, b, c) {
let d = this.z4();
return this.w0(a, b, c, this.aab.r(d, this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.aal(), d, null, null, null);
}
fetchXAxis() {
return this.xAxis;
}
fetchYAxis() {
return this.yAxis;
}
ac5(a) {
this.xAxis = typeCast(NumericXAxis.$, a);
}
ac6(a) {
this.yAxis = typeCast(CategoryYAxis.$, a);
}
aa1() {
return this.xAxis != null && this.xAxis.ei();
}
zy(a, b) {
return this.ab6(a, b, this.yAxis);
}
i0(a) {
return this.adt.e$a(this, a);
}
aa5(a) {
return this.i2(a, this.z4());
}
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;
}
rs(a, b, c, d) {
super.rs(a, b, c, d);
switch (b) {
case VerticalAnchoredCategorySeries.$$p[0]:
if (c != d) {
this.pr(typeCast(Axis.$, c));
this.r0(typeCast(Axis.$, d));
this.aaf.c9.g(this.im);
if (this.dc != null) {
this.dc.ps();
}
this.sa(false);
this.q2();
}
break;
case VerticalAnchoredCategorySeries.$$p[1]:
if (c != d) {
this.pr(typeCast(Axis.$, c));
this.r0(typeCast(Axis.$, d));
this.aaf.c9.g(this.im);
this.aa1();
this.sa(false);
this.q2();
}
break;
case "TrendLineType":
let e = EnumUtil.getEnumValue(TrendLineType_$type, d);
if (e != 0) {
this.ab9.dk = CategoryTrendLineManagerFactory.a(this.ab9.dk, this.yAxis, this.tf, this, this.ds);
}
break;
}
}
adw(a) {
if (typeCast(CategoryYAxis.$, a) !== null) {
return true;
}
return false;
}
adv(a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
}
get useHighMarkerFidelity() {
return this.aa2;
}
static { this.$$p = markDep(DependencyProperty, PropertyMetadata, VerticalAnchoredCategorySeries, 'raisePropertyChanged', ['XAxis::adz', [NumericXAxis.$, null], 'YAxis::ad0', [CategoryYAxis.$, null]]); }
}