igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
1,282 lines • 52.5 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 { Series } from "./Series";
import { UserAnnotationCollection } from "./UserAnnotationCollection";
import { JsonDictionaryParser } from "igniteui-react-core";
import { JsonDictionaryArray } from "igniteui-react-core";
import { UserBaseAnnotation } from "./UserBaseAnnotation";
import { JsonDictionaryObject } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { Axis } from "./Axis";
import { Dictionary$2 } from "igniteui-react-core";
import { BrushUtil } from "igniteui-react-core";
import { UserAnnotationFlow } from "./UserAnnotationFlow";
import { HashSet$1 } from "igniteui-react-core";
import { DataAnnotationSliceLayer } from "./DataAnnotationSliceLayer";
import { DataAnnotationStripLayer } from "./DataAnnotationStripLayer";
import { UserAnnotationDataContext } from "./UserAnnotationDataContext";
import { ObservableCollection$1 } from "igniteui-react-core";
import { CalloutLayer } from "./CalloutLayer";
import { Base, typeCast, runOn, delegateCombine, String_$type, Point_$type, delegateRemove, fromEnum, markType } from "igniteui-react-core";
import { UserAnnotationPointDataContext } from "./UserAnnotationPointDataContext";
import { UserPointAnnotation } from "./UserPointAnnotation";
import { UserSliceAnnotation } from "./UserSliceAnnotation";
import { UserStripAnnotation } from "./UserStripAnnotation";
import { UserAnnotationInformationEventArgs } from "./UserAnnotationInformationEventArgs";
import { ScalerParams } from "./ScalerParams";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { UserAnnotationInformation } from "./UserAnnotationInformation";
import { Tuple$2 } from "igniteui-react-core";
import { CalloutAnnotationWrapper } from "./CalloutAnnotationWrapper";
import { CalloutView } from "./CalloutView";
import { PlatformAPIHelper } from "igniteui-react-core";
import { AutomaticSeriesRequest } from "./AutomaticSeriesRequest";
import { AxisAnnotation } from "./AxisAnnotation";
import { UserAnnotationStripDataContext } from "./UserAnnotationStripDataContext";
import { UserAnnotationAxisDataContext } from "./UserAnnotationAxisDataContext";
import { UserAnnotationSliceDataContext } from "./UserAnnotationSliceDataContext";
import { truncate, isNaN_ } from "igniteui-react-core";
import { stringIsNullOrEmpty } from "igniteui-react-core";
/**
* @hidden
*/
export let UserAnnotationLayer = /*@__PURE__*/ (() => {
class UserAnnotationLayer extends Series {
get annotations() {
return this.xn;
}
get_ev() {
return true;
}
get_ga() {
return true;
}
get_isUsableInLegend() {
return false;
}
y7(a) {
let b = new JsonDictionaryParser();
let c = b.parse(a);
if (typeCast(JsonDictionaryObject.$, c) !== null && c.g("annotations")) {
let d = c.item("annotations");
if (typeCast(JsonDictionaryArray.$, d) !== null) {
let e = d;
if (e.items != null) {
this.annotations.clear();
for (let f = 0; f < e.items.length; f++) {
let g = e.items[f];
if (typeCast(JsonDictionaryObject.$, g) !== null) {
let h = UserBaseAnnotation.l(g);
this.annotations.add(h);
}
}
}
}
}
}
yq() {
let a = new JsonDictionaryObject();
let b = new JsonDictionaryArray();
a.item("annotations", b);
b.items = new Array(this.annotations.count);
for (let c = 0; c < b.items.length; c++) {
let d = this.annotations._inner[c];
let e = d.n();
b.items[c] = e;
}
return a.b();
}
constructor() {
super();
this.ys = "UserLayer";
this.xn = new UserAnnotationCollection();
this.yj = new List$1(Axis.$, 0);
this.yc = new Dictionary$2(Axis.$, Axis.$, 0);
this.zq = BrushUtil.l(255, 255, 255, 255);
this.zp = BrushUtil.l(255, 0, 0, 0);
this.xk = null;
this.x8 = new Dictionary$2(String_$type, UserAnnotationFlow.$, 0);
this.userAnnotationInformationRequested = null;
this.yk = new List$1(UserAnnotationItems.$, 0);
this.x6 = new Dictionary$2(String_$type, UserBaseAnnotation.$, 0);
this.yi = new HashSet$1(Axis.$, 0);
this.yg = new HashSet$1(Axis.$, 0);
this.yb = new Dictionary$2(Axis.$, DataAnnotationSliceLayer.$, 0);
this.yf = new Dictionary$2(Axis.$, DataAnnotationStripLayer.$, 0);
this.ya = new Dictionary$2(Axis.$, HashSet$1.$.specialize(UserAnnotationDataContext.$), 0);
this.x9 = new Dictionary$2(Axis.$, ObservableCollection$1.$.specialize(UserAnnotationDataContext.$), 0);
this.ye = new Dictionary$2(Axis.$, HashSet$1.$.specialize(UserAnnotationDataContext.$), 0);
this.yd = new Dictionary$2(Axis.$, ObservableCollection$1.$.specialize(UserAnnotationDataContext.$), 0);
this.yh = new HashSet$1(UserAnnotationDataContext.$, 0);
this.ym = new ObservableCollection$1(UserAnnotationDataContext.$, 0);
this.x7 = new Dictionary$2(Axis.$, HashSet$1.$.specialize(UserAnnotationDataContext.$), 0);
this.xm = null;
this.stylingAxisAnnotation = null;
this.stylingSliceAnnotation = null;
this.stylingStripAnnotation = null;
this.stylingPointAnnotation = null;
UserAnnotationLayer.yp++;
this.ys = "UserLayer" + UserAnnotationLayer.yp;
let a = this.xn;
a.collectionChanged = delegateCombine(a.collectionChanged, runOn(this, this.yu));
let b = this.xn;
b.collectionResetting = delegateCombine(b.collectionResetting, runOn(this, this.yv));
}
y1(a) {
if (this.da == null) {
return;
}
if (this.da.zr == null) {
return;
}
if (this.da.zr.count < 2) {
return;
}
if (this.yc.containsKey(a)) {
return;
}
let b = this.xl(a);
if (b == null) {
let c = a;
c.ct = true;
c.oh = BrushUtil.l(0, 255, 255, 255);
c.om = BrushUtil.l(0, 255, 255, 255);
c.fn = 0;
this.yc.addItem(a, b);
}
}
y2(a) {
if (this.da == null) {
return;
}
if (this.da.zr == null) {
return;
}
if (this.da.zr.count < 2) {
return;
}
if (this.yc.containsKey(a)) {
this.yc.removeItem(a);
let b = this.xl(a);
a.ct = false;
}
}
xl(a) {
for (let b = 0; b < this.da.zr.count; b++) {
let c = this.da.zr._inner[b];
if (c.dh && c.ao == a) {
return c;
}
}
return null;
}
zr(a, b) {
return a != null ? a : b;
}
y6(a, b) {
let c = typeCast(UserAnnotationPointDataContext.$, b.item);
if (c != null) {
let d = c.b;
if (d != null) {
d.ay(this.dc);
b.a = d.targetSeries;
}
}
}
za(a, b) {
let c = b.o;
let d = c.b;
if (d != null) {
if (d.bo != null) {
b.textColor = d.bo;
}
if (d.bm != null) {
b.background = d.bm;
}
if (d.bn != null) {
b.outline = d.bn;
b.leaderBrush = d.bn;
}
if (!isNaN_(d.y)) {
b.strokeThickness = d.y;
}
if (!isNaN_(d.x)) {
b.backgroundCorner = d.x;
}
if (!isNaN_(d.z)) {
b.bacgkroundPaddingLeft = d.z;
b.bacgkroundPaddingBottom = d.z;
b.bacgkroundPaddingTop = d.z;
b.bacgkroundPaddingRight = d.z;
}
if (!stringIsNullOrEmpty(d.ag)) {
b.badgeImage = d.ag;
}
if (d.bk != null) {
b.badgeBackground = d.bk;
}
if (d.bl != null) {
b.badgeOutline = d.bl;
}
if (d.w >= 0) {
b.badgeThickness = d.w;
}
if (d.t >= 0) {
b.badgeCorner = d.t;
}
if (d.u >= 0) {
b.badgeGap = d.u;
}
if (d.v > 0) {
b.badgeWidth = d.v;
b.badgeHeight = d.v;
}
b.badgeVisible = d.p;
}
}
y9(a, b) {
let c = b.l;
if (typeCast(UserAnnotationPointDataContext.$, c) !== null) {
let d = c.b;
if (d != null) {
if (d.r) {
b.backgroundCorner = b.height * 0.5;
}
}
}
}
y8(a, b) {
if (b != null) {
a.textContent = b.overlayText;
a.textVisible = b.overlayTextVisible;
a.textLocation = b.overlayTextLocation;
a.borderMode = b.overlayTextBorderMode;
a.backgroundMode = b.overlayTextBackgroundMode;
a.textColorMode = b.overlayTextColorMode;
if (b.overlayTextBackground != null) {
a.background = b.overlayTextBackground;
}
if (b.overlayTextBorderColor != null) {
a.borderStroke = b.overlayTextBorderColor;
}
if (b.overlayTextColor != null) {
a.textColor = b.overlayTextColor;
}
if (!isNaN_(b.overlayTextBorderShift)) {
a.borderShift = b.overlayTextBorderShift;
}
if (!isNaN_(b.overlayTextBorderRadius)) {
a.borderRadius = b.overlayTextBorderRadius;
}
if (!isNaN_(b.overlayTextBackgroundShift)) {
a.backgroundShift = b.overlayTextBackgroundShift;
}
if (!isNaN_(b.overlayTextColorShift)) {
a.textColorShift = b.overlayTextColorShift;
}
if (!isNaN_(b.overlayTextAngle)) {
a.textAngle = b.overlayTextAngle;
}
if (!isNaN_(b.overlayTextBorderThickness)) {
a.borderThickness = b.overlayTextBorderThickness;
}
}
}
zc(a, b) {
let c = b.dataIndex;
let d = typeCast(Series.$, a);
if (d != null) {
let e = typeCast(ObservableCollection$1.$.specialize(UserAnnotationDataContext.$), d.itemsSource);
if (e != null && e.count > c) {
let f = e._inner[c].b;
this.y8(b, f);
}
}
}
zf(a, b) {
let c = b.dataIndex;
let d = typeCast(Series.$, a);
if (d != null) {
let e = typeCast(ObservableCollection$1.$.specialize(UserAnnotationDataContext.$), d.itemsSource);
if (e != null && e.count > c) {
let f = e._inner[c].b;
this.y8(b, f);
}
}
}
zd(a, b) {
let c = (b.dataIndex);
let d = typeCast(Series.$, a);
if (d != null) {
let e = typeCast(ObservableCollection$1.$.specialize(UserAnnotationDataContext.$), d.itemsSource);
if (e != null && e.count > c) {
let f = e._inner[c].b;
if (f != null) {
if (f.shapeBackground != null) {
b.shapeBrush = f.shapeBackground;
}
if (f.shapeOutline != null) {
b.shapeOutline = f.shapeOutline;
}
if (!isNaN_(f.shapeThickness)) {
b.shapeThickness = f.shapeThickness;
}
}
}
}
}
zb(a, b) {
let c = truncate((b.dataIndex));
let d = typeCast(Series.$, a);
if (d != null) {
let e = typeCast(ObservableCollection$1.$.specialize(UserAnnotationDataContext.$), d.itemsSource);
if (e != null && e.count > c) {
let f = e._inner[c].b;
if (f != null) {
if (b.j) {
if (f.valueDisplayMode != 0) {
b.a = f.valueDisplayMode;
}
}
if (b.k) {
if (f.valueDisplayMode != 0) {
b.b = f.valueDisplayMode;
}
}
if (!isNaN_(f.x)) {
b.borderRadius = f.x;
}
if (!isNaN_(f.y)) {
b.borderThickness = f.y;
}
if (f.bo != null) {
b.textColor = f.bo;
}
if (f.bm != null) {
b.background = f.bm;
}
if (f.bn != null) {
b.borderColor = f.bn;
}
}
}
}
}
ze(a, b) {
let c = truncate((b.dataIndex));
let d = typeCast(Series.$, a);
if (d != null) {
let e = typeCast(ObservableCollection$1.$.specialize(UserAnnotationDataContext.$), d.itemsSource);
if (e != null && e.count > c) {
let f = e._inner[c].b;
if (f != null) {
if (b.j) {
if (f.valueDisplayMode != 0) {
b.a = f.valueDisplayMode;
}
if (b.isStartLabel) {
if (f.valueDisplayMode != 0) {
b.a = f.valueDisplayMode;
}
if (f.startValueDisplayMode != 0) {
b.a = f.startValueDisplayMode;
}
}
if (b.isEndLabel) {
if (f.valueDisplayMode != 0) {
b.a = f.valueDisplayMode;
}
if (f.endValueDisplayMode != 0) {
b.a = f.endValueDisplayMode;
}
}
}
if (b.k) {
if (f.valueDisplayMode != 0) {
b.b = f.valueDisplayMode;
}
if (b.isStartLabel) {
if (f.valueDisplayMode != 0) {
b.b = f.valueDisplayMode;
}
if (f.startValueDisplayMode != 0) {
b.b = f.startValueDisplayMode;
}
}
if (b.isEndLabel) {
if (f.valueDisplayMode != 0) {
b.b = f.valueDisplayMode;
}
if (f.endValueDisplayMode != 0) {
b.b = f.endValueDisplayMode;
}
}
}
if (!isNaN_(f.x)) {
b.borderRadius = f.x;
}
if (!isNaN_(f.y)) {
b.borderThickness = f.y;
}
if (f.bo != null) {
b.textColor = f.bo;
}
if (f.bm != null) {
b.background = f.bm;
}
if (f.bn != null) {
b.borderColor = f.bn;
}
if (b.isStartLabel) {
if (f.startLabelColor != null) {
b.textColor = f.startLabelColor;
}
if (f.startLabelBackground != null) {
b.background = f.startLabelBackground;
}
if (f.startLabelBorderColor != null) {
b.borderColor = f.startLabelBorderColor;
}
}
if (b.isEndLabel) {
if (f.endLabelColor != null) {
b.textColor = f.endLabelColor;
}
if (f.endLabelBackground != null) {
b.background = f.endLabelBackground;
}
if (f.endLabelBorderColor != null) {
b.borderColor = f.endLabelBorderColor;
}
}
}
}
}
}
zg(a, b) {
let c = (b.dataIndex);
let d = typeCast(Series.$, a);
if (d != null) {
let e = typeCast(ObservableCollection$1.$.specialize(UserAnnotationDataContext.$), d.itemsSource);
if (e != null && e.count > c) {
let f = e._inner[c].b;
if (f != null) {
if (f.shapeBackground != null) {
b.shapeBrush = f.shapeBackground;
}
if (f.shapeOutline != null) {
b.shapeOutline = f.shapeOutline;
}
if (!isNaN_(f.shapeThickness)) {
b.shapeThickness = f.shapeThickness;
}
}
}
}
}
rr(a, b, c, d) {
super.rr(a, b, c, d);
if (b == "SeriesViewer") {
if (c != null) {
this.y0(c);
}
if (d != null) {
this.yw(d);
}
}
else {
this.zh(b);
}
}
yl(a) {
return this.xk.j(this.ys, a);
}
yw(a) {
a.seriesClick = delegateCombine(a.seriesClick, runOn(this, this.zl));
a.axisLabelMouseClick = delegateCombine(a.axisLabelMouseClick, runOn(this, this.zk));
a.viewerManipulationEnding = delegateCombine(a.viewerManipulationEnding, runOn(this, this.zm));
this.xk = this.dc.ao(this.dc);
for (let b = 0; b < this.yk.count; b++) {
this.y4(this.yk._inner[b]);
}
this.userAnnotationInformationRequested = delegateCombine(this.userAnnotationInformationRequested, runOn(this.dc, this.dc.rv));
}
zm(a, b) {
if (b.isDragSelect) {
if (this.dc != null && this.dc.f1) {
let c = b.dragSelectRectangle;
if (!c.isEmpty) {
b.isDragSelectCancelled = true;
let d = null;
for (let e = 0; e < this.da.zr.count; e++) {
let f = this.da.zr._inner[e];
if (f.dh) {
continue;
}
if (!f.dz) {
d = f;
break;
}
}
if (d != null) {
if (d.df && !d.dj) {
let g = this.da.yx(c);
let h = new ScalerParams(1, this.da.ys, this.da.za, d.dn);
h.c = this.getEffectiveViewport();
let i = d.ga(g.left, h);
let j = d.ga(g.right, h);
if (d.dn) {
let k = i;
i = j;
j = k;
}
i = Math.floor(i);
j = Math.ceil(j);
let l = this.xp();
let m = this.x0(d, i, j);
l.b = m;
this.zn(l);
this.yt(l);
this.zj(l);
this.dc.ud(l.d);
}
}
}
}
}
}
zk(a, b) {
let c = b.h;
let d = b.a;
let e = b.c;
if (this.dc.f1) {
if (d.df && !d.dj) {
let f = typeCast(CategoryAxisBase.$, d);
e = f.categoryMode == 2 ? Math.floor(e) : Math.round(e);
}
let g = this.xp();
let h = this.xz(d, c, e);
g.b = h;
this.zn(g);
this.yt(g);
this.zj(g);
this.dc.ud(g.d);
}
if (this.dc.f2) {
if (d.df && !d.dj) {
let i = typeCast(CategoryAxisBase.$, d);
e = i.categoryMode == 2 ? Math.floor(e) : Math.round(e);
}
let j = this.x1(d, c, e);
}
}
x1(a, b, c) {
for (let d = this.annotations.count - 1; d >= 0; d--) {
let e = this.annotations._inner[d];
if (e.k == 0) {
let f = typeCast(UserSliceAnnotation.$, this.annotations._inner[d]);
if (f != null && f.value == c) {
this.annotations.removeAt(d);
this.dc.pb();
return e;
}
}
if (e.k == 1) {
let g = typeCast(UserStripAnnotation.$, this.annotations._inner[d]);
if (g != null && (g.startValue <= c || g.endValue >= c)) {
this.annotations.removeAt(d);
this.dc.pb();
return e;
}
}
}
return null;
}
xz(a, b, c) {
let d = new UserSliceAnnotation();
d.targetAxisMatcher = a.a9();
d.value = c;
d.aq = " ";
return d;
}
x0(a, b, c) {
let d = new UserStripAnnotation();
d.targetAxisMatcher = a.a9();
d.startValue = b;
d.endValue = c;
d.aq = " ";
return d;
}
zl(a, b) {
if (!this.dc.za.containsPoint(b.chartPosition)) {
return;
}
let c = b.series;
let d = b.item;
let e = b.worldPosition;
if (this.dc.f1) {
b.cancelSelection = true;
let f = this.xp();
f.b = this.x2(c, d, e);
if (f.b == null) {
return;
}
this.zn(f);
this.yt(f);
this.zj(f);
this.dc.ud(f.d);
}
if (this.dc.f2) {
b.cancelSelection = true;
this.yz(c, d, e);
this.dc.pb();
}
}
zn(a) {
if (!this.x8.containsKey(a.d)) {
this.x8.addItem(a.d, a);
}
if (a.b != null) {
a.b.an = a.d;
}
}
zj(a) {
if (this.userAnnotationInformationRequested != null) {
this.userAnnotationInformationRequested(this, ((() => {
let $ret = new UserAnnotationInformationEventArgs();
$ret.annotationInfo = this.xr(a);
return $ret;
})()));
}
}
xr(a) {
return a.a;
}
yx(a) {
if (this.x8.containsKey(a)) {
let b = this.x8.item(a);
let c = b.b;
if (this.annotations.contains(c)) {
this.annotations.remove(c);
}
this.x8.removeItem(a);
}
}
y5(a) {
if (a.d != null) {
if (this.x8.containsKey(a.d)) {
let b = this.x8.item(a.d);
this.yy(b, a);
this.zo(b);
this.x8.removeItem(a.d);
}
}
}
zo(a) {
let b = a.a;
let c = a.b;
if (b != null && c != null) {
c.aq = b.f;
c.ac = b.c;
c.bk = b.h;
c.bm = b.i;
c.bn = b.i;
c.ag = b.e;
switch (c.k) {
case 3: break;
case 1:
let d = c;
d.shapeBackground = BrushUtil.u(b.i, 0.3);
d.startLabelBackground = b.i;
d.endLabelBackground = b.i;
d.startLabelBorderColor = b.i;
d.endLabelBorderColor = b.i;
break;
case 0:
let e = c;
e.shapeOutline = b.i;
e.bm = b.i;
e.bn = b.i;
break;
case 2:
let f = c;
f.bm = b.i;
f.bk = b.h;
f.bn = b.i;
break;
}
}
}
yy(a, b) {
let c = a.a;
c.g(b);
}
yt(a) {
this.annotations.add(a.b);
}
x2(a, b, c) {
let d = new UserPointAnnotation();
d.targetSeriesMatcher = a.cg();
let e = a.wx(c, false, false);
let f = a.w2(e);
if (isNaN_(f.x) || isNaN_(f.y)) {
return null;
}
d.xValue = f.x;
d.yValue = f.y;
d.aq = " ";
return d;
}
yz(a, b, c) {
if (a.eq) {
let d = this.o0(a, c);
let e = typeCast(Tuple$2.$.specialize(CalloutAnnotationWrapper.$, CalloutView.$), a.kx(d.d));
if (e == null || e.c == null || e.c.b == null || e.c.b.n == null) {
return;
}
let f = e.c.b.n.b;
for (let g = this.annotations.count - 1; g >= 0; g--) {
let h = this.annotations._inner[g];
if (h.k == 2) {
let i = h;
if (i == f) {
this.annotations.removeAt(g);
break;
}
}
}
return;
}
let j = a.wx(c, false, false);
let k = a.w2(j);
if (isNaN_(k.x) || isNaN_(k.y)) {
return;
}
for (let l = this.annotations.count - 1; l >= 0; l--) {
let m = this.annotations._inner[l];
if (m.k == 2) {
let n = m;
if (n.xValue == k.x && n.yValue == k.y) {
this.annotations.removeAt(l);
}
}
}
}
xp() {
let a = new UserAnnotationFlow();
a.a = this.xq(a.d);
return a;
}
xq(a) {
let b = new UserAnnotationInformation();
b.h = BrushUtil.l(255, 255, 255, 255);
b.f = " ";
b.i = BrushUtil.l(255, 0, 0, 0);
b.d = a;
if (this.dc != null) {
b.a = this.dc.za.left + (this.dc.za.width / 2);
b.b = this.dc.za.top + (this.dc.za.height / 2);
}
let c = this.zs({ $type: Point_$type, x: b.a, y: b.b });
b.a = c.x;
b.b = c.y;
return b;
}
zs(a) {
let b = 0;
let c = 0;
if (this.dc != null) {
let d = this.dc.yl();
b += d.x;
c += d.y;
}
return { $type: Point_$type, x: b + a.x, y: c + a.y };
}
y0(a) {
a.seriesClick = delegateRemove(a.seriesClick, runOn(this, this.zl));
a.axisLabelMouseClick = delegateRemove(a.axisLabelMouseClick, runOn(this, this.zk));
for (let b = 0; b < this.yk.count; b++) {
this.y4(this.yk._inner[b]);
}
this.userAnnotationInformationRequested = delegateRemove(this.userAnnotationInformationRequested, runOn(a, a.rv));
}
zh(a) {
if (this.xk == null) {
return;
}
let b = new List$1(Series.$, 0);
b.o(this.yl(12));
b.o(this.yl(13));
b.o(this.yl(14));
for (let c of fromEnum(b)) {
if (a == "Brush") {
c.v0 = this.v0;
}
else if (a == "Outline") {
c.wg = this.wg;
}
else if (a == "OutlineMode") {
c.cj = this.cj;
}
else if (a == "Thickness") {
c.jz = this.jz;
}
else if (a == "Resolution") {
c.js = this.js;
}
else if (a == "DashArray") {
c.wn = this.wn;
}
else if (a == "DashCap") {
c.wo = this.wo;
}
else if (a == "AreaFillOpacity") {
c.is = this.is;
}
}
}
yv(a, b) {
}
yu(a, b) {
switch (b.action) {
case 0:
if (b.newItems != null) {
for (let c = 0; c < b.newItems.count; c++) {
let d = b.newItems.item(c);
let e = this.xt(d);
if (d != null) {
this.x6.item(d.an, d);
}
this.yk.insert(c + b.newStartingIndex, e);
this.y3(e);
}
}
break;
case 1:
if (b.oldItems != null) {
for (let f = 0; f < b.oldItems.count; f++) {
let g = b.oldItems.item(f);
if (g != null) {
if (this.x6.containsKey(g.an)) {
this.x6.removeItem(g.an);
}
}
let h = this.yk._inner[b.oldStartingIndex];
this.yk.removeAt(b.oldStartingIndex);
this.y4(h);
}
}
break;
case 2:
if (b.oldItems != null) {
for (let i = 0; i < b.oldItems.count; i++) {
let j = b.oldItems.item(i);
if (j != null) {
if (this.x6.containsKey(j.an)) {
this.x6.removeItem(j.an);
}
}
let k = this.yk._inner[b.oldStartingIndex];
this.yk.removeAt(b.oldStartingIndex);
this.y4(k);
}
}
if (b.newItems != null) {
for (let l = 0; l < b.newItems.count; l++) {
let m = b.newItems.item(l);
let n = this.xt(m);
if (m != null) {
this.x6.item(m.an, m);
}
this.y3(n);
this.yk.insert(l + b.newStartingIndex, n);
}
}
break;
case 4:
for (let o = this.yk.count - 1; o >= 0; o--) {
let p = this.yk._inner[o];
if (p.k != null) {
if (this.x6.containsKey(p.k.an)) {
this.x6.removeItem(p.k.an);
}
}
this.yk.removeAt(o);
this.y4(p);
}
this.yk.clear();
break;
}
}
yr(a) {
return PlatformAPIHelper.r(a);
}
y3(a) {
if (a == null) {
return;
}
if (a.k == null || this.dc == null) {
return;
}
let b = a.k;
b.ay(this.dc);
if (a.l) {
let c = a.k.targetAxis;
if (c != null) {
if (a.h != null) {
if (this.yb.containsKey(c)) {
a.c = this.yb.item(c);
}
if (!this.ya.containsKey(c)) {
this.ya.addItem(c, new HashSet$1(UserAnnotationDataContext.$, 0));
}
if (!this.x9.containsKey(c)) {
this.x9.addItem(c, new ObservableCollection$1(UserAnnotationDataContext.$, 0));
}
let d = this.ya.item(c);
let e = this.x9.item(c);
if (!d.contains(a.h)) {
d.add_1(a.h);
e.add(a.h);
if (this.yb.containsKey(c)) {
this.yb.item(c).qx(e.count - 1, a.h);
}
}
}
if (a.h != null && !this.yb.containsKey(c)) {
let f = new DataAnnotationSliceLayer();
f.p1(this.dc);
this.yb.item(c, f);
a.c = f;
f.v0 = this.v0;
f.wg = this.wg;
f.jz = this.jz;
f.wn = this.wn;
f.wo = this.wo;
let g = this.ya.item(c);
let h = this.x9.item(c);
f.mc = this.ys;
f.name = this.ys + "_SliceAnnotation" + (UserAnnotationLayer.yn++);
f.afg = this.yr("OverlayText");
f.aax = 3;
f.ahm = this.yr("Label");
f.ahp = this.yr("Value");
f.stylingAxisAnnotation = delegateCombine(f.stylingAxisAnnotation, runOn(this, this.zb));
f.stylingShapeAnnotation = delegateCombine(f.stylingShapeAnnotation, runOn(this, this.zd));
f.stylingOverlayText = delegateCombine(f.stylingOverlayText, runOn(this, this.zc));
f.aaw = c;
f.itemsSource = h;
f.ado = a.k;
let i = new AutomaticSeriesRequest();
i.d = f;
i.a = 12;
i.g = true;
this.xk.b.add(i);
}
if (a.i != null) {
if (this.yf.containsKey(c)) {
a.d = this.yf.item(c);
}
if (!this.ye.containsKey(c)) {
this.ye.addItem(c, new HashSet$1(UserAnnotationDataContext.$, 0));
}
if (!this.yd.containsKey(c)) {
this.yd.addItem(c, new ObservableCollection$1(UserAnnotationDataContext.$, 0));
}
let j = this.ye.item(c);
let k = this.yd.item(c);
if (!j.contains(a.i)) {
j.add_1(a.i);
k.add(a.i);
if (this.yf.containsKey(c)) {
this.yf.item(c).qx(k.count - 1, a.i);
}
}
}
if (a.i != null && !this.yf.containsKey(c)) {
let l = this.ye.item(c);
let m = this.yd.item(c);
let n = new DataAnnotationStripLayer();
n.p1(this.dc);
this.yf.item(c, n);
a.d = n;
n.v0 = this.v0;
n.wg = this.wg;
n.cj = this.cj;
n.jz = this.jz;
n.js = this.js;
n.wn = this.wn;
n.wo = this.wo;
n.mc = this.ys;
n.name = this.ys + "_StripAnnotation" + (UserAnnotationLayer.yn++);
n.afg = this.yr("OverlayText");
n.ahq = 3;
n.aiy = this.yr("StartLabel");
n.ai1 = this.yr("StartValue");
n.ahp = 3;
n.air = this.yr("EndLabel");
n.aiu = this.yr("EndValue");
n.ain = this.yr("Label");
n.aho = 6;
n.stylingAxisAnnotation = delegateCombine(n.stylingAxisAnnotation, runOn(this, this.ze));
n.stylingShapeAnnotation = delegateCombine(n.stylingShapeAnnotation, runOn(this, this.zg));
n.stylingOverlayText = delegateCombine(n.stylingOverlayText, runOn(this, this.zf));
n.aaw = c;
n.itemsSource = m;
n.ado = a.k;
let o = new AutomaticSeriesRequest();
o.d = n;
o.a = 13;
o.g = true;
this.xk.b.add(o);
}
if (a.e != null) {
if (!this.x7.containsKey(c)) {
this.x7.addItem(c, new HashSet$1(UserAnnotationDataContext.$, 0));
}
let p = this.x7.item(c);
}
if (a.e != null) {
this.yg.add_1(c);
this.y1(c);
let q = this.x7.item(c);
if (!q.contains(a.e)) {
q.add_1(a.e);
let r = this.xl(c);
let s = new AxisAnnotation();
a.a = s;
a.o();
if (r.df && !r.dj) {
let t = typeCast(CategoryAxisBase.$, r);
if (t.categoryMode != 0) {
s.m = true;
}
}
r.at.add(s);
}
}
}
}
if (a.g != null) {
if (this.xm != null) {
a.b = this.xm;
}
if (!this.yh.contains(a.g)) {
this.yh.add_1(a.g);
this.ym.add(a.g);
if (this.xm != null) {
this.xm.qx(this.ym.count - 1, a.g);
}
}
}
if (a.g != null && this.xm == null) {
let u = new CalloutLayer();
u.p1(this.dc);
this.xm = u;
a.b = u;
u.v0 = this.v0;
u.wg = this.wg;
u.cj = this.cj;
u.jz = this.jz;
u.js = this.js;
u.wn = this.wn;
u.wo = this.wo;
u.calloutSeriesSelecting = delegateCombine(u.calloutSeriesSelecting, runOn(this, this.y6));
u.mc = this.ys;
u.name = this.ys + "_CalloutAnnotation" + (UserAnnotationLayer.yn++);
u.afr = this.yr("XValue");
u.afu = this.yr("YValue");
u.aew = this.yr("Label");
u.afb = this.yr("Label");
u.acf = false;
u.acp = false;
u.aci = true;
u.ach = true;
u.calloutStyleUpdating = delegateCombine(u.calloutStyleUpdating, runOn(this, this.za));
u.calloutRenderStyleUpdating = delegateCombine(u.calloutRenderStyleUpdating, runOn(this, this.y9));
u.itemsSource = this.ym;
let v = new AutomaticSeriesRequest();
v.d = u;
v.a = 14;
v.g = true;
this.xk.b.add(v);
}
}
y4(a) {
let b = a.k;
if (b == null) {
return;
}
if (a.l) {
let c = b.targetAxis;
if (c == null) {
return;
}
if (a.h != null) {
a.c = null;
if (this.ya.containsKey(c)) {
let d = this.ya.item(c);
let e = this.x9.item(c);
if (d.contains(a.h)) {
d.remove(a.h);
let f = e.indexOf(a.h);
e.remove(a.h);
this.yb.item(c).qy(f, a.h);
if (e.count == 0) {
this.x9.removeItem(c);
this.ya.removeItem(c);
let g = this.yb.item(c);
this.yb.removeItem(c);
this.zi(g);
}
}
}
}
if (a.i != null) {
a.d = null;
if (this.ye.containsKey(c)) {
let h = this.ye.item(c);
let i = this.yd.item(c);
if (h.contains(a.i)) {
h.remove(a.i);
let j = i.indexOf(a.i);
i.remove(a.i);
this.yf.item(c).qy(j, a.i);
if (i.count == 0) {
this.yd.removeItem(c);
this.ye.removeItem(c);
let k = this.yf.item(c);
this.yf.removeItem(c);
this.zi(k);
}
}
}
}
if (a.e != null) {
if (this.x7.containsKey(c)) {
let l = this.x7.item(c);
if (l.contains(a.e)) {
l.remove(a.e);
let m = this.xl(c);
if (m != null) {
if (m.at.contains(a.a)) {
m.at.remove(a.a);
a.a = null;
}
}
if (l.count == 0) {
this.y2(c);
}
}
}
}
}
if (a.g != null) {
if (this.yh.contains(a.g)) {
this.yh.remove(a.g);
let n = this.ym.indexOf(a.g);
this.ym.remove(a.g);
this.xm.qy(n, a.g);
}
if (this.yh.count == 0) {
this.zi(this.xm);
this.xm = null;
}
}
}
zi(a) {
this.xk.t(a);
}
xt(a) {
switch (a.k) {
case 3: return this.xu(a);
case 0: return this.xw(a);
case 2: return this.xv(a);
case 1: return this.xx(a);
}
return null;
}
xx(a) {
let b = new UserAnnotationItems(this);
b.k = a;
b.i = new UserAnnotationStripDataContext(a);
b.e = new UserAnnotationAxisDataContext(a);
return b;
}
xv(a) {
let b = new UserAnnotationItems(this);
b.k = a;
b.g = new UserAnnotationPointDataContext(a);
return b;
}
xw(a) {
let b = new UserAnnotationItems(this);
b.k = a;
b.h = new UserAnnotationSliceDataContext(a);
b.e = new UserAnnotationAxisDataContext(a);
return b;
}
xu(a) {
let b = new UserAnnotationItems(this);
b.k = a;
b.e = new UserAnnotationAxisDataContext(a);
return b;
}
b3() {
return 1;
}
}
UserAnnotationLayer.$t = /*@__PURE__*/ markType(UserAnnotationLayer, 'UserAnnotationLayer', Series.$);
UserAnnotationLayer.yo = 0;
UserAnnotationLayer.yp = 0;
UserAnnotationLayer.yn = 0;
return UserAnnotationLayer;
})();
/**
* @hidden
*/
export let UserAnnotationItems = /*@__PURE__*/ (() => {
class UserAnnotationItems extends Base {
constructor(a) {
super();
this.f = null;
this.j = null;
this.c = null;
this.h = null;
this.d = null;
this.i = null;
this.b = null;
this.g = null;
this.e = null;
this.a = null;
this.f = a;
}
get k() {
return this.j;
}
set k(a) {
let b = this.j;
this.j = a;
if (this.j != b) {
this.m(b, a);
}
}
o() {
if (this.a == null) {
return;
}
let a = this.a;
let b = this.k;
a.k = this.k;
a.o = true;
a.ag = this.f.ys;
a.value = b.value;
if (b.k == 1) {
let c = b;
a.value = (c.startValue + c.endValue) / 2;
}
a.text