igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
1,158 lines (1,157 loc) • 43 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 { 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 { MathUtil } from "igniteui-react-core";
import { CSSColorUtil } 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 { CategoryAxisBase } from "./CategoryAxisBase";
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_ad4() {
return true;
}
get ad4() {
return this.get_ad4();
}
get adt() {
return this.ads;
}
set adt(a) {
if (this.ads != a) {
let b = this.ads;
this.ads = a;
this.raisePropertyChanged("OverlayTextColumn", b, this.ads);
}
}
get adr() {
return this.adq;
}
set adr(a) {
let b = this.adq;
if (OverlayTextUtil.q(a)) {
a = OverlayTextUtil.c();
}
this.adq = a;
if (b != this.adq) {
this.raisePropertyChanged("OverlayTextStyle", b, this.adq);
}
}
rs(a, b, c, d) {
if (b == "CrosshairPoint") {
return;
}
super.rs(a, b, c, d);
switch (b) {
case "SeriesViewer":
if (d == null) {
if (this.ad5 != null && this.ad5.count > 0) {
let e;
if (this.d4()) {
e = this.x0;
}
else {
e = this.xy;
}
e.bp();
this.afw(e, true, true);
}
}
break;
case DataAnnotationShapeLayer.$$p[0]:
case "AreaFillOpacity":
this.sa(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.acc();
break;
case "FastItemsSource":
this.aft(c, d);
this.afq();
this.acc();
break;
case DataAnnotationShapeLayer.$$p[21]:
case DataAnnotationShapeLayer.$$p[20]:
if (this.dp != null) {
this.dp.deregisterColumn(this.adt);
this.adt = this.dn(this.afh);
}
break;
}
}
ady(a) {
return !stringIsNullOrEmpty(a);
}
dl(a) {
if (this.dp == null) {
return null;
}
if (!this.ady(a)) {
return null;
}
return super.dl(a);
}
dn(a) {
if (this.dp == null) {
return null;
}
if (!this.ady(a)) {
return null;
}
return super.dn(a);
}
afp(a) {
if (this.dp != null) {
this.dp.deregisterColumn(a);
}
}
aft(a, b) {
this.ad7.clear();
if (typeCast(IFastItemsSource_$type, a) != null) {
let c = a;
c.deregisterColumn(this.adt);
this.adt = null;
}
if (typeCast(IFastItemsSource_$type, b) != null) {
this.adt = this.dn(this.afh);
}
}
pq(a, b, c, d) {
super.pq(a, b, c, d);
switch (a) {
case 3:
this.afr(b);
break;
case 1:
for (let e = b; e < b + c; e++) {
if (this.ad7.count > e) {
let f = new DataAnnotationItem();
this.ad7.insert(e, f);
this.afr(e);
}
}
break;
case 0:
this.ad7.v(b, c);
break;
case 2:
for (let g = b; g < b + c; g++) {
this.afr(g);
}
break;
case 4:
this.afq();
break;
}
this.sa(true);
}
constructor() {
super();
this.stylingOverlayText = null;
this.stylingShapeAnnotation = null;
this.stylingAxisAnnotation = null;
this.ads = null;
this.adq = null;
this.adp = null;
this.ad6 = null;
this.ad5 = null;
this.ad7 = new List$1(DataAnnotationItem.$, 0);
this.agt = null;
this.aeq = 0;
this.adw = false;
this.adg = null;
this.adh = null;
this.adn = null;
this.ado = null;
let a = new DataAnnotationShapeLayerFrame();
let b = new DataAnnotationShapeLayerFrame();
let c = new DataAnnotationShapeLayerFrame();
let d = this.ko / 1000;
this.xz = a;
this.xy = b;
this.x0 = c;
this.ab = DataAnnotationShapeLayer.$;
}
ct() {
return new DataAnnotationShapeLayerView(this);
}
rj(a) {
super.rj(a);
this.adj = a;
}
afs() {
this.j0 = Defaults.dataAnnotationShapeThickness;
this.iu = Defaults.dataAnnotationShapeThickness;
this.io = Defaults.dataAnnotationShapeThickness;
this.it = Defaults.dataAnnotationShapeFillOpacity;
this.abe = Defaults.dataAnnotationLabelThickness;
this.adq = OverlayTextUtil.c();
}
q6() {
super.q6();
if (!this.a1.c && !this.d4()) {
return;
}
if (this.aa0) {
this.aa0 = false;
this.afq();
}
if (this.d4()) {
this.afx(this.x0, false);
}
else {
this.afx(this.xy, false);
}
}
afq() {
this.ad7.clear();
if (this.dp == null || this.dp.count == 0) {
return;
}
for (let a = 0; a < this.dp.count; a++) {
let b = new DataAnnotationItem();
this.ad7.add(b);
this.afr(a);
}
}
afr(a) {
}
afx(a, b) {
let c = false;
if (this.ad5 == null) {
c = true;
this.ad6 = new List$1(Axis.$, 0);
this.ad5 = new Dictionary$2(Axis.$, Pool$1.$.specialize(AxisAnnotation.$), 0);
}
this.afw(a, c, b);
}
afw(a, b, c) {
DataAnnotationShapeFrameManager.c(this, a, b, this.ad5, this.ad6, c, this.abh, this.abg);
}
zh(a, b) {
super.zh(a, b);
let c = a;
let d = true;
c.bp();
this.adj.cu();
this.aeq = 0;
if (this.aax != null) {
if (this.aa6(this.aax)) {
this.afv(this.aax, c, d);
}
}
else {
if (typeCast(XamDataChart.$, this.dc) !== null) {
let e = this.da.aax(this.aaz);
for (let f of fromEnum(e)) {
this.afv(f, c, d);
}
}
}
}
aen(a) {
return isNaN_(this.aed) ? 0 : this.aed;
}
afv(a, b, c) {
if (b == null) {
return;
}
if (a == null) {
return;
}
this.adg = null;
this.adh = null;
this.adn = null;
this.ado = null;
let d = this.getEffectiveViewport();
let e = this.dc.yv;
if (a.dz) {
this.adh = a;
if (this.adh.an != null) {
this.adg = this.adh.an;
}
else {
this.adg = this.adf(a);
}
this.adw = false;
}
else {
this.adg = a;
if (this.adg.an != null) {
this.adh = this.adg.an;
}
else {
this.adh = this.adf(a);
}
this.adw = true;
}
if (this.adg == null) {
return;
}
if (this.adh == null) {
return;
}
this.ado = new ScalerParams(1, e, this.adh.o8, this.adh.dn);
this.adn = new ScalerParams(1, e, this.adg.o8, this.adg.dn);
this.adn.c = d;
this.ado.c = d;
let f = this.io;
let g = this.aad();
if (g == null) {
g = BrushUtil.l(255, 0, 0, 0);
}
let h = this.ad4 ? this.aae() : g;
if (h == null) {
h = BrushUtil.l(255, 0, 0, 0);
}
g = OverlayTextUtil.ah(g, this.yb, this.xl);
h = OverlayTextUtil.ah(h, this.yb, this.xl);
let i = this.adw;
this.afq();
this.afu();
let j = this.adr;
let k = OverlayTextUtil.o(j, this.ad3);
let l = this.adl;
if (l == 18) {
k = false;
}
if (k) {
this.adj.cq.count = this.ad7.count;
this.adj.cp.count = this.ad7.count;
}
for (let m = 0; m < this.ad7.count; m++) {
let n = this.ad7._inner[m];
n.dataIndex = m;
n.shapeBrush = n.shapeBrush != null ? n.shapeBrush : g;
n.shapeOutline = n.shapeOutline != null ? n.shapeOutline : h;
if (this.ad4) {
n.shapeBrush = BrushUtil.u(n.shapeBrush, this.it);
}
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.agw(q.at, false);
o.add(r);
let s = this.agw(q.at, 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.bk.add(o);
b.bi.add(n.a);
b.bh.add(n.shapeBrush);
b.bj.add(n.shapeOutline);
b.bl.add(n.shapeThickness);
b.bm.add(this.adu);
let u = this.ac6;
if (u == null) {
u = this.aa1 ? g : Defaults.dataAnnotationLabelBackground;
}
let v = this.ac9;
if (v == null) {
v = this.aa3 ? h : Defaults.dataAnnotationLabelBorderStroke;
}
let w = this.ad4 ? n.shapeOutline : n.shapeBrush;
let x = this.ada;
if (x == null) {
x = this.aa5 ? w : this.ada;
}
let y = OverlayTextUtil.t(this.abe, Defaults.dataAnnotationLabelBorderThickness);
let z = OverlayTextUtil.t(this.abc, 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.abd, this.aav);
aa.background = OverlayTextUtil.ah(aa.background, this.aa7, this.aau);
aa.textColor = OverlayTextUtil.af(aa.background, aa.textColor, this.abf, this.aaw);
if (isNaN_(aa.borderThickness)) {
aa.borderThickness = y;
}
if (isNaN_(aa.borderRadius)) {
aa.borderRadius = z;
}
let ab = this.agw(aa.at, false);
aa.xAxisPixel = ab.x;
aa.yAxisPixel = ab.y;
aa.xAxisWindow = this.aeo(ab.x);
aa.yAxisWindow = this.aep(ab.y);
aa.xAxisValue = aa.j ? this.adg.ga(ab.x, this.adn) : NaN;
aa.yAxisValue = aa.k ? this.adh.ga(ab.y, this.ado) : NaN;
let ac = aa.a;
let ad = aa.b;
aa.xAxisLabel = this.aes(this.adg, aa, true);
aa.yAxisLabel = this.aes(this.adh, aa, false);
aa.dataIndex = n.dataIndex;
aa.isXAxisBadgeEnabled = this.adv(n.dataIndex, false);
aa.isYAxisBadgeEnabled = this.adv(n.dataIndex, true);
aa.xAxisBadgeBackground = this.agn(n.dataIndex, false, false, aa.background);
aa.yAxisBadgeBackground = this.agn(n.dataIndex, false, true, aa.background);
aa.xAxisBadgeOutline = this.agn(n.dataIndex, true, false, aa.background);
aa.yAxisBadgeOutline = this.agn(n.dataIndex, true, true, aa.background);
aa.xAxisBadgeImagePath = this.aeu(n.dataIndex, false);
aa.yAxisBadgeImagePath = this.aeu(n.dataIndex, true);
aa.xAxisBadgeOutlineThickness = this.aba;
aa.yAxisBadgeOutlineThickness = this.aba;
aa.xAxisBadgeRadius = this.aa8;
aa.yAxisBadgeRadius = this.aa8;
aa.xAxisBadgeSize = this.abb;
aa.yAxisBadgeSize = this.abb;
aa.xAxisBadgeMargin = this.aa9;
aa.yAxisBadgeMargin = this.aa9;
aa.xAxisUserAnnotation = this.adp;
aa.yAxisUserAnnotation = this.adp;
if (this.stylingAxisAnnotation != null) {
this.stylingAxisAnnotation(this, aa);
}
if (ac != aa.a) {
aa.xAxisLabel = this.aes(this.adg, aa, true);
}
if (ad != aa.b) {
aa.yAxisLabel = this.aes(this.adh, aa, false);
}
}
if (this.aa4) {
for (let ae = 0; ae < t.count; ae++) {
let af = t._inner[ae];
let ag = !stringIsNullOrEmpty(af.xAxisLabel);
let ah = !stringIsNullOrEmpty(af.yAxisLabel);
DataAnnotationShapeFrameManager.b(b, af, this.adb, ag, ah, this.adg, this.adh, this.adn, this.ado);
}
}
let ai = this.aex;
if (stringIsNullOrEmpty(ai)) {
ai = this.aev(m, this.adt);
}
let aj = new Size(1, 0, 0);
let ak = { $type: Point_$type, x: NaN, y: NaN };
let al = this.aen(a);
let am = this.ags;
if (am == null && this.ad2) {
am = g;
}
let an = this.agq;
if (an == null && this.ad0) {
an = g;
}
let ao = this.agr;
if (ao == null && this.ad1) {
ao = g;
}
let ap = new OverlayTextUpdatingEventArgs();
ap.dataIndex = m;
ap.backgroundMode = this.adc;
ap.backgroundShift = this.aee;
ap.background = an;
ap.borderMode = this.add;
ap.borderShift = this.aeg;
ap.borderStroke = ao;
ap.borderRadius = this.aef;
ap.borderThickness = this.aeh;
ap.textLocation = this.adl;
ap.textAngle = al;
ap.textVisible = this.ad3;
ap.textContent = ai;
ap.textColorMode = this.ade;
ap.textColorShift = this.aei;
ap.textColor = am;
ap.shapeBrush = g;
ap.shapeOutline = h;
ap.f = !i;
ap.horizontalMargin = this.aej;
ap.verticalPadding = this.aem;
ap.verticalMargin = this.ael;
ap.horizontalPadding = this.aek;
if (this.stylingOverlayText != null && k) {
this.stylingOverlayText(this, ap);
}
OverlayTextUtil.ad(ap);
if (k && !ap.textEmpty && ap.textVisible) {
aj = this.cw.cc(ap.textContent, j);
ak = OverlayTextUtil.ak(ap.textLocation, aj, ap.textAngle, ap.horizontalMargin, ap.verticalMargin, ap.horizontalPadding, ap.verticalPadding, n.ac, i);
}
else {
ap.textVisible = false;
}
if (!Extensions.a(ak)) {
ap.textVisible = false;
}
b.a5.add(ap.borderThickness);
b.a3.add(ap.borderStroke);
b.a4.add(ap.borderRadius);
b.a2.add(ap.background);
b.bd.add(aj);
b.a8.add(j);
b.a6.add(ap.textColor);
b.a1.add(ap.textAngle);
b.a7.add(ap.textContent);
b.ba.add(ap.horizontalPadding);
b.bf.add(ap.verticalPadding);
b.a9.add(ap.horizontalMargin);
b.be.add(ap.verticalMargin);
b.bg.add(ap.textVisible);
b.bb.add(ak.x);
b.bc.add(ak.y);
}
}
afu() {
if (OverlayTextUtil.q(this.adq)) {
this.adq = OverlayTextUtil.c();
}
else if (OverlayTextUtil.k(this.adq)) {
this.adq = this.cw.l(this.adq.fontString);
}
}
aet(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.dq) {
let h = a.gk();
g = h == 0 ? 0 : truncate(Math.max(-Math.floor(log10(h)), 0));
g += 1;
}
return MathUtil.t(round10N(b, g));
}
aes(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.aay != 0 && i == 0) {
i = this.aay;
}
if (i == 0) {
if (!stringIsNullOrEmpty(e)) {
i = 2;
}
else if (!isNaN_(f)) {
i = 3;
}
else if (!isNaN_(d)) {
i = 1;
}
}
if (i == 1) {
return this.aet(a, d, this.abh, this.abg);
}
else if (i == 2) {
if (stringIsNullOrEmpty(e)) {
return null;
}
else {
return e;
}
}
else if (i == 4) {
let j = this.abh;
if (j < 0) {
j = 0;
}
let k = this.abh;
if (k < 0) {
k = 0;
}
return this.aet(a, g, j, k);
}
else if (i == 5) {
let l = this.abh;
if (l < 0) {
l = 2;
}
let m = this.abh;
if (m < 0) {
m = 2;
}
return this.aet(a, h, l, m);
}
else if (i == 3) {
if (a.dq) {
return this.aet(a, f, this.abh, this.abg);
}
else {
return a.ja(d);
}
}
return null;
}
adv(a, b) {
return this.aa2;
}
agn(a, b, c, d) {
return this.ac7;
}
aeu(a, b) {
return this.abp;
}
agp(a, b) {
if (a == null) {
return OverlayTextUtil.ae(b);
}
return a;
}
ago(a, b) {
if (b == null || b.count <= a) {
return null;
}
let c = b.item(a);
if (typeof c === 'string') {
return CSSColorUtil.g(c);
}
if (typeCast(Brush.$, c) !== null) {
return c;
}
return null;
}
zk(a, b) {
super.zk(a, b);
let c = this.adj.co;
let d = a;
let e = d.bk.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.bm._inner[q]) {
let r = null;
let s = this.afo(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.bk._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.bi._inner[q];
y.c.add(z);
}
r.an = y;
}
if (d.bg._inner[q]) {
this.adj.cq.item(q)._visibility = 0;
this.adj.cp.item(q)._visibility = 0;
}
else {
this.adj.cq.item(q)._visibility = 1;
this.adj.cp.item(q)._visibility = 1;
}
if (d.bg._inner[q]) {
let aa = new OverlayTextInfo();
aa.background = d.a2._inner[q];
aa.textColor = d.a6._inner[q];
aa.verticalPadding = d.bf._inner[q];
aa.horizontalPadding = d.ba._inner[q];
aa.horizontalMargin = d.a9._inner[q];
aa.verticalMargin = d.be._inner[q];
aa.borderThickness = d.a5._inner[q];
aa.borderStroke = d.a3._inner[q];
aa.borderRadius = d.a4._inner[q];
aa.textLocation = this.adl;
aa.textAngle = d.a1._inner[q];
aa.textVisible = d.bg._inner[q];
aa.textContent = d.a7._inner[q];
aa.f = d.a8._inner[q];
aa.ad = d.bd._inner[q];
aa.u = this.adj.cq.item(q);
aa.ac = this.adj.cp.item(q);
let ab = d.bb._inner[q];
let ac = d.bc._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.afx(this.x0, true);
}
else {
this.afx(this.xy, false);
}
}
afo(a, b, c, d) {
let e = a.item(b);
b++;
e.ad = d.bl._inner[c];
e._stroke = d.bj._inner[c];
e._fill = d.bh._inner[c];
e.ai = this.aaf;
e.am = this.wr;
e.al = this.wq;
e.ak = this.wq;
e.aj = this.wp;
e.ac = this.jr;
return new Tuple$2(Path.$, Number_$type, e, b);
}
xp() {
return 3;
}
yd() {
return 0.1;
}
yg() {
return -0.4;
}
yf() {
return NaN;
}
zp() {
super.zp();
this.yb = this.yj();
}
yj() {
if (isNaN_(this.ym)) {
switch (this.xl) {
case 1: return this.yd();
case 2: return this.yg();
case 4:
case 3: return this.yf();
}
}
return this.ym;
}
aai() {
if (this.agt == null) {
this.agt = new DoubleCollection();
this.agt.add(DeviceUtils.g(2));
this.agt.add(DeviceUtils.g(4));
}
return this.agt;
}
aev(a, b) {
if (b == null || b.count <= a) {
return null;
}
let c = b.item(a);
return c != null ? c.toString() : null;
}
aec(a, b, c) {
if (b == null || b.count <= a) {
return NaN;
}
let d = b.item(a);
if (c != null && c.df && !c.dj) {
let e = typeCast(CategoryAxisBase.$, c);
if (e.categoryMode != 0) {
let f = 0.5;
d += f;
}
}
return d;
}
agv(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);
}
agw(a, b = false) {
let c = b ? 1 : 2;
let d = b ? 0 : -1;
if (this.adz) {
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.yn({ $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.aea(c));
i = true;
}
if (isInfinity(g) && g < 0) {
g = Math.floor(this.aea(d));
i = true;
}
if (isInfinity(h) && h > 0) {
h = Math.floor(this.aeb(c));
j = true;
}
if (isInfinity(h) && h < 0) {
h = Math.floor(this.aeb(d));
j = true;
}
if (!i && !isNaN_(g)) {
g = this.adg.f7(g, this.adn);
}
if (!j && !isNaN_(h)) {
h = this.adh.f7(h, this.ado);
}
return { $type: Point_$type, x: g, y: h };
}
}
ad8(a) {
return this.adg.f7(a, this.adn);
}
ad9(a) {
return this.adh.f7(a, this.ado);
}
adx(a) {
if (this.adg == null) {
return false;
}
if (this.adh == null) {
return false;
}
if (this.adn == null) {
return false;
}
if (this.ado == null) {
return false;
}
if (this.dp == null) {
return false;
}
if (a < 0 || a >= this.dp.count) {
return false;
}
if (this.ad7 == null) {
return false;
}
if (a < 0 || a >= this.ad7.count) {
return false;
}
return true;
}
adf(a) {
if (typeCast(XamDataChart.$, this.dc) !== null) {
let b = this.dc;
for (let c of fromEnum(b.zu)) {
if (c.dz && !a.dz) {
return c;
}
if (!c.dz && a.dz) {
return c;
}
}
}
return null;
}
agu(a) {
return this.dc.yn(a);
}
aea(a) {
return this.dc.yn({ $type: Point_$type, x: a, y: NaN }).x;
}
aeb(a) {
return this.dc.yn({ $type: Point_$type, x: NaN, y: a }).y;
}
agx(a) {
return this.w4(a);
}
aeo(a) {
return this.w4({ $type: Point_$type, x: a, y: NaN }).x;
}
aep(a) {
return this.w4({ $type: Point_$type, x: NaN, y: a }).y;
}
}
DataAnnotationShapeLayer.$t = /*@__PURE__*/ markType(DataAnnotationShapeLayer, 'DataAnnotationShapeLayer', DataAnnotationAxisLayer.$);
DataAnnotationShapeLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, DataAnnotationShapeLayer, 'raisePropertyChanged', ['AnnotationShapeVisible:adu:afy', [0, true], 'ItemsUseWorldCoordinates:adz:afz', [0, false], 'OverlayTextAngle:aed:af0', [1, NaN], 'OverlayTextBackgroundMatchLayer:ad0:af1', [0, false], 'OverlayTextBackgroundMode:adc:af2', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'OverlayTextBackground:agq:af3', [Brush.$, null], 'OverlayTextBackgroundShift:aee:af4', [1, NaN], 'OverlayTextBorderColor:agr:af5', [Brush.$, null], 'OverlayTextBorderMatchLayer:ad1:af6', [0, false], 'OverlayTextBorderMode:add:af7', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'OverlayTextBorderRadius:aef:af8', [1, NaN], 'OverlayTextBorderShift:aeg:af9', [1, NaN], 'OverlayTextBorderThickness:aeh:aga', [1, 1], 'OverlayTextColorMatchLayer:ad2:agb', [0, true], 'OverlayTextColorMode:ade:agc', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'OverlayTextColor:ags:agd', [Brush.$, null], 'OverlayTextColorShift:aei:age', [1, NaN], 'OverlayTextHorizontalMargin:aej:agf', [1, NaN], 'OverlayTextHorizontalPadding:aek:agg', [1, NaN], 'OverlayTextLocation:adl:agh', [OverlayTextLocation_$type, /*@__PURE__*/ enumGetBox(OverlayTextLocation_$type, 0)], 'OverlayTextMemberPath:afh:agi', [2, null], 'OverlayText:aex:agj', [2, null], 'OverlayTextVerticalMargin:ael:agk', [1, NaN], 'OverlayTextVerticalPadding:aem:agl', [1, NaN], 'OverlayTextVisible:ad3:agm', [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.afs();
}
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 && f.width > 0 && f.height > 0) {
a.w(f);
}
}
for (let g = 0; g < this.cs.count; g++) {
let h = this.cs._inner[g];
if (h._visibility == 0 && h.width > 0 && h.height > 0 && !stringIsNullOrEmpty(h.al)) {
a.ah(h.dataContext);
a.y(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;
})();