igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
337 lines (336 loc) • 12.4 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, __generator, __values } from "tslib";
import { Base, fromEnum, toEnum, Number_$type, markType } from "igniteui-angular-core";
import { IFastItemColumn$1_$type } from "igniteui-angular-core";
import { isNaN_, isInfinity } from "igniteui-angular-core";
/**
* @hidden
*/
var FastItemCoalescingColumn = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(FastItemCoalescingColumn, _super);
function FastItemCoalescingColumn(a, b, c) {
var _this = _super.call(this) || this;
_this.a = null;
_this.b = null;
_this.d = false;
_this.a = a;
_this.b = b;
_this.d = c;
return _this;
}
Object.defineProperty(FastItemCoalescingColumn.prototype, "c", {
get: function () {
return this.b;
},
enumerable: false,
configurable: true
});
FastItemCoalescingColumn.prototype.item = function (a, b) {
if (arguments.length === 2) {
this.b.item(a, b);
return b;
}
else {
if (this.a.isOthersValue(a)) {
return NaN;
}
if (this.a.hasOthersCategory && this.a.othersIndex == a) {
if (!this.d) {
return this.e();
}
var b_1 = this.e() / this.a.othersValue;
return b_1;
}
if (this.d) {
var c = this.a.getNormalizingValueAtIndex(a, this.b.item(a));
return this.b.item(a) / c;
}
else {
return this.b.item(a);
}
}
};
Object.defineProperty(FastItemCoalescingColumn.prototype, "minimum", {
get: function () {
if (this.d) {
return 0;
}
if (this.a.hasOthersCategory) {
return Math.min(this.a.othersValue, this.b.minimum);
}
return this.b.minimum;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FastItemCoalescingColumn.prototype, "maximum", {
get: function () {
if (this.d) {
return 1;
}
if (this.a.hasOthersCategory) {
return Math.max(this.a.othersValue, this.b.maximum);
}
return this.b.maximum;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FastItemCoalescingColumn.prototype, "mayContainUnknowns", {
get: function () {
return this.a.normalizationMayContainUnknowns || this.a.hasOthersCategory || this.b.mayContainUnknowns;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FastItemCoalescingColumn.prototype, "count", {
get: function () {
return this.a.itemsCount;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FastItemCoalescingColumn.prototype, "isReadOnly", {
get: function () {
return this.b.isReadOnly;
},
enumerable: false,
configurable: true
});
Object.defineProperty(FastItemCoalescingColumn.prototype, "propertyName", {
get: function () {
return this.b.propertyName;
},
enumerable: false,
configurable: true
});
FastItemCoalescingColumn.prototype.add = function (a) {
this.b.add(a);
};
FastItemCoalescingColumn.prototype.clear = function () {
this.b.clear();
};
FastItemCoalescingColumn.prototype.contains = function (a) {
return this.b.contains(a);
};
FastItemCoalescingColumn.prototype.copyTo = function (a, b) {
for (var c = 0; c < this.count; c++) {
if (this.d) {
var d = this.a.getNormalizingValueAtIndex(c, this.b.item(c));
a[b + c] = this.b.item(c) / d;
}
else {
a[b + c] = this.b.item(c);
}
if (this.a.hasOthersCategory && c == this.a.othersIndex) {
if (this.d) {
if (!this.d) {
a[b + c] = this.e();
}
else {
var e = this.e() / this.a.othersValue;
a[b + c] = e;
}
}
}
}
};
FastItemCoalescingColumn.prototype._getEnumerator = function () {
var a, _a, _b, b, c, e_1_1, d;
var e_1, _c;
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
a = 0;
_d.label = 1;
case 1:
_d.trys.push([1, 9, 10, 11]);
_a = __values(fromEnum(this.b)), _b = _a.next();
_d.label = 2;
case 2:
if (!!_b.done)
return [3 /*break*/, 8];
b = _b.value;
if (!this.d)
return [3 /*break*/, 4];
c = this.a.getNormalizingValueAtIndex(a, this.b.item(a));
return [4 /*yield*/, this.b.item(a) / c];
case 3:
_d.sent();
return [3 /*break*/, 6];
case 4: return [4 /*yield*/, this.b.item(a)];
case 5:
_d.sent();
_d.label = 6;
case 6:
a++;
_d.label = 7;
case 7:
_b = _a.next();
return [3 /*break*/, 2];
case 8: return [3 /*break*/, 11];
case 9:
e_1_1 = _d.sent();
e_1 = { error: e_1_1 };
return [3 /*break*/, 11];
case 10:
try {
if (_b && !_b.done && (_c = _a.return))
_c.call(_a);
}
finally {
if (e_1)
throw e_1.error;
}
return [7 /*endfinally*/];
case 11:
if (!this.a.hasOthersCategory)
return [3 /*break*/, 15];
if (!!this.d)
return [3 /*break*/, 13];
return [4 /*yield*/, this.e()];
case 12:
_d.sent();
return [3 /*break*/, 15];
case 13:
d = this.e() / this.a.othersValue;
return [4 /*yield*/, d];
case 14:
_d.sent();
_d.label = 15;
case 15: return [2 /*return*/];
}
});
};
FastItemCoalescingColumn.prototype.getEnumerator = function () {
var _this = this;
return toEnum(function () { return _this._getEnumerator(); }).getEnumerator();
};
FastItemCoalescingColumn.prototype.getItem = function (a) {
if (this.a.hasOthersCategory && a == this.a.othersIndex) {
return this.b.minimum;
}
return this.b.getItem(a);
};
FastItemCoalescingColumn.prototype.indexOf = function (a) {
var b = this.b.indexOf(a);
if (b >= 0) {
return b;
}
if (a == this.a.othersValue) {
return this.a.othersIndex;
}
return -1;
};
FastItemCoalescingColumn.prototype.insert = function (a, b) {
this.b.insert(a, b);
};
FastItemCoalescingColumn.prototype.remove = function (a) {
return this.b.remove(a);
};
FastItemCoalescingColumn.prototype.removeAt = function (a) {
this.b.removeAt(a);
};
FastItemCoalescingColumn.prototype._getEnumeratorObject = function () {
var a, _a, _b, b, c, e_2_1, d;
var e_2, _c;
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
a = 0;
_d.label = 1;
case 1:
_d.trys.push([1, 9, 10, 11]);
_a = __values(fromEnum(this.b)), _b = _a.next();
_d.label = 2;
case 2:
if (!!_b.done)
return [3 /*break*/, 8];
b = _b.value;
if (!this.d)
return [3 /*break*/, 4];
c = this.a.getNormalizingValueAtIndex(a, this.b.item(a));
return [4 /*yield*/, this.b.item(a) / c];
case 3:
_d.sent();
return [3 /*break*/, 6];
case 4: return [4 /*yield*/, this.b.item(a)];
case 5:
_d.sent();
_d.label = 6;
case 6:
a++;
_d.label = 7;
case 7:
_b = _a.next();
return [3 /*break*/, 2];
case 8: return [3 /*break*/, 11];
case 9:
e_2_1 = _d.sent();
e_2 = { error: e_2_1 };
return [3 /*break*/, 11];
case 10:
try {
if (_b && !_b.done && (_c = _a.return))
_c.call(_a);
}
finally {
if (e_2)
throw e_2.error;
}
return [7 /*endfinally*/];
case 11:
if (!this.a.hasOthersCategory)
return [3 /*break*/, 15];
if (!!this.d)
return [3 /*break*/, 13];
return [4 /*yield*/, this.e()];
case 12:
_d.sent();
return [3 /*break*/, 15];
case 13:
d = this.e() / this.a.othersValue;
return [4 /*yield*/, d];
case 14:
_d.sent();
_d.label = 15;
case 15: return [2 /*return*/];
}
});
};
FastItemCoalescingColumn.prototype.getEnumeratorObject = function () {
var _this = this;
return toEnum(function () { return _this._getEnumeratorObject(); }).getEnumeratorObject();
};
Object.defineProperty(FastItemCoalescingColumn.prototype, "f", {
get: function () {
return this.e();
},
enumerable: false,
configurable: true
});
FastItemCoalescingColumn.prototype.e = function () {
var a = 0;
for (var b = 0; b < this.count; b++) {
if (this.a.isOthersValue(b)) {
if (!isNaN_(this.b.item(b)) && !isInfinity(this.b.item(b)) && this.b.item(b) >= 0) {
a += this.b.item(b);
}
}
}
return a;
};
FastItemCoalescingColumn.prototype.asArray = function () {
var a = new Array(this.count);
this.copyTo(a, 0);
return a;
};
FastItemCoalescingColumn.$t = markType(FastItemCoalescingColumn, 'FastItemCoalescingColumn', Base.$, [IFastItemColumn$1_$type.specialize(Number_$type)]);
return FastItemCoalescingColumn;
}(Base));
export { FastItemCoalescingColumn };