UNPKG

igniteui-react-charts

Version:

Ignite UI React charting components for building rich data visualizations using TypeScript APIs.

1,282 lines 52.5 kB
/* 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.xm; } get_ev() { return true; } get_f9() { return true; } get_isUsableInLegend() { return false; } y6(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); } } } } } } yp() { 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.yr = "UserLayer"; this.xm = new UserAnnotationCollection(); this.yi = new List$1(Axis.$, 0); this.yb = new Dictionary$2(Axis.$, Axis.$, 0); this.zp = BrushUtil.j(255, 255, 255, 255); this.zo = BrushUtil.j(255, 0, 0, 0); this.xj = null; this.x7 = new Dictionary$2(String_$type, UserAnnotationFlow.$, 0); this.userAnnotationInformationRequested = null; this.yj = new List$1(UserAnnotationItems.$, 0); this.x5 = new Dictionary$2(String_$type, UserBaseAnnotation.$, 0); this.yh = new HashSet$1(Axis.$, 0); this.yf = new HashSet$1(Axis.$, 0); this.ya = new Dictionary$2(Axis.$, DataAnnotationSliceLayer.$, 0); this.ye = new Dictionary$2(Axis.$, DataAnnotationStripLayer.$, 0); this.x9 = new Dictionary$2(Axis.$, HashSet$1.$.specialize(UserAnnotationDataContext.$), 0); this.x8 = new Dictionary$2(Axis.$, ObservableCollection$1.$.specialize(UserAnnotationDataContext.$), 0); this.yd = new Dictionary$2(Axis.$, HashSet$1.$.specialize(UserAnnotationDataContext.$), 0); this.yc = new Dictionary$2(Axis.$, ObservableCollection$1.$.specialize(UserAnnotationDataContext.$), 0); this.yg = new HashSet$1(UserAnnotationDataContext.$, 0); this.yl = new ObservableCollection$1(UserAnnotationDataContext.$, 0); this.x6 = new Dictionary$2(Axis.$, HashSet$1.$.specialize(UserAnnotationDataContext.$), 0); this.xl = null; this.stylingAxisAnnotation = null; this.stylingSliceAnnotation = null; this.stylingStripAnnotation = null; this.stylingPointAnnotation = null; UserAnnotationLayer.yo++; this.yr = "UserLayer" + UserAnnotationLayer.yo; let a = this.xm; a.collectionChanged = delegateCombine(a.collectionChanged, runOn(this, this.yt)); let b = this.xm; b.collectionResetting = delegateCombine(b.collectionResetting, runOn(this, this.yu)); } y0(a) { if (this.da == null) { return; } if (this.da.zq == null) { return; } if (this.da.zq.count < 2) { return; } if (this.yb.containsKey(a)) { return; } let b = this.xk(a); if (b == null) { let c = a; c.ct = true; c.of = BrushUtil.j(0, 255, 255, 255); c.ok = BrushUtil.j(0, 255, 255, 255); c.fm = 0; this.yb.addItem(a, b); } } y1(a) { if (this.da == null) { return; } if (this.da.zq == null) { return; } if (this.da.zq.count < 2) { return; } if (this.yb.containsKey(a)) { this.yb.removeItem(a); let b = this.xk(a); a.ct = false; } } xk(a) { for (let b = 0; b < this.da.zq.count; b++) { let c = this.da.zq._inner[b]; if (c.dh && c.ao == a) { return c; } } return null; } zq(a, b) { return a != null ? a : b; } y5(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; } } } y9(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; } } y8(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; } } } } y7(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; } } } zb(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.y7(b, f); } } } ze(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.y7(b, f); } } } 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; 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; } } } } } za(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; } } } } } zd(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; } } } } } } 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; 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; } } } } } rq(a, b, c, d) { super.rq(a, b, c, d); if (b == "SeriesViewer") { if (c != null) { this.yz(c); } if (d != null) { this.yv(d); } } else { this.zg(b); } } yk(a) { return this.xj.j(this.yr, a); } yv(a) { a.seriesClick = delegateCombine(a.seriesClick, runOn(this, this.zk)); a.axisLabelMouseClick = delegateCombine(a.axisLabelMouseClick, runOn(this, this.zj)); a.viewerManipulationEnding = delegateCombine(a.viewerManipulationEnding, runOn(this, this.zl)); this.xj = this.dc.ao(this.dc); for (let b = 0; b < this.yj.count; b++) { this.y3(this.yj._inner[b]); } this.userAnnotationInformationRequested = delegateCombine(this.userAnnotationInformationRequested, runOn(this.dc, this.dc.ru)); } zl(a, b) { if (b.isDragSelect) { if (this.dc != null && this.dc.f0) { let c = b.dragSelectRectangle; if (!c.isEmpty) { b.isDragSelectCancelled = true; let d = null; for (let e = 0; e < this.da.zq.count; e++) { let f = this.da.zq._inner[e]; if (f.dh) { continue; } if (!f.dy) { d = f; break; } } if (d != null) { if (d.df && !d.dj) { let g = this.da.yw(c); let h = new ScalerParams(1, this.da.yr, this.da.y9, d.dn); h.c = this.getEffectiveViewport(); let i = d.f9(g.left, h); let j = d.f9(g.right, h); if (d.dn) { let k = i; i = j; j = k; } i = Math.floor(i); j = Math.ceil(j); let l = this.xo(); let m = this.xz(d, i, j); l.b = m; this.zm(l); this.ys(l); this.zi(l); this.dc.uc(l.d); } } } } } } zj(a, b) { let c = b.h; let d = b.a; let e = b.c; if (this.dc.f0) { if (d.df && !d.dj) { let f = typeCast(CategoryAxisBase.$, d); e = f.categoryMode == 2 ? Math.floor(e) : Math.round(e); } let g = this.xo(); let h = this.xy(d, c, e); g.b = h; this.zm(g); this.ys(g); this.zi(g); this.dc.uc(g.d); } if (this.dc.f1) { if (d.df && !d.dj) { let i = typeCast(CategoryAxisBase.$, d); e = i.categoryMode == 2 ? Math.floor(e) : Math.round(e); } let j = this.x0(d, c, e); } } x0(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.pa(); 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.pa(); return e; } } } return null; } xy(a, b, c) { let d = new UserSliceAnnotation(); d.targetAxisMatcher = a.a9(); d.value = c; d.aq = " "; return d; } xz(a, b, c) { let d = new UserStripAnnotation(); d.targetAxisMatcher = a.a9(); d.startValue = b; d.endValue = c; d.aq = " "; return d; } zk(a, b) { if (!this.dc.y9.containsPoint(b.chartPosition)) { return; } let c = b.series; let d = b.item; let e = b.worldPosition; if (this.dc.f0) { b.cancelSelection = true; let f = this.xo(); f.b = this.x1(c, d, e); if (f.b == null) { return; } this.zm(f); this.ys(f); this.zi(f); this.dc.uc(f.d); } if (this.dc.f1) { b.cancelSelection = true; this.yy(c, d, e); this.dc.pa(); } } zm(a) { if (!this.x7.containsKey(a.d)) { this.x7.addItem(a.d, a); } if (a.b != null) { a.b.an = a.d; } } zi(a) { if (this.userAnnotationInformationRequested != null) { this.userAnnotationInformationRequested(this, ((() => { let $ret = new UserAnnotationInformationEventArgs(); $ret.annotationInfo = this.xq(a); return $ret; })())); } } xq(a) { return a.a; } yw(a) { if (this.x7.containsKey(a)) { let b = this.x7.item(a); let c = b.b; if (this.annotations.contains(c)) { this.annotations.remove(c); } this.x7.removeItem(a); } } y4(a) { if (a.d != null) { if (this.x7.containsKey(a.d)) { let b = this.x7.item(a.d); this.yx(b, a); this.zn(b); this.x7.removeItem(a.d); } } } zn(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.s(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; } } } yx(a, b) { let c = a.a; c.g(b); } ys(a) { this.annotations.add(a.b); } x1(a, b, c) { let d = new UserPointAnnotation(); d.targetSeriesMatcher = a.cg(); let e = a.ww(c, false, false); let f = a.w1(e); if (isNaN_(f.x) || isNaN_(f.y)) { return null; } d.xValue = f.x; d.yValue = f.y; d.aq = " "; return d; } yy(a, b, c) { if (a.eq) { let d = this.oz(a, c); let e = typeCast(Tuple$2.$.specialize(CalloutAnnotationWrapper.$, CalloutView.$), a.kw(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.ww(c, false, false); let k = a.w1(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); } } } } xo() { let a = new UserAnnotationFlow(); a.a = this.xp(a.d); return a; } xp(a) { let b = new UserAnnotationInformation(); b.h = BrushUtil.j(255, 255, 255, 255); b.f = " "; b.i = BrushUtil.j(255, 0, 0, 0); b.d = a; if (this.dc != null) { b.a = this.dc.y9.left + (this.dc.y9.width / 2); b.b = this.dc.y9.top + (this.dc.y9.height / 2); } let c = this.zr({ $type: Point_$type, x: b.a, y: b.b }); b.a = c.x; b.b = c.y; return b; } zr(a) { let b = 0; let c = 0; if (this.dc != null) { let d = this.dc.yk(); b += d.x; c += d.y; } return { $type: Point_$type, x: b + a.x, y: c + a.y }; } yz(a) { a.seriesClick = delegateRemove(a.seriesClick, runOn(this, this.zk)); a.axisLabelMouseClick = delegateRemove(a.axisLabelMouseClick, runOn(this, this.zj)); for (let b = 0; b < this.yj.count; b++) { this.y3(this.yj._inner[b]); } this.userAnnotationInformationRequested = delegateRemove(this.userAnnotationInformationRequested, runOn(a, a.ru)); } zg(a) { if (this.xj == null) { return; } let b = new List$1(Series.$, 0); b.o(this.yk(12)); b.o(this.yk(13)); b.o(this.yk(14)); for (let c of fromEnum(b)) { if (a == "Brush") { c.vz = this.vz; } else if (a == "Outline") { c.wf = this.wf; } else if (a == "OutlineMode") { c.cj = this.cj; } else if (a == "Thickness") { c.jy = this.jy; } else if (a == "Resolution") { c.jr = this.jr; } else if (a == "DashArray") { c.wm = this.wm; } else if (a == "DashCap") { c.wn = this.wn; } else if (a == "AreaFillOpacity") { c.ir = this.ir; } } } yu(a, b) { } yt(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.xs(d); if (d != null) { this.x5.item(d.an, d); } this.yj.insert(c + b.newStartingIndex, e); this.y2(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.x5.containsKey(g.an)) { this.x5.removeItem(g.an); } } let h = this.yj._inner[b.oldStartingIndex]; this.yj.removeAt(b.oldStartingIndex); this.y3(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.x5.containsKey(j.an)) { this.x5.removeItem(j.an); } } let k = this.yj._inner[b.oldStartingIndex]; this.yj.removeAt(b.oldStartingIndex); this.y3(k); } } if (b.newItems != null) { for (let l = 0; l < b.newItems.count; l++) { let m = b.newItems.item(l); let n = this.xs(m); if (m != null) { this.x5.item(m.an, m); } this.y2(n); this.yj.insert(l + b.newStartingIndex, n); } } break; case 4: for (let o = this.yj.count - 1; o >= 0; o--) { let p = this.yj._inner[o]; if (p.k != null) { if (this.x5.containsKey(p.k.an)) { this.x5.removeItem(p.k.an); } } this.yj.removeAt(o); this.y3(p); } this.yj.clear(); break; } } yq(a) { return PlatformAPIHelper.r(a); } y2(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.ya.containsKey(c)) { a.c = this.ya.item(c); } if (!this.x9.containsKey(c)) { this.x9.addItem(c, new HashSet$1(UserAnnotationDataContext.$, 0)); } if (!this.x8.containsKey(c)) { this.x8.addItem(c, new ObservableCollection$1(UserAnnotationDataContext.$, 0)); } let d = this.x9.item(c); let e = this.x8.item(c); if (!d.contains(a.h)) { d.add_1(a.h); e.add(a.h); if (this.ya.containsKey(c)) { this.ya.item(c).qw(e.count - 1, a.h); } } } if (a.h != null && !this.ya.containsKey(c)) { let f = new DataAnnotationSliceLayer(); f.p0(this.dc); this.ya.item(c, f); a.c = f; f.vz = this.vz; f.wf = this.wf; f.jy = this.jy; f.wm = this.wm; f.wn = this.wn; let g = this.x9.item(c); let h = this.x8.item(c); f.mb = this.yr; f.name = this.yr + "_SliceAnnotation" + (UserAnnotationLayer.ym++); f.aff = this.yq("OverlayText"); f.aaw = 3; f.ahl = this.yq("Label"); f.aho = this.yq("Value"); f.stylingAxisAnnotation = delegateCombine(f.stylingAxisAnnotation, runOn(this, this.za)); f.stylingShapeAnnotation = delegateCombine(f.stylingShapeAnnotation, runOn(this, this.zc)); f.stylingOverlayText = delegateCombine(f.stylingOverlayText, runOn(this, this.zb)); f.aav = c; f.itemsSource = h; f.adn = a.k; let i = new AutomaticSeriesRequest(); i.d = f; i.a = 12; i.g = true; this.xj.b.add(i); } if (a.i != null) { if (this.ye.containsKey(c)) { a.d = this.ye.item(c); } if (!this.yd.containsKey(c)) { this.yd.addItem(c, new HashSet$1(UserAnnotationDataContext.$, 0)); } if (!this.yc.containsKey(c)) { this.yc.addItem(c, new ObservableCollection$1(UserAnnotationDataContext.$, 0)); } let j = this.yd.item(c); let k = this.yc.item(c); if (!j.contains(a.i)) { j.add_1(a.i); k.add(a.i); if (this.ye.containsKey(c)) { this.ye.item(c).qw(k.count - 1, a.i); } } } if (a.i != null && !this.ye.containsKey(c)) { let l = this.yd.item(c); let m = this.yc.item(c); let n = new DataAnnotationStripLayer(); n.p0(this.dc); this.ye.item(c, n); a.d = n; n.vz = this.vz; n.wf = this.wf; n.cj = this.cj; n.jy = this.jy; n.jr = this.jr; n.wm = this.wm; n.wn = this.wn; n.mb = this.yr; n.name = this.yr + "_StripAnnotation" + (UserAnnotationLayer.ym++); n.aff = this.yq("OverlayText"); n.ahp = 3; n.aix = this.yq("StartLabel"); n.ai0 = this.yq("StartValue"); n.aho = 3; n.aiq = this.yq("EndLabel"); n.ait = this.yq("EndValue"); n.aim = this.yq("Label"); n.ahn = 6; n.stylingAxisAnnotation = delegateCombine(n.stylingAxisAnnotation, runOn(this, this.zd)); n.stylingShapeAnnotation = delegateCombine(n.stylingShapeAnnotation, runOn(this, this.zf)); n.stylingOverlayText = delegateCombine(n.stylingOverlayText, runOn(this, this.ze)); n.aav = c; n.itemsSource = m; n.adn = a.k; let o = new AutomaticSeriesRequest(); o.d = n; o.a = 13; o.g = true; this.xj.b.add(o); } if (a.e != null) { if (!this.x6.containsKey(c)) { this.x6.addItem(c, new HashSet$1(UserAnnotationDataContext.$, 0)); } let p = this.x6.item(c); } if (a.e != null) { this.yf.add_1(c); this.y0(c); let q = this.x6.item(c); if (!q.contains(a.e)) { q.add_1(a.e); let r = this.xk(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.xl != null) { a.b = this.xl; } if (!this.yg.contains(a.g)) { this.yg.add_1(a.g); this.yl.add(a.g); if (this.xl != null) { this.xl.qw(this.yl.count - 1, a.g); } } } if (a.g != null && this.xl == null) { let u = new CalloutLayer(); u.p0(this.dc); this.xl = u; a.b = u; u.vz = this.vz; u.wf = this.wf; u.cj = this.cj; u.jy = this.jy; u.jr = this.jr; u.wm = this.wm; u.wn = this.wn; u.calloutSeriesSelecting = delegateCombine(u.calloutSeriesSelecting, runOn(this, this.y5)); u.mb = this.yr; u.name = this.yr + "_CalloutAnnotation" + (UserAnnotationLayer.ym++); u.afq = this.yq("XValue"); u.aft = this.yq("YValue"); u.aev = this.yq("Label"); u.afa = this.yq("Label"); u.ace = false; u.aco = false; u.ach = true; u.acg = true; u.calloutStyleUpdating = delegateCombine(u.calloutStyleUpdating, runOn(this, this.y9)); u.calloutRenderStyleUpdating = delegateCombine(u.calloutRenderStyleUpdating, runOn(this, this.y8)); u.itemsSource = this.yl; let v = new AutomaticSeriesRequest(); v.d = u; v.a = 14; v.g = true; this.xj.b.add(v); } } y3(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.x9.containsKey(c)) { let d = this.x9.item(c); let e = this.x8.item(c); if (d.contains(a.h)) { d.remove(a.h); let f = e.indexOf(a.h); e.remove(a.h); this.ya.item(c).qx(f, a.h); if (e.count == 0) { this.x8.removeItem(c); this.x9.removeItem(c); let g = this.ya.item(c); this.ya.removeItem(c); this.zh(g); } } } } if (a.i != null) { a.d = null; if (this.yd.containsKey(c)) { let h = this.yd.item(c); let i = this.yc.item(c); if (h.contains(a.i)) { h.remove(a.i); let j = i.indexOf(a.i); i.remove(a.i); this.ye.item(c).qx(j, a.i); if (i.count == 0) { this.yc.removeItem(c); this.yd.removeItem(c); let k = this.ye.item(c); this.ye.removeItem(c); this.zh(k); } } } } if (a.e != null) { if (this.x6.containsKey(c)) { let l = this.x6.item(c); if (l.contains(a.e)) { l.remove(a.e); let m = this.xk(c); if (m != null) { if (m.at.contains(a.a)) { m.at.remove(a.a); a.a = null; } } if (l.count == 0) { this.y1(c); } } } } } if (a.g != null) { if (this.yg.contains(a.g)) { this.yg.remove(a.g); let n = this.yl.indexOf(a.g); this.yl.remove(a.g); this.xl.qx(n, a.g); } if (this.yg.count == 0) { this.zh(this.xl); this.xl = null; } } } zh(a) { this.xj.t(a); } xs(a) { switch (a.k) { case 3: return this.xt(a); case 0: return this.xv(a); case 2: return this.xu(a); case 1: return this.xw(a); } return null; } xw(a) { let b = new UserAnnotationItems(this); b.k = a; b.i = new UserAnnotationStripDataContext(a); b.e = new UserAnnotationAxisDataContext(a); return b; } xu(a) { let b = new UserAnnotationItems(this); b.k = a; b.g = new UserAnnotationPointDataContext(a); return b; } xv(a) { let b = new UserAnnotationItems(this); b.k = a; b.h = new UserAnnotationSliceDataContext(a); b.e = new UserAnnotationAxisDataContext(a); return b; } xt(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.yn = 0; UserAnnotationLayer.yo = 0; UserAnnotationLayer.ym = 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.yr; a.value = b.value; if (b.k == 1) { let c = b; a.value = (c.startValue + c.endValue) / 2; } a.text