UNPKG

igniteui-react-charts

Version:

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

236 lines (235 loc) 7.6 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, TypeRegistrar } from "igniteui-react-core"; import { HorizontalAxisLabelPanel } from "./HorizontalAxisLabelPanel"; import { ScalerParams } from "./ScalerParams"; import { Rect } from "igniteui-react-core"; import { RangeInfo } from "./RangeInfo"; import { HorizontalLogarithmicScaler } from "./HorizontalLogarithmicScaler"; import { FastHorizontalLinearScaler } from "./FastHorizontalLinearScaler"; import { isNaN_ } from "igniteui-react-core"; import { StraightNumericAxisBaseView } from "./StraightNumericAxisBaseView"; import { AxisDefaults } from "./AxisDefaults"; /** * @hidden */ export let NumericXAxis = /*@__PURE__*/ (() => { class NumericXAxis extends StraightNumericAxisBase { bo() { return new NumericXAxisView(this); } k6(a) { super.k6(a); this.ts = a; } al() { return new NumericXAxis(); } constructor() { super(); this.ab = NumericXAxis.$; this.pw = this.pu(); } a0() { if (this.ei) { return (TypeRegistrar.create('HorizontalSmartAxisLabelPanel')); } else { return new HorizontalAxisLabelPanel(); } } pu() { let a = super.pu(); a.b.c = (b) => { if ((this.a4 == null || this.a4.visibility == 0) && this.an != null) { this.a1.bl = b; if (this.a4 != null && (this.a4.location == 4 || this.a4.location == 5)) { this.b7.pr(); } } }; a.k = (b, c, d) => this.mb(c, d, b.aa, b.b, false); a.l = (b, c, d, e) => this.mc(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.f6(c, e); }; a.q = (b, c) => true; a.j = (b) => this.k4(b.u, b.n, b.aa, b.a, true); a.e = (b) => { b.n = b.aa.bottom; if (this.an != null && this.an.b7 != null) { let c = b.n; let d = b.r; let e = this.l4(c, d, b.ab, b.aa, b.z, b.aa.top, b.aa.bottom); c = e.p0; d = e.p1; b.n = c; b.r = d; } }; a.p = (b, c, d) => { let e = Math.round(c); return e >= Math.floor(b.aa.left) && e <= Math.ceil(b.aa.right); }; return a; } f6(a, b) { if (this.tb != null) { return this.tb.p(a, b); } return this.ta.p(a, b); } f9(a, b) { if (this.tb != null) { return this.tb.q(a, b); } return this.ta.q(a, b); } k1(a, b, c, d) { if (this.tb != null) { this.tb.v(a, b, c, d); return; } this.ta.v(a, b, c, d); } k0(a, b, c, d, e) { if (this.tb != null) { this.tb.u(a, b, c, d, e); return; } this.ta.u(a, b, c, d, e); } k2(a, b, c, d) { if (this.tb != null) { this.tb.j(a, b, c, d); return; } this.ta.j(a, b, c, d); } tt(a, b) { if (this.b7 == null || isNaN_(a) || isNaN_(b)) { return; } let c = this.tg(a, this); let d = this.tg(b, this); if (isNaN_(c) || isNaN_(d)) { return; } this.b7.za = new Rect(0, c, this.b7.za.y, d - c, this.b7.za.height); } px(a, b, c, d) { let e = d; let f = super.px(a, b, c, d); let g = new ScalerParams(0, b, a, this.dn, c); let h = NaN; let i = NaN; if (!this.dn && b.right == 1) { i = this.qv; } else if (this.dn && b.left == 0) { h = this.qv; } if (isNaN_(h)) { h = this.f9(e.left, g); } if (isNaN_(i)) { i = this.f9(e.right, g); } let j = Math.min(h, i); let k = Math.max(h, i); this.qz = j; this.qy = k; f.k.add(((() => { let $ret = new RangeInfo(); $ret.d = j; $ret.c = k; $ret.b = e.width; return $ret; })())); return f; } lz(a) { super.lz(a); let b = this.b7 != null ? this.b7.yr : Rect.empty; let c = !b.isEmpty ? this.o6 : Rect.empty; let d = this.o1(); let e = this.o0(); let f = this.pw.c(a, c, b, d, e); if (f != null) { this.qu = f.f.m; this.qx = f.f.l; } } md(a, b) { super.md(a, b); if (b.height != a.height) { this.ed(); } } get_bm() { return 0; } get bm() { return this.get_bm(); } pz() { if (this.qg) { return new HorizontalLogarithmicScaler(); } switch (this.s9) { case 0: return new FastHorizontalLinearScaler(); case 1: return new HorizontalLogarithmicScaler(); } return null; } j$d(a, b) { return this.f9.apply(this, arguments); } j$c(a, b) { return this.f6.apply(this, arguments); } j$e(a, b, c, d, e) { this.k0.apply(this, arguments); } j$f(a, b, c, d) { this.k1.apply(this, arguments); } j$g(a, b, c, d) { this.k2.apply(this, arguments); } get j$b() { return this.dn; } j$a() { return this.ag.apply(this, arguments); } } NumericXAxis.$t = /*@__PURE__*/ markType(NumericXAxis, 'NumericXAxis', StraightNumericAxisBase.$, [IScaler_$type]); return NumericXAxis; })(); /** * @hidden */ export let NumericXAxisView = /*@__PURE__*/ (() => { class NumericXAxisView extends StraightNumericAxisBaseView { constructor(a) { super(a); this.bu = null; this.bu = a; } ar() { super.ar(); this.b.ol = AxisDefaults.axis_MajorBrush; } } NumericXAxisView.$t = /*@__PURE__*/ markType(NumericXAxisView, 'NumericXAxisView', StraightNumericAxisBaseView.$); return NumericXAxisView; })();