UNPKG

igniteui-angular-charts

Version:

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

236 lines (235 loc) 7.82 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-angular-core"; import { HorizontalAxisLabelPanel } from "./HorizontalAxisLabelPanel"; import { ScalerParams } from "./ScalerParams"; import { Rect } from "igniteui-angular-core"; import { RangeInfo } from "./RangeInfo"; import { HorizontalLogarithmicScaler } from "./HorizontalLogarithmicScaler"; import { FastHorizontalLinearScaler } from "./FastHorizontalLinearScaler"; import { isNaN_ } from "igniteui-angular-core"; import { StraightNumericAxisBaseView } from "./StraightNumericAxisBaseView"; import { AxisDefaults } from "./AxisDefaults"; /** * @hidden */ export let NumericXAxis = /*@__PURE__*/ (() => { class NumericXAxis extends StraightNumericAxisBase { constructor() { super(); this.ab = NumericXAxis.$; this.ps = this.pq(); } bo() { return new NumericXAxisView(this); } k3(a) { super.k3(a); this.tp = a; } al() { return new NumericXAxis(); } a0() { if (this.eh) { return (TypeRegistrar.create('HorizontalSmartAxisLabelPanel')); } else { return new HorizontalAxisLabelPanel(); } } pq() { let a = super.pq(); 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.b2.pr(); } } }; a.k = (b, c, d) => this.l8(c, d, b.aa, b.b, false); a.l = (b, c, d, e) => this.l9(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.f5(c, e); }; a.q = (b, c) => true; a.j = (b) => this.k1(b.u, b.n, b.aa, b.a, true); a.e = (b) => { b.n = b.aa.bottom; if (this.an != null && this.an.b2 != null) { let c = b.n; let d = b.r; let e = this.l1(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; } f5(a, b) { if (this.s8 != null) { return this.s8.p(a, b); } return this.s7.p(a, b); } f8(a, b) { if (this.s8 != null) { return this.s8.q(a, b); } return this.s7.q(a, b); } ky(a, b, c, d) { if (this.s8 != null) { this.s8.v(a, b, c, d); return; } this.s7.v(a, b, c, d); } kx(a, b, c, d, e) { if (this.s8 != null) { this.s8.u(a, b, c, d, e); return; } this.s7.u(a, b, c, d, e); } kz(a, b, c, d) { if (this.s8 != null) { this.s8.j(a, b, c, d); return; } this.s7.j(a, b, c, d); } tq(a, b) { if (this.b2 == null || isNaN_(a) || isNaN_(b)) { return; } let c = this.td(a, this); let d = this.td(b, this); if (isNaN_(c) || isNaN_(d)) { return; } this.b2.za = new Rect(0, c, this.b2.za.y, d - c, this.b2.za.height); } pt(a, b, c, d) { let e = d; let f = super.pt(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.qs; } else if (this.dn && b.left == 0) { h = this.qs; } if (isNaN_(h)) { h = this.f8(e.left, g); } if (isNaN_(i)) { i = this.f8(e.right, g); } let j = Math.min(h, i); let k = Math.max(h, i); this.qw = j; this.qv = k; f.k.add(((() => { let $ret = new RangeInfo(); $ret.d = j; $ret.c = k; $ret.b = e.width; return $ret; })())); return f; } lw(a) { super.lw(a); let b = this.b2 != null ? this.b2.yr : Rect.empty; let c = !b.isEmpty ? this.o3 : Rect.empty; let d = this.oy(); let e = this.ox(); let f = this.ps.c(a, c, b, d, e); if (f != null) { this.qr = f.f.m; this.qu = f.f.l; } } ma(a, b) { super.ma(a, b); if (b.height != a.height) { this.ec(); } } get_bm() { return 0; } get bm() { return this.get_bm(); } pv() { if (this.qd) { return new HorizontalLogarithmicScaler(); } switch (this.s6) { case 0: return new FastHorizontalLinearScaler(); case 1: return new HorizontalLogarithmicScaler(); } return null; } j$d(a, b) { return this.f8.apply(this, arguments); } j$c(a, b) { return this.f5.apply(this, arguments); } j$e(a, b, c, d, e) { this.kx.apply(this, arguments); } j$f(a, b, c, d) { this.ky.apply(this, arguments); } j$g(a, b, c, d) { this.kz.apply(this, arguments); } get j$b() { return this.dn; } j$a() { return this.ag.apply(this, arguments); } } NumericXAxis.$t = 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.oi = AxisDefaults.axis_MajorBrush; } } NumericXAxisView.$t = markType(NumericXAxisView, 'NumericXAxisView', StraightNumericAxisBaseView.$); return NumericXAxisView; })();