UNPKG

igniteui-react-charts

Version:

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

236 lines (235 loc) 7.61 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 { StraightNumericAxisBase } from "./StraightNumericAxisBase"; import { IScaler_$type } from "./IScaler"; import { markType } from "igniteui-react-core"; import { VerticalAxisLabelPanel } from "./VerticalAxisLabelPanel"; import { Rect } from "igniteui-react-core"; import { ScalerParams } from "./ScalerParams"; import { RangeInfo } from "./RangeInfo"; import { VerticalLogarithmicScaler } from "./VerticalLogarithmicScaler"; import { FastVerticalLinearScaler } from "./FastVerticalLinearScaler"; import { isNaN_ } from "igniteui-react-core"; import { StraightNumericAxisBaseView } from "./StraightNumericAxisBaseView"; import { AxisDefaults } from "./AxisDefaults"; /** * @hidden */ export let NumericYAxis = /*@__PURE__*/ (() => { class NumericYAxis extends StraightNumericAxisBase { bo() { return new NumericYAxisView(this); } constructor() { super(); this.ab = NumericYAxis.$; this.py = this.pw(); } a0() { return new VerticalAxisLabelPanel(); } al() { return new NumericYAxis(); } get_dz() { return true; } f6() { return this.o2().height; } f7(a, b) { if (this.td != null) { return this.td.p(a, b); } return this.tc.p(a, b); } k3(a, b, c, d) { if (this.td != null) { this.td.v(a, b, c, d); return; } this.tc.v(a, b, c, d); } k2(a, b, c, d, e) { if (this.td != null) { this.td.u(a, b, c, d, e); return; } this.tc.u(a, b, c, d, e); } ga(a, b) { if (this.td != null) { return this.td.q(a, b); } return this.tc.q(a, b); } k4(a, b, c, d) { if (this.td != null) { this.td.j(a, b, c, d); return; } this.tc.j(a, b, c, d); } tu(a, b) { if (this.b7 == null || isNaN_(a) || isNaN_(b)) { return; } let c = this.ti(a, this); let d = this.ti(b, this); if (isNaN_(c) || isNaN_(d)) { return; } this.b7.zb = new Rect(0, this.b7.zb.x, d, this.b7.zb.width, c - d); } pw() { let a = super.pw(); a.b.c = (b) => { if (this.a4 == null || this.a4.visibility == 0) { this.a1.bn = b; if (this.a4 != null && (this.a4.location == 7 || this.a4.location == 6)) { this.b7.ps(); } } }; a.k = (b, c, d) => this.k6(c, d, b.aa, b.b, false); a.l = (b, c, d, e) => this.k7(c, d, e, b.aa); a.m = (b, c) => { let d = b.z; let e = new ScalerParams(0, b.ab, b.aa, this.dp, d); return this.f7(c, e); }; a.q = (b, c) => true; a.j = (b) => this.md(b.u, b.n, b.aa, b.a, true); a.e = (b) => { b.n = this.a4 != null && (this.a4.location == 7 || this.a4.location == 3) ? b.aa.right : b.aa.left; let c = b.z; let d = new ScalerParams(0, b.ab, b.aa, this.dp, c); if (this.an != null && this.an.b7 != null) { let e = b.n; let f = b.r; let g = this.l6(e, f, b.ab, b.aa, b.z, b.aa.left, b.aa.right); e = g.p0; f = g.p1; b.n = e; b.r = f; } }; a.p = (b, c, d) => { let e = Math.round(c); return e >= Math.floor(b.aa.top) && e <= Math.ceil(b.aa.bottom); }; return a; } pz(a, b, c, d) { let e = d; let f = super.pz(a, b, c, d); let g = new ScalerParams(0, b, a, this.dn, c); let h = NaN; let i = NaN; if (!this.dn && b.top == 0) { i = this.qx; } else if (this.dn && b.bottom == 1) { h = this.qx; } if (isNaN_(h)) { h = this.ga(e.bottom, g); } if (isNaN_(i)) { i = this.ga(e.top, g); } let j = Math.min(h, i); let k = Math.max(h, i); this.q1 = j; this.q0 = k; let l = ((() => { let $ret = new RangeInfo(); $ret.d = j; $ret.c = k; $ret.b = e.height; return $ret; })()); f.k.add(l); return f; } l1(a) { super.l1(a); let b = this.b7 != null ? this.b7.ys : Rect.empty; let c = this.o8; let d = this.o3(); let e = this.o2(); let f = this.py.c(a, c, b, d, e); if (f != null) { this.qw = f.f.m; this.qz = f.f.l; } } mf(a, b) { super.mf(a, b); if (b.height != a.height) { this.ee(); } } get_bm() { return 1; } get bm() { return this.get_bm(); } p1() { if (this.qi) { return new VerticalLogarithmicScaler(); } switch (this.tb) { case 0: return new FastVerticalLinearScaler(); case 1: return new VerticalLogarithmicScaler(); } return null; } j$d(a, b) { return this.ga.apply(this, arguments); } j$c(a, b) { return this.f7.apply(this, arguments); } j$e(a, b, c, d, e) { this.k2.apply(this, arguments); } j$f(a, b, c, d) { this.k3.apply(this, arguments); } j$g(a, b, c, d) { this.k4.apply(this, arguments); } get j$b() { return this.dn; } j$a() { return this.ag.apply(this, arguments); } } NumericYAxis.$t = /*@__PURE__*/ markType(NumericYAxis, 'NumericYAxis', StraightNumericAxisBase.$, [IScaler_$type]); return NumericYAxis; })(); /** * @hidden */ export let NumericYAxisView = /*@__PURE__*/ (() => { class NumericYAxisView extends StraightNumericAxisBaseView { constructor(a) { super(a); this.bx = null; this.bx = a; } as() { super.as(); this.c.on = AxisDefaults.axis_MajorBrush; } } NumericYAxisView.$t = /*@__PURE__*/ markType(NumericYAxisView, 'NumericYAxisView', StraightNumericAxisBaseView.$); return NumericYAxisView; })();