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.oq = _this.oo(); return _this; } NumericYAxis.prototype.bm = function () { return new NumericYAxisView(this); }; NumericYAxis.prototype.az = function () { return new VerticalAxisLabelPanel(); }; NumericYAxis.prototype.ak = function () { return new NumericYAxis(); }; NumericYAxis.prototype.get_dq = function () { return true; }; NumericYAxis.prototype.fs = function () { return this.nv().height; }; NumericYAxis.prototype.ft = function (a, b) { if (this.r6 != null) { return this.r6.p(a, b); } return this.r5.p(a, b); }; NumericYAxis.prototype.j6 = function (a, b, c, d) { if (this.r6 != null) { this.r6.v(a, b, c, d); return; } this.r5.v(a, b, c, d); }; NumericYAxis.prototype.j5 = function (a, b, c, d, e) { if (this.r6 != null) { this.r6.u(a, b, c, d, e); return; } this.r5.u(a, b, c, d, e); }; NumericYAxis.prototype.fw = function (a, b) { if (this.r6 != null) { return this.r6.q(a, b); } return this.r5.q(a, b); }; NumericYAxis.prototype.j7 = function (a, b, c, d) { if (this.r6 != null) { this.r6.j(a, b, c, d); return; } this.r5.j(a, b, c, d); }; NumericYAxis.prototype.sn = function (a, b) { if (this.b0 == null || isNaN_(a) || isNaN_(b)) { return; } var c = this.sb(a, this); var d = this.sb(b, this); if (isNaN_(c) || isNaN_(d)) { return; } this.b0.x6 = new Rect(0, this.b0.x6.x, d, this.b0.x6.width, c - d); }; NumericYAxis.prototype.oo = function () { var _this = this; var a = _super.prototype.oo.call(this); a.b.c = function (b) { if (_this.a3 == null || _this.a3.visibility == 0) { _this.a0.bj = b; if (_this.a3 != null && (_this.a3.location == 7 || _this.a3.location == 6)) { _this.b0.o2(); } } }; a.k = function (b, c, d) { return _this.j9(c, d, b.aa, b.b, false); }; a.l = function (b, c, d, e) { return _this.ka(c, d, e, b.aa); }; a.m = function (b, c) { var d = b.z; var e = new ScalerParams(0, b.ab, b.aa, _this.dg, d); return _this.ft(c, e); }; a.q = function (b, c) { return true; }; a.j = function (b) { return _this.lg(b.u, b.n, b.aa, b.a, true); }; a.e = function (b) { b.n = _this.a3 != null && (_this.a3.location == 7 || _this.a3.location == 3) ? b.aa.right : b.aa.left; var c = b.z; var d = new ScalerParams(0, b.ab, b.aa, _this.dg, c); if (_this.am != null && _this.am.b0 != null) { var e = b.n; var f = b.r; var g = _this.k9(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.or = function (a, b, c, d) { var e = d; var f = _super.prototype.or.call(this, a, b, c, d); var g = new ScalerParams(0, b, a, this.df, c); var h = NaN; var i = NaN; if (!this.df && b.top == 0) { i = this.pq; } else if (this.df && b.bottom == 1) { h = this.pq; } if (isNaN_(h)) { h = this.fw(e.bottom, g); } if (isNaN_(i)) { i = this.fw(e.top, g); } var j = Math.min(h, i); var k = Math.max(h, i); this.pu = j; this.pt = 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.k4 = function (a) { _super.prototype.k4.call(this, a); var b = this.b0 != null ? this.b0.xn : Rect.empty; var c = this.n1; var d = this.nw(); var e = this.nv(); var f = this.oq.c(a, c, b, d, e); if (f != null) { this.pp = f.f.m; this.ps = f.f.l; } }; NumericYAxis.prototype.li = function (a, b) { _super.prototype.li.call(this, a, b); if (b.height != a.height) { this.d2(); } }; NumericYAxis.prototype.get_bk = function () { return 1; }; Object.defineProperty(NumericYAxis.prototype, "bk", { get: function () { return this.get_bk(); }, enumerable: false, configurable: true }); NumericYAxis.prototype.ot = function () { if (this.pb) { return new VerticalLogarithmicScaler(); } switch (this.r4) { case 0: return new FastVerticalLinearScaler(); case 1: return new VerticalLogarithmicScaler(); } return null; }; NumericYAxis.prototype.j$d = function (a, b) { return this.fw.apply(this, arguments); }; NumericYAxis.prototype.j$c = function (a, b) { return this.ft.apply(this, arguments); }; NumericYAxis.prototype.j$e = function (a, b, c, d, e) { this.j5.apply(this, arguments); }; NumericYAxis.prototype.j$f = function (a, b, c, d) { this.j6.apply(this, arguments); }; NumericYAxis.prototype.j$g = function (a, b, c, d) { this.j7.apply(this, arguments); }; Object.defineProperty(NumericYAxis.prototype, "j$b", { get: function () { return this.df; }, 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.bo = null; _this.bo = a; return _this; } NumericYAxisView.prototype.al = function () { _super.prototype.al.call(this); this.a.ni = AxisDefaults.axis_MajorBrush; }; NumericYAxisView.$t = markType(NumericYAxisView, 'NumericYAxisView', StraightNumericAxisBaseView.$); return NumericYAxisView; }(StraightNumericAxisBaseView)); export { NumericYAxisView };