UNPKG

igniteui-react-charts

Version:

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

113 lines (112 loc) 4.1 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 { TickmarkValues } from "./TickmarkValues"; import { DependencyProperty } from "igniteui-react-core"; import { LogarithmicNumericSnapper } from "./LogarithmicNumericSnapper"; import { Number_$type, typeGetValue, markType } from "igniteui-react-core"; import { PropertyMetadata } from "igniteui-react-core"; import { truncate, logBase } from "igniteui-react-core"; /** * @hidden */ var LogarithmicTickmarkValues = /** @class */ /*@__PURE__*/ (function (_super) { __extends(LogarithmicTickmarkValues, _super); function LogarithmicTickmarkValues() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.t = null; _this.u = null; return _this; } LogarithmicTickmarkValues.prototype.s = function (a) { _super.prototype.s.call(this, a); var b = new LogarithmicNumericSnapper(a.n, a.m, this.x, a.k); this.m = 1; this.r = truncate(b.h); this.p = truncate(Math.floor(logBase(Math.max(4.94065645841247E-324, a.n), this.x))); this.q = truncate(Math.ceil(logBase(Math.max(4.94065645841247E-324, a.m), this.x))); }; Object.defineProperty(LogarithmicTickmarkValues.prototype, "x", { get: function () { return typeGetValue(this.c(LogarithmicTickmarkValues.z)); }, set: function (a) { this.h(LogarithmicTickmarkValues.z, a); }, enumerable: false, configurable: true }); LogarithmicTickmarkValues.prototype.v = function (a) { var b = a * this.m; return Math.pow(this.x, b); }; LogarithmicTickmarkValues.prototype.j = function () { var a = this.p; var b = this.q; var c = this.o; var d = 0; for (var e = a; e <= b; ++e) { var f = this.v(e); if (f <= c) { d++; } } if (this.t == null || this.t.length != d) { this.t = new Array(d); } var g = this.t; var h = 0; for (var i = a; i <= b; ++i) { var j = this.v(i); if (j <= c) { g[h] = j; h++; } } return g; }; LogarithmicTickmarkValues.prototype.k = function () { var a = this.p; var b = this.q; var c = this.x; var d = this.r; var e = this.o; var f = 0; for (var g = a; g <= b; ++g) { var h = this.v(g); var i = Math.pow(c, g); for (var j = 1; j < this.r - 1; ++j) { var k = h + j * i; if (k <= e) { f++; } } } if (this.u == null || this.u.length != f) { this.u = new Array(f); } var l = this.u; var m = 0; for (var n = a; n <= b; ++n) { var o = this.v(n); var p = Math.pow(c, n); for (var q = 1; q < this.r - 1; ++q) { var r = o + q * p; if (r <= e) { l[m] = r; m++; } } } return l; }; LogarithmicTickmarkValues.$t = markType(LogarithmicTickmarkValues, 'LogarithmicTickmarkValues', TickmarkValues.$); LogarithmicTickmarkValues.z = DependencyProperty.i("LogarithmBase", Number_$type, LogarithmicTickmarkValues.$, new PropertyMetadata(2, 10, function (a, b) { })); return LogarithmicTickmarkValues; }(TickmarkValues)); export { LogarithmicTickmarkValues };