UNPKG

igniteui-angular-charts

Version:

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

147 lines (146 loc) 4.88 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 { fromEnum, markType } from "igniteui-angular-core"; import { NumericYAxis } from "./NumericYAxis"; import { NumericScaler } from "./NumericScaler"; import { AxisRange } from "./AxisRange"; import { PercentChangeAxisRenderer } from "./PercentChangeAxisRenderer"; import { isNaN_ } from "igniteui-angular-core"; import { AutoRangeCalculator } from "./AutoRangeCalculator"; /** * @hidden */ export let PercentChangeYAxis = /*@__PURE__*/ (() => { class PercentChangeYAxis extends NumericYAxis { k7() { return new VerticalPercentChangeScaler(this); } kv() { let a = 1.7976931348623157E+308; let b = -1.7976931348623157E+308; for (let c of fromEnum(this.db())) { let d = c.ay(this); if (d == null) { continue; } let e = c.ix(); if (isNaN_(e) || e == 0) { continue; } let f = d.b - e; let g = e - d.c; let h = Math.abs(f / e * 100); let i = Math.abs(g / e * 100); a = Math.min(a, -i); b = Math.max(b, h); } return new AxisRange(a, b); } k3(a) { return new PercentChangeAxisRenderer(a); } d2(a, b) { let c = ((a - b.b) / b.b) * 100; if (c < this.l4) { let d = ((this.l4 / 100) * b.b) + b.b; return d; } if (c > this.l3) { let e = ((this.l3 / 100) * b.b) + b.b; return e; } return a; } j$d(a, b) { return this.eo.apply(this, arguments); } j$c(a, b) { return this.el.apply(this, arguments); } j$e(a, b, c, d, e) { this.hp.apply(this, arguments); } j$f(a, b, c, d) { this.hq.apply(this, arguments); } j$g(a, b, c, d) { this.hr.apply(this, arguments); } get j$b() { return this.ch; } j$a() { return this.ag.apply(this, arguments); } } PercentChangeYAxis.$t = markType(PercentChangeYAxis, 'PercentChangeYAxis', NumericYAxis.$); return PercentChangeYAxis; })(); /** * @hidden */ export let VerticalPercentChangeScaler = /*@__PURE__*/ (() => { class VerticalPercentChangeScaler extends NumericScaler { constructor(a) { super(); this.ad = null; this.ad = a; } t(a, b, c, d, e) { let f = AutoRangeCalculator.a(this.ad, b, c, false, -1, d, e); d = f.p5; e = f.p6; return { p3: d, p4: e }; } p(a, b) { if (!b.c.isEmpty) { let c = this.ae(a, NumericScaler.ac, b.c, b.b, b.a); c = (c - b.d.top) / b.d.height; c = b.d.top + b.d.height * (c - b.e.top) / b.e.height; return c; } return this.ae(a, b.e, b.d, b.b, b.a); } ae(a, b, c, d, e) { let f; if (isNaN_(d)) { f = a; } else { let g = (a - d) / Math.abs(d) * 100; f = g; } let h = (f - this.o) / this.m; if (!e) { h = 1 - h; } return c.top + c.height * (h - b.top) / b.height; } q(a, b) { let c = b.b; let d = b.e.top + b.e.height * (a - b.d.top) / b.d.height; if (!b.a) { d = 1 - d; } let e = this.o + d * (this.m); let f; if (isNaN_(c)) { f = e; } else { let g = ((e) * Math.abs(c) / 100) + c; f = g; } return f; } } VerticalPercentChangeScaler.$t = markType(VerticalPercentChangeScaler, 'VerticalPercentChangeScaler', NumericScaler.$); return VerticalPercentChangeScaler; })();