igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
230 lines (229 loc) • 6.62 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 { StraightNumericAxisBase } from "./StraightNumericAxisBase";
import { IScaler_$type } from "./IScaler";
import { markType, TypeRegistrar } from "igniteui-angular-core";
import { HorizontalAxisLabelPanel } from "./HorizontalAxisLabelPanel";
import { ScalerParams } from "./ScalerParams";
import { Rect } from "igniteui-angular-core";
import { RangeInfo } from "./RangeInfo";
import { HorizontalLogarithmicScaler } from "./HorizontalLogarithmicScaler";
import { FastHorizontalLinearScaler } from "./FastHorizontalLinearScaler";
import { isNaN_ } from "igniteui-angular-core";
import { StraightNumericAxisBaseView } from "./StraightNumericAxisBaseView";
import { AxisDefaults } from "./AxisDefaults";
/**
* @hidden
*/
export class NumericXAxis extends StraightNumericAxisBase {
static { this.$t = markType(NumericXAxis, 'NumericXAxis', StraightNumericAxisBase.$, [IScaler_$type]); }
bo() {
return new NumericXAxisView(this);
}
lg(a) {
super.lg(a);
this.t6 = a;
}
al() {
return new NumericXAxis();
}
constructor() {
super();
this.ab = NumericXAxis.$;
this.qa = this.p8();
}
a0() {
if (this.en) {
return (TypeRegistrar.create('HorizontalSmartAxisLabelPanel'));
}
else {
return new HorizontalAxisLabelPanel();
}
}
p8() {
let a = super.p8();
a.b.c = (b) => {
if ((this.a4 == null || this.a4.visibility == 0) && this.an != null) {
this.a1.bn = b;
if (this.a4 != null && (this.a4.location == 4 || this.a4.location == 5)) {
this.b7.pt();
}
}
};
a.k = (b, c, d) => this.ml(c, d, b.aa, b.b, false);
a.l = (b, c, d, e) => this.mm(c, d, e, b.aa);
a.m = (b, c) => {
let d = b.z;
let e = new ScalerParams(0, b.ab, b.aa, this.ds, d);
return this.gc(c, e);
};
a.q = (b, c) => true;
a.j = (b) => this.le(b.u, b.n, b.aa, b.a, true);
a.e = (b) => {
b.n = b.aa.bottom;
if (this.an != null && this.an.b7 != null) {
let c = b.n;
let d = b.r;
let e = this.me(c, d, b.ab, b.aa, b.z, b.aa.top, b.aa.bottom);
c = e.p0;
d = e.p1;
b.n = c;
b.r = d;
}
};
a.p = (b, c, d) => {
let e = Math.round(c);
return e >= Math.floor(b.aa.left) && e <= Math.ceil(b.aa.right);
};
return a;
}
gc(a, b) {
if (this.tp != null) {
return this.tp.p(a, b);
}
return this.to.p(a, b);
}
gf(a, b) {
if (this.tp != null) {
return this.tp.q(a, b);
}
return this.to.q(a, b);
}
lb(a, b, c, d) {
if (this.tp != null) {
this.tp.v(a, b, c, d);
return;
}
this.to.v(a, b, c, d);
}
la(a, b, c, d, e) {
if (this.tp != null) {
this.tp.u(a, b, c, d, e);
return;
}
this.to.u(a, b, c, d, e);
}
lc(a, b, c, d) {
if (this.tp != null) {
this.tp.j(a, b, c, d);
return;
}
this.to.j(a, b, c, d);
}
t7(a, b) {
if (this.b7 == null || isNaN_(a) || isNaN_(b)) {
return;
}
let c = this.tu(a, this);
let d = this.tu(b, this);
if (isNaN_(c) || isNaN_(d)) {
return;
}
this.b7.ze = new Rect(0, c, this.b7.ze.y, d - c, this.b7.ze.height);
}
qb(a, b, c, d) {
let e = d;
let f = super.qb(a, b, c, d);
let g = new ScalerParams(0, b, a, this.dr, c);
let h = NaN;
let i = NaN;
if (!this.dr && b.right == 1) {
i = this.q9;
}
else if (this.dr && b.left == 0) {
h = this.q9;
}
if (isNaN_(h)) {
h = this.gf(e.left, g);
}
if (isNaN_(i)) {
i = this.gf(e.right, g);
}
let j = Math.min(h, i);
let k = Math.max(h, i);
this.rd = j;
this.rc = k;
f.k.add(((() => {
let $ret = new RangeInfo();
$ret.d = j;
$ret.c = k;
$ret.b = e.width;
return $ret;
})()));
return f;
}
l9(a) {
super.l9(a);
let b = this.b7 != null ? this.b7.yv : Rect.empty;
let c = !b.isEmpty ? this.pk : Rect.empty;
let d = this.pf();
let e = this.pe();
let f = this.qa.c(a, c, b, d, e);
if (f != null) {
this.q8 = f.f.m;
this.rb = f.f.l;
}
}
mn(a, b) {
super.mn(a, b);
if (b.height != a.height) {
this.ei();
}
}
get_bm() {
return 0;
}
get bm() {
return this.get_bm();
}
qd() {
if (this.qu) {
return new HorizontalLogarithmicScaler();
}
switch (this.tn) {
case 0: return new FastHorizontalLinearScaler();
case 1: return new HorizontalLogarithmicScaler();
}
return null;
}
j$d(a, b) {
return this.gf.apply(this, arguments);
}
j$c(a, b) {
return this.gc.apply(this, arguments);
}
j$e(a, b, c, d, e) {
this.la.apply(this, arguments);
}
j$f(a, b, c, d) {
this.lb.apply(this, arguments);
}
j$g(a, b, c, d) {
this.lc.apply(this, arguments);
}
get j$b() {
return this.dr;
}
j$a() {
return this.ag.apply(this, arguments);
}
}
/**
* @hidden
*/
export class NumericXAxisView extends StraightNumericAxisBaseView {
static { this.$t = markType(NumericXAxisView, 'NumericXAxisView', StraightNumericAxisBaseView.$); }
constructor(a) {
super(a);
this.bx = null;
this.bx = a;
}
as() {
super.as();
this.c.oz = AxisDefaults.axis_MajorBrush;
}
}