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.xo; } get_ev() { return true; } get_ga() { return true; } get_isUsableInLegend() { return false; } y8(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); } } } } } } yr() { 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.yt = "UserLayer"; this.xo = new UserAnnotationCollection(); this.yk = new List$1(Axis.$, 0); this.yd = new Dictionary$2(Axis.$, Axis.$, 0); this.zr = BrushUtil.l(255, 255, 255, 255); this.zq = BrushUtil.l(255, 0, 0, 0); this.xl = null; this.x9 = new Dictionary$2(String_$type, UserAnnotationFlow.$, 0); this.userAnnotationInformationRequested = null; this.yl = new List$1(UserAnnotationItems.$, 0); this.x7 = new Dictionary$2(String_$type, UserBaseAnnotation.$, 0); this.yj = new HashSet$1(Axis.$, 0); this.yh = new HashSet$1(Axis.$, 0); this.yc = new Dictionary$2(Axis.$, DataAnnotationSliceLayer.$, 0); this.yg = new Dictionary$2(Axis.$, DataAnnotationStripLayer.$, 0); this.yb = new Dictionary$2(Axis.$, HashSet$1.$.specialize(UserAnnotationDataContext.$), 0); this.ya = new Dictionary$2(Axis.$, ObservableCollection$1.$.specialize(UserAnnotationDataContext.$), 0); this.yf = new Dictionary$2(Axis.$, HashSet$1.$.specialize(UserAnnotationDataContext.$), 0); this.ye = new Dictionary$2(Axis.$, ObservableCollection$1.$.specialize(UserAnnotationDataContext.$), 0); this.yi = new HashSet$1(UserAnnotationDataContext.$, 0); this.yn = new ObservableCollection$1(UserAnnotationDataContext.$, 0); this.x8 = new Dictionary$2(Axis.$, HashSet$1.$.specialize(UserAnnotationDataContext.$), 0); this.xn = null; this.stylingAxisAnnotation = null; this.stylingSliceAnnotation = null; this.stylingStripAnnotation = null; this.stylingPointAnnotation = null; UserAnnotationLayer.yq++; this.yt = "UserLayer" + UserAnnotationLayer.yq; let a = this.xo; a.collectionChanged = delegateCombine(a.collectionChanged, runOn(this, this.yv)); let b = this.xo; b.collectionResetting = delegateCombine(b.collectionResetting, runOn(this, this.yw)); } y2(a) { if (this.da == null) { return; } if (this.da.zu == null) { return; } if (this.da.zu.count < 2) { return; } if (this.yd.containsKey(a)) { return; } let b = this.xm(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.yd.addItem(a, b); } } y3(a) { if (this.da == null) { return; } if (this.da.zu == null) { return; } if (this.da.zu.count < 2) { return; } if (this.yd.containsKey(a)) { this.yd.removeItem(a); let b = this.xm(a); a.ct = false; } } xm(a) { for (let b = 0; b < this.da.zu.count; b++) { let c = this.da.zu._inner[b]; if (c.dh && c.ao == a) { return c; } } return null; } zs(a, b) { return a != null ? a : b; } y7(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; } } } zb(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; } } za(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; } } } } y9(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; } } } 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; this.y9(b, f); } } } 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; this.y9(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; 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; } } } } } zc(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; } } } } } zf(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; } } } } } } zh(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; } } } } } rs(a, b, c, d) { super.rs(a, b, c, d); if (b == "SeriesViewer") { if (c != null) { this.y1(c); } if (d != null) { this.yx(d); } } else { this.zi(b); } } ym(a) { return this.xl.j(this.yt, a); } yx(a) { a.seriesClick = delegateCombine(a.seriesClick, runOn(this, this.zm)); a.axisLabelMouseClick = delegateCombine(a.axisLabelMouseClick, runOn(this, this.zl)); a.viewerManipulationEnding = delegateCombine(a.viewerManipulationEnding, runOn(this, this.zn)); this.xl = this.dc.ao(this.dc); for (let b = 0; b < this.yl.count; b++) { this.y5(this.yl._inner[b]); } this.userAnnotationInformationRequested = delegateCombine(this.userAnnotationInformationRequested, runOn(this.dc, this.dc.rw)); } zn(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.zu.count; e++) { let f = this.da.zu._inner[e]; if (f.dh) { continue; } if (!f.dz) { d = f; break; } } if (d != null) { if (d.df && !d.dj) { let g = this.da.y0(c); let h = new ScalerParams(1, this.da.yv, this.da.zd, 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.xq(); let m = this.x1(d, i, j); l.b = m; this.zo(l); this.yu(l); this.zk(l); this.dc.ue(l.d); } } } } } } zl(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.xq(); let h = this.x0(d, c, e); g.b = h; this.zo(g); this.yu(g); this.zk(g); this.dc.ue(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.x2(d, c, e); } } x2(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.pc(); 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.pc(); return e; } } } return null; } x0(a, b, c) { let d = new UserSliceAnnotation(); d.targetAxisMatcher = a.a9(); d.value = c; d.aq = " "; return d; } x1(a, b, c) { let d = new UserStripAnnotation(); d.targetAxisMatcher = a.a9(); d.startValue = b; d.endValue = c; d.aq = " "; return d; } zm(a, b) { if (!this.dc.zd.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.xq(); f.b = this.x3(c, d, e); if (f.b == null) { return; } this.zo(f); this.yu(f); this.zk(f); this.dc.ue(f.d); } if (this.dc.f2) { b.cancelSelection = true; this.y0(c, d, e); this.dc.pc(); } } zo(a) { if (!this.x9.containsKey(a.d)) { this.x9.addItem(a.d, a); } if (a.b != null) { a.b.an = a.d; } } zk(a) { if (this.userAnnotationInformationRequested != null) { this.userAnnotationInformationRequested(this, ((() => { let $ret = new UserAnnotationInformationEventArgs(); $ret.annotationInfo = this.xs(a); return $ret; })())); } } xs(a) { return a.a; } yy(a) { if (this.x9.containsKey(a)) { let b = this.x9.item(a); let c = b.b; if (this.annotations.contains(c)) { this.annotations.remove(c); } this.x9.removeItem(a); } } y6(a) { if (a.d != null) { if (this.x9.containsKey(a.d)) { let b = this.x9.item(a.d); this.yz(b, a); this.zp(b); this.x9.removeItem(a.d); } } } zp(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; } } } yz(a, b) { let c = a.a; c.g(b); } yu(a) { this.annotations.add(a.b); } x3(a, b, c) { let d = new UserPointAnnotation(); d.targetSeriesMatcher = a.cg(); let e = a.wy(c, false, false); let f = a.w3(e); if (isNaN_(f.x) || isNaN_(f.y)) { return null; } d.xValue = f.x; d.yValue = f.y; d.aq = " "; return d; } y0(a, b, c) { if (a.eq) { let d = this.o1(a, c); let e = typeCast(Tuple$2.$.specialize(CalloutAnnotationWrapper.$, CalloutView.$), a.ky(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.wy(c, false, false); let k = a.w3(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); } } } } xq() { let a = new UserAnnotationFlow(); a.a = this.xr(a.d); return a; } xr(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.zd.left + (this.dc.zd.width / 2); b.b = this.dc.zd.top + (this.dc.zd.height / 2); } let c = this.zt({ $type: Point_$type, x: b.a, y: b.b }); b.a = c.x; b.b = c.y; return b; } zt(a) { let b = 0; let c = 0; if (this.dc != null) { let d = this.dc.yo(); b += d.x; c += d.y; } return { $type: Point_$type, x: b + a.x, y: c + a.y }; } y1(a) { a.seriesClick = delegateRemove(a.seriesClick, runOn(this, this.zm)); a.axisLabelMouseClick = delegateRemove(a.axisLabelMouseClick, runOn(this, this.zl)); for (let b = 0; b < this.yl.count; b++) { this.y5(this.yl._inner[b]); } this.userAnnotationInformationRequested = delegateRemove(this.userAnnotationInformationRequested, runOn(a, a.rw)); } zi(a) { if (this.xl == null) { return; } let b = new List$1(Series.$, 0); b.o(this.ym(12)); b.o(this.ym(13)); b.o(this.ym(14)); for (let c of fromEnum(b)) { if (a == "Brush") { c.v1 = this.v1; } else if (a == "Outline") { c.wh = this.wh; } else if (a == "OutlineMode") { c.cj = this.cj; } else if (a == "Thickness") { c.j0 = this.j0; } else if (a == "Resolution") { c.jt = this.jt; } else if (a == "DashArray") { c.wo = this.wo; } else if (a == "DashCap") { c.wp = this.wp; } else if (a == "AreaFillOpacity") { c.it = this.it; } } } yw(a, b) { } yv(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.xu(d); if (d != null) { this.x7.item(d.an, d); } this.yl.insert(c + b.newStartingIndex, e); this.y4(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.x7.containsKey(g.an)) { this.x7.removeItem(g.an); } } let h = this.yl._inner[b.oldStartingIndex]; this.yl.removeAt(b.oldStartingIndex); this.y5(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.x7.containsKey(j.an)) { this.x7.removeItem(j.an); } } let k = this.yl._inner[b.oldStartingIndex]; this.yl.removeAt(b.oldStartingIndex); this.y5(k); } } if (b.newItems != null) { for (let l = 0; l < b.newItems.count; l++) { let m = b.newItems.item(l); let n = this.xu(m); if (m != null) { this.x7.item(m.an, m); } this.y4(n); this.yl.insert(l + b.newStartingIndex, n); } } break; case 4: for (let o = this.yl.count - 1; o >= 0; o--) { let p = this.yl._inner[o]; if (p.k != null) { if (this.x7.containsKey(p.k.an)) { this.x7.removeItem(p.k.an); } } this.yl.removeAt(o); this.y5(p); } this.yl.clear(); break; } } ys(a) { return PlatformAPIHelper.r(a); } y4(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.yc.containsKey(c)) { a.c = this.yc.item(c); } if (!this.yb.containsKey(c)) { this.yb.addItem(c, new HashSet$1(UserAnnotationDataContext.$, 0)); } if (!this.ya.containsKey(c)) { this.ya.addItem(c, new ObservableCollection$1(UserAnnotationDataContext.$, 0)); } let d = this.yb.item(c); let e = this.ya.item(c); if (!d.contains(a.h)) { d.add_1(a.h); e.add(a.h); if (this.yc.containsKey(c)) { this.yc.item(c).qy(e.count - 1, a.h); } } } if (a.h != null && !this.yc.containsKey(c)) { let f = new DataAnnotationSliceLayer(); f.p2(this.dc); this.yc.item(c, f); a.c = f; f.v1 = this.v1; f.wh = this.wh; f.j0 = this.j0; f.wo = this.wo; f.wp = this.wp; let g = this.yb.item(c); let h = this.ya.item(c); f.md = this.yt; f.name = this.yt + "_SliceAnnotation" + (UserAnnotationLayer.yo++); f.afh = this.ys("OverlayText"); f.aay = 3; f.ahn = this.ys("Label"); f.ahq = this.ys("Value"); f.stylingAxisAnnotation = delegateCombine(f.stylingAxisAnnotation, runOn(this, this.zc)); f.stylingShapeAnnotation = delegateCombine(f.stylingShapeAnnotation, runOn(this, this.ze)); f.stylingOverlayText = delegateCombine(f.stylingOverlayText, runOn(this, this.zd)); f.aax = c; f.itemsSource = h; f.adp = a.k; let i = new AutomaticSeriesRequest(); i.d = f; i.a = 12; i.g = true; this.xl.b.add(i); } if (a.i != null) { if (this.yg.containsKey(c)) { a.d = this.yg.item(c); } if (!this.yf.containsKey(c)) { this.yf.addItem(c, new HashSet$1(UserAnnotationDataContext.$, 0)); } if (!this.ye.containsKey(c)) { this.ye.addItem(c, new ObservableCollection$1(UserAnnotationDataContext.$, 0)); } let j = this.yf.item(c); let k = this.ye.item(c); if (!j.contains(a.i)) { j.add_1(a.i); k.add(a.i); if (this.yg.containsKey(c)) { this.yg.item(c).qy(k.count - 1, a.i); } } } if (a.i != null && !this.yg.containsKey(c)) { let l = this.yf.item(c); let m = this.ye.item(c); let n = new DataAnnotationStripLayer(); n.p2(this.dc); this.yg.item(c, n); a.d = n; n.v1 = this.v1; n.wh = this.wh; n.cj = this.cj; n.j0 = this.j0; n.jt = this.jt; n.wo = this.wo; n.wp = this.wp; n.md = this.yt; n.name = this.yt + "_StripAnnotation" + (UserAnnotationLayer.yo++); n.afh = this.ys("OverlayText"); n.ahr = 3; n.aiz = this.ys("StartLabel"); n.ai2 = this.ys("StartValue"); n.ahq = 3; n.ais = this.ys("EndLabel"); n.aiv = this.ys("EndValue"); n.aio = this.ys("Label"); n.ahp = 6; n.stylingAxisAnnotation = delegateCombine(n.stylingAxisAnnotation, runOn(this, this.zf)); n.stylingShapeAnnotation = delegateCombine(n.stylingShapeAnnotation, runOn(this, this.zh)); n.stylingOverlayText = delegateCombine(n.stylingOverlayText, runOn(this, this.zg)); n.aax = c; n.itemsSource = m; n.adp = a.k; let o = new AutomaticSeriesRequest(); o.d = n; o.a = 13; o.g = true; this.xl.b.add(o); } if (a.e != null) { if (!this.x8.containsKey(c)) { this.x8.addItem(c, new HashSet$1(UserAnnotationDataContext.$, 0)); } let p = this.x8.item(c); } if (a.e != null) { this.yh.add_1(c); this.y2(c); let q = this.x8.item(c); if (!q.contains(a.e)) { q.add_1(a.e); let r = this.xm(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.xn != null) { a.b = this.xn; } if (!this.yi.contains(a.g)) { this.yi.add_1(a.g); this.yn.add(a.g); if (this.xn != null) { this.xn.qy(this.yn.count - 1, a.g); } } } if (a.g != null && this.xn == null) { let u = new CalloutLayer(); u.p2(this.dc); this.xn = u; a.b = u; u.v1 = this.v1; u.wh = this.wh; u.cj = this.cj; u.j0 = this.j0; u.jt = this.jt; u.wo = this.wo; u.wp = this.wp; u.calloutSeriesSelecting = delegateCombine(u.calloutSeriesSelecting, runOn(this, this.y7)); u.md = this.yt; u.name = this.yt + "_CalloutAnnotation" + (UserAnnotationLayer.yo++); u.afs = this.ys("XValue"); u.afv = this.ys("YValue"); u.aex = this.ys("Label"); u.afc = this.ys("Label"); u.acg = false; u.acq = false; u.acj = true; u.aci = true; u.calloutStyleUpdating = delegateCombine(u.calloutStyleUpdating, runOn(this, this.zb)); u.calloutRenderStyleUpdating = delegateCombine(u.calloutRenderStyleUpdating, runOn(this, this.za)); u.itemsSource = this.yn; let v = new AutomaticSeriesRequest(); v.d = u; v.a = 14; v.g = true; this.xl.b.add(v); } } y5(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.yb.containsKey(c)) { let d = this.yb.item(c); let e = this.ya.item(c); if (d.contains(a.h)) { d.remove(a.h); let f = e.indexOf(a.h); e.remove(a.h); this.yc.item(c).qz(f, a.h); if (e.count == 0) { this.ya.removeItem(c); this.yb.removeItem(c); let g = this.yc.item(c); this.yc.removeItem(c); this.zj(g); } } } } if (a.i != null) { a.d = null; if (this.yf.containsKey(c)) { let h = this.yf.item(c); let i = this.ye.item(c); if (h.contains(a.i)) { h.remove(a.i); let j = i.indexOf(a.i); i.remove(a.i); this.yg.item(c).qz(j, a.i); if (i.count == 0) { this.ye.removeItem(c); this.yf.removeItem(c); let k = this.yg.item(c); this.yg.removeItem(c); this.zj(k); } } } } if (a.e != null) { if (this.x8.containsKey(c)) { let l = this.x8.item(c); if (l.contains(a.e)) { l.remove(a.e); let m = this.xm(c); if (m != null) { if (m.at.contains(a.a)) { m.at.remove(a.a); a.a = null; } } if (l.count == 0) { this.y3(c); } } } } } if (a.g != null) { if (this.yi.contains(a.g)) { this.yi.remove(a.g); let n = this.yn.indexOf(a.g); this.yn.remove(a.g); this.xn.qz(n, a.g); } if (this.yi.count == 0) { this.zj(this.xn); this.xn = null; } } } zj(a) { this.xl.t(a); } xu(a) { switch (a.k) { case 3: return this.xv(a); case 0: return this.xx(a); case 2: return this.xw(a); case 1: return this.xy(a); } return null; } xy(a) { let b = new UserAnnotationItems(this); b.k = a; b.i = new UserAnnotationStripDataContext(a); b.e = new UserAnnotationAxisDataContext(a); return b; } xw(a) { let b = new UserAnnotationItems(this); b.k = a; b.g = new UserAnnotationPointDataContext(a); return b; } xx(a) { let b = new UserAnnotationItems(this); b.k = a; b.h = new UserAnnotationSliceDataContext(a); b.e = new UserAnnotationAxisDataContext(a); return b; } xv(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.yp = 0; UserAnnotationLayer.yq = 0; UserAnnotationLayer.yo = 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.yt; a.value = b.value; if (b.k == 1) { let c = b; a.value = (c.startValue + c.endValue) / 2; } a.text