igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
97 lines (96 loc) • 4.14 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 { StreamingIndicatorCalculationStrategy } from "./StreamingIndicatorCalculationStrategy";
import { String_$type, fromEnum, toEnum, markType } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
/**
* @hidden
*/
var AccumulationDistributionIndicatorStrategy = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(AccumulationDistributionIndicatorStrategy, _super);
function AccumulationDistributionIndicatorStrategy() {
return _super !== null && _super.apply(this, arguments) || this;
}
AccumulationDistributionIndicatorStrategy.prototype.b = function (a, b) {
var c = new List$1(String_$type, 0);
c.add("CloseColumn");
c.add("LowColumn");
c.add("HighColumn");
c.add("VolumeColumn");
return c;
};
AccumulationDistributionIndicatorStrategy.prototype.a = function (a, b) {
var e_1, _a;
var c = 0;
try {
for (var _b = __values(fromEnum(this.c(a, b))), _d = _b.next(); !_d.done; _d = _b.next()) {
var d = _d.value;
a.indicatorColumn.item(c, d);
c++;
}
}
catch (e_1_1) {
e_1 = { error: e_1_1 };
}
finally {
try {
if (_d && !_d.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_1)
throw e_1.error;
}
}
return true;
};
AccumulationDistributionIndicatorStrategy.prototype._c = function (a, b) {
var c, d, e, f, g, h, i, j, k, l, m, n, o, p;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
c = 0;
d = Number.POSITIVE_INFINITY;
e = Number.NEGATIVE_INFINITY;
f = a.indicatorColumn != null ? a.indicatorColumn.count : 0;
g = a.closeColumn != null ? a.closeColumn.count : 0;
h = a.highColumn != null ? a.highColumn.count : 0;
i = a.volumeColumn != null ? a.volumeColumn.count : 0;
j = Math.min(f, Math.min(g, Math.min(h, i)));
k = 0;
_a.label = 1;
case 1:
if (!(k < j))
return [3 /*break*/, 4];
l = a.closeColumn.item(k);
m = a.lowColumn.item(k);
n = a.highColumn.item(k);
o = a.volumeColumn.item(k);
p = ((l - m) - (n - l)) / (n - m);
c += b.i(p * o);
d = Math.min(d, c);
e = Math.max(e, c);
return [4 /*yield*/, c];
case 2:
_a.sent();
_a.label = 3;
case 3:
++k;
return [3 /*break*/, 1];
case 4: return [2 /*return*/];
}
});
};
AccumulationDistributionIndicatorStrategy.prototype.c = function (a, b) {
var _this = this;
return toEnum(function () { return _this._c(a, b); });
};
AccumulationDistributionIndicatorStrategy.$t = markType(AccumulationDistributionIndicatorStrategy, 'AccumulationDistributionIndicatorStrategy', StreamingIndicatorCalculationStrategy.$);
return AccumulationDistributionIndicatorStrategy;
}(StreamingIndicatorCalculationStrategy));
export { AccumulationDistributionIndicatorStrategy };