UNPKG

igniteui-react-charts

Version:

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

96 lines (95 loc) 3.53 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 { Base, Point_$type, markType } from "igniteui-react-core"; import { LeastSquaresFit } from "igniteui-react-core"; import { NotImplementedException } from "igniteui-react-core"; import { isNaN_, isInfinity } from "igniteui-react-core"; /** * @hidden */ var TrendFitCalculator = /** @class */ /*@__PURE__*/ (function (_super) { __extends(TrendFitCalculator, _super); function TrendFitCalculator() { return _super !== null && _super.apply(this, arguments) || this; } TrendFitCalculator.a = function (a, b, c, d, e, f, g, h, i, j, k) { if (d == null) { switch (b) { case 1: d = LeastSquaresFit.k(e, f, g); break; case 2: d = LeastSquaresFit.o(e, f, g); break; case 3: d = LeastSquaresFit.i(e, f, g); break; case 4: d = LeastSquaresFit.p(e, f, g); break; case 5: d = LeastSquaresFit.q(e, f, g); break; case 7: d = LeastSquaresFit.j(e, f, g); break; case 6: d = LeastSquaresFit.l(e, f, g); break; case 8: d = LeastSquaresFit.n(e, f, g); break; default: throw new NotImplementedException(0); } } if (d == null) { return null; } for (var l = 0; l < c.i.width; l += 2) { var m = l / (c.i.width - 1); var n = j + m * (k - j); var o = NaN; switch (b) { case 1: o = LeastSquaresFit.ad(d, n); break; case 2: o = LeastSquaresFit.ah(d, n); break; case 3: o = LeastSquaresFit.ab(d, n); break; case 4: o = LeastSquaresFit.ai(d, n); break; case 5: o = LeastSquaresFit.aj(d, n); break; case 7: o = LeastSquaresFit.ac(d, n); break; case 6: o = LeastSquaresFit.ae(d, n); break; case 8: o = LeastSquaresFit.ag(d, n); break; default: throw new NotImplementedException(0); } n = h(n); o = i(o); if (!isNaN_(o) && !isInfinity(o)) { a.add({ $type: Point_$type, x: n + c.a, y: o }); } } return d; }; TrendFitCalculator.$t = markType(TrendFitCalculator, 'TrendFitCalculator'); return TrendFitCalculator; }(Base)); export { TrendFitCalculator };