igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
236 lines (235 loc) • 7.61 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 } from "igniteui-react-core";
import { VerticalAxisLabelPanel } from "./VerticalAxisLabelPanel";
import { Rect } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { RangeInfo } from "./RangeInfo";
import { VerticalLogarithmicScaler } from "./VerticalLogarithmicScaler";
import { FastVerticalLinearScaler } from "./FastVerticalLinearScaler";
import { isNaN_ } from "igniteui-react-core";
import { StraightNumericAxisBaseView } from "./StraightNumericAxisBaseView";
import { AxisDefaults } from "./AxisDefaults";
/**
* @hidden
*/
export let NumericYAxis = /*@__PURE__*/ (() => {
class NumericYAxis extends StraightNumericAxisBase {
bo() {
return new NumericYAxisView(this);
}
constructor() {
super();
this.ab = NumericYAxis.$;
this.pw = this.pu();
}
a0() {
return new VerticalAxisLabelPanel();
}
al() {
return new NumericYAxis();
}
get_dy() {
return true;
}
f5() {
return this.o0().height;
}
f6(a, b) {
if (this.tb != null) {
return this.tb.p(a, b);
}
return this.ta.p(a, b);
}
k1(a, b, c, d) {
if (this.tb != null) {
this.tb.v(a, b, c, d);
return;
}
this.ta.v(a, b, c, d);
}
k0(a, b, c, d, e) {
if (this.tb != null) {
this.tb.u(a, b, c, d, e);
return;
}
this.ta.u(a, b, c, d, e);
}
f9(a, b) {
if (this.tb != null) {
return this.tb.q(a, b);
}
return this.ta.q(a, b);
}
k2(a, b, c, d) {
if (this.tb != null) {
this.tb.j(a, b, c, d);
return;
}
this.ta.j(a, b, c, d);
}
ts(a, b) {
if (this.b7 == null || isNaN_(a) || isNaN_(b)) {
return;
}
let c = this.tg(a, this);
let d = this.tg(b, this);
if (isNaN_(c) || isNaN_(d)) {
return;
}
this.b7.za = new Rect(0, this.b7.za.x, d, this.b7.za.width, c - d);
}
pu() {
let a = super.pu();
a.b.c = (b) => {
if (this.a4 == null || this.a4.visibility == 0) {
this.a1.bl = b;
if (this.a4 != null && (this.a4.location == 7 || this.a4.location == 6)) {
this.b7.pr();
}
}
};
a.k = (b, c, d) => this.k4(c, d, b.aa, b.b, false);
a.l = (b, c, d, e) => this.k5(c, d, e, b.aa);
a.m = (b, c) => {
let d = b.z;
let e = new ScalerParams(0, b.ab, b.aa, this.dp, d);
return this.f6(c, e);
};
a.q = (b, c) => true;
a.j = (b) => this.mb(b.u, b.n, b.aa, b.a, true);
a.e = (b) => {
b.n = this.a4 != null && (this.a4.location == 7 || this.a4.location == 3) ? b.aa.right : b.aa.left;
let c = b.z;
let d = new ScalerParams(0, b.ab, b.aa, this.dp, c);
if (this.an != null && this.an.b7 != null) {
let e = b.n;
let f = b.r;
let g = this.l4(e, f, b.ab, b.aa, b.z, b.aa.left, b.aa.right);
e = g.p0;
f = g.p1;
b.n = e;
b.r = f;
}
};
a.p = (b, c, d) => {
let e = Math.round(c);
return e >= Math.floor(b.aa.top) && e <= Math.ceil(b.aa.bottom);
};
return a;
}
px(a, b, c, d) {
let e = d;
let f = super.px(a, b, c, d);
let g = new ScalerParams(0, b, a, this.dn, c);
let h = NaN;
let i = NaN;
if (!this.dn && b.top == 0) {
i = this.qv;
}
else if (this.dn && b.bottom == 1) {
h = this.qv;
}
if (isNaN_(h)) {
h = this.f9(e.bottom, g);
}
if (isNaN_(i)) {
i = this.f9(e.top, g);
}
let j = Math.min(h, i);
let k = Math.max(h, i);
this.qz = j;
this.qy = k;
let l = ((() => {
let $ret = new RangeInfo();
$ret.d = j;
$ret.c = k;
$ret.b = e.height;
return $ret;
})());
f.k.add(l);
return f;
}
lz(a) {
super.lz(a);
let b = this.b7 != null ? this.b7.yr : Rect.empty;
let c = this.o6;
let d = this.o1();
let e = this.o0();
let f = this.pw.c(a, c, b, d, e);
if (f != null) {
this.qu = f.f.m;
this.qx = f.f.l;
}
}
md(a, b) {
super.md(a, b);
if (b.height != a.height) {
this.ed();
}
}
get_bm() {
return 1;
}
get bm() {
return this.get_bm();
}
pz() {
if (this.qg) {
return new VerticalLogarithmicScaler();
}
switch (this.s9) {
case 0: return new FastVerticalLinearScaler();
case 1: return new VerticalLogarithmicScaler();
}
return null;
}
j$d(a, b) {
return this.f9.apply(this, arguments);
}
j$c(a, b) {
return this.f6.apply(this, arguments);
}
j$e(a, b, c, d, e) {
this.k0.apply(this, arguments);
}
j$f(a, b, c, d) {
this.k1.apply(this, arguments);
}
j$g(a, b, c, d) {
this.k2.apply(this, arguments);
}
get j$b() {
return this.dn;
}
j$a() {
return this.ag.apply(this, arguments);
}
}
NumericYAxis.$t = /*@__PURE__*/ markType(NumericYAxis, 'NumericYAxis', StraightNumericAxisBase.$, [IScaler_$type]);
return NumericYAxis;
})();
/**
* @hidden
*/
export let NumericYAxisView = /*@__PURE__*/ (() => {
class NumericYAxisView extends StraightNumericAxisBaseView {
constructor(a) {
super(a);
this.bu = null;
this.bu = a;
}
ar() {
super.ar();
this.b.ol = AxisDefaults.axis_MajorBrush;
}
}
NumericYAxisView.$t = /*@__PURE__*/ markType(NumericYAxisView, 'NumericYAxisView', StraightNumericAxisBaseView.$);
return NumericYAxisView;
})();