igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
1,105 lines (1,104 loc) • 41.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 { DataAnnotationAxisLayer } from "./DataAnnotationAxisLayer";
import { DependencyProperty } from "igniteui-react-core";
import { OverlayTextLocation_$type } from "./OverlayTextLocation";
import { Brush } from "igniteui-react-core";
import { enumGetBox, Number_$type, typeCast, fromEnum, Point_$type, markType, markDep, getInstanceType, runOn } from "igniteui-react-core";
import { AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode";
import { OverlayTextUtil } from "./OverlayTextUtil";
import { OverlayTextUpdatingEventArgs } from "./OverlayTextUpdatingEventArgs";
import { DataAnnotationItem } from "./DataAnnotationItem";
import { DataAnnotationInfo } from "./DataAnnotationInfo";
import { DataAnnotationShapeLayerFrame } from "./DataAnnotationShapeLayerFrame";
import { Dictionary$2 } from "igniteui-react-core";
import { Axis } from "./Axis";
import { Pool$1 } from "igniteui-react-core";
import { AxisAnnotation } from "./AxisAnnotation";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { Defaults } from "./Defaults";
import { DataAnnotationShapeFrameManager } from "./DataAnnotationShapeFrameManager";
import { XamDataChart } from "./XamDataChart";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { Size } from "igniteui-react-core";
import { BrushUtil } from "igniteui-react-core";
import { TextBlock } from "igniteui-react-core";
import { Rectangle } from "igniteui-react-core";
import { Extensions } from "igniteui-react-core";
import { NumberFormatSpecifier } from "igniteui-react-core";
import { BindingFormatter } from "igniteui-react-core";
import { Path } from "igniteui-react-core";
import { Tuple$2 } from "igniteui-react-core";
import { PathFigure } from "igniteui-react-core";
import { PathGeometry } from "igniteui-react-core";
import { LineSegment } from "igniteui-react-core";
import { OverlayTextInfo } from "./OverlayTextInfo";
import { DoubleCollection } from "igniteui-react-core";
import { DeviceUtils } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { truncate, isNaN_, log10, isInfinity } from "igniteui-react-core";
import { stringIsNullOrEmpty } from "igniteui-react-core";
import { round10N } from "igniteui-react-core";
import { AnnotationLayerView } from "./AnnotationLayerView";
import { TranslateTransform } from "igniteui-react-core";
import { LineGeometry } from "igniteui-react-core";
/**
* @hidden
*/
export let DataAnnotationShapeLayer = /*@__PURE__*/ (() => {
class DataAnnotationShapeLayer extends DataAnnotationAxisLayer {
get_acu() {
return true;
}
get acu() {
return this.get_acu();
}
get ack() {
return this.acj;
}
set ack(a) {
if (this.acj != a) {
let b = this.acj;
this.acj = a;
this.raisePropertyChanged("OverlayTextColumn", b, this.acj);
}
}
get aci() {
return this.ach;
}
set aci(a) {
let b = this.ach;
if (OverlayTextUtil.q(a)) {
a = OverlayTextUtil.c();
}
this.ach = a;
if (b != this.ach) {
this.raisePropertyChanged("OverlayTextStyle", b, this.ach);
}
}
rc(a, b, c, d) {
if (b == "CrosshairPoint") {
return;
}
super.rc(a, b, c, d);
switch (b) {
case "SeriesViewer":
if (d == null) {
if (this.acv != null && this.acv.count > 0) {
let e;
if (this.d4()) {
e = this.xi;
}
else {
e = this.xg;
}
e.a3();
this.aek(e, true, true);
}
}
break;
case DataAnnotationShapeLayer.$$p[0]:
case "AreaFillOpacity":
this.ru(true);
break;
case DataAnnotationShapeLayer.$$p[1]:
case "OverlayTextColumn":
case DataAnnotationShapeLayer.$$p[24]:
case DataAnnotationShapeLayer.$$p[19]:
case DataAnnotationShapeLayer.$$p[2]:
case DataAnnotationShapeLayer.$$p[13]:
case DataAnnotationShapeLayer.$$p[14]:
case DataAnnotationShapeLayer.$$p[16]:
case DataAnnotationShapeLayer.$$p[15]:
case DataAnnotationShapeLayer.$$p[3]:
case DataAnnotationShapeLayer.$$p[4]:
case DataAnnotationShapeLayer.$$p[6]:
case DataAnnotationShapeLayer.$$p[5]:
case DataAnnotationShapeLayer.$$p[8]:
case DataAnnotationShapeLayer.$$p[9]:
case DataAnnotationShapeLayer.$$p[11]:
case DataAnnotationShapeLayer.$$p[7]:
case DataAnnotationShapeLayer.$$p[10]:
case DataAnnotationShapeLayer.$$p[12]:
case DataAnnotationShapeLayer.$$p[17]:
case DataAnnotationShapeLayer.$$p[18]:
case DataAnnotationShapeLayer.$$p[23]:
case DataAnnotationShapeLayer.$$p[22]:
this.abe();
break;
case "FastItemsSource":
this.aeh(c, d);
this.abe();
break;
case DataAnnotationShapeLayer.$$p[21]:
case DataAnnotationShapeLayer.$$p[20]:
if (this.dp != null) {
this.dp.deregisterColumn(this.ack);
this.ack = this.dn(this.ad5);
}
break;
}
}
aco(a) {
return !stringIsNullOrEmpty(a);
}
dl(a) {
if (this.dp == null) {
return null;
}
if (!this.aco(a)) {
return null;
}
return super.dl(a);
}
dn(a) {
if (this.dp == null) {
return null;
}
if (!this.aco(a)) {
return null;
}
return super.dn(a);
}
aed(a) {
if (this.dp != null) {
this.dp.deregisterColumn(a);
}
}
aeh(a, b) {
this.acx.clear();
if (typeCast(IFastItemsSource_$type, a) != null) {
a.deregisterColumn(this.ack);
this.ack = null;
}
if (typeCast(IFastItemsSource_$type, b) != null) {
this.ack = this.dn(this.ad5);
}
}
pd(a, b, c, d) {
super.pd(a, b, c, d);
switch (a) {
case 3:
this.aef(b);
break;
case 1:
for (let e = b; e < b + c; e++) {
let f = new DataAnnotationItem();
this.acx.insert(e, f);
this.aef(e);
}
break;
case 0:
this.acx.v(b, c);
break;
case 2:
for (let g = b; g < b + c; g++) {
this.aef(g);
}
break;
case 4:
this.aee();
break;
}
this.ru(true);
}
constructor() {
super();
this.stylingOverlayText = null;
this.stylingShapeAnnotation = null;
this.stylingAxisAnnotation = null;
this.acj = null;
this.ach = null;
this.acw = null;
this.acv = null;
this.acx = new List$1(DataAnnotationItem.$, 0);
this.afe = null;
this.adf = 0;
this.acm = false;
this.ab8 = null;
this.ab9 = null;
this.acf = null;
this.acg = null;
let a = new DataAnnotationShapeLayerFrame();
let b = new DataAnnotationShapeLayerFrame();
let c = new DataAnnotationShapeLayerFrame();
let d = this.ke / 1000;
this.xh = a;
this.xg = b;
this.xi = c;
this.ab = DataAnnotationShapeLayer.$;
}
ct() {
return new DataAnnotationShapeLayerView(this);
}
q3(a) {
super.q3(a);
this.acb = a;
}
aeg() {
this.jq = Defaults.dataAnnotationShapeThickness;
this.im = Defaults.dataAnnotationShapeThickness;
this.ig = Defaults.dataAnnotationShapeThickness;
this.il = Defaults.dataAnnotationShapeFillOpacity;
this.aap = Defaults.dataAnnotationLabelThickness;
this.ach = OverlayTextUtil.c();
}
qr() {
super.qr();
if (!this.a1.c && !this.d4()) {
return;
}
if (this.aag) {
this.aag = false;
this.aee();
}
if (this.d4()) {
this.ael(this.xi, false);
}
else {
this.ael(this.xg, false);
}
}
aee() {
this.acx.clear();
if (this.dp == null || this.dp.count == 0) {
return;
}
for (let a = 0; a < this.dp.count; a++) {
let b = new DataAnnotationItem();
this.acx.add(b);
this.aef(a);
}
}
aef(a) {
}
ael(a, b) {
let c = false;
if (this.acv == null) {
c = true;
this.acw = new List$1(Axis.$, 0);
this.acv = new Dictionary$2(Axis.$, Pool$1.$.specialize(AxisAnnotation.$), 0);
}
this.aek(a, c, b);
}
aek(a, b, c) {
DataAnnotationShapeFrameManager.c(this, a, b, this.acv, this.acw, c, this.aas, this.aar);
}
yy(a, b) {
super.yy(a, b);
let c = a;
let d = true;
c.a3();
this.adf = 0;
if (this.aad != null) {
if (this.aal(this.aad)) {
this.aej(this.aad, c, d);
}
}
else {
if (typeCast(XamDataChart.$, this.dc) !== null) {
let e = this.dc;
let f = true;
for (let g of fromEnum(e.axes)) {
if (!this.aal(g)) {
continue;
}
if (!g.cj) {
f = false;
}
}
for (let h of fromEnum(e.axes)) {
if (!this.aal(h)) {
continue;
}
if (this.aaf == 0) {
if (typeCast(CategoryAxisBase.$, h) !== null) {
this.aej(h, c, d);
}
else if (h.cj && !h.cp && f) {
this.aej(h, c, d);
}
}
else if (this.aaf == 1 && (h.cb || h.ce)) {
this.aej(h, c, d);
}
else if (this.aaf == 4 && h.cb) {
this.aej(h, c, d);
}
else if (this.aaf == 5 && h.ce) {
this.aej(h, c, d);
}
else if (this.aaf == 6 && h.cj && !h.cp) {
this.aej(h, c, d);
}
else if (this.aaf == 7 && h.cj && h.cp) {
this.aej(h, c, d);
}
else if (this.aaf == 3 && h.cp) {
this.aej(h, c, d);
}
else if (this.aaf == 2 && !h.cp) {
this.aej(h, c, d);
}
}
}
}
}
aej(a, b, c) {
this.ab8 = null;
this.ab9 = null;
this.acf = null;
this.acg = null;
let d = this.getEffectiveViewport();
let e = this.dc.wt;
if (a.cp) {
this.ab9 = a;
if (this.ab9.aj != null) {
this.ab8 = this.ab9.aj;
}
else {
this.ab8 = this.ab7(a);
}
this.acm = false;
}
else {
this.ab8 = a;
if (this.ab8.aj != null) {
this.ab9 = this.ab8.aj;
}
else {
this.ab9 = this.ab7(a);
}
this.acm = true;
}
if (this.ab8 == null) {
return;
}
if (this.ab9 == null) {
return;
}
this.acg = new ScalerParams(1, e, this.ab9.kh, this.ab9.ch);
this.acf = new ScalerParams(1, e, this.ab8.kh, this.ab8.ch);
this.acf.c = d;
this.acg.c = d;
let f = this.ig;
let g = this.zt();
if (g == null) {
g = BrushUtil.j(255, 0, 0, 0);
}
let h = this.acu ? this.zu() : g;
if (h == null) {
h = BrushUtil.j(255, 0, 0, 0);
}
g = OverlayTextUtil.ah(g, this.xs, this.w3);
h = OverlayTextUtil.ah(h, this.xs, this.w3);
let i = this.acm;
this.aee();
this.acb.cu();
this.aei();
let j = this.aci;
let k = OverlayTextUtil.o(j, this.act);
let l = this.acd;
if (l == 18) {
k = false;
}
if (k) {
this.acb.cq.count = this.acx.count;
this.acb.cp.count = this.acx.count;
}
for (let m = 0; m < this.acx.count; m++) {
let n = this.acx._inner[m];
n.dataIndex = m;
n.shapeBrush = n.shapeBrush != null ? n.shapeBrush : g;
n.shapeOutline = n.shapeOutline != null ? n.shapeOutline : h;
if (this.acu) {
n.shapeBrush = BrushUtil.s(n.shapeBrush, this.il);
}
n.shapeThickness = !isNaN_(n.shapeThickness) ? n.shapeThickness : f;
n.h = 1.7976931348623157E+308;
n.f = 1.7976931348623157E+308;
n.g = -1.7976931348623157E+308;
n.d = -1.7976931348623157E+308;
let o = new List$1(Point_$type, 0);
for (let p = 0; p < n.c.count; p++) {
let q = n.c._inner[p];
let r = this.afh(q.y, false);
o.add(r);
let s = this.afh(q.y, true);
n.h = Math.min(s.y, n.h);
n.d = Math.max(s.y, n.d);
n.f = Math.min(s.x, n.f);
n.g = Math.max(s.x, n.g);
}
let t = new List$1(DataAnnotationInfo.$, 0);
t = new List$1(DataAnnotationInfo.$, 0);
t.o(n.c);
t.o(n.b);
if (this.stylingShapeAnnotation != null) {
this.stylingShapeAnnotation(this, n);
}
b.ay.add(o);
b.aw.add(n.a);
b.av.add(n.shapeBrush);
b.ax.add(n.shapeOutline);
b.az.add(n.shapeThickness);
b.a0.add(this.acl);
let u = this.ab0;
if (u == null) {
u = this.aah ? g : Defaults.dataAnnotationLabelBackground;
}
let v = this.ab1;
if (v == null) {
v = this.aai ? h : Defaults.dataAnnotationLabelBorderStroke;
}
let w = this.acu ? n.shapeOutline : n.shapeBrush;
let x = this.ab2;
if (x == null) {
x = this.aak ? w : this.ab2;
}
let y = OverlayTextUtil.t(this.aap, Defaults.dataAnnotationLabelBorderThickness);
let z = OverlayTextUtil.t(this.aan, Defaults.dataAnnotationLabelBorderRadius);
for (let aa of fromEnum(t)) {
if (aa.borderColor == null) {
aa.borderColor = v;
}
if (aa.background == null) {
aa.background = u;
}
if (aa.textColor == null) {
aa.textColor = x;
}
aa.borderColor = OverlayTextUtil.ah(aa.borderColor, this.aao, this.aab);
aa.background = OverlayTextUtil.ah(aa.background, this.aam, this.aaa);
aa.textColor = OverlayTextUtil.af(aa.background, aa.textColor, this.aaq, this.aac);
if (isNaN_(aa.borderThickness)) {
aa.borderThickness = y;
}
if (isNaN_(aa.borderRadius)) {
aa.borderRadius = z;
}
let ab = this.afh(aa.y, false);
aa.xAxisPixel = ab.x;
aa.yAxisPixel = ab.y;
aa.xAxisWindow = this.add(ab.x);
aa.yAxisWindow = this.ade(ab.y);
aa.xAxisValue = aa.c ? this.ab8.eo(ab.x, this.acf) : NaN;
aa.yAxisValue = aa.d ? this.ab9.eo(ab.y, this.acg) : NaN;
aa.xAxisLabel = this.adh(this.ab8, aa, true);
aa.yAxisLabel = this.adh(this.ab9, aa, false);
aa.dataIndex = n.dataIndex;
if (this.stylingAxisAnnotation != null) {
this.stylingAxisAnnotation(this, aa);
}
}
if (this.aaj) {
for (let ac = 0; ac < t.count; ac++) {
let ad = t._inner[ac];
let ae = !stringIsNullOrEmpty(ad.xAxisLabel);
let af = !stringIsNullOrEmpty(ad.yAxisLabel);
DataAnnotationShapeFrameManager.b(b, ad.xAxisValue, ad.yAxisValue, ad.xAxisLabel, ad.yAxisLabel, ad.textColor, ad.background, ad.borderColor, ad.borderThickness, ad.borderRadius, this.ab3, ae, af, this.ab8, this.ab9, this.acf, this.acg);
}
}
let ag = this.adl;
if (stringIsNullOrEmpty(ag)) {
ag = this.adj(m, this.ack);
}
let ah = new Size(1, 0, 0);
let ai = { $type: Point_$type, x: NaN, y: NaN };
let aj = new OverlayTextUpdatingEventArgs();
aj.dataIndex = m;
aj.backgroundMode = this.ab4;
aj.backgroundShift = this.ac4;
aj.background = this.acq ? g : this.afb;
aj.borderMode = this.ab5;
aj.borderShift = this.ac6;
aj.borderStroke = this.acr ? g : this.afc;
aj.borderRadius = this.ac5;
aj.borderThickness = this.ac7;
aj.textLocation = this.acd;
aj.textAngle = this.ac3;
aj.textVisible = this.act;
aj.textContent = ag;
aj.textColorMode = this.ab6;
aj.textColorShift = this.ac8;
aj.textColor = this.acs ? g : this.afd;
aj.shapeBrush = g;
aj.shapeOutline = h;
aj.f = !i;
aj.horizontalMargin = this.ac9;
aj.verticalPadding = this.adc;
aj.verticalMargin = this.adb;
aj.horizontalPadding = this.ada;
if (this.stylingOverlayText != null && k) {
this.stylingOverlayText(this, aj);
}
OverlayTextUtil.ad(aj);
if (k && !aj.textEmpty && aj.textVisible) {
ah = this.cw.cc(aj.textContent, j);
ai = OverlayTextUtil.ak(aj.textLocation, ah, aj.textAngle, aj.horizontalMargin, aj.verticalMargin, aj.horizontalPadding, aj.verticalPadding, n.ac, i);
}
else {
aj.textVisible = false;
}
if (!Extensions.a(ai)) {
aj.textVisible = false;
}
b.aj.add(aj.borderThickness);
b.ah.add(aj.borderStroke);
b.ai.add(aj.borderRadius);
b.ag.add(aj.background);
b.ar.add(ah);
b.am.add(j);
b.ak.add(aj.textColor);
b.af.add(aj.textAngle);
b.al.add(aj.textContent);
b.ao.add(aj.horizontalPadding);
b.at.add(aj.verticalPadding);
b.an.add(aj.horizontalMargin);
b.as.add(aj.verticalMargin);
b.au.add(aj.textVisible);
b.ap.add(ai.x);
b.aq.add(ai.y);
}
}
aei() {
if (OverlayTextUtil.q(this.ach)) {
this.ach = OverlayTextUtil.c();
}
else if (OverlayTextUtil.k(this.ach)) {
this.ach = this.cw.l(this.ach.fontString);
}
}
adi(a, b, c, d) {
if (isNaN_(b)) {
return null;
}
if (c >= 0) {
let e = new NumberFormatSpecifier();
e.minimumFractionDigits = c;
e.maximumFractionDigits = d > 0 ? d : c;
let f = new BindingFormatter();
f.j = "{0}";
f.d = [e];
return f.i(b);
}
let g = 0;
if (d >= 0) {
g = d;
}
else if (a.cj) {
let h = a.ex();
g = h == 0 ? 0 : truncate(Math.max(-Math.floor(log10(h)), 0));
g += 1;
}
return round10N(b, g).toString();
}
adh(a, b, c) {
let d = c ? b.dataValueX : b.dataValueY;
let e = c ? b.dataLabelX : b.dataLabelY;
let f = c ? b.xAxisValue : b.yAxisValue;
let g = c ? b.xAxisPixel : b.yAxisPixel;
let h = c ? b.xAxisWindow : b.yAxisWindow;
let i = c ? b.a : b.b;
if (i == 6) {
return null;
}
if (this.aae != 0 && i == 0) {
i = this.aae;
}
if (i == 0) {
if (!stringIsNullOrEmpty(e)) {
return e;
}
else if (!isNaN_(d)) {
return this.adi(a, d, this.aas, this.aar);
}
}
else if (i == 1) {
return this.adi(a, d, this.aas, this.aar);
}
else if (i == 2) {
if (stringIsNullOrEmpty(e)) {
return null;
}
else {
return e;
}
}
else if (i == 4) {
let j = this.aas;
if (j < 0) {
j = 0;
}
let k = this.aas;
if (k < 0) {
k = 0;
}
return this.adi(a, g, j, k);
}
else if (i == 5) {
let l = this.aas;
if (l < 0) {
l = 2;
}
let m = this.aas;
if (m < 0) {
m = 2;
}
return this.adi(a, h, l, m);
}
else if (i == 3) {
if (a.cj) {
return this.adi(a, f, this.aas, this.aar);
}
else {
return a.gf(d);
}
}
return null;
}
y1(a, b) {
super.y1(a, b);
let c = this.acb.co;
let d = a;
let e = d.ay.count;
let f = 0;
let g = b.b9.top;
let h = b.b9.left;
let i = b.b9.right;
let j = b.b9.bottom;
let k = Math.min(h, i);
let l = Math.min(g, j);
let m = Math.max(h, i);
let n = Math.max(g, j);
let o = m - k;
let p = n - l;
for (let q = 0; q < e; q++) {
if (!d.a0._inner[q]) {
continue;
}
let r = null;
let s = this.aec(c, f, q, d);
r = s.c;
f = s.d;
let t = true;
let u = new List$1(PathFigure.$, 0);
let v = null;
for (let w of fromEnum(d.ay._inner[q])) {
if (!Extensions.a(w)) {
t = true;
if (v != null && v._segments.count > 0) {
u.add(v);
}
continue;
}
if (t) {
t = false;
v = new PathFigure();
v._startPoint = w;
}
else {
let x = ((() => {
let $ret = new LineSegment(1);
$ret.c = w;
return $ret;
})());
v._segments.add(x);
}
}
if (v != null && v._segments.count > 0) {
u.add(v);
}
let y = new PathGeometry();
for (let z of fromEnum(u)) {
z._isClosed = d.aw._inner[q];
y.c.add(z);
}
r.an = y;
if (d.au._inner[q]) {
this.acb.cq.item(q)._visibility = 0;
this.acb.cp.item(q)._visibility = 0;
}
else {
this.acb.cq.item(q)._visibility = 1;
this.acb.cp.item(q)._visibility = 1;
}
if (d.au._inner[q]) {
let aa = new OverlayTextInfo();
aa.background = d.ag._inner[q];
aa.textColor = d.ak._inner[q];
aa.verticalPadding = d.at._inner[q];
aa.horizontalPadding = d.ao._inner[q];
aa.horizontalMargin = d.an._inner[q];
aa.verticalMargin = d.as._inner[q];
aa.borderThickness = d.aj._inner[q];
aa.borderStroke = d.ah._inner[q];
aa.borderRadius = d.ai._inner[q];
aa.textLocation = this.acd;
aa.textAngle = d.af._inner[q];
aa.textVisible = d.au._inner[q];
aa.textContent = d.al._inner[q];
aa.f = d.am._inner[q];
aa.ad = d.ar._inner[q];
aa.u = this.acb.cq.item(q);
aa.ac = this.acb.cp.item(q);
let ab = d.ap._inner[q];
let ac = d.aq._inner[q];
aa.aa = { $type: Point_$type, x: ab, y: ac };
OverlayTextUtil.y(aa.ac, aa.background, aa.borderStroke, aa.borderThickness, aa.borderRadius);
OverlayTextUtil.z(aa.u, aa.textColor);
OverlayTextUtil.x(aa);
OverlayTextUtil.w(aa);
this.cw.av(aa.u, aa.f);
this.cw.aw(aa.u, aa.f);
}
}
c.count = f;
if (this.d4()) {
this.ael(this.xi, true);
}
else {
this.ael(this.xg, false);
}
}
aec(a, b, c, d) {
let e = a.item(b);
b++;
e.ad = d.az._inner[c];
e._stroke = d.ax._inner[c];
e._fill = d.av._inner[c];
e.ai = this.zv;
e.am = this.wa;
e.al = this.v9;
e.ak = this.v9;
e.aj = this.v8;
e.ac = this.ji;
return new Tuple$2(Path.$, Number_$type, e, b);
}
w7() {
return 3;
}
xu() {
return 0.1;
}
xx() {
return -0.4;
}
xw() {
return NaN;
}
y6() {
super.y6();
this.xs = this.x0();
}
x0() {
if (isNaN_(this.x3)) {
switch (this.w3) {
case 1: return this.xu();
case 2: return this.xx();
case 4:
case 3: return this.xw();
}
}
return this.x3;
}
zy() {
if (this.afe == null) {
this.afe = new DoubleCollection();
this.afe.add(DeviceUtils.g(2));
this.afe.add(DeviceUtils.g(4));
}
return this.afe;
}
adj(a, b) {
if (b == null || b.count <= a) {
return null;
}
let c = b.item(a);
return c != null ? c.toString() : null;
}
ac2(a, b) {
if (b == null || b.count <= a) {
return NaN;
}
return b.item(a);
}
afg(a, b) {
if (b == null || b.count <= a) {
return { $type: Point_$type, x: NaN, y: NaN };
}
let c = b.item(a);
if (c == null || getInstanceType(c) != Point_$type) {
return { $type: Point_$type, x: NaN, y: NaN };
}
return b.item(a);
}
afh(a, b = false) {
let c = b ? 1 : 2;
let d = b ? 0 : -1;
if (this.acp) {
let e = a.x;
let f = a.y;
if (isInfinity(e) && e > 0) {
e = c;
}
if (isInfinity(e) && e < 0) {
e = d;
}
if (isInfinity(f) && f > 0) {
f = c;
}
if (isInfinity(f) && f < 0) {
f = d;
}
return this.dc.wl({ $type: Point_$type, x: e, y: f });
}
else {
let g = a.x;
let h = a.y;
let i = false;
let j = false;
if (isInfinity(g) && g > 0) {
g = Math.floor(this.ac0(c));
i = true;
}
if (isInfinity(g) && g < 0) {
g = Math.floor(this.ac0(d));
i = true;
}
if (isInfinity(h) && h > 0) {
h = Math.floor(this.ac1(c));
j = true;
}
if (isInfinity(h) && h < 0) {
h = Math.floor(this.ac1(d));
j = true;
}
if (!i && !isNaN_(g)) {
g = this.ab8.el(g, this.acf);
}
if (!j && !isNaN_(h)) {
h = this.ab9.el(h, this.acg);
}
return { $type: Point_$type, x: g, y: h };
}
}
acy(a) {
return this.ab8.el(a, this.acf);
}
acz(a) {
return this.ab9.el(a, this.acg);
}
acn(a) {
if (this.ab8 == null) {
return false;
}
if (this.ab9 == null) {
return false;
}
if (this.acf == null) {
return false;
}
if (this.acg == null) {
return false;
}
if (this.dp == null) {
return false;
}
if (a < 0 || a >= this.dp.count) {
return false;
}
if (this.acx == null) {
return false;
}
if (a < 0 || a >= this.acx.count) {
return false;
}
return true;
}
ab7(a) {
if (typeCast(XamDataChart.$, this.dc) !== null) {
let b = this.dc;
for (let c of fromEnum(b.axes)) {
if (c.cp && !a.cp) {
return c;
}
if (!c.cp && a.cp) {
return c;
}
}
}
return null;
}
aff(a) {
return this.dc.wl(a);
}
ac0(a) {
return this.dc.wl({ $type: Point_$type, x: a, y: NaN }).x;
}
ac1(a) {
return this.dc.wl({ $type: Point_$type, x: NaN, y: a }).y;
}
afi(a) {
return this.dc.wn(a);
}
add(a) {
return this.dc.wn({ $type: Point_$type, x: a, y: NaN }).x;
}
ade(a) {
return this.dc.wn({ $type: Point_$type, x: NaN, y: a }).y;
}
}
DataAnnotationShapeLayer.$t = /*@__PURE__*/ markType(DataAnnotationShapeLayer, 'DataAnnotationShapeLayer', DataAnnotationAxisLayer.$);
DataAnnotationShapeLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, DataAnnotationShapeLayer, 'raisePropertyChanged', ['AnnotationShapeVisible:acl:aem', [0, true], 'ItemsUseWorldCoordinates:acp:aen', [0, false], 'OverlayTextAngle:ac3:aeo', [1, NaN], 'OverlayTextBackgroundMatchLayer:acq:aep', [0, false], 'OverlayTextBackgroundMode:ab4:aeq', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'OverlayTextBackground:afb:aer', [Brush.$, null], 'OverlayTextBackgroundShift:ac4:aes', [1, NaN], 'OverlayTextBorderColor:afc:aet', [Brush.$, null], 'OverlayTextBorderMatchLayer:acr:aeu', [0, false], 'OverlayTextBorderMode:ab5:aev', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'OverlayTextBorderRadius:ac5:aew', [1, NaN], 'OverlayTextBorderShift:ac6:aex', [1, NaN], 'OverlayTextBorderThickness:ac7:aey', [1, 1], 'OverlayTextColorMatchLayer:acs:aez', [0, true], 'OverlayTextColorMode:ab6:ae0', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'OverlayTextColor:afd:ae1', [Brush.$, null], 'OverlayTextColorShift:ac8:ae2', [1, NaN], 'OverlayTextHorizontalMargin:ac9:ae3', [1, NaN], 'OverlayTextHorizontalPadding:ada:ae4', [1, NaN], 'OverlayTextLocation:acd:ae5', [OverlayTextLocation_$type, /*@__PURE__*/ enumGetBox(OverlayTextLocation_$type, 0)], 'OverlayTextMemberPath:ad5:ae6', [2, null], 'OverlayText:adl:ae7', [2, null], 'OverlayTextVerticalMargin:adb:ae8', [1, NaN], 'OverlayTextVerticalPadding:adc:ae9', [1, NaN], 'OverlayTextVisible:act:afa', [0, true]]);
return DataAnnotationShapeLayer;
})();
/**
* @hidden
*/
export let DataAnnotationShapeLayerView = /*@__PURE__*/ (() => {
class DataAnnotationShapeLayerView extends AnnotationLayerView {
constructor(a) {
super(a);
this.cn = null;
this.co = null;
this.ct = null;
this.cs = null;
this.cq = null;
this.cr = null;
this.cp = null;
this.cn = a;
this.ct = new List$1(Path.$, 0);
}
a4() {
super.a4();
this.co = ((() => {
let $ret = new Pool$1(Path.$);
$ret.create = runOn(this, this.c6);
$ret.activate = runOn(this, this.cv);
$ret.disactivate = runOn(this, this.cx);
$ret.destroy = runOn(this, this.cw);
return $ret;
})());
this.cs = new List$1(TextBlock.$, 0);
this.cq = ((() => {
let $ret = new Pool$1(TextBlock.$);
$ret.create = runOn(this, this.c5);
$ret.activate = runOn(this, this.c1);
$ret.disactivate = runOn(this, this.c3);
$ret.destroy = runOn(this, this.c2);
return $ret;
})());
this.cr = new List$1(Rectangle.$, 0);
this.cp = ((() => {
let $ret = new Pool$1(Rectangle.$);
$ret.create = runOn(this, this.c7);
$ret.activate = runOn(this, this.cy);
$ret.disactivate = runOn(this, this.c0);
$ret.destroy = runOn(this, this.cz);
return $ret;
})());
this.cn.aeg();
}
cu() {
}
c5() {
let a = new TextBlock();
this.cs.add(a);
return a;
}
c2(a) {
if (this.cs.contains(a)) {
this.cs.remove(a);
}
}
c1(a) {
a._visibility = 0;
a.s = 0;
}
c3(a) {
a._visibility = 1;
}
c7() {
let a = new Rectangle();
this.cr.add(a);
return a;
}
cz(a) {
a.dataContext = null;
if (this.cr.contains(a)) {
this.cr.remove(a);
}
}
cy(a) {
a._visibility = 0;
}
c0(a) {
a._visibility = 1;
}
c6() {
let a = new Path();
a.j = new TranslateTransform();
this.ct.add(a);
return a;
}
cv(a) {
a._visibility = 0;
}
cx(a) {
a._visibility = 1;
}
cw(a) {
this.ct.remove(a);
}
c4(a, b, c, d) {
if (a.an == null || a.an.c.x != d || a.an.d.x != c) {
let e = ((() => {
let $ret = new LineGeometry();
$ret.d = { $type: Point_$type, x: c, y: b };
$ret.c = { $type: Point_$type, x: d, y: b };
return $ret;
})());
a.an = e;
}
}
bj(a, b) {
super.bj(a, b);
if (a.d && !b) {
for (let c = 0; c < this.ct.count; c++) {
let d = this.ct._inner[c];
if (d._visibility == 0) {
a.t(d);
}
}
for (let e = 0; e < this.cr.count; e++) {
let f = this.cr._inner[e];
if (f._visibility == 0) {
a.w(f);
}
}
for (let g = 0; g < this.cs.count; g++) {
let h = this.cs._inner[g];
if (h._visibility == 0) {
a.ad(h.dataContext);
a.x(h);
}
}
}
}
ax(a) {
super.ax(a);
for (let b = 0; b < this.ct.count; b++) {
this.f.bc.exportPathData(a, this.ct._inner[b], "DataAnnotationPath", ["Main", "DataAnnotation"]);
}
}
}
DataAnnotationShapeLayerView.$t = /*@__PURE__*/ markType(DataAnnotationShapeLayerView, 'DataAnnotationShapeLayerView', AnnotationLayerView.$);
return DataAnnotationShapeLayerView;
})();