UNPKG

igniteui-react-charts

Version:

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

51 lines (50 loc) 2.31 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 { IndicatorCalculationStrategy } from "./IndicatorCalculationStrategy"; import { String_$type, markType } from "igniteui-react-core"; import { List$1 } from "igniteui-react-core"; import { isNaN_ } from "igniteui-react-core"; /** * @hidden */ var WilliamsPercentRIndicatorStrategy = /** @class */ /*@__PURE__*/ (function (_super) { __extends(WilliamsPercentRIndicatorStrategy, _super); function WilliamsPercentRIndicatorStrategy() { return _super !== null && _super.apply(this, arguments) || this; } WilliamsPercentRIndicatorStrategy.prototype.b = function (a, b) { var c = new List$1(String_$type, 0); c.add("HighColumn"); c.add("LowColumn"); c.add("CloseColumn"); return c; }; WilliamsPercentRIndicatorStrategy.prototype.a = function (a, b) { var c = a.period; var d = a.highColumn; var e = a.lowColumn; for (var f = 0; f < a.count; f++) { var g = Math.min(c, f); var h = -1.7976931348623157E+308; var i = 1.7976931348623157E+308; for (var j = 0; j < g; j++) { if (!isNaN_(d.item(f - j))) { h = Math.max(h, d.item(f - j)); } if (!isNaN_(e.item(f - j))) { i = Math.min(i, e.item(f - j)); } } a.indicatorColumn.item(f, b.i((a.closeColumn.item(f) - h) / (h - i) * 100)); } return true; }; WilliamsPercentRIndicatorStrategy.$t = markType(WilliamsPercentRIndicatorStrategy, 'WilliamsPercentRIndicatorStrategy', IndicatorCalculationStrategy.$); return WilliamsPercentRIndicatorStrategy; }(IndicatorCalculationStrategy)); export { WilliamsPercentRIndicatorStrategy };