igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
1,427 lines • 91.7 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 { AnnotationLayer } from "./AnnotationLayer";
import { DependencyProperty } from "igniteui-react-core";
import { Base, runOn, delegateCombine, String_$type, typeCast, Array_$type, enumGetBox, EnumUtil, fromEnum, delegateRemove, Point_$type, Date_$type, markType, markDep } from "igniteui-react-core";
import { Series } from "./Series";
import { CalloutPlacementPositionsCollection } from "./CalloutPlacementPositionsCollection";
import { HighlightedValueLabelMode_$type } from "igniteui-react-core";
import { AutoCalloutVisibilityMode_$type } from "./AutoCalloutVisibilityMode";
import { Brush } from "igniteui-react-core";
import { Thickness } from "igniteui-react-core";
import { CalloutCollisionMode_$type } from "igniteui-react-core";
import { FontUtil } from "igniteui-react-core";
import { Rect } from "igniteui-react-core";
import { BindingFormatter } from "igniteui-react-core";
import { CalloutLayerFrame } from "./CalloutLayerFrame";
import { Size } from "igniteui-react-core";
import { HashSet$1 } from "igniteui-react-core";
import { CalloutAnnotationWrapper } from "./CalloutAnnotationWrapper";
import { List$1 } from "igniteui-react-core";
import { LinkedList$1 } from "igniteui-react-core";
import { Dictionary$2 } from "igniteui-react-core";
import { LinkedListNode$1 } from "igniteui-react-core";
import { LabelCollisionManager } from "igniteui-react-core";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { CalloutAnnotation } from "./CalloutAnnotation";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { DeviceUtils } from "igniteui-react-core";
import { CalloutLabelUpdatingEventArgs } from "./CalloutLabelUpdatingEventArgs";
import { CalloutSeriesSelectingEventArgs } from "./CalloutSeriesSelectingEventArgs";
import { UserAnnotationDataContext } from "./UserAnnotationDataContext";
import { CalloutStyleUpdatingEventArgs } from "./CalloutStyleUpdatingEventArgs";
import { BrushUtilCore } from "igniteui-react-core";
import { LabelCollisionInfo } from "igniteui-react-core";
import { BrushUtil } from "igniteui-react-core";
import { CalloutRenderStyleUpdatingEventArgs } from "./CalloutRenderStyleUpdatingEventArgs";
import { ImageLoadParam } from "igniteui-react-core";
import { ImageLoader } from "igniteui-react-core";
import { IHasCategoryAxis_$type } from "./IHasCategoryAxis";
import { QuadTreeBoundingBox } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { ViewportUtils } from "./ViewportUtils";
import { CalloutBadgeInfo } from "./CalloutBadgeInfo";
import { CalloutContentUpdatingEventArgs } from "./CalloutContentUpdatingEventArgs";
import { CalloutKey } from "./CalloutKey";
import { DataContext } from "igniteui-react-core";
import { HashPool$2 } from "igniteui-react-core";
import { AxisRange } from "./AxisRange";
import { Tuple$2 } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { isNaN_, isInfinity } from "igniteui-react-core";
import { stringIsNullOrEmpty } from "igniteui-react-core";
import { FastItemObjectColumn } from "igniteui-react-core";
import { AnnotationLayerView } from "./AnnotationLayerView";
import { TextBlock } from "igniteui-react-core";
import { Color } from "igniteui-react-core";
import { Rectangle } from "igniteui-react-core";
import { Line } from "igniteui-react-core";
import { Image } from "igniteui-react-core";
import { TranslateTransform } from "igniteui-react-core";
import { CalloutViewHelper } from "./CalloutViewHelper";
/**
* @hidden
*/
export let CalloutLayer = /*@__PURE__*/ (() => {
class CalloutLayer extends AnnotationLayer {
bk() {
return new CalloutLayer();
}
get_eq() {
return true;
}
constructor() {
super();
this.ab1 = false;
this.abw = false;
this.aby = false;
this.abx = true;
this.aie = new Size(1, 0, 0);
this.abv = true;
this.calloutStyleUpdating = null;
this.calloutRenderStyleUpdating = null;
this.abh = null;
this.abi = null;
this.abj = null;
this.abg = null;
this.abf = null;
this.acs = new HashSet$1(CalloutAnnotationWrapper.$, 0);
this.acv = new List$1(CalloutAnnotationWrapper.$, 0);
this.acw = new List$1(CalloutAnnotationWrapper.$, 0);
this.aa5 = null;
this.aat = null;
this.abe = null;
this.abq = null;
this.abc = null;
this.acx = new List$1(CalloutAnnotationWrapper.$, 0);
this.acy = new List$1(CalloutAnnotationWrapper.$, 0);
this.adl = 0;
this.ac1 = -1;
this.ac0 = -1;
this.act = new LinkedList$1(CalloutAnnotationWrapper.$);
this.acq = new Dictionary$2(CalloutAnnotationWrapper.$, LinkedListNode$1.$.specialize(CalloutAnnotationWrapper.$), 0);
this.abr = null;
this.aic = new Rect(0, 0, 0, 1, 1);
this.ab3 = false;
this.ab5 = false;
this.adk = 0;
this.aib = Rect.empty;
this.ab2 = false;
this.ab4 = false;
this.calloutContentUpdating = null;
this.calloutLabelUpdating = null;
this.calloutSeriesSelecting = null;
this.acu = new List$1(SeriesPointOfInterest.$, 0);
this.ab7 = false;
this.ab8 = false;
this.ac2 = 0;
this.ab6 = false;
this.aaw = null;
this.abz = false;
this.ab0 = true;
this.aax = 1;
FastItemObjectColumn.m();
this.aat = null;
this.aa5 = new CalloutPlacementPositionsCollection();
let a = this.aa5;
a.collectionChanged = delegateCombine(a.collectionChanged, runOn(this, this.afw));
this.x7 = true;
let b = new CalloutLayerFrame();
let c = new CalloutLayerFrame();
let d = new CalloutLayerFrame();
let e = this.kn / 1000;
this.xy = b;
this.xx = c;
this.xz = d;
this.ab = CalloutLayer.$;
}
afw(a, b) {
this.af5();
}
af5() {
this.aat = this.aav(this.aa6);
this.af2();
}
afx(a, b) {
this.acw.clear();
this.r9(false);
}
pp(a, b, c, d) {
super.pp(a, b, c, d);
let e = this.acr();
switch (a) {
case 3:
this.age(b, e, true);
break;
case 1:
for (let f = b; f < b + c; f++) {
let g = new CalloutAnnotation();
let h = new CalloutAnnotationWrapper();
h.b = g;
h.b.series = this.abb;
this.acw.insert(f, h);
this.age(f, e, false);
}
break;
case 0:
this.acw.v(b, c);
break;
case 2:
for (let i = b; i < b + c; i++) {
this.age(i, e, true);
}
break;
case 4:
this.acw.clear();
for (let j = 0; j < this.dp.count; j++) {
let k = new CalloutAnnotation();
let l = new CalloutAnnotationWrapper();
l.b = k;
l.b.series = this.abb;
this.acw.add(l);
this.age(j, e, false);
}
break;
}
this.r9(true);
}
gm(a) {
return false;
}
aig() {
let a = new Thickness(0, DeviceUtils.g(3));
if (isNaN_(this.aif.left) || isNaN_(this.aif.top) || isNaN_(this.aif.right) || isNaN_(this.aif.bottom)) {
a = new Thickness(0, DeviceUtils.g(3));
}
else {
a = this.aif;
}
return a;
}
xf() {
if (!this.abv) {
return this.aie;
}
let a = 0;
let b = 0;
if (!this.acb) {
this.aie = new Size(1, 0, 0);
return this.aie;
}
if (this.acd) {
this.ab1 = true;
let c = new CalloutLayerFrame();
this.zg(c, this.cw);
this.ab1 = false;
if (this.acx != null && this.acx.count == 0) {
this.aie = new Size(1, 0, 0);
return this.aie;
}
}
let d = this.aig();
let e = -1.7976931348623157E+308;
let f = -1.7976931348623157E+308;
for (let g = 0; g < this.acx.count; g++) {
let h = this.acx._inner[g].b.text;
let i = this.aa4.da(h, d, null);
if (!isNaN_(i.height)) {
f = Math.max(i.height, f);
}
if (!isNaN_(i.width)) {
e = Math.max(i.width, e);
}
}
a = f;
b = e;
if (!isNaN_(this.adh)) {
a += this.adh;
}
if (!isNaN_(this.adh)) {
b += this.adh;
}
if (!isNaN_(this.adb)) {
a = Math.max(a, this.adb);
}
if (!isNaN_(this.ac9)) {
a = Math.min(a, this.ac9);
}
if (!isNaN_(this.adc)) {
b = Math.max(b, this.adc);
}
if (!isNaN_(this.ada)) {
b = Math.min(b, this.ada);
}
this.abx = false;
this.aie = new Size(1, b, a);
return this.aie;
}
acr() {
let a = new Dictionary$2(String_$type, Series.$, 0);
if (this.dc != null) {
for (let b = 0; b < this.dc.b9.count; b++) {
let c = this.dc.b9._inner[b];
if (c.name != null && !a.containsKey(c.name)) {
a.addItem(c.name, c);
}
}
}
return a;
}
age(a, b, c) {
if (this.abp == null || this.abn == null) {
return;
}
let d = a;
if (this.abo != null) {
d = this.abo.item(a);
}
let e = this.abp.item(a);
let f = this.abn.item(a);
let g = this.acw._inner[a];
if (this.abm != null) {
if (g.b.ao != this.abm.item(a)) {
g.b.key = this.abm.item(a);
}
}
if (this.acq.containsKey(g)) {
g.b = this.acq.item(g).c.b;
}
g.b.xValue = d;
g.b.yValue = e;
g.b.badgeImage = this.aey(a);
if (this.calloutLabelUpdating != null) {
let h = ((() => {
let $ret = new CalloutLabelUpdatingEventArgs();
$ret.d = d;
$ret.e = e;
$ret.item = this.dp.item(a);
$ret.c = f;
return $ret;
})());
this.calloutLabelUpdating(this, h);
if (h.c != null && !Base.equalsStatic(h.c, g.b.bc)) {
let i = h.c;
if (this.aaw != null) {
g.b.text = this.aaw.i(i);
}
else {
g.b.text = i != null ? i.toString() : "";
}
}
}
else {
if (this.aaw != null) {
g.b.text = this.aaw.i(f);
}
else {
g.b.text = f != null ? f.toString() : "";
}
}
if (this.abl != null) {
g.b.content = this.abl.item(a);
}
else {
g.b.content = this.dp.item(a);
}
g.b.n = typeCast(UserAnnotationDataContext.$, this.dp.item(a));
if (this.calloutSeriesSelecting != null) {
let j = ((() => {
let $ret = new CalloutSeriesSelectingEventArgs();
$ret.c = d;
$ret.d = e;
$ret.item = this.dp.item(a);
return $ret;
})());
this.calloutSeriesSelecting(this, j);
if (j.a != null) {
g.b.series = j.a;
}
else if (j.e != null) {
if (b.containsKey(j.e)) {
g.b.series = b.item(j.e);
}
}
}
this.agf(g);
if (c && g.c != null) {
this.agg(g.c, g);
}
}
agf(a) {
let b = new Thickness(0, DeviceUtils.g(3));
if (isNaN_(this.aif.left) || isNaN_(this.aif.top) || isNaN_(this.aif.right) || isNaN_(this.aif.bottom)) {
b = new Thickness(0, DeviceUtils.g(3));
}
else {
b = this.aif;
}
let c = DeviceUtils.g(3);
if (isNaN_(this.ac8)) {
c = DeviceUtils.g(3);
}
else {
c = this.ac8;
}
let d = this.aa4.c4(a.b.l, a.b.itemColor);
let e = this.aa4.c8(a.b.l, a.b.itemColor);
let f = this.aa4.c6(a.b.l, a.b.itemColor);
let g = this.ah3 != null && !this.acm ? this.ah3 : d;
let h = this.aia != null ? this.aia : null;
let i = this.ah8 != null ? this.ah8 : this.aa4.c7();
let j = this.ah6 != null ? this.ah6 : this.aa4.c5();
let k = this.ah9 != null && !this.acn ? this.ah9 : e;
let l = this.ah7 != null ? this.ah7 : f;
let m = isNaN_(this.adi) ? 0 : this.adi;
if (h == null && (this.ack || this.ah8 != null || this.ah6 != null)) {
let n = g;
if (n == null || BrushUtilCore.a(g)) {
n = this.dc != null ? this.dc.x8 : null;
if (a.c != null && (a.c.b == 8 || a.c.b == 9)) {
n = a.b.itemColor;
}
if (n == null || BrushUtilCore.a(g)) {
n = BrushUtil.l(255, 255, 255, 255);
}
}
h = BrushUtil.n(n, j, i);
}
if (h == null) {
h = this.aa4.c7();
}
let o = this.ah4 != null ? this.ah4 : this.ab9 ? d : h;
let p = this.ah5 != null ? this.ah5 : this.ab9 ? e : h;
let q = !isNaN_(this.ac6) ? this.ac6 : 1;
let r = !isNaN_(this.ac5) ? this.ac5 : 10;
let s = !isNaN_(this.ac7) ? this.ac7 : 10;
let t = !isNaN_(this.ac4) ? this.ac4 : 5;
let u = !isNaN_(this.ac3) ? this.ac3 : 5;
let v = this.aca;
let w = a.b.bb;
if (!v) {
t = 0;
q = 0;
r = 0;
s = 0;
w = null;
}
if (this.aci && this.calloutStyleUpdating != null) {
let x = new CalloutStyleUpdatingEventArgs();
x.item = a.b.an;
x.xValue = a.b.ap;
x.yValue = a.b.aq;
x.series = a.b.l;
x.background = g;
x.backgroundCorner = c;
x.textColor = h;
x.outline = k;
x.leaderBrush = l;
x.strokeThickness = m;
x.badgeOutline = p;
x.badgeCorner = u;
x.badgeBackground = o;
x.badgeThickness = q;
x.badgeHeight = r;
x.badgeWidth = s;
x.badgeVisible = v;
x.badgeGap = t;
x.badgeImage = w;
x.bacgkroundPaddingLeft = b.left;
x.bacgkroundPaddingTop = b.top;
x.bacgkroundPaddingBottom = b.bottom;
x.bacgkroundPaddingRight = b.right;
x.o = a.b.n;
this.calloutStyleUpdating(this, x);
g = x.background;
h = x.textColor;
k = x.outline;
l = x.leaderBrush;
m = x.strokeThickness;
c = x.backgroundCorner;
p = x.badgeOutline;
o = x.badgeBackground;
v = x.badgeVisible;
b = new Thickness(1, x.bacgkroundPaddingLeft, x.bacgkroundPaddingTop, x.bacgkroundPaddingRight, x.bacgkroundPaddingBottom);
if (v) {
q = x.badgeThickness;
r = x.badgeHeight;
s = x.badgeWidth;
t = x.badgeGap;
w = x.badgeImage;
u = x.badgeCorner;
}
else {
t = 0;
q = 0;
r = 0;
s = 0;
w = null;
}
}
a.b.backgroundPadding = b;
a.b.backgroundCornerRadius = c;
a.b.background = g;
a.b.textColor = h;
a.b.outline = k;
a.b.leaderBrush = l;
a.b.strokeThickness = m;
a.b.badgeGap = t;
a.b.badgeCorner = u;
a.b.badgeBackground = o;
a.b.badgeOutline = p;
a.b.badgeThickness = q;
a.b.badgeHeight = r;
a.b.badgeWidth = s;
a.b.badgeVisible = v;
a.b.badgeImage = w;
}
k0(a, b) {
let c = this.np(b);
if (c == CalloutLayer.$$p[44]) {
return this.k1(a, b, this.afb);
}
if (c == CalloutLayer.$$p[55]) {
return this.k1(a, b, this.afr);
}
if (c == CalloutLayer.$$p[56]) {
return this.k1(a, b, this.afu);
}
if (c == CalloutLayer.$$p[41]) {
return this.k1(a, b, this.ae5);
}
if (c == CalloutLayer.$$p[35]) {
return this.k1(a, b, this.aew);
}
return super.k0(a, b);
}
mp(a) {
let b = this.np(a);
if (b == CalloutLayer.$$p[44]) {
return this.afb;
}
if (b == CalloutLayer.$$p[55]) {
return this.afr;
}
if (b == CalloutLayer.$$p[56]) {
return this.afu;
}
if (b == CalloutLayer.$$p[41]) {
return this.ae5;
}
if (b == CalloutLayer.$$p[35]) {
return this.aew;
}
return super.mp(a);
}
get abn() {
return this.abh;
}
set abn(a) {
if (this.abh != a) {
let b = this.abh;
this.abh = a;
this.raisePropertyChanged("LabelColumn", b, this.abh);
}
}
get abo() {
return this.abi;
}
set abo(a) {
if (this.abi != a) {
let b = this.abi;
this.abi = a;
this.raisePropertyChanged("XColumn", b, this.abi);
}
}
get abp() {
return this.abj;
}
set abp(a) {
if (this.abj != a) {
let b = this.abj;
this.abj = a;
this.raisePropertyChanged("YColumn", b, this.abj);
}
}
get abm() {
return this.abg;
}
set abm(a) {
if (this.abg != a) {
let b = this.abg;
this.abg = a;
this.raisePropertyChanged("KeyColumn", b, this.abg);
}
}
get abl() {
return this.abf;
}
set abl(a) {
if (this.abf != a) {
let b = this.abf;
this.abf = a;
this.raisePropertyChanged("ContentColumn", b, this.abf);
}
}
afz(a, b) {
if (b.propertyName == CalloutAnnotation.$$p[24] || b.propertyName == CalloutAnnotation.$$p[25]) {
let c = a.k;
if (!this.acs.contains(c)) {
this.acs.add_1(c);
this.acv.add(c);
this.r9(false);
}
}
}
ct() {
return new CalloutLayerView(this);
}
ri(a) {
super.ri(a);
this.aa4 = a;
}
get aa6() {
return this.aa5;
}
set aa6(a) {
let b = this.aa6;
if (a != b) {
this.aa5 = a;
this.raisePropertyChanged("AllowedPositions", b, this.aa6);
}
}
g1(a) {
if (this.abb == null) {
return true;
}
if (this.abb == a) {
return true;
}
return false;
}
get aaz() {
return EnumUtil.getEnumValue(AutoCalloutVisibilityMode_$type, this.c(CalloutLayer.ahf));
}
set aaz(a) {
this.h(CalloutLayer.ahf, enumGetBox(AutoCalloutVisibilityMode_$type, a));
}
get aay() {
return this.aax;
}
set aay(a) {
this.aax = a;
}
get abk() {
return this.abe;
}
set abk(a) {
if (this.abe != a) {
let b = this.abe;
this.abe = a;
this.raisePropertyChanged("CalloutBadgeImageColumn", b, this.abe);
}
}
agb() {
this.dp.deregisterColumn(this.abk);
this.abq = ImageLoadParam.a(this.ad0, "{", "}");
if (stringIsNullOrEmpty(this.abq.value)) {
this.abk = null;
}
else {
this.abk = this.dn(this.abq.value);
}
}
aey(a) {
if (this.abk != null && this.abk.count > a) {
let b = this.abk.item(a);
let c = this.abq.b(b);
return c;
}
else {
return null;
}
}
provideRenderer(a) {
super.provideRenderer(a);
ImageLoader.d = a;
if (this.aa4 != null) {
this.aa4.cw = a;
}
}
get aif() {
return new Thickness(1, this.ade, this.adg, this.adf, this.add);
}
get abd() {
if (this.abc == null) {
this.abc = FontUtil.toFontInfo(this.j9, this.afh);
}
return this.abc;
}
ze(a, b) {
if (this.abb == null || this.abb == a) {
if (!this.a1.c) {
this.r9(b);
}
}
}
zg(a, b) {
super.zg(a, b);
let c = a;
c.ac.clear();
c.ad.clear();
c.z.clear();
c.r.clear();
c.u.clear();
c.t.clear();
c.w.clear();
c.y.clear();
c.x.clear();
c.v.clear();
c.s.clear();
c.aa.clear();
c.ab.clear();
c.ag.clear();
c.ah.clear();
c.ae.clear();
c.af.clear();
c.i.clear();
c.n.clear();
c.l.clear();
c.q.clear();
c.k.clear();
c.j.clear();
c.o.clear();
c.p.clear();
c.m.clear();
let d = this.acz();
let e = new List$1(CalloutAnnotationWrapper.$, 0);
let f = Number.POSITIVE_INFINITY;
let g = true;
if (this.acf) {
if (this.x5(this.abb)) {
if (typeCast(IHasCategoryAxis_$type, this.abb) !== null) {
let h = this.abb.i4() > 0 ? this.abb.i4() : this.abb.getCategoryWidth();
if (!isNaN_(h) && !isInfinity(h) && h > 0) {
f = Math.min(f, h);
}
}
this.af7(this.abb, c, e);
}
else {
for (let i of fromEnum(this.dc.b9)) {
if (this.x5(i)) {
if (typeCast(IHasCategoryAxis_$type, i) !== null) {
let j = i.i4() > 0 ? i.i4() : i.getCategoryWidth();
if (!isNaN_(j) && !isInfinity(j) && j > 0) {
f = Math.min(f, j);
}
}
if (!i.ev) {
if (!i.isVertical) {
g = false;
}
}
let k = false;
if (i.ei && this.aba == 0 || this.aba == 3 || this.aba == 2) {
if (this.aba == 0 || this.aba == 2) {
k = true;
}
i.qg((l) => {
this.af7(l, c, e);
return true;
});
}
if (!k) {
this.af7(i, c, e);
}
}
}
}
}
if (this.acf && this.aay == 2) {
let l = 0;
let m = 0;
let n = 1.7976931348623157E+308;
let o = 1.7976931348623157E+308;
let p = -1.7976931348623157E+308;
let q = -1.7976931348623157E+308;
if (e.count > 0) {
if (e._inner[0].c != null) {
l = e._inner[0].e;
m = e._inner[0].f;
}
for (let r = 0; r < e.count; r++) {
let s = e._inner[r];
if (s.c != null) {
let t = s.e;
let u = s.f;
if (t != l) {
n = Math.min(n, Math.abs(t - l));
}
if (u != m) {
o = Math.min(o, Math.abs(u - m));
}
p = Math.max(s.c.p + s.c.p, p);
q = Math.max(s.c.o + s.c.o, q);
}
}
if (g) {
if (!isNaN_(f) && !isInfinity(f)) {
if (q > f) {
e.clear();
}
}
else {
if (q > o) {
e.clear();
}
}
}
else {
if (!isNaN_(f) && !isInfinity(f)) {
if (p > f) {
e.clear();
}
}
else {
if (p > n) {
e.clear();
}
}
}
}
}
let v = this.adl <= 0 && e.count > 0;
let w = this.adl > 0 && e.count <= 0;
let x = v || w;
let y = this.adl != e.count;
if (v && this.ace) {
return;
}
if (!this.ab1) {
this.af6(c, d, e);
}
let z = this.da.iy();
let aa = this.da.ix();
let ab = z != this.ac1;
let ac = aa != this.ac0;
let ad = ab || ac;
if (ad) {
this.ac1 = z;
this.ac0 = aa;
}
this.adl = e.count;
if (this.ab1) {
return;
}
if (!this.abw && this.acb && this.acc && e.count > 0 && e.count == this.adl && this.aay == 2) {
this.abw = true;
this.af9();
}
}
ta(a, b) {
super.ta(a, b);
let c = b.width - this.aic.width;
let d = b.height - this.aic.height;
let e = 0;
if (Math.abs(c) > Math.abs(d)) {
e = c;
this.ac2 = c * this.xe.width;
}
else {
e = d;
this.ac2 = d * this.xe.height;
}
if (e > 0 && this.ac2 > 5) {
this.ab8 = true;
}
if (e < 0 && this.ac2 > 5) {
this.ab7 = true;
}
}
s9(a, b) {
super.s9(a, b);
if (!a.equals1(b)) {
this.ab6 = true;
}
}
get aid() {
return this.aib;
}
set aid(a) {
this.aib = a;
}
af6(a, b, c) {
if (this.dc != null) {
this.aic = this.dc.ys;
}
if (this.xe.isEmpty) {
return;
}
this.aid = new Rect(0, this.xe.left, this.xe.top, this.xe.width, this.xe.height);
if (this.abr != null && this.aet != null && this.aet != this.abr.bd) {
this.af1();
}
if (this.abr != null && this.abr.j != this.abt()) {
this.af1();
}
if (this.abr == null) {
let d = this.abs();
if (d != null) {
this.abr = d;
let e = this.abr;
e.labelsMoved = delegateCombine(e.labelsMoved, runOn(this, this.afy));
}
else {
let f = this.w5(this.cw);
let g = new Array(2);
g[0] = 0;
g[1] = 3;
if (this.abb != null) {
if (this.abb.isVertical) {
g = new Array(2);
g[0] = 2;
g[1] = 1;
}
}
else {
let h = false;
if (this.dc != null && this.dc.b9.count > 0) {
h = true;
for (let i of fromEnum(this.dc.b9)) {
if (!i.ev) {
if (!i.isVertical) {
h = false;
}
}
}
}
if (h) {
g = new Array(2);
g[0] = 2;
g[1] = 1;
}
}
if (this.aa1 == 4 || this.aa1 == 6) {
g = new Array(4);
g[0] = 10;
g[1] = 11;
g[2] = 8;
g[3] = 9;
}
if (this.aa1 == 5) {
g = new Array(4);
g[0] = 9;
g[1] = 10;
g[2] = 11;
g[3] = 8;
}
if (this.aa1 == 7) {
g = new Array(4);
g = new Array(4);
g[0] = 8;
g[1] = 10;
g[2] = 11;
g[3] = 9;
}
this.abr = new LabelCollisionManager(this.xe.right, this.xe.bottom, this.xe, this.aa4.k(), this.adh, this.abt(), g, this.adp(), this.ado(), this.acg, this.aat);
this.abr.v = this.acj;
if (this.aet != null) {
this.abr.bd = this.aet;
this.abr.bb = this;
}
let j = this.abr;
j.labelsMoved = delegateCombine(j.labelsMoved, runOn(this, this.afy));
}
}
if (this.ab7) {
this.ab7 = false;
if (this.abr.a9 > 2) {
this.ab5 = true;
}
}
if (this.ab8) {
this.ab8 = false;
if (this.ac2 > 5) {
this.ab5 = true;
}
}
if (this.ab6) {
this.ab6 = false;
this.abr.bs(this.xe.right, this.xe.bottom, this.xe);
this.ab5 = true;
}
let k = new HashSet$1(CalloutAnnotationWrapper.$, 0);
let l = new HashSet$1(CalloutAnnotationWrapper.$, 0);
let m = new List$1(CalloutAnnotationWrapper.$, 0);
let n = new List$1(CalloutAnnotationWrapper.$, 0);
let o = new HashSet$1(CalloutAnnotationWrapper.$, 0);
for (let p = 0; p < b.count; p++) {
o.add_1(b._inner[p]);
}
for (let q = 0; q < c.count; q++) {
o.add_1(c._inner[q]);
}
let r = this.act.c;
while (r != null) {
let s = r.a;
if (!o.contains(r.c)) {
n.add(r.c);
l.add_1(r.c);
let t = r.c.b;
t.propertyChanged = delegateRemove(t.propertyChanged, runOn(this, this.afz));
this.act.h(r);
this.acq.removeItem(r.c);
this.abr.br(r.c.c);
}
r = s;
}
for (let u = 0; u < b.count; u++) {
if (!this.acq.containsKey(b._inner[u])) {
this.act.f(b._inner[u]);
let v = b._inner[u].b;
v.propertyChanged = delegateCombine(v.propertyChanged, runOn(this, this.afz));
this.acq.addItem(b._inner[u], this.act.d);
m.add(b._inner[u]);
k.add_1(b._inner[u]);
this.ab5 = true;
}
}
for (let w = 0; w < c.count; w++) {
if (!this.acq.containsKey(c._inner[w])) {
this.act.f(c._inner[w]);
this.acq.addItem(c._inner[w], this.act.d);
let x = c._inner[w].b;
x.propertyChanged = delegateCombine(x.propertyChanged, runOn(this, this.afz));
m.add(c._inner[w]);
k.add_1(c._inner[w]);
this.ab5 = true;
}
}
if (this.ab2 == true) {
this.ab2 = false;
this.ab5 = true;
}
let y = false;
if (this.acv.count > 0) {
y = true;
this.acv.clear();
this.acs.clear();
}
r = this.act.c;
while (r != null) {
let z = this.abu(r.c);
if (z == null) {
return;
}
if (!Base.equalsStatic(z, r.c.c.e)) {
let aa = false;
if (r.c.c.e == null) {
aa = true;
}
let ab = r.c.c;
ab.s = z.d;
ab.t = z.e;
if (!isNaN_(ab.s) && !isNaN_(ab.t)) {
ab.r = z.g;
ab.q = z.f;
if (ab.c == null) {
this.abr.ad(ab, false);
}
if (aa) {
this.abr.be(ab);
}
else {
this.abr.bo(ab);
}
}
}
r = r.a;
}
let ac = this.abr.ba();
let ad = this.abr.af();
if (!this.ab5 && y && (ac != 0 || ad)) {
{
this.ab5 = true;
}
}
if (ad) {
if (this.abr.x()) {
this.ab5 = true;
}
}
if (this.ab5 && (ac != 0 || ad || this.ab3)) {
this.ab3 = false;
this.ab5 = false;
this.adk = 0x7FFFFFFF;
if (this.aet != null) {
let ae = true;
for (let af = 0; af < this.dc.b9.count; af++) {
let ag = this.dc.b9._inner[af];
if (ag.ev && typeCast(CalloutLayer.$, ag) !== null) {
let ah = ag;
if (ah.aet == this.aet) {
if (!ah.aid.equals1(this.abr.b0)) {
ae = false;
break;
}
}
}
}
if (ae) {
this.abr.bv();
}
else {
this.abr.bf();
this.abr.bg();
}
}
else {
this.abr.bv();
}
}
else {
this.abr.bg();
}
let ai = this.act.c;
let aj;
let ak;
let al;
let am;
let an;
let ao;
let ap;
let aq;
let ar;
let as;
let at;
let au;
let av;
let aw;
let ax;
let ay;
let az;
let a0;
let a1;
let a2;
let a3;
let a4;
let a5;
let a6 = NaN;
let a7 = NaN;
let a8 = this.ach;
let a9 = this.acj;
let ba = this.cw.b5();
while (ai != null) {
let bb = ai.c;
let bc = bb.b;
aj = bc.cl;
ak = bc.cq;
al = bc.cp;
am = bc.backgroundPadding.left;
an = bc.backgroundPadding.top;
ao = bc.backgroundPadding.right;
ap = bc.backgroundPadding.bottom;
ar = bc.backgroundCornerRadius;
aq = bc.al;
as = bc.cr;
at = bc.bc;
au = bc.an;
az = bc.cm;
a0 = bc.cn;
a2 = bc.aj;
a3 = bc.ai;
a4 = bc.ak;
a1 = bc.q;
a6 = bc.ah;
a7 = bc.ag;
a5 = bc.bb;
let bd = bb.c;
av = bd.s - (bd.k - bd.p);
aw = bd.t - (bd.l - bd.o);
ax = bd.k - bd.p;
ay = bd.l - bd.o;
let be = false;
if (a9) {
if (bd.c != null && this.abr.ab(bd.c)) {
be = true;
}
}
if (bb.c.h && !be) {
av = NaN;
aw = NaN;
}
if (!bb.c.h && (bb.c.b == 8 || bb.c.b == 9)) {
al = ba;
av = bd.k;
aw = bd.l;
}
if (be) {
at = this.afj(bb, at);
let bf = this.abr.as(bb.c.c);
if (bf > 0) {
ax += bf;
av -= bf;
}
}
if (a8) {
let bg = new CalloutRenderStyleUpdatingEventArgs();
bg.background = aj;
bg.outline = ak;
bg.leaderBrush = al;
bg.strokeThickness = aq;
bg.textColor = as;
bg.item = au;
bg.series = bc.l;
bg.actualPosition = bd.b;
bg.xValue = bc.ap;
bg.yValue = bc.aq;
bg.width = bd.p * 2;
bg.height = bd.o * 2;
bg.badgeOutline = a0;
bg.badgeBackground = az;
bg.badgeThickness = a2;
bg.badgeImage = a5;
bg.backgroundCorner = ar;
bg.l = bb.b.n;
if (this.calloutRenderStyleUpdating != null) {
this.calloutRenderStyleUpdating(this, bg);
aj = bg.background;
ak = bg.outline;
al = bg.leaderBrush;
aq = bg.strokeThickness;
as = bg.textColor;
a0 = bg.badgeOutline;
az = bg.badgeBackground;
a2 = bg.badgeThickness;
a5 = bg.badgeImage;
ar = bg.backgroundCorner;
}
}
a.z.add1(bb);
a.r.add(aj);
a.u.add(ak);
a.t.add(al);
a.w.add(am);
a.y.add(an);
a.x.add(ao);
a.v.add(ap);
a.s.add(ar);
a.aa.add(aq);
a.ab.add(as);
a.ac.add1(at);
a.ad.add1(au);
a.i.add(az);
a.n.add(a0);
a.l.add(a3);
a.q.add(a4);
a.j.add(a7);
a.k.add(a6);
a.o.add(a2);
a.p.add(a1);
a.m.add1(a5);
a.ag.add(av);
a.ah.add(aw);
a.ae.add(ax);
a.af.add(ay);
ai = ai.a;
}
}
afj(a, b) {
let c = Math.max(this.abr.as(a.c.c), this.abr.at(a.c.c));
if (c <= 0) {
return b;
}
let d = b.length;
let e = this.aa4.da(b, a.b.backgroundPadding, null);
let f = e.width;
let g = f - c;
while (f - g > 0.0001 && d > 0) {
d--;
b = b.substr(0, d) + "…";
e = this.aa4.da(b, a.b.backgroundPadding, null);
f = e.width;
}
return b;
}
af1() {
if (this.abr != null) {
let a = this.act.c;
while (a != null) {
let b = a.c.c;
if (b != null) {
this.abr.br(b);
}
a = a.a;
}
let c = this.abr;
c.labelsMoved = delegateRemove(c.labelsMoved, runOn(this, this.afy));
this.abr = null;
}
this.af0();
}
abs() {
if (this.dc == null) {
return null;
}
for (let a = 0; a < this.dc.b9.count; a++) {
let b = this.dc.b9._inner[a];
if (b.ev && typeCast(CalloutLayer.$, b) !== null) {
let c = b;
if (c != this) {
if (c.aet != null && c.aet == this.aet) {
if (c.abr != null) {
return c.abr;
}
}
}
}
}
return null;
}
ado() {
return 20000;
}
adp() {
return 300;
}
abt() {
switch (this.aa1) {
case 0: return 2;
case 2: return 1;
case 3: return 2;
case 1: return 0;
case 4: return 3;
case 7: return 7;
case 5: return 5;
case 6: return 6;
}
return 2;
}
afy(a) {
let b = this.abr.ba();
let c = this.adk;
if (b < this.adk) {
this.adk = b;
if (c != 0x7FFFFFFF) {
this.r9(false);
}
}
}
abu(a) {
let b = this.abb;
if (a.b.l != null) {
b = a.b.l;
}
if (b == null) {
for (let c = 0; c < this.dc.b9.count; c++) {
let d = this.dc.b9._inner[c];
if (!d.ev) {
b = d;
break;
}
}
}
if (b == null) {
return null;
}
let e = b.ai();
let f = b.i6();
let g = null;
let h = null;
let i = false;
for (let j = 0; j < e.length; j++) {
if (e[j] == null) {
continue;
}
if (e[j].dc) {
i = true;
g = e[j];
}
else if (e[j].dv) {
i = true;
h = e[j];
}
else if (e[j].dz) {
h = e[j];
}
else {
g = e[j];
}
}
if (g == null || h == null) {
return null;
}
if (!g.dy() || !h.dy()) {
return null;
}
let k = 0;
let l = 0;
if (g.df && g.categoryMode != 0) {
if (b.fa) {
k = b.getOffsetValue();
}
else if (b.e1) {
k = b.getOffsetValue();
}
}
if (h.df && h.categoryMode != 0) {
if (b.e1) {
l = b.getOffsetValue();
}
}
let m = new ScalerParams(0, this.dc.ys, g.o8, g.dn, g.o3());
m.b = f;
let n = new ScalerParams(0, this.dc.ys, h.o8, h.dn, h.o3());
n.b = f;
let o = 0;
let p = 0;
if (i) {
o = g.f7(this.adj(a.b.ap), m) + k;
p = h.f7(this.adj(a.b.aq), n) + l;
let q = o;
let r = p;
let s = { $type: Point_$type, x: 0.5, y: 0.5 };
let t = s.x + (r * Math.cos(q));
o = ViewportUtils.e(t, m.e, m.d, m.c);
let u = s.y + (r * Math.sin(q));
p = ViewportUtils.i(u, n.e, n.d, n.c);
}
else {
o = g.f7(this.adj(a.b.ap), m) + k;
p = h.f7(this.adj(a.b.aq), n) + l;
}
let v = new QuadTreeBoundingBox();
v.d = o;
v.e = p;
v.g = 3;
v.f = 3;
v.i = a.b;
return v;
}
adj(a) {
if (typeCast(Date_$type, a) !== null) {
return a.getTime();
}
if (a == null) {
return 0;
}
return a;
}
acz() {
let a = new List$1(CalloutAnnotationWrapper.$, 0);
for (let b = 0; b < this.acw.count; b++) {
if (stringIsNullOrEmpty(this.acw._inner[b].b.bc)) {
continue;
}
if (this.acw._inner[b].c == null) {
let c = new LabelCollisionInfo();
this.acw._inner[b].c = c;
let d = this.acw._inner[b];
this.agg(c, d);
}
let e = this.abu(this.acw._inner[b]);
if (e == null || e.d < this.xe.lef