UNPKG

igniteui-react-charts

Version:

Ignite UI React charting components for building rich data visualizations using TypeScript APIs.

248 lines (247 loc) 8.44 kB
/* 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 } 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 */ var NumericYAxis = /** @class */ /*@__PURE__*/ (function (_super) { __extends(NumericYAxis, _super); function NumericYAxis() { var _this = _super.call(this) || this; _this.ab = NumericYAxis.$; _this.pw = _this.pu(); return _this; } NumericYAxis.prototype.bo = function () { return new NumericYAxisView(this); }; NumericYAxis.prototype.a0 = function () { return new VerticalAxisLabelPanel(); }; NumericYAxis.prototype.al = function () { return new NumericYAxis(); }; NumericYAxis.prototype.get_dy = function () { return true; }; NumericYAxis.prototype.f5 = function () { return this.o0().height; }; NumericYAxis.prototype.f6 = function (a, b) { if (this.tb != null) { return this.tb.p(a, b); } return this.ta.p(a, b); }; NumericYAxis.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); }; NumericYAxis.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); }; NumericYAxis.prototype.f9 = function (a, b) { if (this.tb != null) { return this.tb.q(a, b); } return this.ta.q(a, b); }; NumericYAxis.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); }; NumericYAxis.prototype.ts = 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, this.b7.za.x, d, this.b7.za.width, c - d); }; NumericYAxis.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.a1.bl = b; if (_this.a4 != null && (_this.a4.location == 7 || _this.a4.location == 6)) { _this.b7.pr(); } } }; a.k = function (b, c, d) { return _this.k4(c, d, b.aa, b.b, false); }; a.l = function (b, c, d, e) { return _this.k5(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.mb(b.u, b.n, b.aa, b.a, true); }; a.e = function (b) { b.n = _this.a4 != null && (_this.a4.location == 7 || _this.a4.location == 3) ? b.aa.right : b.aa.left; var c = b.z; var d = new ScalerParams(0, b.ab, b.aa, _this.dp, c); if (_this.an != null && _this.an.b7 != null) { var e = b.n; var f = b.r; var 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 = function (b, c, d) { var e = Math.round(c); return e >= Math.floor(b.aa.top) && e <= Math.ceil(b.aa.bottom); }; return a; }; NumericYAxis.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.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); } var j = Math.min(h, i); var k = Math.max(h, i); this.qz = j; this.qy = k; var l = ((function () { var $ret = new RangeInfo(); $ret.d = j; $ret.c = k; $ret.b = e.height; return $ret; })()); f.k.add(l); return f; }; NumericYAxis.prototype.lz = function (a) { _super.prototype.lz.call(this, a); var b = this.b7 != null ? this.b7.yr : Rect.empty; var c = this.o6; 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; } }; NumericYAxis.prototype.md = function (a, b) { _super.prototype.md.call(this, a, b); if (b.height != a.height) { this.ed(); } }; NumericYAxis.prototype.get_bm = function () { return 1; }; Object.defineProperty(NumericYAxis.prototype, "bm", { get: function () { return this.get_bm(); }, enumerable: false, configurable: true }); NumericYAxis.prototype.pz = function () { if (this.qg) { return new VerticalLogarithmicScaler(); } switch (this.s9) { case 0: return new FastVerticalLinearScaler(); case 1: return new VerticalLogarithmicScaler(); } return null; }; NumericYAxis.prototype.j$d = function (a, b) { return this.f9.apply(this, arguments); }; NumericYAxis.prototype.j$c = function (a, b) { return this.f6.apply(this, arguments); }; NumericYAxis.prototype.j$e = function (a, b, c, d, e) { this.k0.apply(this, arguments); }; NumericYAxis.prototype.j$f = function (a, b, c, d) { this.k1.apply(this, arguments); }; NumericYAxis.prototype.j$g = function (a, b, c, d) { this.k2.apply(this, arguments); }; Object.defineProperty(NumericYAxis.prototype, "j$b", { get: function () { return this.dn; }, enumerable: false, configurable: true }); NumericYAxis.prototype.j$a = function () { return this.ag.apply(this, arguments); }; NumericYAxis.$t = markType(NumericYAxis, 'NumericYAxis', StraightNumericAxisBase.$, [IScaler_$type]); return NumericYAxis; }(StraightNumericAxisBase)); export { NumericYAxis }; /** * @hidden */ var NumericYAxisView = /** @class */ /*@__PURE__*/ (function (_super) { __extends(NumericYAxisView, _super); function NumericYAxisView(a) { var _this = _super.call(this, a) || this; _this.bu = null; _this.bu = a; return _this; } NumericYAxisView.prototype.ar = function () { _super.prototype.ar.call(this); this.b.ol = AxisDefaults.axis_MajorBrush; }; NumericYAxisView.$t = markType(NumericYAxisView, 'NumericYAxisView', StraightNumericAxisBaseView.$); return NumericYAxisView; }(StraightNumericAxisBaseView)); export { NumericYAxisView };