UNPKG

igniteui-react-core

Version:
180 lines (179 loc) 7.65 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 { ScatterDataInfo } from "./ScatterDataInfo"; import { List$1 } from "./List$1"; import { BreakEvenItem } from "./BreakEvenItem"; import { fromEnum, Point_$type, markType } from "./type"; import { DataSeriesMemberPathHint } from "./DataSeriesMemberPathHint"; import { LineEquation } from "./LineEquation"; import { Compute } from "./Compute"; import { ShapeChartUtils } from "./ShapeChartUtils"; /** * @hidden */ export let BreakEvenDataInfo = /*@__PURE__*/ (() => { class BreakEvenDataInfo extends ScatterDataInfo { constructor(a) { super(a); this.ac = null; this.ad = null; this.af = null; this.ab = null; this.aa = null; this.ah = null; this.ae = null; this.ag = null; this.u = null; this.z = null; this.x = null; this.w = null; this.v = null; this.y = null; this.ac = new List$1(BreakEvenItem.$, 0); this.af = new List$1(BreakEvenItem.$, 0); this.ad = new List$1(BreakEvenItem.$, 0); this.y = ((() => { let $ret = new DataSeriesMemberPathHint(); $ret.intent = 19; return $ret; })()); this.u = ((() => { let $ret = new DataSeriesMemberPathHint(); $ret.intent = 20; return $ret; })()); this.z = ((() => { let $ret = new DataSeriesMemberPathHint(); $ret.intent = 21; return $ret; })()); this.x = ((() => { let $ret = new DataSeriesMemberPathHint(); $ret.intent = 22; return $ret; })()); this.w = ((() => { let $ret = new DataSeriesMemberPathHint(); $ret.intent = 23; return $ret; })()); this.v = ((() => { let $ret = new DataSeriesMemberPathHint(); $ret.intent = 24; return $ret; })()); } ai() { this.ad.clear(); this.ac.clear(); this.ac.o(this.af); if (this.ac.count == 1) { let a = new BreakEvenItem(); a.FixedCost = this.af._inner[0].FixedCost; a.VariableCost = 0; a.MarginalProfit = 0; a.SalesRevenue = 0; a.Units = 0; this.ac.add(a); } this.ab = ((() => { let $ret = new BreakEvenItem(); $ret.MarginalProfit = 1.7976931348623157E+308; $ret.VariableCost = 1.7976931348623157E+308; $ret.FixedCost = 1.7976931348623157E+308; $ret.SalesRevenue = 1.7976931348623157E+308; $ret.Units = 1.7976931348623157E+308; return $ret; })()); this.aa = ((() => { let $ret = new BreakEvenItem(); $ret.MarginalProfit = -1.7976931348623157E+308; $ret.VariableCost = -1.7976931348623157E+308; $ret.FixedCost = -1.7976931348623157E+308; $ret.SalesRevenue = -1.7976931348623157E+308; $ret.Units = -1.7976931348623157E+308; return $ret; })()); for (let b of fromEnum(this.ac)) { this.ab.VariableCost = Math.min(this.ab.VariableCost, b.VariableCost); this.aa.VariableCost = Math.max(this.aa.VariableCost, b.VariableCost); this.ab.FixedCost = Math.min(this.ab.FixedCost, b.FixedCost); this.aa.FixedCost = Math.max(this.aa.FixedCost, b.FixedCost); this.ab.Units = Math.min(this.ab.Units, b.Units); this.aa.Units = Math.max(this.aa.Units, b.Units); this.ab.MarginalProfit = Math.min(this.ab.MarginalProfit, b.MarginalProfit); this.aa.MarginalProfit = Math.max(this.aa.MarginalProfit, b.MarginalProfit); this.ab.SalesRevenue = Math.min(this.ab.SalesRevenue, b.SalesRevenue); this.aa.SalesRevenue = Math.max(this.aa.SalesRevenue, b.SalesRevenue); } let c = new LineEquation(0, this.ab.Units, this.ab.MarginalProfit, this.aa.Units, this.aa.MarginalProfit); let d = new LineEquation(0, this.ab.Units, this.ab.SalesRevenue, this.aa.Units, this.aa.SalesRevenue); let e = new LineEquation(0, this.ab.Units, this.ab.TotalCost, this.aa.Units, this.aa.TotalCost); let f = new LineEquation(0, this.ab.Units, this.ab.FixedCost, this.aa.Units, this.aa.FixedCost); let g = Compute.a(d, e); let h = Compute.a(c, f); let i = new BreakEvenItem(); i.FixedCost = this.ac._inner[0].FixedCost; i.VariableCost = g.y - i.FixedCost; i.SalesRevenue = g.y; i.MarginalProfit = h.y; i.Units = g.x; let j = new BreakEvenItem(); j.SalesRevenue = g.y; j.Units = g.x; let k = new BreakEvenItem(); k.SalesRevenue = h.y; k.Units = h.x; let l = new BreakEvenItem(); l.SalesRevenue = g.y; l.Units = this.ab.Units; let m = new BreakEvenItem(); m.SalesRevenue = 0; m.Units = g.x; this.ad.add(l); this.ad.add(j); this.ad.add(m); this.ah = new List$1(List$1.$.specialize(Point_$type), 0); this.ah.add(((() => { let $ret = new List$1(Point_$type, 0); $ret.add(h); $ret.add(f.f); $ret.add(c.f); return $ret; })())); this.ae = new List$1(List$1.$.specialize(Point_$type), 0); this.ae.add(((() => { let $ret = new List$1(Point_$type, 0); $ret.add(g); $ret.add(d.g); $ret.add(e.g); return $ret; })())); this.ag = new List$1(List$1.$.specialize(Point_$type), 0); this.ag.add(((() => { let $ret = new List$1(Point_$type, 0); $ret.add(g); $ret.add(e.f); $ret.add(d.f); return $ret; })())); } s(a, b = null) { if (a == null || a.count == 0) { return; } this.z.update(ShapeChartUtils.ab(a).toArray(), b); this.u.update(ShapeChartUtils.q(a).toArray(), b); this.x.update(ShapeChartUtils.z(a).toArray(), b); this.w.update(ShapeChartUtils.w(a).toArray(), b); this.v.update(ShapeChartUtils.v(a).toArray(), b); this.y.update(ShapeChartUtils.x(a).toArray(), b); } } BreakEvenDataInfo.$t = /*@__PURE__*/ markType(BreakEvenDataInfo, 'BreakEvenDataInfo', ScatterDataInfo.$); return BreakEvenDataInfo; })();