igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
175 lines (174 loc) • 6.48 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, __values } from "tslib";
import { FinancialIndicator } from "./FinancialIndicator";
import { String_$type, Number_$type, typeCast, fromEnum, markType } from "igniteui-react-core";
import { DependencyProperty } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { AxisRange } from "./AxisRange";
import { isNaN_ } from "igniteui-react-core";
/**
* @hidden
*/
var StrategyBasedIndicator = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(StrategyBasedIndicator, _super);
function StrategyBasedIndicator() {
var _this = _super.call(this) || this;
_this.acw();
return _this;
}
StrategyBasedIndicator.prototype.acw = function () {
this.ach = this.aci;
this.ab = this.acv;
};
StrategyBasedIndicator.prototype.aco = function () {
return -2147483648;
};
StrategyBasedIndicator.prototype.acx = function (a) {
};
StrategyBasedIndicator.prototype.acq = function () {
return -2147483648;
};
StrategyBasedIndicator.prototype.acn = function () {
return -2147483648;
};
StrategyBasedIndicator.ac1 = function (a, b, c) {
var d = DependencyProperty.i(c, Number_$type, b, new PropertyMetadata(2, a, function (e, f) { return (typeCast(StrategyBasedIndicator.$, e)).raisePropertyChanged(c, f.oldValue, f.newValue); }));
StrategyBasedIndicator.acl.add(c);
return d;
};
StrategyBasedIndicator.ac0 = function (a, b) {
return StrategyBasedIndicator.ac1(a, b, "Period");
};
StrategyBasedIndicator.acy = function (a, b) {
return StrategyBasedIndicator.ac1(a, b, "LongPeriod");
};
StrategyBasedIndicator.ac2 = function (a, b) {
return StrategyBasedIndicator.ac1(a, b, "ShortPeriod");
};
StrategyBasedIndicator.prototype.abu = function (a, b) {
var c = this.x6(a, b);
var d = this.x7(c);
return this.ach.b(c, d);
};
StrategyBasedIndicator.prototype.abr = function (a, b) {
var c = this.x6(a, b);
if (b == 0) {
return false;
}
if (!this.y2(this.abu(a, b))) {
return false;
}
var d = this.x7(c);
if (this.abn != null) {
c.minimumValue = this.abn.c;
c.maximumValue = this.abn.b;
}
var e = this.ach.a(c, d);
for (var f = 0; f < this.abw && f < c.indicatorColumn.count; f++) {
c.indicatorColumn.item(f, NaN);
}
if (this.yc != null && this.ack(c)) {
this.yc.ee();
}
return e;
};
StrategyBasedIndicator.prototype.ack = function (a) {
var e_1, _a;
if (!isNaN_(a.minimumValue) && !isNaN_(a.maximumValue) && a.specifiesRange) {
var b = this.abn;
this.abn = new AxisRange(a.minimumValue, a.maximumValue);
return this.acj(b, this.abn);
}
var c = 1.7976931348623157E+308;
var d = -1.7976931348623157E+308;
try {
for (var _b = __values(fromEnum(a.indicatorColumn)), _c = _b.next(); !_c.done; _c = _b.next()) {
var e = _c.value;
if (!isNaN_(e)) {
c = Math.min(c, e);
d = Math.max(d, e);
}
}
}
catch (e_1_1) {
e_1 = { error: e_1_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_1)
throw e_1.error;
}
}
var f = this.abn;
this.abn = new AxisRange(c, d);
return this.acj(f, this.abn);
};
StrategyBasedIndicator.prototype.acj = function (a, b) {
if (a == null || b == null) {
return true;
}
if (a.c != b.c) {
return true;
}
if (a.b != b.b) {
return true;
}
return false;
};
StrategyBasedIndicator.prototype.acp = function (a) {
if (a == -2147483648) {
return 0;
}
if (a > this.indicatorColumn.count && this.indicatorColumn.count > 0) {
a = this.indicatorColumn.count - 1;
}
if (a < 1) {
return 1;
}
return a;
};
StrategyBasedIndicator.prototype.x6 = function (a, b) {
var c = _super.prototype.x6.call(this, a, b);
c.indicatorColumn = this.indicatorColumn;
c.period = this.acp(this.aco());
c.shortPeriod = this.acp(this.acq());
c.longPeriod = this.acp(this.acn());
c.multiplier = this.acm();
return c;
};
StrategyBasedIndicator.prototype.acm = function () {
return 1;
};
StrategyBasedIndicator.acz = function (a, b) {
var c = DependencyProperty.i("Multiplier", Number_$type, b, new PropertyMetadata(2, a, function (d, e) { return (typeCast(StrategyBasedIndicator.$, d)).raisePropertyChanged("Multiplier", e.oldValue, e.newValue); }));
StrategyBasedIndicator.acl.add("Multiplier");
return c;
};
StrategyBasedIndicator.prototype.rs = function (a, b, c, d) {
_super.prototype.rs.call(this, a, b, c, d);
if (StrategyBasedIndicator.acl.contains(b)) {
if (this.yc != null && !this.yc.ee()) {
this.ya.cd.e(this.im);
this.abr(0, this.indicatorColumn.count);
if (this.abo.cn) {
this.abo.cl.g$m();
}
this.sa(false);
}
}
};
StrategyBasedIndicator.$t = markType(StrategyBasedIndicator, 'StrategyBasedIndicator', FinancialIndicator.$);
StrategyBasedIndicator.acl = new List$1(String_$type, 0);
return StrategyBasedIndicator;
}(FinancialIndicator));
export { StrategyBasedIndicator };