igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
1,437 lines • 75.2 kB
JavaScript
/*
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, __values } from "tslib";
import { AxisLabelPanelBase } from "./AxisLabelPanelBase";
import { Boolean_$type, typeCast, markType, Point_$type, typeGetValue, fromEnum, runOn, Number_$type, enumGetBox, markDep } from "igniteui-angular-core";
import { AxisLabelPanelBaseView } from "./AxisLabelPanelBaseView";
import { Rect } from "igniteui-angular-core";
import { Extensions } from "igniteui-angular-core";
import { Axis } from "./Axis";
import { List$1 } from "igniteui-angular-core";
import { AxisAngleLabelMode_$type } from "./AxisAngleLabelMode";
import { LabelPosition } from "./LabelPosition";
import { XamDataChart } from "./XamDataChart";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { IAngleScaler_$type } from "./IAngleScaler";
import { CategoryAxisRenderer } from "./CategoryAxisRenderer";
import { DependencyProperty } from "igniteui-angular-core";
import { PolarAxisRenderingManager } from "./PolarAxisRenderingManager";
import { AxisLabelManager } from "./AxisLabelManager";
import { ViewportUtils } from "./ViewportUtils";
import { GeometryUtil } from "igniteui-angular-core";
import { RadialAxisRenderingParameters } from "./RadialAxisRenderingParameters";
import { CategoryTickmarkValues } from "./CategoryTickmarkValues";
import { SeriesViewer } from "./SeriesViewer";
import { ScalerParams } from "./ScalerParams";
import { AxisRangeChangedEventArgs } from "./AxisRangeChangedEventArgs";
import { LineGeometry } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { RangeInfo } from "./RangeInfo";
import { isNaN_, isInfinity } from "igniteui-angular-core";
import { NumericAxisBase } from "./NumericAxisBase";
import { LogarithmicTickmarkValues } from "./LogarithmicTickmarkValues";
import { PolarAxisRenderingParameters } from "./PolarAxisRenderingParameters";
import { MathUtil } from "igniteui-angular-core";
import { RadialAxisLabelPanel } from "./RadialAxisLabelPanel";
import { LinearTickmarkValues } from "./LinearTickmarkValues";
import { IPolarRadialRenderingParameters_$type } from "./IPolarRadialRenderingParameters";
import { PathGeometry } from "igniteui-angular-core";
import { PathFigure } from "igniteui-angular-core";
import { ArcSegment } from "igniteui-angular-core";
import { Size } from "igniteui-angular-core";
import { CategoryAxisBaseView } from "./CategoryAxisBaseView";
import { AxisDefaults } from "./AxisDefaults";
import { NumericAxisBaseView } from "./NumericAxisBaseView";
/**
* @hidden
*/
var AngleAxisLabelPanel = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(AngleAxisLabelPanel, _super);
function AngleAxisLabelPanel() {
var _this = _super.call(this) || this;
_this.da = false;
_this.di = null;
_this.df = 0;
_this.dc = 0;
_this.de = 0;
_this.dd = 0;
_this.db = 0;
return _this;
}
AngleAxisLabelPanel.prototype.ae = function () {
return new AngleAxisLabelPanelView(this);
};
AngleAxisLabelPanel.prototype.ch = function (a) {
_super.prototype.ch.call(this, a);
this.c9 = a;
};
AngleAxisLabelPanel.prototype.at = function (a, b) {
if (!Extensions.b(b)) {
return false;
}
if (this.ad == null || this.ad.kh.isEmpty) {
return _super.prototype.at.call(this, a, b);
}
return true;
};
AngleAxisLabelPanel.prototype.a5 = function () {
var a = new List$1(Rect.$, 0);
var b = new List$1(Boolean_$type, 0);
if (this.bb.count != this.ba.count) {
return a;
}
var c = 1;
if (typeCast(CategoryAngleAxis.$, this.ad) !== null) {
c = this.ad.mm();
}
else if (typeCast(NumericAngleAxis.$, this.ad) !== null) {
c = this.ad.n1();
}
if (c == 2) {
this.c9.a0(a, b);
}
else {
this.c9.a1(a, b);
}
var d = false;
this.ao = this.an(a, b);
if (!this.ad.b8()) {
d = true;
switch (c) {
case 1:
this.dk();
break;
case 2:
this.dj();
break;
}
}
else {
d = true;
this.c9.ac();
}
if (d) {
for (var e = 0; e < a.count; e++) {
var f = this.bb._inner[e];
var g = this.ba._inner[e];
var h = a._inner[e];
var i = this.di(g.c, h.width, h.height);
var j = i.x - this.bk(f) / 2;
var k = i.y - this.bj(f) / 2;
h.x = j;
h.y = k;
a._inner[e] = h;
}
}
return a;
};
AngleAxisLabelPanel.prototype.dk = function () {
this.bh = this.df / 2;
this.bh = this.bh + this.dg();
};
AngleAxisLabelPanel.prototype.dj = function () {
this.bh = 5;
this.bh = this.bh + this.dh();
};
AngleAxisLabelPanel.prototype.dh = function () {
var a;
var b;
b = this.ad;
a = null;
if (b != null) {
a = typeCast(XamDataChart.$, b.bi);
}
if (a == null || b == null) {
return 0;
}
var c = new List$1(Axis.$, 0);
for (var d = 0; d < a.axes.count; d++) {
var e = a.axes._inner[d];
if ((typeCast(NumericAngleAxis.$, e) !== null || typeCast(CategoryAngleAxis.$, e) !== null) && typeCast(AngleAxisLabelPanel.$, e.aw) !== null && e.aw.bb.count > 0 && (!e.b8()) && !e.b5() && (e.aj == null || this.ad.aj == null || e.aj.n7 == b.aj.n7)) {
c.add(e);
}
}
var f = c.indexOf(b);
if (f == -1) {
return 0;
}
var g = 0;
if (f > 0) {
if (typeCast(CategoryAngleAxis.$, c._inner[f - 1]) !== null) {
var h = c._inner[f - 1];
if (h.ml == 2) {
g += h.aw.db;
}
else {
g += c._inner[f - 1].aw.bh;
}
}
else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) {
var i = c._inner[f - 1];
if (i.ml == 2) {
g += i.aw.db;
}
else {
g += c._inner[f - 1].aw.bh;
}
}
}
return g;
};
AngleAxisLabelPanel.prototype.dg = function () {
var a;
var b;
b = this.ad;
a = null;
if (b != null) {
a = typeCast(XamDataChart.$, b.bi);
}
if (a == null || b == null) {
return 0;
}
var c = new List$1(Axis.$, 0);
for (var d = 0; d < a.axes.count; d++) {
var e = a.axes._inner[d];
if ((typeCast(NumericAngleAxis.$, e) !== null || typeCast(CategoryAngleAxis.$, e) !== null) && typeCast(AngleAxisLabelPanel.$, e.aw) !== null && e.aw.bb.count > 0 && (!e.b8()) && !e.b5() && (e.aj == null || this.ad.aj == null || e.aj.n7 == b.aj.n7)) {
c.add(e);
}
}
var f = c.indexOf(b);
if (f == -1) {
return 0;
}
var g = 0;
var h = 5;
if (f == 0) {
g += h;
}
else {
if (typeCast(CategoryAngleAxis.$, c._inner[f - 1]) !== null) {
var i = c._inner[f - 1];
if (i.ml == 2) {
g += i.aw.db;
}
else {
g += c._inner[f - 1].aw.bh;
}
}
else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) {
var j = c._inner[f - 1];
if (j.n0 == 2) {
g += j.aw.db;
}
else {
g += c._inner[f - 1].aw.bh;
}
}
g += c._inner[f].aw.bh * 2 + h;
}
return g;
};
AngleAxisLabelPanel.prototype.ai = function () {
return 4;
};
AngleAxisLabelPanel.prototype.ay = function (a) {
return a == 4 || a == 5;
};
AngleAxisLabelPanel.$t = markType(AngleAxisLabelPanel, 'AngleAxisLabelPanel', AxisLabelPanelBase.$);
return AngleAxisLabelPanel;
}(AxisLabelPanelBase));
export { AngleAxisLabelPanel };
/**
* @hidden
*/
var CategoryAngleAxis = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(CategoryAngleAxis, _super);
function CategoryAngleAxis() {
var _this = _super.call(this) || this;
_this.mt = null;
_this.mq = null;
_this.mu = false;
_this.m1 = NaN;
_this.mr = null;
_this.m2 = 0;
_this.mz = 0;
_this.m0 = 0;
_this.nf = 1;
_this.ab = CategoryAngleAxis.$;
_this.mq = _this.mp();
_this.mt = new PolarAxisRenderingManager();
return _this;
}
CategoryAngleAxis.prototype.a4 = function () {
return new CategoryAngleAxisView(this);
};
CategoryAngleAxis.prototype.hv = function (a) {
_super.prototype.hv.call(this, a);
this.mo = a;
};
CategoryAngleAxis.prototype.get_b9 = function () {
return true;
};
CategoryAngleAxis.prototype.av = function () {
var _this = this;
var a = new AngleAxisLabelPanel();
a.di = function (b, c, d) {
var e = _this.bi != null ? _this.bi.v4 : Rect.empty;
var f = !e.isEmpty ? _this.kh : Rect.empty;
var g = _this.kc();
switch (_this.ml) {
case 2: return _this.nw(b, c, d, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, _this.aw.bh);
case 0:
case 1:
default: return _this.nx(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, _this.aw.bh);
}
};
return a;
};
CategoryAngleAxis.prototype.mx = function (a) {
return false;
};
CategoryAngleAxis.prototype.nk = function () {
return null;
};
CategoryAngleAxis.prototype.nd = function (a) {
return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
};
CategoryAngleAxis.prototype.mp = function () {
var _this = this;
var a = ((function () {
var $ret = new AxisLabelManager();
$ret.a = _this;
$ret.f = _this.de;
$ret.e = _this.dd;
$ret.b = _this.aw;
return $ret;
})());
if (this.az != null) {
this.az.registerAxis(this);
}
var b = new CategoryAxisRenderer(a);
b.u = function () {
var c = _this.a5.a4();
var d = _this.a5.a7();
var e = _this.a5.a5();
var f = _this.a5.a6();
_this.ip();
_this.hk(c);
_this.hk(d);
_this.hk(e);
_this.hk(f);
};
b.o = function (c, d) { return !d.isEmpty && !c.isEmpty && _this.ms != null; };
b.d = function (c, d, e, f) { return _this.mn(c, d, e, f); };
b.v = function () {
if (!_this.mu) {
_this.mu = true;
_this.ms.c1();
_this.mu = false;
}
};
b.g = function (c, d) {
var e = typeGetValue(c);
if (e == _this.lj - 1) {
if (_this.cl) {
if (_this.mx(e)) {
return _this.nk();
}
}
}
if (e > _this.lj - 1) {
e -= _this.lj;
}
if (_this.my(e)) {
return null;
}
var f = _this.kv.item(e);
return _this.f1(f);
};
b.b.c = function (c) {
var e_1, _a;
if ((_this.az == null || _this.az.visibility == 0) && _this.ms != null && _this.m1 != c) {
var d = typeCast(XamDataChart.$, _this.bi);
if (d == null) {
return;
}
_this.m1 = c;
_this.aw.bg = c;
d.n3();
try {
for (var _b = __values(fromEnum(d.axes)), _c = _b.next(); !_c.done; _c = _b.next()) {
var e = _c.value;
if (e != _this && typeCast(AngleAxisLabelPanel.$, e.aw) !== null) {
e.a5.ai();
}
}
}
catch (e_1_1) {
e_1 = { error: e_1_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_1)
throw e_1.error;
}
}
}
};
b.k = function (c, d, e) {
var f = typeCast(RadialAxisRenderingParameters.$, c);
_this.mt.o(d, e, c.aa, c.z, c.ab, f.minLength, f.maxLength, f.center);
};
b.l = function (c, d, e, f) {
var g = typeCast(RadialAxisRenderingParameters.$, c);
_this.mt.p(d, e, f, g.aa, g.z, c.ab, g.minLength, g.maxLength, g.center);
};
b.m = function (c, d) { return _this.getScaledAngle(d); };
b.q = function (c, d) {
if (_this.nd(d - _this.m2) < 0) {
return false;
}
if (_this.nd(d - _this.m2 - (2 * Math.PI)) > 0) {
return false;
}
return true;
};
b.j = function (c) {
var d = typeCast(RadialAxisRenderingParameters.$, c);
if (d.e == d.k._inner[0]) {
_this.mt.k(c.u, c.n, c.aa, c.z, c.ab, d.center, d.minAngle, d.maxAngle);
}
};
b.e = function (c) {
c.n = _this.m5();
c.r = c.n;
};
b.p = function (c, d, e) {
var f = typeCast(RadialAxisRenderingParameters.$, c);
if (e) {
return false;
}
var g = _this.nx(d, f.center, c.ab, c.aa, c.z, 0);
if (g.x < c.aa.right && g.x >= c.aa.left && g.y < c.aa.bottom && g.y >= c.aa.top) {
return true;
}
return false;
};
b.a = function (c, d, e, f) {
var g = c.z;
var h = new ScalerParams(0, c.ab, c.aa, _this.ch, g);
var i = d;
if (_this.categoryMode != 0) {
var j = (e * f) + 1;
j = Math.min(j, _this.lj);
var k = _this.el(j, h);
i = (d + k) / 2;
}
return i;
};
b.f = runOn(this, this.getGroupCenter);
b.i = runOn(this, this.na);
return b;
};
CategoryAngleAxis.prototype.my = function (a) {
return false;
};
CategoryAngleAxis.prototype.nx = function (a, b, c, d, e, f) {
var g = this.m5();
var h = ViewportUtils.a(f, c, d, e);
if (this.az != null && (this.az.c == 5 || this.az.c == 1)) {
h *= -1;
}
var i = b.x + (g + h) * Math.cos(a);
var j = b.y + (g + h) * Math.sin(a);
i = ViewportUtils.e(i, c, d, e);
j = ViewportUtils.i(j, c, d, e);
return { $type: Point_$type, x: i, y: j };
};
CategoryAngleAxis.prototype.nw = function (a, b, c, d, e, f, g, h) {
if (!isNaN_(b) && !isNaN_(c)) {
var i = this.m5();
var j = b / f.width;
var k = c / f.width;
var l = ViewportUtils.a(h, e, f, g);
var m = GeometryUtil.l(i, a, j, k);
var n = d.x + (m + l) * Math.cos(a);
var o = d.y + (m + l) * Math.sin(a);
n = ViewportUtils.e(n, e, f, g);
o = ViewportUtils.i(o, e, f, g);
return { $type: Point_$type, x: n, y: o };
}
else {
return this.nx(a, d, e, f, g, h);
}
};
CategoryAngleAxis.prototype.m5 = function () {
if (this.ms == null) {
return 0;
}
if (!this.b5()) {
return this.ms.oc();
}
else {
return this.ms.od((this.fx));
}
};
CategoryAngleAxis.prototype.mn = function (a, b, c, d) {
if (this.kv == null) {
return null;
}
var e = new RadialAxisRenderingParameters();
var f = this.lk - 1;
var g = this.a5.a4();
var h = this.a5.a7();
var i = this.a5.a5();
var j = this.a5.a6();
e.u = g;
e.x = h;
e.v = i;
e.w = j;
e.l = f;
e.m = 0;
e.h = false;
e.aa = a;
e.z = c;
e.y = d;
e.ab = b;
e.g = this.mw();
e.p = this.nb;
e.o = this.e0();
e.s = this.nh();
e.q = this.nc;
e.t = this.f2;
var k = this.mt.h(b, a, c);
var l = this.mt.i(b, a, c);
var m = 0.5 * this.ms.n7;
var n = 0.5 * this.ms.n6;
var o = k;
var p = l;
var q = this.ms.oc();
if (isNaN_(q) || isInfinity(q)) {
return null;
}
if (p >= m) {
p = q;
}
if (o < n) {
o = n;
}
var r = a.width;
this.mt.m(b, a, c, e, 0, this.lk, this.ch, runOn(this, this.getUnscaledAngle), r);
var s = { $type: Point_$type, x: 0.5, y: 0.5 };
e.center = s;
e.maxLength = p;
e.minLength = o;
e.effectiveMaximum = q;
e.af = this.lk;
e.ac = this.categoryMode;
e.ae = true;
e.ad = this.ch;
e.ag = this.ll;
e.f = new CategoryTickmarkValues();
e.j = this.cy;
return e;
};
CategoryAngleAxis.prototype.nh = function () {
return -1;
};
CategoryAngleAxis.prototype.getMinMaxAngle = function (a, b, c, d, e) {
var f = this.mt.n(a, b, c, d, e);
d = f.p3;
e = f.p4;
return {
p3: d,
p4: e
};
};
CategoryAngleAxis.prototype.ac = function () {
_super.prototype.ac.call(this);
this.ib(false);
};
Object.defineProperty(CategoryAngleAxis.prototype, "ms", {
get: function () {
if (this.mr != null) {
return this.mr;
}
var a = typeCast(XamDataChart.$, this.bi);
if (a != null) {
for (var b = 0; b < a.axes.count; b++) {
if (typeCast(NumericRadiusAxis.$, a.axes._inner[b]) !== null) {
return a.axes._inner[b];
}
}
}
return this.mr;
},
set: function (a) {
this.mr = a;
},
enumerable: false,
configurable: true
});
CategoryAngleAxis.prototype.ak = function () {
return this.ms;
};
CategoryAngleAxis.prototype.mm = function () {
if (this.ml == 0) {
return 1;
}
else {
return this.ml;
}
};
CategoryAngleAxis.prototype.getCategorySize = function (a, b, c) {
return 2 * Math.PI / this.lj;
};
CategoryAngleAxis.prototype.get_mv = function () {
return false;
};
Object.defineProperty(CategoryAngleAxis.prototype, "mv", {
get: function () {
return this.get_mv();
},
enumerable: false,
configurable: true
});
CategoryAngleAxis.prototype.m7 = function (a, b, c, d) {
return this.k8(b, c, d);
};
CategoryAngleAxis.prototype.k8 = function (a, b, c) {
var d = this.lf(a, b, c);
var e = 0;
if (!isNaN_(this.le)) {
e = Math.min(this.le, 1);
}
var f = 1 - 0.5 * d;
return this.getCategorySize(a, b, c) * f / (this.ll - (this.ll - 1) * e);
};
CategoryAngleAxis.prototype.m6 = function (a, b, c, d, e) {
return this.getGroupCenter(b, c, d, e);
};
CategoryAngleAxis.prototype.getGroupCenter = function (a, b, c, d) {
var e = 0.5;
if (this.ll > 1) {
var f = this.lf(b, c, d);
var g = 0;
if (!isNaN_(this.le)) {
g = Math.min(this.le, 1);
}
var h = 1 - 0.5 * f;
var i = h / (this.ll - (this.ll - 1) * g);
var j = (h - i) / (this.ll - 1);
e = 0.25 * f + 0.5 * i + a * j;
}
return this.getCategorySize(b, c, d) * e;
};
CategoryAngleAxis.prototype.na = function (a) {
var b = 0.5;
if (this.ll > 1) {
var c = this.lf(Rect.empty, Rect.empty, Rect.empty);
var d = 0;
if (!isNaN_(this.le)) {
d = Math.min(this.le, 1);
}
var e = 1 - 0.5 * c;
var f = e / (this.ll - (this.ll - 1) * d);
var g = (e - f) / (this.ll - 1);
b = 0.25 * c + 0.5 * f + a * g;
}
return b;
};
CategoryAngleAxis.prototype.ic = function (a) {
_super.prototype.ic.call(this, a);
var b = this.bi != null ? this.bi.v4 : Rect.empty;
var c = !b.isEmpty ? this.kh : Rect.empty;
var d = this.kc();
var e = this.kb();
var f = this.mq.c(a, c, b, d, e);
if (f != null) {
this.m3 = f.f.m;
this.m4 = f.f.l;
}
};
CategoryAngleAxis.prototype.m9 = function (a, b, c) {
var d;
var e;
var f = this.mt.n(c, a, b, d, e);
d = f.p3;
e = f.p4;
if (d == 0) {
if (this.ch) {
return this.lj;
}
else {
return 0;
}
}
var g = this.getUnscaledAngle(d);
if (g < 0 || g > this.lj) {
g = this.getUnscaledAngle(d + Math.PI * 2);
}
return g;
};
CategoryAngleAxis.prototype.m8 = function (a, b, c) {
var d;
var e;
var f = this.mt.n(c, a, b, d, e);
d = f.p3;
e = f.p4;
if (e > Math.PI * 2) {
e = e - Math.PI * 2;
}
if (e == Math.PI * 2) {
if (this.ch) {
return 0;
}
else {
return this.lj;
}
}
var g = this.getUnscaledAngle(e);
if (g < 0 || g > this.lj) {
g = this.getUnscaledAngle(e + Math.PI * 2);
}
return g;
};
CategoryAngleAxis.prototype.getScaledAngle = function (a) {
var b = this.lj;
var c = b >= 2 ? (a) / (b) : b == 1 ? 0.5 : NaN;
if (this.ci) {
c = 1 - c;
}
return (c * 2 * Math.PI) + this.m2;
};
CategoryAngleAxis.prototype.getUnscaledAngle = function (a) {
if (a < this.m2) {
a += 2 * Math.PI;
}
var b = (a - this.m2) / (2 * Math.PI);
if (this.ch) {
b = 1 - b;
}
return b * (this.lj);
};
CategoryAngleAxis.prototype.el = function (a, b) {
return this.getScaledAngle(a);
};
CategoryAngleAxis.prototype.eo = function (a, b) {
return this.getUnscaledAngle(a);
};
CategoryAngleAxis.prototype.d5 = function (a) {
var b = { $type: Point_$type, x: 0.5, y: 0.5 };
var c = Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
var d = Math.acos((a.x - b.x) / c);
if ((a.y - b.y) < 0) {
d = (2 * Math.PI) - d;
}
return d;
};
CategoryAngleAxis.prototype.hz = function (a, b, c, d) {
var e_2, _a, e_3, _b, e_4, _c;
_super.prototype.hz.call(this, a, b, c, d);
var e = typeCast(XamDataChart.$, this.bi);
switch (b) {
case "CrossingAxis":
var f = typeCast(NumericRadiusAxis.$, d);
this.nr(f);
if (f != null) {
f.om(this);
}
this.cq = true;
this.ib(false);
break;
case CategoryAngleAxis.$$p[1]:
this.m2 = this.ne;
while (this.m2 < 0) {
this.m2 += 360;
}
while (this.m2 >= 360) {
this.m2 -= 360;
}
this.m2 = (this.m2 * Math.PI) / 180;
this.cq = true;
this.ib(false);
try {
for (var _d = __values(fromEnum(this.df)), _e = _d.next(); !_e.done; _e = _d.next()) {
var g = _e.value;
g.rq(false);
g.qk();
}
}
catch (e_2_1) {
e_2 = { error: e_2_1 };
}
finally {
try {
if (_e && !_e.done && (_a = _d.return))
_a.call(_d);
}
finally {
if (e_2)
throw e_2.error;
}
}
break;
case "Label":
case CategoryAngleAxis.$$p[0]:
if (e != null) {
try {
for (var _f = __values(fromEnum(e.axes)), _g = _f.next(); !_g.done; _g = _f.next()) {
var h = _g.value;
h.cq = true;
h.ia();
}
}
catch (e_3_1) {
e_3 = { error: e_3_1 };
}
finally {
try {
if (_g && !_g.done && (_b = _f.return))
_b.call(_f);
}
finally {
if (e_3)
throw e_3.error;
}
}
}
break;
case "CrossingValue":
if (e != null) {
try {
for (var _h = __values(fromEnum(e.axes)), _j = _h.next(); !_j.done; _j = _h.next()) {
var i = _j.value;
if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) {
i.cq = true;
i.ia();
}
}
}
catch (e_4_1) {
e_4 = { error: e_4_1 };
}
finally {
try {
if (_j && !_j.done && (_c = _h.return))
_c.call(_h);
}
finally {
if (e_4)
throw e_4.error;
}
}
}
break;
case "LabelSettings":
this.mq = this.mp();
this.np();
this.cq = true;
this.ib(false);
break;
}
};
CategoryAngleAxis.prototype.np = function () {
this.m1 = NaN;
};
CategoryAngleAxis.prototype.nr = function (a) {
this.ms = a;
};
Object.defineProperty(CategoryAngleAxis.prototype, "nb", {
get: function () {
return this.c(CategoryAngleAxis.ns);
},
set: function (a) {
this.h(CategoryAngleAxis.ns, a);
},
enumerable: false,
configurable: true
});
Object.defineProperty(CategoryAngleAxis.prototype, "m3", {
get: function () {
return this.mz;
},
set: function (a) {
if (this.m3 != a) {
var b = this.mz;
this.mz = a;
this.h5("ActualInterval", b, this.m3);
}
},
enumerable: false,
configurable: true
});
CategoryAngleAxis.prototype.ex = function () {
return this.m3;
};
Object.defineProperty(CategoryAngleAxis.prototype, "nc", {
get: function () {
return this.c(CategoryAngleAxis.nu);
},
set: function (a) {
this.h(CategoryAngleAxis.nu, a);
},
enumerable: false,
configurable: true
});
Object.defineProperty(CategoryAngleAxis.prototype, "m4", {
get: function () {
return this.m0;
},
set: function (a) {
if (this.m4 != a) {
var b = this.m0;
this.m0 = a;
this.h5("ActualMinorInterval", b, this.m4);
}
},
enumerable: false,
configurable: true
});
CategoryAngleAxis.prototype.mw = function () {
return !isNaN_(this.nb);
};
CategoryAngleAxis.prototype.get_a2 = function () {
return 2;
};
Object.defineProperty(CategoryAngleAxis.prototype, "a2", {
get: function () {
return this.get_a2();
},
enumerable: false,
configurable: true
});
CategoryAngleAxis.prototype.c3 = function () {
if (this.cq && this.c4) {
this.bc = this.bb();
}
if (this.kv == null) {
return false;
}
var a = this.kv.count;
if (a != this.ng) {
var b = new AxisRangeChangedEventArgs(0, 1, 1, this.ng, a);
this.ng = a;
this.h6(b);
return true;
}
return false;
};
Object.defineProperty(CategoryAngleAxis.prototype, "ng", {
get: function () {
return this.nf;
},
set: function (a) {
this.nf = a;
},
enumerable: false,
configurable: true
});
CategoryAngleAxis.prototype.j8 = function (a, b, c, d, e) {
var f = typeCast(RadialAxisRenderingParameters.$, this.mq.d(c, b, d, e));
if (f == null) {
return null;
}
var g = Math.cos(a);
var h = Math.sin(a);
var i = f.center.x + g * f.minLength;
var j = f.center.y + h * f.minLength;
var k = f.center.x + g * f.maxLength;
var l = f.center.y + h * f.maxLength;
i = ViewportUtils.e(i, b, c, d);
j = ViewportUtils.i(j, b, c, d);
k = ViewportUtils.e(k, b, c, d);
l = ViewportUtils.i(l, b, c, d);
var m = new LineGeometry();
m.d = { $type: Point_$type, x: i, y: j };
m.c = { $type: Point_$type, x: k, y: l };
return m;
};
Object.defineProperty(CategoryAngleAxis.prototype, "isVertical", {
get: function () {
return this.cp;
},
enumerable: false,
configurable: true
});
CategoryAngleAxis.prototype.j$d = function (a, b) {
return this.eo.apply(this, arguments);
};
CategoryAngleAxis.prototype.j$c = function (a, b) {
return this.el.apply(this, arguments);
};
CategoryAngleAxis.prototype.j$e = function (a, b, c, d, e) {
this.hp.apply(this, arguments);
};
CategoryAngleAxis.prototype.j$f = function (a, b, c, d) {
this.hq.apply(this, arguments);
};
CategoryAngleAxis.prototype.j$g = function (a, b, c, d) {
this.hr.apply(this, arguments);
};
Object.defineProperty(CategoryAngleAxis.prototype, "j$b", {
get: function () {
return this.ch;
},
enumerable: false,
configurable: true
});
CategoryAngleAxis.prototype.j$a = function () {
return this.ag.apply(this, arguments);
};
CategoryAngleAxis.$t = markType(CategoryAngleAxis, 'CategoryAngleAxis', CategoryAxisBase.$, [IAngleScaler_$type]);
CategoryAngleAxis.ns = DependencyProperty.i("Interval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, function (a, b) {
a.h5("Interval", b.oldValue, b.newValue);
a.ib(false);
}));
CategoryAngleAxis.nu = DependencyProperty.i("MinorInterval", Number_$type, CategoryAngleAxis.$, new PropertyMetadata(2, NaN, function (a, b) {
(typeCast(CategoryAngleAxis.$, a)).h5("MinorInterval", b.oldValue, b.newValue);
(typeCast(CategoryAngleAxis.$, a)).ib(false);
}));
CategoryAngleAxis.$$p = markDep(DependencyProperty, PropertyMetadata, CategoryAngleAxis, 'h5', ['LabelMode:ml:nt', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:ne:nv', [1, 0]]);
return CategoryAngleAxis;
}(CategoryAxisBase));
export { CategoryAngleAxis };
/**
* @hidden
*/
var NumericAngleAxis = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(NumericAngleAxis, _super);
function NumericAngleAxis() {
var _this = _super.call(this) || this;
_this.n5 = null;
_this.n6 = false;
_this.n7 = NaN;
_this.n8 = 0;
_this.n3 = null;
_this.ab = NumericAngleAxis.$;
_this.n5 = new PolarAxisRenderingManager();
_this.k4 = _this.k2();
return _this;
}
NumericAngleAxis.prototype.a4 = function () {
return new NumericAngleAxisView(this);
};
NumericAngleAxis.prototype.hv = function (a) {
_super.prototype.hv.call(this, a);
this.n2 = a;
};
NumericAngleAxis.prototype.get_b9 = function () {
return true;
};
NumericAngleAxis.prototype.av = function () {
var _this = this;
var a = new AngleAxisLabelPanel();
a.di = function (b, c, d) {
var e = _this.bi != null ? _this.bi.v4 : Rect.empty;
var f = !e.isEmpty ? _this.kh : Rect.empty;
var g = _this.kc();
return _this.ok(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, _this.aw.bh);
};
return a;
};
NumericAngleAxis.prototype.n9 = function () {
if (this.n4 == null) {
return 0;
}
if (!this.b5()) {
return this.n4.oc();
}
else {
return this.n4.od((this.fx));
}
};
NumericAngleAxis.prototype.ob = function (a) {
return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
};
NumericAngleAxis.prototype.k2 = function () {
var _this = this;
var a = _super.prototype.k2.call(this);
a.b.c = function (b) {
var e_5, _a;
if ((_this.az == null || _this.az.visibility == 0) && _this.n4 != null && _this.n7 != b) {
var c = typeCast(XamDataChart.$, _this.bi);
if (c == null) {
return;
}
_this.n7 = b;
_this.aw.bg = b;
c.n3();
try {
for (var _b = __values(fromEnum(c.axes)), _c = _b.next(); !_c.done; _c = _b.next()) {
var d = _c.value;
if (d != _this && typeCast(AngleAxisLabelPanel.$, d.aw) !== null) {
d.a5.ai();
}
}
}
catch (e_5_1) {
e_5 = { error: e_5_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_5)
throw e_5.error;
}
}
}
};
a.e = function (b) {
b.n = _this.n9();
b.r = b.n;
};
a.j = function (b) {
var c = typeCast(PolarAxisRenderingParameters.$, b);
if (c.e == c.k._inner[0]) {
_this.n5.k(b.u, b.n, b.aa, b.z, b.ab, c.center, c.minAngle, c.maxAngle);
}
};
a.k = function (b, c, d) {
var e = typeCast(PolarAxisRenderingParameters.$, b);
_this.n5.o(c, d, b.aa, b.z, b.ab, e.minLength, e.maxLength, e.center);
};
a.l = function (b, c, d, e) {
var f = typeCast(PolarAxisRenderingParameters.$, b);
_this.n5.p(c, d, e, f.aa, f.z, b.ab, f.minLength, f.maxLength, f.center);
};
a.d = function (b, c, d, e) {
var f = typeCast(PolarAxisRenderingParameters.$, _this.k5(b, c, d, e));
return f;
};
a.v = function () {
if (!_this.n6) {
_this.n6 = true;
_this.n4.c1();
_this.n6 = false;
}
};
a.m = function (b, c) { return _this.getScaledAngle(c); };
a.o = function (b, c) { return !c.isEmpty && !b.isEmpty && _this.n4 != null; };
a.q = function (b, c) {
if (_this.ob(c - _this.n8) < 0) {
return false;
}
if (_this.ob(c - _this.n8 - (2 * Math.PI)) > 0) {
return false;
}
return true;
};
a.p = function (b, c, d) {
var e = typeCast(PolarAxisRenderingParameters.$, b);
var f = _this.ok(_this.getScaledAngle(e.l), e.center, b.ab, b.aa, b.z, 0);
var g = _this.ok(c, e.center, b.ab, b.aa, b.z, 0);
if (d && MathUtil.g(f.x - g.x, f.y - g.y) < 2) {
return false;
}
if (g.x < b.aa.right && g.x >= b.aa.left && g.y < b.aa.bottom && g.y >= b.aa.top) {
return true;
}
return false;
};
a.r = function (b, c, d, e) {
if (c < b.m && typeCast(LogarithmicTickmarkValues.$, b.f) !== null) {
return b.m;
}
else if (c > b.l && (typeCast(LogarithmicTickmarkValues.$, b.f) !== null || b.h)) {
return b.l;
}
return c;
};
return a;
};
NumericAngleAxis.prototype.ok = function (a, b, c, d, e, f) {
var g = this.n9();
var h = ViewportUtils.a(f, c, d, e);
if (this.az != null && (this.az.c == 5 || this.az.c == 1)) {
h *= -1;
}
var i = b.x + (g + h) * Math.cos(a);
var j = b.y + (g + h) * Math.sin(a);
i = ViewportUtils.e(i, c, d, e);
j = ViewportUtils.i(j, c, d, e);
return { $type: Point_$type, x: i, y: j };
};
NumericAngleAxis.prototype.el = function (a, b) {
return this.getScaledAngle(a);
};
NumericAngleAxis.prototype.getScaledAngle1 = function (a, b, c) {
var d = 0;
if (b) {
d = (Math.log(a) - this.ma) / (this.l9 - this.ma);
}
else {
d = (a - this.l4) / (this.l3 - this.l4);
}
if (c) {
d = 1 - d;
}
return (d * 2 * Math.PI) + this.n8;
};
NumericAngleAxis.prototype.getScaledAngle = function (a) {
return this.getScaledAngle1(a, this.lp, this.ci);
};
NumericAngleAxis.prototype.eo = function (a, b) {
return this.getUnscaledAngle(a);
};
NumericAngleAxis.prototype.getUnscaledAngle = function (a) {
var b = (a - this.n8) / (2 * Math.PI);
if (this.ch) {
b = 1 - b;
}
if (this.lp) {
return Math.exp(b * (this.l9 - this.ma) + this.ma);
}
else {
return this.l4 + b * (this.l3 - this.l4);
}
};
NumericAngleAxis.prototype.n1 = function () {
if (this.n0 == 0) {
return 1;
}
else {
return this.n0;
}
};
NumericAngleAxis.prototype.hz = function (a, b, c, d) {
var e_6, _a, e_7, _b, e_8, _c;
_super.prototype.hz.call(this, a, b, c, d);
var e = typeCast(XamDataChart.$, this.bi);
switch (b) {
case "CrossingAxis":
var f = typeCast(NumericRadiusAxis.$, d);
this.oh(f);
if (f != null) {
f.om(this);
}
this.ib(false);
break;
case NumericAngleAxis.$$p[1]:
this.n8 = this.oc;
while (this.n8 < 0) {
this.n8 += 360;
}
while (this.n8 >= 360) {
this.n8 -= 360;
}
this.n8 = (this.oc * Math.PI) / 180;
this.ib(false);
try {
for (var _d = __values(fromEnum(this.db())), _e = _d.next(); !_e.done; _e = _d.next()) {
var g = _e.value;
g.rq(false);
g.qk();
}
}
catch (e_6_1) {
e_6 = { error: e_6_1 };
}
finally {
try {
if (_e && !_e.done && (_a = _d.return))
_a.call(_d);
}
finally {
if (e_6)
throw e_6.error;
}
}
break;
case "Label":
if (e != null) {
try {
for (var _f = __values(fromEnum(e.axes)), _g = _f.next(); !_g.done; _g = _f.next()) {
var h = _g.value;
h.ia();
}
}
catch (e_7_1) {
e_7 = { error: e_7_1 };
}
finally {
try {
if (_g && !_g.done && (_b = _f.return))
_b.call(_f);
}
finally {
if (e_7)
throw e_7.error;
}
}
}
break;
case "CrossingValue":
if (e != null) {
try {
for (var _h = __values(fromEnum(e.axes)), _j = _h.next(); !_j.done; _j = _h.next()) {
var i = _j.value;
if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) {
i.ia();
}
}
}
catch (e_8_1) {
e_8 = { error: e_8_1 };
}
finally {
try {
if (_j && !_j.done && (_c = _h.return))
_c.call(_h);
}
finally {
if (e_8)
throw e_8.error;
}
}
}
break;
case "LabelSettings":
this.k4 = this.k2();
this.of();
this.cq = true;
this.ib(false);
break;
}
};
NumericAngleAxis.prototype.of = function () {
this.n7 = NaN;
};
NumericAngleAxis.prototype.k6 = function () {
return new PolarAxisRenderingParameters();
};
NumericAngleAxis.prototype.k5 = function (a, b, c, d) {
var e = typeCast(PolarAxisRenderingParameters.$, _super.prototype.k5.call(this, a, b, c, d));
var f = this.n5.h(b, a, c);
var g = this.n5.i(b, a, c);
var h = 0.5 * this.n4.n7;
var i = 0.5 * this.n4.n6;
var j = f;
var k = g;
var l = this.n4.oc();
if (isNaN_(l) || isInfinity(l)) {
return null;
}
if (k >= h) {
k = l;
}
if (j < i) {
j = i;
}
var m = a.width;
this.n5.m(b, a, c, e, this.l4, this.l3, this.ch, runOn(this, this.getUnscaledAngle), m);
var n = { $type: Point_$type, x: 0.5, y: 0.5 };
e.center = n;
e.maxLength = k;
e.minLength = j;
e.effectiveMaximum = l;
return e;
};
NumericAngleAxis.prototype.getMinMaxAngle = function (a, b, c, d, e) {
var f = this.n5.n(a, b, c, d, e);
d = f.p3;
e = f.p4;
return {
p3: d,
p4: e
};
};
NumericAngleAxis.prototype.ic = function (a) {
_super.prototype.ic.call(this, a);
var b = this.bi != null ? this.bi.v4 : Rect.empty;
var c = !b.isEmpty ? this.kh : Rect.empty;
var d = this.kc();
var e = this.kb();
var f = this.k4.c(a, c, b, d, e);
if (f != null) {
this.l2 = f.f.m;
this.l5 = f.f.l;
}
};
Object.defineProperty(NumericAngleAxis.prototype, "n4", {
get: function () {
if (this.n3 != null) {
return this.n3;
}
var a = typeCast(XamDataChart.$, this.bi);
if (a != null) {
for (var b = 0; b < a.axes.count; b++) {
if (a.axes._inner[b].cm) {
return a.axes._inner[b];
}
}
}
return this.n3;
},
set: function (a) {
this.n3 = a;
},
enumerable: false,
configurable: true
});
NumericAngleAxis.prototype.ak = function () {
return this.n4;
};
NumericAngleAxis.prototype.oh = function (a) {
this.n4 = a;
};
NumericAngleAxis.prototype.is = function (a, b) {
_super.prototype.is.call(this, a, b);
if (b.height != a.height || b.width != a.width) {
this.c1();
}
};
NumericAngleAxis.prototype.get_a2 = function () {
return 2;
};
Object.defineProperty(NumericAngleAxis.prototype, "a2", {
get: function () {
return this.get_a2();
},
enumerable: false,
configurable: true
});
NumericAngleAxis.prototype.j8 = function (a, b, c, d, e) {
if (this.n4 == null) {
return null;
}
var f = typeCast(PolarAxisRenderingParameters.$, this.k5(c, b, d, e));
if (f == null) {
return null;
}
var g = Math.cos(a);
var h = Math.sin(a);
var i = f.center.x + g * f.minLength;
var j = f.center.y + h * f.minLength;
var k = f.center.x + g * f.maxLength;
var l = f.center.y + h * f.maxLength;
i = ViewportUtils.e(i, b, c, d);
j = ViewportUtils.i(j, b, c, d);
k = ViewportUtils.e(k, b, c, d);
l = ViewportUtils.i(l, b, c, d);
var m = new LineGeometry();
m.d = { $type: Point_$type, x: i, y: j };
m.c = { $type: Point_$type, x: k, y: l };
return m;
};
NumericAngleAxis.$t = markType(NumericAngleAxis, 'NumericAngleAxis', NumericAxisBase.$, [IAngleScaler_$type]);
NumericAngleAxis.$$p = markDep(DependencyProperty, PropertyMetadata, NumericAngleAxis, 'h5', ['LabelMode:n0:oi', [AxisAngleLabelMode_$type, enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:oc:oj', [1, 0]]);
return NumericAngleAxis;
}(NumericAxisBase));
export { NumericAngleAxis };
/**
* @hidden
*/
var NumericRadiusAxis = /** @class */ /*@__PURE__*/ (function (_super) {
__exten