igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
1,481 lines (1,480 loc) • 68.4 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 { AxisLabelPanelBase } from "./AxisLabelPanelBase";
import { Boolean_$type, typeCast, markType, Number_$type, enumGetBox, Point_$type, typeGetValue, fromEnum, runOn, markDep } from "igniteui-react-core";
import { AxisLabelPanelBaseView } from "./AxisLabelPanelBaseView";
import { Rect } from "igniteui-react-core";
import { Extensions } from "igniteui-react-core";
import { Axis } from "./Axis";
import { List$1 } from "igniteui-react-core";
import { AxisAngleLabelMode_$type } from "./AxisAngleLabelMode";
import { LabelPosition } from "./LabelPosition";
import { XamDataChart } from "./XamDataChart";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { IAngleScaler_$type } from "./IAngleScaler";
import { DependencyProperty } from "igniteui-react-core";
import { CategoryAxisRenderer } from "./CategoryAxisRenderer";
import { PolarAxisRenderingManager } from "./PolarAxisRenderingManager";
import { AxisLabelManager } from "./AxisLabelManager";
import { ViewportUtils } from "./ViewportUtils";
import { GeometryUtil } from "igniteui-react-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-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { RangeInfo } from "./RangeInfo";
import { isNaN_, isInfinity } from "igniteui-react-core";
import { NumericAxisBase } from "./NumericAxisBase";
import { LogarithmicTickmarkValues } from "./LogarithmicTickmarkValues";
import { PolarAxisRenderingParameters } from "./PolarAxisRenderingParameters";
import { MathUtil } from "igniteui-react-core";
import { RadialAxisLabelPanel } from "./RadialAxisLabelPanel";
import { LinearTickmarkValues } from "./LinearTickmarkValues";
import { IPolarRadialRenderingParameters_$type } from "./IPolarRadialRenderingParameters";
import { PathGeometry } from "igniteui-react-core";
import { PathFigure } from "igniteui-react-core";
import { ArcSegment } from "igniteui-react-core";
import { Size } from "igniteui-react-core";
import { CategoryAxisBaseView } from "./CategoryAxisBaseView";
import { AxisDefaults } from "./AxisDefaults";
import { NumericAxisBaseView } from "./NumericAxisBaseView";
/**
* @hidden
*/
export let AngleAxisLabelPanel = /*@__PURE__*/ (() => {
class AngleAxisLabelPanel extends AxisLabelPanelBase {
af() {
return new AngleAxisLabelPanelView(this);
}
cl(a) {
super.cl(a);
this.de = a;
}
constructor() {
super();
this.df = false;
this.dn = null;
this.dk = 0;
this.dh = 0;
this.dj = 0;
this.di = 0;
this.dg = 0;
}
aw(a, b) {
if (!Extensions.b(b)) {
return false;
}
if (this.ae == null || this.ae.o6.isEmpty) {
return super.aw(a, b);
}
return true;
}
ba() {
let a = new List$1(Rect.$, 0);
let b = new List$1(Boolean_$type, 0);
if (this.bg.count != this.bf.count) {
return a;
}
let c = 1;
if (typeCast(CategoryAngleAxis.$, this.ae) !== null) {
c = this.ae.re();
}
else if (typeCast(NumericAngleAxis.$, this.ae) !== null) {
c = this.ae.tb();
}
if (c == 2) {
this.de.a0(a, b);
}
else {
this.de.a1(a, b);
}
let d = false;
this.aq = this.ap(a, b);
if (!this.ae.db()) {
d = true;
switch (c) {
case 1:
this.dq();
break;
case 2:
this.dp();
break;
}
}
else {
d = true;
this.de.ab();
}
if (d) {
for (let e = 0; e < a.count; e++) {
let f = this.bg._inner[e];
let g = this.bf._inner[e];
let h = a._inner[e];
let i = this.dn(g.h, h.width, h.height);
let j = i.x - this.bp(f) / 2;
let k = i.y - this.bo(f) / 2;
h.x = j;
h.y = k;
a._inner[e] = h;
}
}
return a;
}
dq() {
this.bm = this.dk / 2;
this.bm = this.bm + this.dl();
}
dp() {
this.bm = 5;
this.bm = this.bm + this.dm();
}
dm() {
let a;
let b;
b = this.ae;
a = null;
if (b != null) {
a = typeCast(XamDataChart.$, b.b7);
}
if (a == null || b == null) {
return 0;
}
let c = new List$1(Axis.$, 0);
for (let d = 0; d < a.zq.count; d++) {
let e = a.zq._inner[d];
if ((typeCast(NumericAngleAxis.$, e) !== null || typeCast(CategoryAngleAxis.$, e) !== null) && typeCast(AngleAxisLabelPanel.$, e.a1) !== null && e.a1.bg.count > 0 && (!e.db()) && !e.c2() && (e.an == null || this.ae.an == null || e.an.tg == b.an.tg)) {
c.add(e);
}
}
let f = c.indexOf(b);
if (f == -1) {
return 0;
}
let g = 0;
if (f > 0) {
if (typeCast(CategoryAngleAxis.$, c._inner[f - 1]) !== null) {
let h = c._inner[f - 1];
if (h.rd == 2) {
g += h.a1.dg;
}
else {
g += c._inner[f - 1].a1.bm;
}
}
else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) {
let i = c._inner[f - 1];
if (i.rd == 2) {
g += i.a1.dg;
}
else {
g += c._inner[f - 1].a1.bm;
}
}
}
return g;
}
dl() {
let a;
let b;
b = this.ae;
a = null;
if (b != null) {
a = typeCast(XamDataChart.$, b.b7);
}
if (a == null || b == null) {
return 0;
}
let c = new List$1(Axis.$, 0);
for (let d = 0; d < a.zq.count; d++) {
let e = a.zq._inner[d];
if ((typeCast(NumericAngleAxis.$, e) !== null || typeCast(CategoryAngleAxis.$, e) !== null) && typeCast(AngleAxisLabelPanel.$, e.a1) !== null && e.a1.bg.count > 0 && (!e.db()) && !e.c2() && (e.an == null || this.ae.an == null || e.an.tg == b.an.tg)) {
c.add(e);
}
}
let f = c.indexOf(b);
if (f == -1) {
return 0;
}
let g = 0;
let h = 5;
if (f == 0) {
g += h;
}
else {
if (typeCast(CategoryAngleAxis.$, c._inner[f - 1]) !== null) {
let i = c._inner[f - 1];
if (i.rd == 2) {
g += i.a1.dg;
}
else {
g += c._inner[f - 1].a1.bm;
}
}
else if (typeCast(NumericAngleAxis.$, c._inner[f - 1]) !== null) {
let j = c._inner[f - 1];
if (j.ta == 2) {
g += j.a1.dg;
}
else {
g += c._inner[f - 1].a1.bm;
}
}
g += c._inner[f].a1.bm * 2 + h;
}
return g;
}
aj() {
return 4;
}
a3(a) {
return a == 4 || a == 5;
}
}
AngleAxisLabelPanel.$t = /*@__PURE__*/ markType(AngleAxisLabelPanel, 'AngleAxisLabelPanel', AxisLabelPanelBase.$);
return AngleAxisLabelPanel;
})();
/**
* @hidden
*/
export let CategoryAngleAxis = /*@__PURE__*/ (() => {
class CategoryAngleAxis extends CategoryAxisBase {
bo() {
return new CategoryAngleAxisView(this);
}
k6(a) {
super.k6(a);
this.rg = a;
}
al() {
return new CategoryAngleAxis();
}
km(a) {
super.km(a);
this.kp(a, "ActualInterval");
this.kp(a, "ActualMinorInterval");
this.kp(a, "StartAngleOffset");
this.kp(a, "LabelMode");
}
kp(a, b) {
super.kp(a, b);
let c = typeCast(CategoryAngleAxis.$, a);
if (c == null) {
return;
}
let d = this;
if (b == "ActualMinorInterval") {
c.r7 = Axis.gs(d.ry, d.rw);
}
if (b == "ActualInterval") {
c.r6 = Axis.gs(d.rx, d.rv);
}
if (b == "StartAngleOffset") {
c.r6 = Axis.gs(d.rz, d.r9);
}
if (b == "LabelMode") {
c.rd = d.rc != 0 ? d.rc : d.rd;
}
}
get_dc() {
return true;
}
kw(a) {
super.kw(a);
switch (a) {
case CategoryAngleAxis.$$p[0]:
case CategoryAngleAxis.$$p[2]:
this.kr(a);
break;
case CategoryAngleAxis.$$p[1]:
case CategoryAngleAxis.$$p[3]:
this.ks(a);
break;
}
}
constructor() {
super();
this.rl = null;
this.ri = null;
this.rm = false;
this.rt = NaN;
this.rj = null;
this.ru = 0;
this.rr = 0;
this.rs = 0;
this.sa = 1;
this.ab = CategoryAngleAxis.$;
this.ri = this.rh();
this.rl = new PolarAxisRenderingManager();
}
a0() {
let a = new AngleAxisLabelPanel();
a.dn = (b, c, d) => {
let e = this.b7 != null ? this.b7.yr : Rect.empty;
let f = !e.isEmpty ? this.o6 : Rect.empty;
let g = this.o1();
switch (this.rd) {
case 2: return this.sz(b, c, d, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, this.a1.bm);
case 0:
case 1:
default: return this.s0(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, this.a1.bm);
}
};
return a;
}
rp(a) {
return false;
}
sj() {
return null;
}
r8(a) {
return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
}
rh() {
let a = ((() => {
let $ret = new AxisLabelManager();
$ret.a = this;
$ret.f = this.er;
$ret.e = this.eq;
$ret.b = this.a1;
return $ret;
})());
if (this.a4 != null) {
this.a4.registerAxis(this);
}
let b = new CategoryAxisRenderer(a);
b.u = () => {
let c = this.bp.ba();
let d = this.bp.bd();
let e = this.bp.bb();
let f = this.bp.bc();
this.ma();
this.kk(c);
this.kk(d);
this.kk(e);
this.kk(f);
};
b.o = (c, d) => !d.isEmpty && !c.isEmpty && this.rk != null;
b.d = (c, d, e, f) => this.rf(c, d, e, f);
b.v = () => {
if (!this.rm) {
this.rm = true;
this.rk.ed();
this.rm = false;
}
};
b.g = (c, d) => {
let e = typeGetValue(c);
if (e == this.qa - 1) {
if (this.ds) {
if (this.rp(e)) {
return this.sj();
}
}
}
if (e > this.qa - 1) {
e -= this.qa;
}
if (this.rq(e)) {
return null;
}
let f = this.pm.item(e);
return this.hw(f);
};
b.b.c = (c) => {
if ((this.a4 == null || this.a4.visibility == 0) && this.rk != null && this.rt != c) {
let d = typeCast(XamDataChart.$, this.b7);
if (d == null) {
return;
}
this.rt = c;
this.a1.bl = c;
d.pr();
for (let e of fromEnum(d.zq)) {
if (e != this && typeCast(AngleAxisLabelPanel.$, e.a1) !== null) {
e.bp.ao();
}
}
}
};
b.k = (c, d, e) => {
let f = typeCast(RadialAxisRenderingParameters.$, c);
this.rl.o(d, e, c.aa, c.z, c.ab, f.minLength, f.maxLength, f.center);
};
b.l = (c, d, e, f) => {
let g = typeCast(RadialAxisRenderingParameters.$, c);
this.rl.p(d, e, f, g.aa, g.z, c.ab, g.minLength, g.maxLength, g.center);
};
b.m = (c, d) => this.getScaledAngle(d);
b.q = (c, d) => {
if (this.r8(d - this.ru) < 0) {
return false;
}
if (this.r8(d - this.ru - (2 * Math.PI)) > 0) {
return false;
}
return true;
};
b.j = (c) => {
let d = typeCast(RadialAxisRenderingParameters.$, c);
if (d.e == d.k._inner[0]) {
this.rl.k(c.u, c.n, c.aa, c.z, c.ab, d.center, d.minAngle, d.maxAngle);
}
};
b.e = (c) => {
c.n = this.r0();
c.r = c.n;
};
b.p = (c, d, e) => {
let f = typeCast(RadialAxisRenderingParameters.$, c);
if (e) {
return false;
}
let g = this.s0(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 = (c, d, e, f) => {
let g = c.z;
let h = new ScalerParams(0, c.ab, c.aa, this.dn, g);
let i = d;
if (this.categoryMode != 0) {
let j = (e * f) + 1;
j = Math.min(j, this.qa);
let k = this.f6(j, h);
i = (d + k) / 2;
}
return i;
};
b.f = runOn(this, this.getGroupCenter);
b.i = runOn(this, this.r5);
return b;
}
rq(a) {
return false;
}
s0(a, b, c, d, e, f) {
let g = this.r0();
let h = ViewportUtils.a(f, c, d, e);
if (this.a4 != null && (this.a4.c == 5 || this.a4.c == 1)) {
h *= -1;
}
let i = b.x + (g + h) * Math.cos(a);
let 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 };
}
sz(a, b, c, d, e, f, g, h) {
if (!isNaN_(b) && !isNaN_(c)) {
let i = this.r0();
let j = b / f.width;
let k = c / f.width;
let l = ViewportUtils.a(h, e, f, g);
let m = GeometryUtil.i(i, a, j, k);
let n = d.x + (m + l) * Math.cos(a);
let 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.s0(a, d, e, f, g, h);
}
}
r0() {
if (this.rk == null) {
return 0;
}
if (!this.c2()) {
return this.rk.tl();
}
else {
return this.rk.tm((this.hr));
}
}
rf(a, b, c, d) {
if (this.pm == null) {
return null;
}
let e = new RadialAxisRenderingParameters();
let f = this.qb - 1;
let g = this.bp.ba();
let h = this.bp.bd();
let i = this.bp.bb();
let j = this.bp.bc();
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.ro();
e.p = this.r6;
e.o = this.gm();
e.s = this.sc();
e.q = this.r7;
e.t = this.hx;
let k = this.rl.h(b, a, c);
let l = this.rl.i(b, a, c);
let m = 0.5 * this.rk.tg;
let n = 0.5 * this.rk.tf;
let o = k;
let p = l;
let q = this.rk.tl();
if (isNaN_(q) || isInfinity(q)) {
return null;
}
if (p >= m) {
p = q;
}
if (o < n) {
o = n;
}
let r = a.width;
this.rl.m(b, a, c, e, 0, this.qb, this.dn, runOn(this, this.getUnscaledAngle), r);
let 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.qb;
e.ac = this.categoryMode;
e.ae = true;
e.ad = this.dn;
e.ag = this.qc;
e.f = new CategoryTickmarkValues();
e.j = this.ea;
return e;
}
sc() {
return -1;
}
getMinMaxAngle(a, b, c, d, e) {
let f = this.rl.n(a, b, c, d, e);
d = f.p3;
e = f.p4;
return {
p3: d,
p4: e
};
}
ac() {
super.ac();
this.ly(false);
}
get rk() {
if (this.rj != null) {
return this.rj;
}
let a = typeCast(XamDataChart.$, this.b7);
if (a != null) {
for (let b = 0; b < a.zq.count; b++) {
if (typeCast(NumericRadiusAxis.$, a.zq._inner[b]) !== null) {
return a.zq._inner[b];
}
}
}
return this.rj;
}
set rk(a) {
this.rj = a;
}
ap() {
return this.rk;
}
re() {
if (this.rd == 0) {
return 1;
}
else {
return this.rd;
}
}
getCategorySize(a, b, c) {
return 2 * Math.PI / this.qa;
}
get_rn() {
return false;
}
get rn() {
return this.get_rn();
}
r2(a, b, c, d) {
return this.pz(b, c, d);
}
pz(a, b, c) {
let d = this.p6(a, b, c);
let e = 0;
if (!isNaN_(this.p5)) {
e = Math.min(this.p5, 1);
}
let f = 1 - 0.5 * d;
return this.getCategorySize(a, b, c) * f / (this.qc - (this.qc - 1) * e);
}
r1(a, b, c, d, e) {
return this.getGroupCenter(b, c, d, e);
}
getGroupCenter(a, b, c, d) {
let e = 0.5;
if (this.qc > 1) {
let f = this.p6(b, c, d);
let g = 0;
if (!isNaN_(this.p5)) {
g = Math.min(this.p5, 1);
}
let h = 1 - 0.5 * f;
let i = h / (this.qc - (this.qc - 1) * g);
let j = (h - i) / (this.qc - 1);
e = 0.25 * f + 0.5 * i + a * j;
}
return this.getCategorySize(b, c, d) * e;
}
r5(a) {
let b = 0.5;
if (this.qc > 1) {
let c = this.p6(Rect.empty, Rect.empty, Rect.empty);
let d = 0;
if (!isNaN_(this.p5)) {
d = Math.min(this.p5, 1);
}
let e = 1 - 0.5 * c;
let f = e / (this.qc - (this.qc - 1) * d);
let g = (e - f) / (this.qc - 1);
b = 0.25 * c + 0.5 * f + a * g;
}
return b;
}
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.ri.c(a, c, b, d, e);
if (f != null) {
this.rv = f.f.m;
this.rw = f.f.l;
}
}
r4(a, b, c) {
let d;
let e;
let f = this.rl.n(c, a, b, d, e);
d = f.p3;
e = f.p4;
if (d == 0) {
if (this.dn) {
return this.qa;
}
else {
return 0;
}
}
let g = this.getUnscaledAngle(d);
if (g < 0 || g > this.qa) {
g = this.getUnscaledAngle(d + Math.PI * 2);
}
return g;
}
r3(a, b, c) {
let d;
let e;
let f = this.rl.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.dn) {
return 0;
}
else {
return this.qa;
}
}
let g = this.getUnscaledAngle(e);
if (g < 0 || g > this.qa) {
g = this.getUnscaledAngle(e + Math.PI * 2);
}
return g;
}
getScaledAngle(a) {
let b = this.qa;
let c = b >= 2 ? (a) / (b) : b == 1 ? 0.5 : NaN;
if (this.dp) {
c = 1 - c;
}
return (c * 2 * Math.PI) + this.ru;
}
getUnscaledAngle(a) {
if (a < this.ru) {
a += 2 * Math.PI;
}
let b = (a - this.ru) / (2 * Math.PI);
if (this.dn) {
b = 1 - b;
}
return b * (this.qa);
}
f6(a, b) {
return this.getScaledAngle(a);
}
f9(a, b) {
return this.getUnscaledAngle(a);
}
fq(a) {
let b = { $type: Point_$type, x: 0.5, y: 0.5 };
let c = Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
let d = Math.acos((a.x - b.x) / c);
if ((a.y - b.y) < 0) {
d = (2 * Math.PI) - d;
}
return d;
}
la(a, b, c, d) {
super.la(a, b, c, d);
let e = typeCast(XamDataChart.$, this.b7);
switch (b) {
case "CrossingAxis":
let f = typeCast(NumericRadiusAxis.$, d);
this.sq(f);
if (f != null) {
f.tv(this);
}
this.d0 = true;
this.ly(false);
break;
case CategoryAngleAxis.$$p[5]:
this.ru = this.r9;
while (this.ru < 0) {
this.ru += 360;
}
while (this.ru >= 360) {
this.ru -= 360;
}
this.ru = (this.ru * Math.PI) / 180;
this.d0 = true;
this.ly(false);
for (let g of fromEnum(this.es)) {
g.r8(false);
g.q0();
}
break;
case "Label":
case CategoryAngleAxis.$$p[4]:
if (e != null) {
for (let h of fromEnum(e.zq)) {
h.d0 = true;
h.lx();
}
}
break;
case "CrossingValue":
if (e != null) {
for (let i of fromEnum(e.zq)) {
if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) {
i.d0 = true;
i.lx();
}
}
}
break;
case "LabelSettings":
this.ri = this.rh();
this.so();
this.d0 = true;
this.ly(false);
break;
case CategoryAngleAxis.$$p[0]:
case CategoryAngleAxis.$$p[2]:
case CategoryAngleAxis.$$p[1]:
case CategoryAngleAxis.$$p[3]:
this.kw(b);
break;
}
}
so() {
this.rt = NaN;
}
sq(a) {
this.rk = a;
}
get r6() {
return this.c(CategoryAngleAxis.sv);
}
set r6(a) {
this.h(CategoryAngleAxis.sv, a);
}
get rv() {
return this.rr;
}
set rv(a) {
if (this.rv != a) {
let b = this.rr;
this.rr = a;
this.ls("ActualInterval", b, this.rv);
}
}
gi() {
return this.rv;
}
get r7() {
return this.c(CategoryAngleAxis.sx);
}
set r7(a) {
this.h(CategoryAngleAxis.sx, a);
}
get rw() {
return this.rs;
}
set rw(a) {
if (this.rw != a) {
let b = this.rs;
this.rs = a;
this.ls("ActualMinorInterval", b, this.rw);
}
}
ro() {
return !isNaN_(this.r6);
}
get_bm() {
return 2;
}
get bm() {
return this.get_bm();
}
ef() {
if (this.d0 && this.eg) {
this.b1 = this.b0();
}
if (this.pm == null) {
return false;
}
let a = this.pm.count;
if (a != this.sb) {
let b = new AxisRangeChangedEventArgs(0, 1, 1, this.sb, a);
this.sb = a;
this.lt(b);
return true;
}
return false;
}
get sb() {
return this.sa;
}
set sb(a) {
this.sa = a;
}
ov(a, b, c, d, e) {
let f = typeCast(RadialAxisRenderingParameters.$, this.ri.d(c, b, d, e));
if (f == null) {
return null;
}
let g = Math.cos(a);
let h = Math.sin(a);
let i = f.center.x + g * f.minLength;
let j = f.center.y + h * f.minLength;
let k = f.center.x + g * f.maxLength;
let 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);
let m = new LineGeometry();
m.d = { $type: Point_$type, x: i, y: j };
m.c = { $type: Point_$type, x: k, y: l };
return m;
}
get isVertical() {
return this.dy;
}
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);
}
}
CategoryAngleAxis.$t = /*@__PURE__*/ markType(CategoryAngleAxis, 'CategoryAngleAxis', CategoryAxisBase.$, [IAngleScaler_$type]);
CategoryAngleAxis.sv = /*@__PURE__*/ DependencyProperty.i("Interval", Number_$type, CategoryAngleAxis.$, /*@__PURE__*/ new PropertyMetadata(2, NaN, (a, b) => {
a.ls("Interval", b.oldValue, b.newValue);
a.ly(false);
}));
CategoryAngleAxis.sx = /*@__PURE__*/ DependencyProperty.i("MinorInterval", Number_$type, CategoryAngleAxis.$, /*@__PURE__*/ new PropertyMetadata(2, NaN, (a, b) => {
(typeCast(CategoryAngleAxis.$, a)).ls("MinorInterval", b.oldValue, b.newValue);
(typeCast(CategoryAngleAxis.$, a)).ly(false);
}));
CategoryAngleAxis.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, CategoryAngleAxis, 'ls', ['CompanionAxisInterval:rx:sr', [1, NaN], 'CompanionAxisLabelMode:rc:ss', [AxisAngleLabelMode_$type, /*@__PURE__*/ enumGetBox(AxisAngleLabelMode_$type, 0)], 'CompanionAxisMinorInterval:ry:st', [1, NaN], 'CompanionAxisStartAngleOffset:rz:su', [1, NaN], 'LabelMode:rd:sw', [AxisAngleLabelMode_$type, /*@__PURE__*/ enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:r9:sy', [1, 0]]);
return CategoryAngleAxis;
})();
/**
* @hidden
*/
export let NumericAngleAxis = /*@__PURE__*/ (() => {
class NumericAngleAxis extends NumericAxisBase {
bo() {
return new NumericAngleAxisView(this);
}
k6(a) {
super.k6(a);
this.tc = a;
}
al() {
return new NumericAngleAxis();
}
km(a) {
super.km(a);
this.kp(a, "LabelMode");
this.kp(a, "StartAngleOffset");
}
kp(a, b) {
super.kp(a, b);
let c = typeCast(NumericAngleAxis.$, a);
if (c == null) {
return;
}
let d = this;
if (b == "StartAngleOffset") {
c.q5 = Axis.gs(d.tj, d.tn);
}
if (b == "LabelMode") {
c.ta = d.s9 != 0 ? d.s9 : d.ta;
}
}
get_dc() {
return true;
}
constructor() {
super();
this.tf = null;
this.tg = false;
this.th = NaN;
this.ti = 0;
this.td = null;
this.ab = NumericAngleAxis.$;
this.tf = new PolarAxisRenderingManager();
this.pw = this.pu();
}
a0() {
let a = new AngleAxisLabelPanel();
a.dn = (b, c, d) => {
let e = this.b7 != null ? this.b7.yr : Rect.empty;
let f = !e.isEmpty ? this.o6 : Rect.empty;
let g = this.o1();
return this.tz(b, { $type: Point_$type, x: 0.5, y: 0.5 }, e, f, g, this.a1.bm);
};
return a;
}
tk() {
if (this.te == null) {
return 0;
}
if (!this.c2()) {
return this.te.tl();
}
else {
return this.te.tm((this.hr));
}
}
tm(a) {
return Math.round(a * Math.pow(10, 10)) / Math.pow(10, 10);
}
pu() {
let a = super.pu();
a.b.c = (b) => {
if ((this.a4 == null || this.a4.visibility == 0) && this.te != null && this.th != b) {
let c = typeCast(XamDataChart.$, this.b7);
if (c == null) {
return;
}
this.th = b;
this.a1.bl = b;
c.pr();
for (let d of fromEnum(c.zq)) {
if (d != this && typeCast(AngleAxisLabelPanel.$, d.a1) !== null) {
d.bp.ao();
}
}
}
};
a.e = (b) => {
b.n = this.tk();
b.r = b.n;
};
a.j = (b) => {
let c = typeCast(PolarAxisRenderingParameters.$, b);
if (c.e == c.k._inner[0]) {
this.tf.k(b.u, b.n, b.aa, b.z, b.ab, c.center, c.minAngle, c.maxAngle);
}
};
a.k = (b, c, d) => {
let e = typeCast(PolarAxisRenderingParameters.$, b);
this.tf.o(c, d, b.aa, b.z, b.ab, e.minLength, e.maxLength, e.center);
};
a.l = (b, c, d, e) => {
let f = typeCast(PolarAxisRenderingParameters.$, b);
this.tf.p(c, d, e, f.aa, f.z, b.ab, f.minLength, f.maxLength, f.center);
};
a.d = (b, c, d, e) => {
let f = typeCast(PolarAxisRenderingParameters.$, this.px(b, c, d, e));
return f;
};
a.v = () => {
if (!this.tg) {
this.tg = true;
this.te.ed();
this.tg = false;
}
};
a.m = (b, c) => this.getScaledAngle(c);
a.o = (b, c) => !c.isEmpty && !b.isEmpty && this.te != null;
a.q = (b, c) => {
if (this.tm(c - this.ti) < 0) {
return false;
}
if (this.tm(c - this.ti - (2 * Math.PI)) > 0) {
return false;
}
return true;
};
a.p = (b, c, d) => {
let e = typeCast(PolarAxisRenderingParameters.$, b);
let f = this.tz(this.getScaledAngle(e.l), e.center, b.ab, b.aa, b.z, 0);
let g = this.tz(c, e.center, b.ab, b.aa, b.z, 0);
if (d && MathUtil.h(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 = (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;
}
tz(a, b, c, d, e, f) {
let g = this.tk();
let h = ViewportUtils.a(f, c, d, e);
if (this.a4 != null && (this.a4.c == 5 || this.a4.c == 1)) {
h *= -1;
}
let i = b.x + (g + h) * Math.cos(a);
let 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 };
}
f6(a, b) {
return this.getScaledAngle(a);
}
getScaledAngle1(a, b, c) {
let d = 0;
if (b) {
d = (Math.log(a) - this.q7) / (this.q6 - this.q7);
}
else {
d = (a - this.qw) / (this.qv - this.qw);
}
if (c) {
d = 1 - d;
}
return (d * 2 * Math.PI) + this.ti;
}
getScaledAngle(a) {
return this.getScaledAngle1(a, this.qh, this.dp);
}
f9(a, b) {
return this.getUnscaledAngle(a);
}
getUnscaledAngle(a) {
let b = (a - this.ti) / (2 * Math.PI);
if (this.dn) {
b = 1 - b;
}
if (this.qh) {
return Math.exp(b * (this.q6 - this.q7) + this.q7);
}
else {
return this.qw + b * (this.qv - this.qw);
}
}
tb() {
if (this.ta == 0) {
return 1;
}
else {
return this.ta;
}
}
la(a, b, c, d) {
super.la(a, b, c, d);
let e = typeCast(XamDataChart.$, this.b7);
switch (b) {
case "CrossingAxis":
let f = typeCast(NumericRadiusAxis.$, d);
this.tu(f);
if (f != null) {
f.tv(this);
}
this.ly(false);
break;
case NumericAngleAxis.$$p[3]:
this.ti = this.tn;
while (this.ti < 0) {
this.ti += 360;
}
while (this.ti >= 360) {
this.ti -= 360;
}
this.ti = (this.tn * Math.PI) / 180;
this.ly(false);
for (let g of fromEnum(this.eo())) {
g.r8(false);
g.q0();
}
break;
case "Label":
if (e != null) {
for (let h of fromEnum(e.zq)) {
h.lx();
}
}
break;
case "CrossingValue":
if (e != null) {
for (let i of fromEnum(e.zq)) {
if (typeCast(NumericAngleAxis.$, i) !== null || typeCast(CategoryAngleAxis.$, i) !== null) {
i.lx();
}
}
}
break;
case "LabelSettings":
this.pw = this.pu();
this.ts();
this.d0 = true;
this.ly(false);
break;
case NumericAngleAxis.$$p[0]:
case NumericAngleAxis.$$p[1]:
this.kw(b);
break;
}
}
kw(a) {
super.kw(a);
switch (a) {
case NumericAngleAxis.$$p[0]:
case NumericAngleAxis.$$p[1]:
this.ks(a);
break;
}
}
ts() {
this.th = NaN;
}
py() {
return new PolarAxisRenderingParameters();
}
px(a, b, c, d) {
let e = typeCast(PolarAxisRenderingParameters.$, super.px(a, b, c, d));
let f = this.tf.h(b, a, c);
let g = this.tf.i(b, a, c);
let h = 0.5 * this.te.tg;
let i = 0.5 * this.te.tf;
let j = f;
let k = g;
let l = this.te.tl();
if (isNaN_(l) || isInfinity(l)) {
return null;
}
if (k >= h) {
k = l;
}
if (j < i) {
j = i;
}
let m = a.width;
this.tf.m(b, a, c, e, this.qw, this.qv, this.dn, runOn(this, this.getUnscaledAngle), m);
let n = { $type: Point_$type, x: 0.5, y: 0.5 };
e.center = n;
e.maxLength = k;
e.minLength = j;
e.effectiveMaximum = l;
return e;
}
getMinMaxAngle(a, b, c, d, e) {
let f = this.tf.n(a, b, c, d, e);
d = f.p3;
e = f.p4;
return {
p3: d,
p4: e
};
}
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;
}
}
get te() {
if (this.td != null) {
return this.td;
}
let a = typeCast(XamDataChart.$, this.b7);
if (a != null) {
for (let b = 0; b < a.zq.count; b++) {
if (a.zq._inner[b].du) {
return a.zq._inner[b];
}
}
}
return this.td;
}
set te(a) {
this.td = a;
}
ap() {
return this.te;
}
tu(a) {
this.te = a;
}
md(a, b) {
super.md(a, b);
if (b.height != a.height || b.width != a.width) {
this.ed();
}
}
get_bm() {
return 2;
}
get bm() {
return this.get_bm();
}
ov(a, b, c, d, e) {
if (this.te == null) {
return null;
}
let f = typeCast(PolarAxisRenderingParameters.$, this.px(c, b, d, e));
if (f == null) {
return null;
}
let g = Math.cos(a);
let h = Math.sin(a);
let i = f.center.x + g * f.minLength;
let j = f.center.y + h * f.minLength;
let k = f.center.x + g * f.maxLength;
let 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);
let 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 = /*@__PURE__*/ markType(NumericAngleAxis, 'NumericAngleAxis', NumericAxisBase.$, [IAngleScaler_$type]);
NumericAngleAxis.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, NumericAngleAxis, 'ls', ['CompanionAxisLabelMode:s9:tv', [AxisAngleLabelMode_$type, /*@__PURE__*/ enumGetBox(AxisAngleLabelMode_$type, 0)], 'CompanionAxisStartAngleOffset:tj:tw', [1, NaN], 'LabelMode:ta:tx', [AxisAngleLabelMode_$type, /*@__PURE__*/ enumGetBox(AxisAngleLabelMode_$type, 0)], 'StartAngleOffset:tn:ty', [1, 0]]);
return NumericAngleAxis;
})();
/**
* @hidden
*/
export let NumericRadiusAxis = /*@__PURE__*/ (() => {
class NumericRadiusAxis extends NumericAxisBase {
bo() {
return new NumericRadiusAxisView(this);
}
k6(a) {
super.k6(a);
this.tb = a;
}
al() {
return new NumericRadiusAxis();
}
km(a) {
super.km(a);
this.kp(a, "InnerRadiusExtentScale");
this.kp(a, "RadiusExtentScale");
}
kp(a, b) {
super.kp(a, b);
let c = typeCast(NumericRadiusAxis.$, a);
if (c == null) {
return;
}
let d = this;
if (b == "InnerRadiusExtentScale") {
c.tp = d.tp;
}
if (b == "RadiusExtentScale") {
c.tq = d.tq;
}
}
get_du() {
return true;
}
f5() {
let a = this.tg;
let b = this.tf;
let c = Math.min(this.tk(), this.tj()) * (a - b) / 2;
c = Math.max(c, 14);
return c;
}
tk() {
return this.o6.width;
}
tj() {
return this.o6.height;
}
constructor() {
super();
this.tc = null;
this.td = false;
this.te = NaN;
this.tg = 0;
this.tf = 0;
this.ti = 0;
this.s9 = null;
this.ab = NumericRadiusAxis.$;
this.tg = this.tq;
this.tf = this.tp;
this.tc = new PolarAxisRenderingManager();
this.pw = this.pu();
}
a0() {
return new RadialAxisLabelPanel();
}
th(a) {
if (a == null) {
return 0;
}
return a;
}
pu() {
let a = super.pu();
a.b.c = (b) => {
if ((this.a4 == null || this.a4.visibility == 0) && this.ta != null) {
if ((this.a4 == null || (this.a4.c == 4 || this.a4.c == 5)) && this.te != b) {
this.te = b;
this.a1.bl = b;
this.b7.pr();
}
}
};
a.k = (b, c, d) => {
let e = typeCast(PolarAxisRenderingParameters.$, b);
this.tc.k(c, d, e.aa, e.z, e.ab, e.center, e.minAngle, e.maxAngle);
};
a.l = (b, c, d, e) => {
if (d == e) {
return;
}
let f = typeCast(PolarAxisRenderingParameters.$, b);
this.tc.l(c, d, e, f.aa, f.z, f.ab, f.center, f.minAngle, f.maxAngle);
};
a.m = (b, c) => this.tm(c);
a.q = (b, c) => {
let d = typeCast(PolarAxisRenderingParameters.$, b);
return c <= d.effectiveMaximum;
};
a.n = (b, c) => {
let d = typeCast(PolarAxisRenderingParameters.$, b);
return c <= d.effectiveMaximum;
};
a.j = (b) => {
let c = typeCast(PolarAxisRenderingParameters.$, b);
this.tc.o(b.u, c.crossingAngleRadians, b.aa, b.z, b.ab, c.minLength, c.maxLength, c.center);
};
a.e = (b) => {
b.n = this.a4 == null || (this.a4.c == 4 || this.a4.c == 0) ? b.aa.top : b.aa.bottom;
b.r = b.n;
let c = typeCast(PolarAxisRenderingParameters.$, b);
c.crossingAngleRadians = (this.th(this.hr) * Math.PI) / 180;
if (this.a4 == null || (this.a4.c == 4 || this.a4.c == 5)) {
c.n = ViewportUtils.i(0.5, c.ab, c.aa, c.z) - b.aa.top;
c.r = c.n;
let d = typeCast(RadialAxisLabelPanel.$, this.a1);
if (d != null) {
let e = 0;
if (this.a4 != null && this.a4.c == 4) {
e = 1;
}
d.d4 = { $type: Point_$type, x: ViewportUtils.e(0.5, c.ab, c.aa, c.z), y: e };
d.d1 = c.crossingAngleRadians;
}
}
};
a.p = (b, c, d) => {
let e = typeCast(PolarAxisRenderingParameters.$, b);
if (this.ta == null) {
return false;
}
if (c > e.effectiveMaximum) {
return false;
}
let f = false;
f = this.a4 == null || (this.a4.c == 4 || this.a4.c == 5);
let g = 0;
if (f) {
g = this.ti;
}
let h = e.center.x + c * Math.cos(g);
let i = e.center.y + c * Math.sin(g);
h = ViewportUtils.e(h, e.ab, e.aa, e.z);
i = ViewportUtils.i(i, e.ab, e.aa, e.z);
if (h <= b.aa.right && h >= b.aa.left && ((i <= b.aa.bottom && i >= b.aa.top) || !f)) {
return true;
}
return false;
};
a.h = (b, c) => {