UNPKG

igniteui-angular-charts

Version:

Ignite UI Angular charting components for building rich data visualizations for modern web apps.

59 lines (58 loc) 2.27 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 { IndicatorCalculationStrategy } from "./IndicatorCalculationStrategy"; import { String_$type, toEnum, fromEnum, markType } from "igniteui-angular-core"; import { List$1 } from "igniteui-angular-core"; import { isNaN_, isInfinity } from "igniteui-angular-core"; /** * @hidden */ export let ForceIndexIndicatorStrategy = /*@__PURE__*/ (() => { class ForceIndexIndicatorStrategy extends IndicatorCalculationStrategy { b(a, b) { let c = new List$1(String_$type, 0); c.add("CloseColumn"); c.add("VolumeColumn"); c.o(b.a.c); return c; } *_c(a) { let b = 0; let c = a.closeColumn; let d = a.volumeColumn; let e = a.indicatorColumn; if (c != null && d != null) { b = Math.min(c.count, d.count); } if (b > 0) { yield 0; } for (let f = 1; f < b; ++f) { yield d.item(f) * (c.item(f) - c.item(f - 1)); } } c(a) { return toEnum(() => this._c(a)); } a(a, b) { let c = this.c(a); let d = a.period; let e = a.indicatorColumn; if (d != 0 && !isNaN_(d) && !isInfinity(d)) { c = b.a.b(c, a.period); } let f = 0; for (let g of fromEnum(c)) { e.item(f, g); ++f; } return true; } } ForceIndexIndicatorStrategy.$t = markType(ForceIndexIndicatorStrategy, 'ForceIndexIndicatorStrategy', IndicatorCalculationStrategy.$); return ForceIndexIndicatorStrategy; })();