UNPKG

igniteui-react-charts

Version:

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

65 lines (64 loc) 2.62 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 { LogarithmicScaler } from "./LogarithmicScaler"; import { NumericScaler } from "./NumericScaler"; import { markType } from "igniteui-react-core"; import { isNaN_ } from "igniteui-react-core"; /** * @hidden */ var HorizontalLogarithmicScaler = /** @class */ /*@__PURE__*/ (function (_super) { __extends(HorizontalLogarithmicScaler, _super); function HorizontalLogarithmicScaler() { return _super !== null && _super.apply(this, arguments) || this; } HorizontalLogarithmicScaler.prototype.q = function (a, b) { if (!b.c.isEmpty) { var c = b.e.left + b.e.width * (a - b.d.left) / b.d.width; c = (c * b.d.width) + b.d.left; c = this.ag(c, NumericScaler.ac, b.c, b.a); return c; } return this.ag(a, b.e, b.d, b.a); }; HorizontalLogarithmicScaler.prototype.p = function (a, b) { if (!b.c.isEmpty) { var c = this.af(a, NumericScaler.ac, b.c, b.a); c = (c - b.d.left) / b.d.width; c = b.d.left + b.d.width * (c - b.e.left) / b.e.width; return c; } return this.af(a, b.e, b.d, b.a); }; HorizontalLogarithmicScaler.prototype.ag = function (a, b, c, d) { var e = b.left + b.width * (a - c.left) / c.width; if (d) { e = 1 - e; } return Math.exp(e * (this.ad - this.ae) + this.ae); }; HorizontalLogarithmicScaler.prototype.af = function (a, b, c, d) { if (isNaN_(a)) { return NaN; } var e = 0; if (a <= 0) { e = (Math.log(this.o) - this.ae) / (this.ad - this.ae); } else { e = (Math.log(a) - this.ae) / (this.ad - this.ae); } if (d) { e = 1 - e; } return c.left + c.width * (e - b.left) / b.width; }; HorizontalLogarithmicScaler.$t = markType(HorizontalLogarithmicScaler, 'HorizontalLogarithmicScaler', LogarithmicScaler.$); return HorizontalLogarithmicScaler; }(LogarithmicScaler)); export { HorizontalLogarithmicScaler };