igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
248 lines (247 loc) • 8.42 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 { __extends } from "tslib";
import { StraightNumericAxisBase } from "./StraightNumericAxisBase";
import { IScaler_$type } from "./IScaler";
import { markType, TypeRegistrar } from "igniteui-react-core";
import { HorizontalAxisLabelPanel } from "./HorizontalAxisLabelPanel";
import { ScalerParams } from "./ScalerParams";
import { Rect } from "igniteui-react-core";
import { RangeInfo } from "./RangeInfo";
import { HorizontalLogarithmicScaler } from "./HorizontalLogarithmicScaler";
import { FastHorizontalLinearScaler } from "./FastHorizontalLinearScaler";
import { isNaN_ } from "igniteui-react-core";
import { StraightNumericAxisBaseView } from "./StraightNumericAxisBaseView";
import { AxisDefaults } from "./AxisDefaults";
/**
* @hidden
*/
var NumericXAxis = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(NumericXAxis, _super);
function NumericXAxis() {
var _this = _super.call(this) || this;
_this.ab = NumericXAxis.$;
_this.pw = _this.pu();
return _this;
}
NumericXAxis.prototype.bo = function () {
return new NumericXAxisView(this);
};
NumericXAxis.prototype.k6 = function (a) {
_super.prototype.k6.call(this, a);
this.ts = a;
};
NumericXAxis.prototype.al = function () {
return new NumericXAxis();
};
NumericXAxis.prototype.a0 = function () {
if (this.ei) {
return (TypeRegistrar.create('HorizontalSmartAxisLabelPanel'));
}
else {
return new HorizontalAxisLabelPanel();
}
};
NumericXAxis.prototype.pu = function () {
var _this = this;
var a = _super.prototype.pu.call(this);
a.b.c = function (b) {
if ((_this.a4 == null || _this.a4.visibility == 0) && _this.an != null) {
_this.a1.bl = b;
if (_this.a4 != null && (_this.a4.location == 4 || _this.a4.location == 5)) {
_this.b7.pr();
}
}
};
a.k = function (b, c, d) { return _this.mb(c, d, b.aa, b.b, false); };
a.l = function (b, c, d, e) { return _this.mc(c, d, e, b.aa); };
a.m = function (b, c) {
var d = b.z;
var e = new ScalerParams(0, b.ab, b.aa, _this.dp, d);
return _this.f6(c, e);
};
a.q = function (b, c) { return true; };
a.j = function (b) { return _this.k4(b.u, b.n, b.aa, b.a, true); };
a.e = function (b) {
b.n = b.aa.bottom;
if (_this.an != null && _this.an.b7 != null) {
var c = b.n;
var d = b.r;
var e = _this.l4(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 = function (b, c, d) {
var e = Math.round(c);
return e >= Math.floor(b.aa.left) && e <= Math.ceil(b.aa.right);
};
return a;
};
NumericXAxis.prototype.f6 = function (a, b) {
if (this.tb != null) {
return this.tb.p(a, b);
}
return this.ta.p(a, b);
};
NumericXAxis.prototype.f9 = function (a, b) {
if (this.tb != null) {
return this.tb.q(a, b);
}
return this.ta.q(a, b);
};
NumericXAxis.prototype.k1 = function (a, b, c, d) {
if (this.tb != null) {
this.tb.v(a, b, c, d);
return;
}
this.ta.v(a, b, c, d);
};
NumericXAxis.prototype.k0 = function (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);
};
NumericXAxis.prototype.k2 = function (a, b, c, d) {
if (this.tb != null) {
this.tb.j(a, b, c, d);
return;
}
this.ta.j(a, b, c, d);
};
NumericXAxis.prototype.tt = function (a, b) {
if (this.b7 == null || isNaN_(a) || isNaN_(b)) {
return;
}
var c = this.tg(a, this);
var d = this.tg(b, this);
if (isNaN_(c) || isNaN_(d)) {
return;
}
this.b7.za = new Rect(0, c, this.b7.za.y, d - c, this.b7.za.height);
};
NumericXAxis.prototype.px = function (a, b, c, d) {
var e = d;
var f = _super.prototype.px.call(this, a, b, c, d);
var g = new ScalerParams(0, b, a, this.dn, c);
var h = NaN;
var i = NaN;
if (!this.dn && b.right == 1) {
i = this.qv;
}
else if (this.dn && b.left == 0) {
h = this.qv;
}
if (isNaN_(h)) {
h = this.f9(e.left, g);
}
if (isNaN_(i)) {
i = this.f9(e.right, g);
}
var j = Math.min(h, i);
var k = Math.max(h, i);
this.qz = j;
this.qy = k;
f.k.add(((function () {
var $ret = new RangeInfo();
$ret.d = j;
$ret.c = k;
$ret.b = e.width;
return $ret;
})()));
return f;
};
NumericXAxis.prototype.lz = function (a) {
_super.prototype.lz.call(this, a);
var b = this.b7 != null ? this.b7.yr : Rect.empty;
var c = !b.isEmpty ? this.o6 : Rect.empty;
var d = this.o1();
var e = this.o0();
var f = this.pw.c(a, c, b, d, e);
if (f != null) {
this.qu = f.f.m;
this.qx = f.f.l;
}
};
NumericXAxis.prototype.md = function (a, b) {
_super.prototype.md.call(this, a, b);
if (b.height != a.height) {
this.ed();
}
};
NumericXAxis.prototype.get_bm = function () {
return 0;
};
Object.defineProperty(NumericXAxis.prototype, "bm", {
get: function () {
return this.get_bm();
},
enumerable: false,
configurable: true
});
NumericXAxis.prototype.pz = function () {
if (this.qg) {
return new HorizontalLogarithmicScaler();
}
switch (this.s9) {
case 0: return new FastHorizontalLinearScaler();
case 1: return new HorizontalLogarithmicScaler();
}
return null;
};
NumericXAxis.prototype.j$d = function (a, b) {
return this.f9.apply(this, arguments);
};
NumericXAxis.prototype.j$c = function (a, b) {
return this.f6.apply(this, arguments);
};
NumericXAxis.prototype.j$e = function (a, b, c, d, e) {
this.k0.apply(this, arguments);
};
NumericXAxis.prototype.j$f = function (a, b, c, d) {
this.k1.apply(this, arguments);
};
NumericXAxis.prototype.j$g = function (a, b, c, d) {
this.k2.apply(this, arguments);
};
Object.defineProperty(NumericXAxis.prototype, "j$b", {
get: function () {
return this.dn;
},
enumerable: false,
configurable: true
});
NumericXAxis.prototype.j$a = function () {
return this.ag.apply(this, arguments);
};
NumericXAxis.$t = markType(NumericXAxis, 'NumericXAxis', StraightNumericAxisBase.$, [IScaler_$type]);
return NumericXAxis;
}(StraightNumericAxisBase));
export { NumericXAxis };
/**
* @hidden
*/
var NumericXAxisView = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(NumericXAxisView, _super);
function NumericXAxisView(a) {
var _this = _super.call(this, a) || this;
_this.bu = null;
_this.bu = a;
return _this;
}
NumericXAxisView.prototype.ar = function () {
_super.prototype.ar.call(this);
this.b.ol = AxisDefaults.axis_MajorBrush;
};
NumericXAxisView.$t = markType(NumericXAxisView, 'NumericXAxisView', StraightNumericAxisBaseView.$);
return NumericXAxisView;
}(StraightNumericAxisBaseView));
export { NumericXAxisView };