igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
172 lines (171 loc) • 5.29 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 { TickmarkValues } from "./TickmarkValues";
import { LinearNumericSnapper } from "./LinearNumericSnapper";
import { markType } from "igniteui-angular-core";
import { truncate, isNaN_ } from "igniteui-angular-core";
/**
* @hidden
*/
var LinearTickmarkValues = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(LinearTickmarkValues, _super);
function LinearTickmarkValues() {
var _this = _super.call(this) || this;
_this.y = 0;
_this.x = 0;
_this.t = null;
_this.u = null;
_this.y = 0;
return _this;
}
LinearTickmarkValues.prototype.s = function (a) {
_super.prototype.s.call(this, a);
var b;
if (this.y != 0) {
b = new LinearNumericSnapper(1, a.n, a.m, a.k, this.y, a.h, a.p);
}
else {
b = new LinearNumericSnapper(0, a.n, a.m, a.k, a.h, a.p);
}
this.m = b.g;
if ((a.d) && a.l > 0 && (a.m - a.n) / a.l < 1000) {
this.m = a.l;
}
if (a.i != -1) {
this.m = a.i;
}
if (this.m == 0) {
this.p = 0;
this.q = 0;
}
else {
this.p = truncate(Math.floor((a.n - a.g) / this.m));
this.q = truncate(Math.ceil((a.m - a.g) / this.m));
}
this.r = b.j;
if (a.q != -1) {
this.r = a.q;
}
this.n = a.j;
this.x = a.g;
};
LinearTickmarkValues.prototype.j = function () {
var a = 0;
var b = this.p;
if (!isNaN_(this.m)) {
a = this.q - b + 1;
if (a < 0) {
a = 0;
}
}
if (this.t == null || this.t.length != a) {
this.t = new Array(a);
}
var c = this.t;
for (var d = 0; d < a; ++d) {
var e = this.x + (d + b) * this.m;
c[d] = e;
}
return c;
};
LinearTickmarkValues.prototype.k = function () {
if (this.n > 0) {
return this.w();
}
return this.v();
};
LinearTickmarkValues.prototype.v = function () {
var a = this.p;
var b = this.q;
var c = this.r;
var d = this.m;
var e = this.x;
var f = this.o;
var g = d / c;
var h = 0;
for (var i = a; i < b; ++i) {
if (c > 0) {
for (var j = 1; j < c; ++j) {
var k = e + i * d + (j * g);
if (k <= f) {
h++;
}
}
}
}
if (this.u == null || this.u.length != h) {
this.u = new Array(h);
}
var l = this.u;
var m = 0;
for (var n = a; n < b; ++n) {
if (c > 0) {
for (var o = 1; o < c; ++o) {
var p = e + n * d + (o * g);
if (p <= this.o) {
l[m] = p;
m++;
}
}
}
}
return l;
};
LinearTickmarkValues.prototype.w = function () {
var a = this.p;
var b = this.q;
var c = this.r;
var d = this.m;
var e = this.x;
var f = this.o;
var g = d / c;
var h = 0;
for (var i = a; i < b; ++i) {
var j = e + i * this.m;
var k = this.o;
if (i + 1 <= this.q) {
k = this.x + ((i + 1) * this.m);
}
if (k > this.o) {
k = this.o;
}
while (j < k) {
j += this.n;
if (j < k) {
h++;
}
}
}
if (this.u == null || this.u.length != h) {
this.u = new Array(h);
}
var l = this.u;
var m = 0;
for (var n = a; n < b; ++n) {
var o = e + n * this.m;
var p = this.o;
if (n + 1 <= this.q) {
p = this.x + ((n + 1) * this.m);
}
if (p > this.o) {
p = this.o;
}
while (o < p) {
o += this.n;
if (o < p) {
l[m] = o;
m++;
}
}
}
return l;
};
LinearTickmarkValues.$t = markType(LinearTickmarkValues, 'LinearTickmarkValues', TickmarkValues.$);
return LinearTickmarkValues;
}(TickmarkValues));
export { LinearTickmarkValues };