igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
1,157 lines (1,156 loc) • 44 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-angular-core";
import { OverlayTextLocation_$type } from "./OverlayTextLocation";
import { Brush } from "igniteui-angular-core";
import { enumGetBox, Number_$type, typeCast, fromEnum, Point_$type, markType, markDep, getInstanceType, runOn } from "igniteui-angular-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-angular-core";
import { Axis } from "./Axis";
import { Pool$1 } from "igniteui-angular-core";
import { AxisAnnotation } from "./AxisAnnotation";
import { IFastItemsSource_$type } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { Defaults } from "./Defaults";
import { DataAnnotationShapeFrameManager } from "./DataAnnotationShapeFrameManager";
import { XamDataChart } from "./XamDataChart";
import { Size } from "igniteui-angular-core";
import { BrushUtil } from "igniteui-angular-core";
import { TextBlock } from "igniteui-angular-core";
import { Rectangle } from "igniteui-angular-core";
import { Extensions } from "igniteui-angular-core";
import { NumberFormatSpecifier } from "igniteui-angular-core";
import { BindingFormatter } from "igniteui-angular-core";
import { CSSColorUtil } from "igniteui-angular-core";
import { Path } from "igniteui-angular-core";
import { Tuple$2 } from "igniteui-angular-core";
import { PathFigure } from "igniteui-angular-core";
import { PathGeometry } from "igniteui-angular-core";
import { LineSegment } from "igniteui-angular-core";
import { OverlayTextInfo } from "./OverlayTextInfo";
import { DoubleCollection } from "igniteui-angular-core";
import { DeviceUtils } from "igniteui-angular-core";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { PropertyMetadata } from "igniteui-angular-core";
import { truncate, isNaN_, log10, isInfinity } from "igniteui-angular-core";
import { stringIsNullOrEmpty } from "igniteui-angular-core";
import { round10N } from "igniteui-angular-core";
import { AnnotationLayerView } from "./AnnotationLayerView";
import { TranslateTransform } from "igniteui-angular-core";
import { LineGeometry } from "igniteui-angular-core";
/**
* @hidden
*/
export let DataAnnotationShapeLayer = /*@__PURE__*/ (() => {
class DataAnnotationShapeLayer extends DataAnnotationAxisLayer {
constructor() {
super();
this.stylingOverlayText = null;
this.stylingShapeAnnotation = null;
this.stylingAxisAnnotation = null;
this.adq = null;
this.ado = null;
this.adn = null;
this.ad4 = null;
this.ad3 = null;
this.ad5 = new List$1(DataAnnotationItem.$, 0);
this.agr = null;
this.aeo = 0;
this.adu = false;
this.ade = null;
this.adf = null;
this.adl = null;
this.adm = null;
let a = new DataAnnotationShapeLayerFrame();
let b = new DataAnnotationShapeLayerFrame();
let c = new DataAnnotationShapeLayerFrame();
let d = this.km / 1000;
this.xw = a;
this.xv = b;
this.xx = c;
this.ab = DataAnnotationShapeLayer.$;
}
get_ad2() {
return true;
}
get ad2() {
return this.get_ad2();
}
get adr() {
return this.adq;
}
set adr(a) {
if (this.adq != a) {
let b = this.adq;
this.adq = a;
this.raisePropertyChanged("OverlayTextColumn", b, this.adq);
}
}
get adp() {
return this.ado;
}
set adp(a) {
let b = this.ado;
if (OverlayTextUtil.q(a)) {
a = OverlayTextUtil.c();
}
this.ado = a;
if (b != this.ado) {
this.raisePropertyChanged("OverlayTextStyle", b, this.ado);
}
}
rp(a, b, c, d) {
if (b == "CrosshairPoint") {
return;
}
super.rp(a, b, c, d);
switch (b) {
case "SeriesViewer":
if (d == null) {
if (this.ad3 != null && this.ad3.count > 0) {
let e;
if (this.d4()) {
e = this.xx;
}
else {
e = this.xv;
}
e.bp();
this.afu(e, true, true);
}
}
break;
case DataAnnotationShapeLayer.$$p[0]:
case "AreaFillOpacity":
this.r7(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.aca();
break;
case "FastItemsSource":
this.afr(c, d);
this.afo();
this.aca();
break;
case DataAnnotationShapeLayer.$$p[21]:
case DataAnnotationShapeLayer.$$p[20]:
if (this.dp != null) {
this.dp.deregisterColumn(this.adr);
this.adr = this.dn(this.aff);
}
break;
}
}
adw(a) {
return !stringIsNullOrEmpty(a);
}
dl(a) {
if (this.dp == null) {
return null;
}
if (!this.adw(a)) {
return null;
}
return super.dl(a);
}
dn(a) {
if (this.dp == null) {
return null;
}
if (!this.adw(a)) {
return null;
}
return super.dn(a);
}
afn(a) {
if (this.dp != null) {
this.dp.deregisterColumn(a);
}
}
afr(a, b) {
this.ad5.clear();
if (typeCast(IFastItemsSource_$type, a) != null) {
let c = a;
c.deregisterColumn(this.adr);
this.adr = null;
}
if (typeCast(IFastItemsSource_$type, b) != null) {
this.adr = this.dn(this.aff);
}
}
pn(a, b, c, d) {
super.pn(a, b, c, d);
switch (a) {
case 3:
this.afp(b);
break;
case 1:
for (let e = b; e < b + c; e++) {
if (this.ad5.count > e) {
let f = new DataAnnotationItem();
this.ad5.insert(e, f);
this.afp(e);
}
}
break;
case 0:
this.ad5.v(b, c);
break;
case 2:
for (let g = b; g < b + c; g++) {
this.afp(g);
}
break;
case 4:
this.afo();
break;
}
this.r7(true);
}
ct() {
return new DataAnnotationShapeLayerView(this);
}
rg(a) {
super.rg(a);
this.adh = a;
}
afq() {
this.jy = Defaults.dataAnnotationShapeThickness;
this.is = Defaults.dataAnnotationShapeThickness;
this.il = Defaults.dataAnnotationShapeThickness;
this.ir = Defaults.dataAnnotationShapeFillOpacity;
this.abc = Defaults.dataAnnotationLabelThickness;
this.ado = OverlayTextUtil.c();
}
q3() {
super.q3();
if (!this.a1.c && !this.d4()) {
return;
}
if (this.aay) {
this.aay = false;
this.afo();
}
if (this.d4()) {
this.afv(this.xx, false);
}
else {
this.afv(this.xv, false);
}
}
afo() {
this.ad5.clear();
if (this.dp == null || this.dp.count == 0) {
return;
}
for (let a = 0; a < this.dp.count; a++) {
let b = new DataAnnotationItem();
this.ad5.add(b);
this.afp(a);
}
}
afp(a) {
}
afv(a, b) {
let c = false;
if (this.ad3 == null) {
c = true;
this.ad4 = new List$1(Axis.$, 0);
this.ad3 = new Dictionary$2(Axis.$, Pool$1.$.specialize(AxisAnnotation.$), 0);
}
this.afu(a, c, b);
}
afu(a, b, c) {
DataAnnotationShapeFrameManager.c(this, a, b, this.ad3, this.ad4, c, this.abf, this.abe);
}
zf(a, b) {
super.zf(a, b);
let c = a;
let d = true;
c.bp();
this.adh.cu();
this.aeo = 0;
if (this.aav != null) {
if (this.aa4(this.aav)) {
this.aft(this.aav, c, d);
}
}
else {
if (typeCast(XamDataChart.$, this.dc) !== null) {
let e = this.da.aat(this.aax);
for (let f of fromEnum(e)) {
this.aft(f, c, d);
}
}
}
}
ael(a) {
return isNaN_(this.aeb) ? 0 : this.aeb;
}
aft(a, b, c) {
if (b == null) {
return;
}
if (a == null) {
return;
}
this.ade = null;
this.adf = null;
this.adl = null;
this.adm = null;
let d = this.getEffectiveViewport();
let e = this.dc.yr;
if (a.dy) {
this.adf = a;
if (this.adf.an != null) {
this.ade = this.adf.an;
}
else {
this.ade = this.add(a);
}
this.adu = false;
}
else {
this.ade = a;
if (this.ade.an != null) {
this.adf = this.ade.an;
}
else {
this.adf = this.add(a);
}
this.adu = true;
}
if (this.ade == null) {
return;
}
if (this.adf == null) {
return;
}
this.adm = new ScalerParams(1, e, this.adf.o3, this.adf.dn);
this.adl = new ScalerParams(1, e, this.ade.o3, this.ade.dn);
this.adl.c = d;
this.adm.c = d;
let f = this.il;
let g = this.aab();
if (g == null) {
g = BrushUtil.j(255, 0, 0, 0);
}
let h = this.ad2 ? this.aac() : g;
if (h == null) {
h = BrushUtil.j(255, 0, 0, 0);
}
g = OverlayTextUtil.ah(g, this.x8, this.xi);
h = OverlayTextUtil.ah(h, this.x8, this.xi);
let i = this.adu;
this.afo();
this.afs();
let j = this.adp;
let k = OverlayTextUtil.o(j, this.ad1);
let l = this.adj;
if (l == 18) {
k = false;
}
if (k) {
this.adh.cq.count = this.ad5.count;
this.adh.cp.count = this.ad5.count;
}
for (let m = 0; m < this.ad5.count; m++) {
let n = this.ad5._inner[m];
n.dataIndex = m;
n.shapeBrush = n.shapeBrush != null ? n.shapeBrush : g;
n.shapeOutline = n.shapeOutline != null ? n.shapeOutline : h;
if (this.ad2) {
n.shapeBrush = BrushUtil.s(n.shapeBrush, this.ir);
}
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.agu(q.at, false);
o.add(r);
let s = this.agu(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.ads);
let u = this.ac4;
if (u == null) {
u = this.aaz ? g : Defaults.dataAnnotationLabelBackground;
}
let v = this.ac7;
if (v == null) {
v = this.aa1 ? h : Defaults.dataAnnotationLabelBorderStroke;
}
let w = this.ad2 ? n.shapeOutline : n.shapeBrush;
let x = this.ac8;
if (x == null) {
x = this.aa3 ? w : this.ac8;
}
let y = OverlayTextUtil.t(this.abc, Defaults.dataAnnotationLabelBorderThickness);
let z = OverlayTextUtil.t(this.aba, 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.abb, this.aat);
aa.background = OverlayTextUtil.ah(aa.background, this.aa5, this.aas);
aa.textColor = OverlayTextUtil.af(aa.background, aa.textColor, this.abd, this.aau);
if (isNaN_(aa.borderThickness)) {
aa.borderThickness = y;
}
if (isNaN_(aa.borderRadius)) {
aa.borderRadius = z;
}
let ab = this.agu(aa.at, false);
aa.xAxisPixel = ab.x;
aa.yAxisPixel = ab.y;
aa.xAxisWindow = this.aem(ab.x);
aa.yAxisWindow = this.aen(ab.y);
aa.xAxisValue = aa.j ? this.ade.f8(ab.x, this.adl) : NaN;
aa.yAxisValue = aa.k ? this.adf.f8(ab.y, this.adm) : NaN;
let ac = aa.a;
let ad = aa.b;
aa.xAxisLabel = this.aeq(this.ade, aa, true);
aa.yAxisLabel = this.aeq(this.adf, aa, false);
aa.dataIndex = n.dataIndex;
aa.isXAxisBadgeEnabled = this.adt(n.dataIndex, false);
aa.isYAxisBadgeEnabled = this.adt(n.dataIndex, true);
aa.xAxisBadgeBackground = this.agl(n.dataIndex, false, false, aa.background);
aa.yAxisBadgeBackground = this.agl(n.dataIndex, false, true, aa.background);
aa.xAxisBadgeOutline = this.agl(n.dataIndex, true, false, aa.background);
aa.yAxisBadgeOutline = this.agl(n.dataIndex, true, true, aa.background);
aa.xAxisBadgeImagePath = this.aes(n.dataIndex, false);
aa.yAxisBadgeImagePath = this.aes(n.dataIndex, true);
aa.xAxisBadgeOutlineThickness = this.aa8;
aa.yAxisBadgeOutlineThickness = this.aa8;
aa.xAxisBadgeRadius = this.aa6;
aa.yAxisBadgeRadius = this.aa6;
aa.xAxisBadgeSize = this.aa9;
aa.yAxisBadgeSize = this.aa9;
aa.xAxisBadgeMargin = this.aa7;
aa.yAxisBadgeMargin = this.aa7;
aa.xAxisUserAnnotation = this.adn;
aa.yAxisUserAnnotation = this.adn;
if (this.stylingAxisAnnotation != null) {
this.stylingAxisAnnotation(this, aa);
}
if (ac != aa.a) {
aa.xAxisLabel = this.aeq(this.ade, aa, true);
}
if (ad != aa.b) {
aa.yAxisLabel = this.aeq(this.adf, aa, false);
}
}
if (this.aa2) {
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.ac9, ag, ah, this.ade, this.adf, this.adl, this.adm);
}
}
let ai = this.aev;
if (stringIsNullOrEmpty(ai)) {
ai = this.aet(m, this.adr);
}
let aj = new Size(1, 0, 0);
let ak = { $type: Point_$type, x: NaN, y: NaN };
let al = this.ael(a);
let am = this.agq;
if (am == null && this.ad0) {
am = g;
}
let an = this.ago;
if (an == null && this.ady) {
an = g;
}
let ao = this.agp;
if (ao == null && this.adz) {
ao = g;
}
let ap = new OverlayTextUpdatingEventArgs();
ap.dataIndex = m;
ap.backgroundMode = this.ada;
ap.backgroundShift = this.aec;
ap.background = an;
ap.borderMode = this.adb;
ap.borderShift = this.aee;
ap.borderStroke = ao;
ap.borderRadius = this.aed;
ap.borderThickness = this.aef;
ap.textLocation = this.adj;
ap.textAngle = al;
ap.textVisible = this.ad1;
ap.textContent = ai;
ap.textColorMode = this.adc;
ap.textColorShift = this.aeg;
ap.textColor = am;
ap.shapeBrush = g;
ap.shapeOutline = h;
ap.f = !i;
ap.horizontalMargin = this.aeh;
ap.verticalPadding = this.aek;
ap.verticalMargin = this.aej;
ap.horizontalPadding = this.aei;
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);
}
}
afs() {
if (OverlayTextUtil.q(this.ado)) {
this.ado = OverlayTextUtil.c();
}
else if (OverlayTextUtil.k(this.ado)) {
this.ado = this.cw.l(this.ado.fontString);
}
}
aer(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.gh();
g = h == 0 ? 0 : truncate(Math.max(-Math.floor(log10(h)), 0));
g += 1;
}
return round10N(b, g).toString();
}
aeq(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.aaw != 0 && i == 0) {
i = this.aaw;
}
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.aer(a, d, this.abf, this.abe);
}
else if (i == 2) {
if (stringIsNullOrEmpty(e)) {
return null;
}
else {
return e;
}
}
else if (i == 4) {
let j = this.abf;
if (j < 0) {
j = 0;
}
let k = this.abf;
if (k < 0) {
k = 0;
}
return this.aer(a, g, j, k);
}
else if (i == 5) {
let l = this.abf;
if (l < 0) {
l = 2;
}
let m = this.abf;
if (m < 0) {
m = 2;
}
return this.aer(a, h, l, m);
}
else if (i == 3) {
if (a.dq) {
return this.aer(a, f, this.abf, this.abe);
}
else {
return a.i6(d);
}
}
return null;
}
adt(a, b) {
return this.aa0;
}
agl(a, b, c, d) {
return this.ac5;
}
aes(a, b) {
return this.abn;
}
agn(a, b) {
if (a == null) {
return OverlayTextUtil.ae(b);
}
return a;
}
agm(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;
}
zi(a, b) {
super.zi(a, b);
let c = this.adh.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.afm(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.adh.cq.item(q)._visibility = 0;
this.adh.cp.item(q)._visibility = 0;
}
else {
this.adh.cq.item(q)._visibility = 1;
this.adh.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.adj;
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.adh.cq.item(q);
aa.ac = this.adh.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.afv(this.xx, true);
}
else {
this.afv(this.xv, false);
}
}
afm(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.aad;
e.am = this.wo;
e.al = this.wn;
e.ak = this.wn;
e.aj = this.wm;
e.ac = this.jp;
return new Tuple$2(Path.$, Number_$type, e, b);
}
xm() {
return 3;
}
ya() {
return 0.1;
}
yd() {
return -0.4;
}
yc() {
return NaN;
}
zn() {
super.zn();
this.x8 = this.yg();
}
yg() {
if (isNaN_(this.yj)) {
switch (this.xi) {
case 1: return this.ya();
case 2: return this.yd();
case 4:
case 3: return this.yc();
}
}
return this.yj;
}
aag() {
if (this.agr == null) {
this.agr = new DoubleCollection();
this.agr.add(DeviceUtils.g(2));
this.agr.add(DeviceUtils.g(4));
}
return this.agr;
}
aet(a, b) {
if (b == null || b.count <= a) {
return null;
}
let c = b.item(a);
return c != null ? c.toString() : null;
}
aea(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;
}
agt(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);
}
agu(a, b = false) {
let c = b ? 1 : 2;
let d = b ? 0 : -1;
if (this.adx) {
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.yj({ $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.ad8(c));
i = true;
}
if (isInfinity(g) && g < 0) {
g = Math.floor(this.ad8(d));
i = true;
}
if (isInfinity(h) && h > 0) {
h = Math.floor(this.ad9(c));
j = true;
}
if (isInfinity(h) && h < 0) {
h = Math.floor(this.ad9(d));
j = true;
}
if (!i && !isNaN_(g)) {
g = this.ade.f5(g, this.adl);
}
if (!j && !isNaN_(h)) {
h = this.adf.f5(h, this.adm);
}
return { $type: Point_$type, x: g, y: h };
}
}
ad6(a) {
return this.ade.f5(a, this.adl);
}
ad7(a) {
return this.adf.f5(a, this.adm);
}
adv(a) {
if (this.ade == null) {
return false;
}
if (this.adf == null) {
return false;
}
if (this.adl == null) {
return false;
}
if (this.adm == null) {
return false;
}
if (this.dp == null) {
return false;
}
if (a < 0 || a >= this.dp.count) {
return false;
}
if (this.ad5 == null) {
return false;
}
if (a < 0 || a >= this.ad5.count) {
return false;
}
return true;
}
add(a) {
if (typeCast(XamDataChart.$, this.dc) !== null) {
let b = this.dc;
for (let c of fromEnum(b.zq)) {
if (c.dy && !a.dy) {
return c;
}
if (!c.dy && a.dy) {
return c;
}
}
}
return null;
}
ags(a) {
return this.dc.yj(a);
}
ad8(a) {
return this.dc.yj({ $type: Point_$type, x: a, y: NaN }).x;
}
ad9(a) {
return this.dc.yj({ $type: Point_$type, x: NaN, y: a }).y;
}
agv(a) {
return this.dc.yl(a);
}
aem(a) {
return this.dc.yl({ $type: Point_$type, x: a, y: NaN }).x;
}
aen(a) {
return this.dc.yl({ $type: Point_$type, x: NaN, y: a }).y;
}
}
DataAnnotationShapeLayer.$t = markType(DataAnnotationShapeLayer, 'DataAnnotationShapeLayer', DataAnnotationAxisLayer.$);
DataAnnotationShapeLayer.$$p = markDep(DependencyProperty, PropertyMetadata, DataAnnotationShapeLayer, 'raisePropertyChanged', ['AnnotationShapeVisible:ads:afw', [0, true], 'ItemsUseWorldCoordinates:adx:afx', [0, false], 'OverlayTextAngle:aeb:afy', [1, NaN], 'OverlayTextBackgroundMatchLayer:ady:afz', [0, false], 'OverlayTextBackgroundMode:ada:af0', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'OverlayTextBackground:ago:af1', [Brush.$, null], 'OverlayTextBackgroundShift:aec:af2', [1, NaN], 'OverlayTextBorderColor:agp:af3', [Brush.$, null], 'OverlayTextBorderMatchLayer:adz:af4', [0, false], 'OverlayTextBorderMode:adb:af5', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'OverlayTextBorderRadius:aed:af6', [1, NaN], 'OverlayTextBorderShift:aee:af7', [1, NaN], 'OverlayTextBorderThickness:aef:af8', [1, 1], 'OverlayTextColorMatchLayer:ad0:af9', [0, true], 'OverlayTextColorMode:adc:aga', [AnnotationAppearanceMode_$type, enumGetBox(AnnotationAppearanceMode_$type, 0)], 'OverlayTextColor:agq:agb', [Brush.$, null], 'OverlayTextColorShift:aeg:agc', [1, NaN], 'OverlayTextHorizontalMargin:aeh:agd', [1, NaN], 'OverlayTextHorizontalPadding:aei:age', [1, NaN], 'OverlayTextLocation:adj:agf', [OverlayTextLocation_$type, enumGetBox(OverlayTextLocation_$type, 0)], 'OverlayTextMemberPath:aff:agg', [2, null], 'OverlayText:aev:agh', [2, null], 'OverlayTextVerticalMargin:aej:agi', [1, NaN], 'OverlayTextVerticalPadding:aek:agj', [1, NaN], 'OverlayTextVisible:ad1:agk', [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.afq();
}
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.af(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 = markType(DataAnnotationShapeLayerView, 'DataAnnotationShapeLayerView', AnnotationLayerView.$);
return DataAnnotationShapeLayerView;
})();