UNPKG

igniteui-angular-charts

Version:

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

230 lines (229 loc) 6.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 { StraightNumericAxisBase } from "./StraightNumericAxisBase"; import { IScaler_$type } from "./IScaler"; import { markType } from "igniteui-angular-core"; import { VerticalAxisLabelPanel } from "./VerticalAxisLabelPanel"; import { Rect } from "igniteui-angular-core"; import { ScalerParams } from "./ScalerParams"; import { RangeInfo } from "./RangeInfo"; import { VerticalLogarithmicScaler } from "./VerticalLogarithmicScaler"; import { FastVerticalLinearScaler } from "./FastVerticalLinearScaler"; import { isNaN_ } from "igniteui-angular-core"; import { StraightNumericAxisBaseView } from "./StraightNumericAxisBaseView"; import { AxisDefaults } from "./AxisDefaults"; /** * @hidden */ export class NumericYAxis extends StraightNumericAxisBase { static { this.$t = markType(NumericYAxis, 'NumericYAxis', StraightNumericAxisBase.$, [IScaler_$type]); } bo() { return new NumericYAxisView(this); } constructor() { super(); this.ab = NumericYAxis.$; this.qa = this.p8(); } a0() { return new VerticalAxisLabelPanel(); } al() { return new NumericYAxis(); } get_d3() { return true; } ga() { return this.pe().height; } gc(a, b) { if (this.tp != null) { return this.tp.p(a, b); } return this.to.p(a, b); } lb(a, b, c, d) { if (this.tp != null) { this.tp.v(a, b, c, d); return; } this.to.v(a, b, c, d); } la(a, b, c, d, e) { if (this.tp != null) { this.tp.u(a, b, c, d, e); return; } this.to.u(a, b, c, d, e); } gf(a, b) { if (this.tp != null) { return this.tp.q(a, b); } return this.to.q(a, b); } lc(a, b, c, d) { if (this.tp != null) { this.tp.j(a, b, c, d); return; } this.to.j(a, b, c, d); } t6(a, b) { if (this.b7 == null || isNaN_(a) || isNaN_(b)) { return; } let c = this.tu(a, this); let d = this.tu(b, this); if (isNaN_(c) || isNaN_(d)) { return; } this.b7.ze = new Rect(0, this.b7.ze.x, d, this.b7.ze.width, c - d); } p8() { let a = super.p8(); 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.pt(); } } }; a.k = (b, c, d) => this.le(c, d, b.aa, b.b, false); a.l = (b, c, d, e) => this.lf(c, d, e, b.aa); a.m = (b, c) => { let d = b.z; let e = new ScalerParams(0, b.ab, b.aa, this.ds, d); return this.gc(c, e); }; a.q = (b, c) => true; a.j = (b) => this.ml(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.ds, c); if (this.an != null && this.an.b7 != null) { let e = b.n; let f = b.r; let g = this.me(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; } qb(a, b, c, d) { let e = d; let f = super.qb(a, b, c, d); let g = new ScalerParams(0, b, a, this.dr, c); let h = NaN; let i = NaN; if (!this.dr && b.top == 0) { i = this.q9; } else if (this.dr && b.bottom == 1) { h = this.q9; } if (isNaN_(h)) { h = this.gf(e.bottom, g); } if (isNaN_(i)) { i = this.gf(e.top, g); } let j = Math.min(h, i); let k = Math.max(h, i); this.rd = j; this.rc = 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; } l9(a) { super.l9(a); let b = this.b7 != null ? this.b7.yv : Rect.empty; let c = this.pk; let d = this.pf(); let e = this.pe(); let f = this.qa.c(a, c, b, d, e); if (f != null) { this.q8 = f.f.m; this.rb = f.f.l; } } mn(a, b) { super.mn(a, b); if (b.height != a.height) { this.ei(); } } get_bm() { return 1; } get bm() { return this.get_bm(); } qd() { if (this.qu) { return new VerticalLogarithmicScaler(); } switch (this.tn) { case 0: return new FastVerticalLinearScaler(); case 1: return new VerticalLogarithmicScaler(); } return null; } j$d(a, b) { return this.gf.apply(this, arguments); } j$c(a, b) { return this.gc.apply(this, arguments); } j$e(a, b, c, d, e) { this.la.apply(this, arguments); } j$f(a, b, c, d) { this.lb.apply(this, arguments); } j$g(a, b, c, d) { this.lc.apply(this, arguments); } get j$b() { return this.dr; } j$a() { return this.ag.apply(this, arguments); } } /** * @hidden */ export class NumericYAxisView extends StraightNumericAxisBaseView { static { this.$t = markType(NumericYAxisView, 'NumericYAxisView', StraightNumericAxisBaseView.$); } constructor(a) { super(a); this.bx = null; this.bx = a; } as() { super.as(); this.c.oz = AxisDefaults.axis_MajorBrush; } }