igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
1,457 lines (1,456 loc) • 65.6 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 { __extends, __values } from "tslib";
import { Series } from "./Series";
import { ISupportsFillScale_$type } from "./ISupportsFillScale";
import { DependencyProperty } from "igniteui-angular-core";
import { BrushScale } from "./BrushScale";
import { HighlightingInfo } from "igniteui-angular-core";
import { ShapeItemSearchMode_$type } from "./ShapeItemSearchMode";
import { IEnumerable$1_$type, String_$type, enumGetBox, Number_$type, Point_$type, typeCast, runOn, delegateCombine, fromEnum, Array_$type, markType, markDep } from "igniteui-angular-core";
import { NumericXAxis } from "./NumericXAxis";
import { NumericYAxis } from "./NumericYAxis";
import { List$1 } from "igniteui-angular-core";
import { Rect } from "igniteui-angular-core";
import { StyleShapeEventArgs } from "./StyleShapeEventArgs";
import { FrameworkElement } from "igniteui-angular-core";
import { IFastItemsSource_$type } from "igniteui-angular-core";
import { DataContext } from "igniteui-angular-core";
import { Tuple$2 } from "igniteui-angular-core";
import { ShapeHitRegion } from "./ShapeHitRegion";
import { RectUtil } from "igniteui-angular-core";
import { Tuple$3 } from "igniteui-angular-core";
import { GeometryUtil } from "igniteui-angular-core";
import { AssigningShapeStyleEventArgs } from "./AssigningShapeStyleEventArgs";
import { AssigningShapeMarkerStyleEventArgs } from "./AssigningShapeMarkerStyleEventArgs";
import { SeriesLayerPropertyOverlay } from "./SeriesLayerPropertyOverlay";
import { CustomPaletteBrushScale } from "./CustomPaletteBrushScale";
import { ValueBrushScale } from "./ValueBrushScale";
import { PointCollectionUtil } from "igniteui-angular-core";
import { FlattenedShape } from "./FlattenedShape";
import { SeriesView } from "./SeriesView";
import { Clipper } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { Dictionary$2 } from "igniteui-angular-core";
import { ActualRange } from "./ActualRange";
import { SeriesRenderManager } from "./SeriesRenderManager";
import { PolySimplification } from "igniteui-angular-core";
import { DefaultFlattener } from "./DefaultFlattener";
import { ChartSelection } from "./ChartSelection";
import { AxisRange } from "./AxisRange";
import { Style } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { boxArray$1 } from "igniteui-angular-core";
import { InvalidOperationException } from "igniteui-angular-core";
import { isNaN_, truncate } from "igniteui-angular-core";
import { FastItemObjectColumn } from "igniteui-angular-core";
import { Path } from "igniteui-angular-core";
import { Pool$1 } from "igniteui-angular-core";
import { PointCollection } from "igniteui-angular-core";
import { PathGeometry } from "igniteui-angular-core";
import { PolyLineSegment } from "igniteui-angular-core";
import { PathFigure } from "igniteui-angular-core";
import { PolygonUtil } from "igniteui-angular-core";
/**
* @hidden
*/
var ShapeSeriesBase = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(ShapeSeriesBase, _super);
function ShapeSeriesBase() {
var _this = _super.call(this) || this;
_this.xt = null;
_this.xy = false;
_this.xx = false;
_this.xr = null;
_this.xs = null;
_this.xh = 1;
_this.w2 = null;
_this.w3 = null;
_this.assigningShapeStyle = null;
_this.assigningShapeMarkerStyle = null;
_this.xl = null;
_this.xu = null;
_this.xd = null;
_this.xf = null;
_this.yk = 0;
_this.yg = null;
_this.wz = null;
_this.w1 = null;
_this.w0 = null;
_this.wy = null;
_this.z4 = null;
_this.xb = null;
_this.xn = null;
_this.w6 = null;
_this.yn = 0;
_this.styleShape = null;
_this.xl = new ShapeSeriesRenderManager();
FastItemObjectColumn.m();
_this.yn = _this.ym;
_this.z4 = Rect.empty;
return _this;
}
ShapeSeriesBase.prototype.o2 = function () {
_super.prototype.o2.call(this);
this.xe = null;
this.xg = null;
};
ShapeSeriesBase.prototype.ai = function () {
return [this.xe, this.xg];
};
ShapeSeriesBase.prototype.kq = function (a, b) {
var c = this.nd(b);
if (c == ShapeSeriesBase.$$p[9]) {
return this.kr(a, b, this.y7);
}
return null;
};
ShapeSeriesBase.prototype.md = function (a) {
var b = this.nd(a);
if (b == ShapeSeriesBase.$$p[9]) {
return this.y7;
}
return _super.prototype.md.call(this, a);
};
Object.defineProperty(ShapeSeriesBase.prototype, "xv", {
get: function () {
return this.xt;
},
set: function (a) {
if (this.xt != a) {
var b = this.xv;
this.xt = a;
this.raisePropertyChanged("FillColumn", b, this.xv);
}
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.get_fe = function () {
return true;
};
ShapeSeriesBase.prototype.get_ed = function () {
return true;
};
ShapeSeriesBase.prototype.xp = function (a, b, c) {
if (this.dn == null) {
return null;
}
var d = this.v7(b);
var e = this.xm.c2(d, false);
var f = -1;
if (e == null) {
if (a != null) {
f = this.dn.indexOf(a);
}
else {
return null;
}
}
else if (e.dataContext != null) {
f = e.dataContext.c;
}
if (f == -1) {
return null;
}
var g = new HighlightingInfo();
g.i = this;
g.g = f;
g.f = f;
g.c = false;
if (c != null && c.g == g.g && c.f == g.f) {
return c;
}
return g;
};
ShapeSeriesBase.prototype.xq = function (a, b, c) {
if (this.dn == null) {
return null;
}
var d = this.xm.b4(this.v7(b));
var e = -1;
if (d == null) {
if (a != null) {
e = this.dn.indexOf(a);
}
else {
return null;
}
}
else {
e = d.ak;
}
if (e == -1) {
return null;
}
var f = new HighlightingInfo();
f.i = this;
f.g = e;
f.f = e;
f.c = false;
f.d = true;
if (c != null && c.g == f.g && c.f == f.f) {
return c;
}
return f;
};
Object.defineProperty(ShapeSeriesBase.prototype, "xi", {
get: function () {
return this.xh;
},
set: function (a) {
var b = this.xh;
this.xh = a;
if (b != this.xh) {
this.raisePropertyChanged("ActualItemSearchMode", enumGetBox(ShapeItemSearchMode_$type, b), enumGetBox(ShapeItemSearchMode_$type, this.xh));
}
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.xj = function () {
if (this.xk != 0) {
return this.xk;
}
return 1;
};
ShapeSeriesBase.prototype.ir = function (a) {
switch (this.xi) {
case 1: return this.zd(a).c;
case 2: return this.yl(a);
case 3: return this.yl(a);
}
return -1;
};
ShapeSeriesBase.prototype.zd = function (a) {
var b = this.v7(a);
var c = { $type: Point_$type, x: NaN, y: NaN };
var d = this.xm.ce;
if (d == null) {
return new Tuple$2(Number_$type, Point_$type, -1, c);
}
var e = this.xm.b5(b, false, !this.x0);
if (e != null) {
c = RectUtil.l(e.d);
return new Tuple$2(Number_$type, Point_$type, e.b, c);
}
var f = b.x;
var g = b.y;
if (this.dn == null || this.xe == null || this.xg == null || this.yg == null) {
return new Tuple$2(Number_$type, Point_$type, -1, c);
}
if (this.dn.count > this.yq) {
return new Tuple$2(Number_$type, Point_$type, -1, c);
}
var h = 1.7976931348623157E+308;
var i = -1;
for (var j = 0; j < d.count; j++) {
var k = d._inner[j].d;
var l = RectUtil.g(k, b);
if (l < h) {
h = l;
i = d._inner[j].b;
c = RectUtil.l(d._inner[j].d);
}
}
return new Tuple$2(Number_$type, Point_$type, i, c);
};
ShapeSeriesBase.prototype.zc = function (a) {
var b = this.v7(a);
var c = b.x;
var d = b.y;
var e = { $type: Point_$type, x: NaN, y: NaN };
if (this.dn == null || this.xe == null || this.xg == null || this.yg == null) {
return new Tuple$3(Number_$type, Point_$type, Point_$type, -1, e, e);
}
if (this.dn.count > this.yq) {
return new Tuple$3(Number_$type, Point_$type, Point_$type, -1, e, e);
}
var f = 1.7976931348623157E+308;
var g = this.xm.ce;
if (g == null) {
return new Tuple$3(Number_$type, Point_$type, Point_$type, -1, e, e);
}
var h = this.xm.b5(b, false, !this.x0);
if (h != null) {
var i = RectUtil.l(h.d);
var j = this.zb(b, h.a, this.x0);
return new Tuple$3(Number_$type, Point_$type, Point_$type, h.b, j.d, i);
}
for (var k = 0; k < g.count; k++) {
var l = g._inner[k].d;
var m = RectUtil.g(l, b);
var n = (l.width * l.width) + (l.height * l.height) + m;
if (n <= f) {
f = n;
}
}
var o = 1.7976931348623157E+308;
var p = -1;
for (var q = 0; q < g.count; q++) {
var r = g._inner[q].d;
var s = RectUtil.g(r, b);
if (s < f) {
var t = this.zb(b, g._inner[q].a, this.x0);
if (t.c < o) {
o = t.c;
e = t.d;
p = q;
}
}
}
if (p >= 0) {
return new Tuple$3(Number_$type, Point_$type, Point_$type, g._inner[p].b, e, RectUtil.l(g._inner[p].d));
}
return new Tuple$3(Number_$type, Point_$type, Point_$type, -1, e, e);
};
ShapeSeriesBase.prototype.get_x0 = function () {
return true;
};
Object.defineProperty(ShapeSeriesBase.prototype, "x0", {
get: function () {
return this.get_x0();
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.zb = function (a, b, c) {
var d = { $type: Point_$type, x: NaN, y: NaN };
var e = 1.7976931348623157E+308;
var f = { $type: Point_$type, x: NaN, y: NaN };
var g = false;
var h = -1;
for (var i = 0; i < b.count; i++) {
var j = b._inner[i];
if (i >= 1) {
var k = GeometryUtil.h(a, d, j);
if (k < e) {
e = k;
g = true;
h = i;
}
}
d = j;
}
if (c) {
var l = b._inner[0];
var m = GeometryUtil.h(a, d, l);
if (m < e) {
e = m;
var n = GeometryUtil.m(a, d, l);
f = { $type: Point_$type, x: d.x + (l.x - d.x) * n, y: d.y + (l.y - d.y) * n };
return new Tuple$2(Number_$type, Point_$type, e, f);
}
}
if (g) {
var o = b._inner[h - 1];
var p = b._inner[h];
var q = GeometryUtil.m(a, o, p);
f = { $type: Point_$type, x: o.x + (p.x - o.x) * q, y: o.y + (p.y - o.y) * q };
}
return new Tuple$2(Number_$type, Point_$type, e, f);
};
ShapeSeriesBase.prototype.yl = function (a) {
return this.zc(a).c;
};
ShapeSeriesBase.prototype.wc = function (a, b, c) {
if (this.xe == null || this.xg == null || this.yg == null) {
return { $type: Point_$type, x: NaN, y: NaN };
}
switch (this.xi) {
case 1:
var d = this.zd(a);
return d.d;
case 2:
var e = this.zc(a);
return e.e;
case 3:
var f = this.zc(a);
return f.d;
}
return { $type: Point_$type, x: NaN, y: NaN };
};
ShapeSeriesBase.prototype.kn = function (a) {
var b = this.j3(a);
if (this.dn != null && b >= 0 && b < this.dn.count) {
return this.dn.item(b);
}
return null;
};
ShapeSeriesBase.prototype.xo = function (a, b, c) {
var d = new HighlightingInfo();
d.i = this;
d.g = 0;
d.f = this.dn.count - 1;
d.c = true;
if (c != null && c.g == d.g && c.f == d.f) {
return c;
}
return d;
};
ShapeSeriesBase.prototype.dg = function (a, b, c) {
if (this.ed && this.fz(this.bx) && !c) {
var d = this.xp(a, b, this.xr);
this.xr = d;
return d;
}
else {
var e = this.xo(a, b, this.xr);
this.xr = e;
return e;
}
};
ShapeSeriesBase.prototype.dh = function (a, b, c) {
if (this.fz(this.bx) && !c) {
var d = this.xq(a, b, this.xs);
this.xs = d;
return d;
}
else {
var e = this.xo(a, b, this.xs);
e.d = true;
this.xs = e;
return e;
}
};
ShapeSeriesBase.prototype.ye = function () {
return (this.assigningShapeStyle != null && this.xy) || this.d2 || (this.bx != 1) || (this.cp != 1) || (this.co != 1) || (this.xv != null && this.xa != null);
};
ShapeSeriesBase.prototype.yd = function () {
return (this.assigningShapeMarkerStyle != null && this.xx) || this.d2 || (this.bx != 1) || (this.cp != 1) || (this.co != 1);
};
Object.defineProperty(ShapeSeriesBase.prototype, "yy", {
get: function () {
return this.c(ShapeSeriesBase.zu);
},
set: function (a) {
this.h(ShapeSeriesBase.zu, a);
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.gb = function () {
return this.highlightedItemsSource != null || this.yy != null;
};
ShapeSeriesBase.prototype.ht = function () {
var a = _super.prototype.ht.call(this);
{
var b = ((function () {
var $ret = new SeriesLayerPropertyOverlay();
$ret.ad = "ShapeMemberPath";
$ret.p = true;
$ret.y = "HighlightedShapeMemberPath";
$ret.q = true;
return $ret;
})());
b.valueResolving = delegateCombine(b.valueResolving, runOn(this, this.zg));
a.add(b);
}
{
var c = ((function () {
var $ret = new SeriesLayerPropertyOverlay();
$ret.r = true;
$ret.ad = "Brush";
$ret.p = true;
$ret.y = "ActualBrush";
$ret.q = true;
return $ret;
})());
c.valueResolving = delegateCombine(c.valueResolving, runOn(this, this.r0));
a.add(c);
}
{
var d = ((function () {
var $ret = new SeriesLayerPropertyOverlay();
$ret.r = true;
$ret.ad = "Outline";
$ret.p = true;
$ret.y = "ActualOutline";
$ret.q = true;
return $ret;
})());
d.valueResolving = delegateCombine(d.valueResolving, runOn(this, this.r0));
a.add(d);
}
return a;
};
ShapeSeriesBase.prototype.zg = function (a, b) {
if (this.yy != null) {
b.value = this.yy;
return;
}
b.value = this.y7;
};
Object.defineProperty(ShapeSeriesBase.prototype, "xw", {
get: function () {
return this.xu;
},
set: function (a) {
var b = this.xw != a;
if (b) {
var c = this.xw;
this.xu = a;
this.raisePropertyChanged("ShapeColumn", c, this.xw);
}
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.x5 = function (array_) {
var a = (Array.isArray(array_));
return a;
};
ShapeSeriesBase.x9 = function (a) {
if (a == null) {
return true;
}
var val_ = a;
return (val_ == undefined);
};
ShapeSeriesBase.prototype.convertToListList = function (a) {
if (a == null) {
return null;
}
var b = new List$1(List$1.$.specialize(Point_$type), 0);
var c;
var curr_;
var d;
var e;
var f = false;
var g = false;
for (var h = 0; h < a.length; h++) {
c = a[h];
if (c == null) {
continue;
}
var i = new List$1(Point_$type, 0);
for (var j = 0; j < c.length; j++) {
curr_ = c[j];
if (f) {
d = (curr_.X);
e = (curr_.Y);
}
else {
d = (curr_.x);
e = (curr_.y);
}
if (!g) {
if ((isNaN_(d) || ShapeSeriesBase.x9(d)) && (isNaN_(e) || ShapeSeriesBase.x9(e))) {
d = (curr_.X);
e = (curr_.Y);
if (!isNaN_(d) && !ShapeSeriesBase.x9(d) && !isNaN_(e) && !ShapeSeriesBase.x9(e)) {
g = true;
f = true;
}
}
else {
g = true;
}
}
i.add({ $type: Point_$type, x: d, y: e });
}
b.add(i);
}
return b;
};
ShapeSeriesBase.prototype.dm = function (a) {
if (this.dn != null && this.x5(this.itemsSource) && a != null && a.split('!').length != 2) {
if (this.coercionMethods == null) {
this.coercionMethods = {};
}
var methods_ = this.coercionMethods;
methods_.convertToListList = this.convertToListList;
a += "!convertToListList";
}
return _super.prototype.dm.call(this, a);
};
ShapeSeriesBase.prototype.q9 = function (a, b, c, d) {
_super.prototype.q9.call(this, a, b, c, d);
var e = false;
var f = false;
switch (b) {
case ShapeSeriesBase.$$p[5]:
this.xi = this.xj();
break;
case "FastItemsSource":
var g = typeCast(IFastItemsSource_$type, c);
if (g != null) {
if (this.xv != null) {
g.deregisterColumn(this.xv);
}
if (this.xw != null) {
g.deregisterColumn(this.xw);
}
this.xw = null;
}
var h = typeCast(IFastItemsSource_$type, d);
if (h != null) {
if (this.y7 != null) {
this.xw = this.dm(this.y7);
}
if (this.yu != null) {
this.xv = this.dk(this.yu);
}
}
e = this.xe != null && !this.xe.c1();
f = this.xg != null && !this.xg.c1();
if (e || f) {
this.rr(this.gg && c != null);
}
break;
case ShapeSeriesBase.$$p[9]:
if (this.dn != null) {
this.dn.deregisterColumn(this.xw);
this.xw = this.dm(this.y7);
}
break;
case "ShapeColumn":
this.zo();
e = this.xe != null && !this.xe.c1();
f = this.xg != null && !this.xg.c1();
if (e || f) {
this.rr(this.gg && this.d7);
}
this.ql();
break;
case ShapeSeriesBase.$$p[10]:
case ShapeSeriesBase.$$p[11]:
this.xd = this.xe;
this.xf = this.xg;
var i = c;
var j = d;
this.zp(i);
this.zh(j);
if ((j != null && !j.c1()) || (j == null && i != null)) {
this.rr(false);
}
this.ql();
break;
case "ActualResolution":
this.yk = this.id;
this.ql();
break;
case "ActualBrush":
this.rr(false);
break;
case ShapeSeriesBase.$$p[8]:
this.yn = this.ym;
this.rr(false);
this.ql();
break;
case ShapeSeriesBase.$$p[2]:
case "ActualThickness":
this.rr(false);
this.ql();
break;
case ShapeSeriesBase.$$p[4]:
this.xy = this.yc();
this.rr(false);
break;
case ShapeSeriesBase.$$p[3]:
this.xx = this.yb();
this.rr(false);
break;
case ShapeSeriesBase.$$p[1]:
if (c != null) {
c.o.remove(this);
c.x();
this.xb = null;
this.xn = null;
}
if (d != null) {
d.o.add(this);
d.x();
this.xb = typeCast(CustomPaletteBrushScale.$, d);
this.xn = typeCast(ValueBrushScale.$, d);
}
this.rr(false);
this.ql();
break;
case "FillColumn":
this.rr(this.gg && this.d7);
this.ql();
break;
case ShapeSeriesBase.$$p[0]:
if (this.xa != null) {
this.xa.x();
}
if (this.dn != null) {
this.dn.deregisterColumn(this.xv);
this.xv = this.dk(this.yu);
}
break;
}
};
ShapeSeriesBase.prototype.yc = function () {
return this.x8;
};
ShapeSeriesBase.prototype.yb = function () {
return this.x7;
};
ShapeSeriesBase.prototype.x2 = function (a) {
if (typeCast(NumericYAxis.$, a) !== null) {
return true;
}
return false;
};
ShapeSeriesBase.prototype.x1 = function (a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
};
ShapeSeriesBase.prototype.zo = function () {
this.yg = null;
if (this.xw == null) {
return;
}
this.yg = new List$1(Rect.$, 2, this.xw.count);
for (var a = 0; a < this.xw.count; a++) {
this.yg.add(PointCollectionUtil.j(this.xw.item(a)));
}
};
ShapeSeriesBase.prototype.z5 = function (a) {
if (typeCast(IEnumerable$1_$type.specialize(IEnumerable$1_$type.specialize(Point_$type)), a) !== null) {
return PointCollectionUtil.h(a);
}
else if (typeCast(IEnumerable$1_$type.specialize(Point_$type), a) !== null) {
return PointCollectionUtil.g(a);
}
return Rect.empty;
};
ShapeSeriesBase.prototype.yi = function (a, b, c, d, e, f, g) {
var e_1, _a;
return this.yj(a, b, c, d, e, f, g);
if (typeCast(List$1.$.specialize(List$1.$.specialize(Point_$type)), c) !== null) {
return this.yj(a, b, c, d, e, f, g);
}
else if (typeCast(IEnumerable$1_$type.specialize(IEnumerable$1_$type.specialize(Point_$type)), c) !== null) {
var h = c;
var i = new List$1(FlattenedShape.$, 0);
var j = null;
try {
for (var _b = __values(fromEnum(h)), _c = _b.next(); !_c.done; _c = _b.next()) {
var k = _c.value;
j = this.xc(a, b, PointCollectionUtil.b(k), d, e, f, g);
if (j == null) {
continue;
}
i.add(j);
}
}
catch (e_1_1) {
e_1 = { error: e_1_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_1)
throw e_1.error;
}
}
return i;
}
else if (typeCast(IEnumerable$1_$type.specialize(Point_$type), c) !== null) {
var l = c;
var m = this.xc(a, b, PointCollectionUtil.b(l), d, e, f, g);
var n = new List$1(FlattenedShape.$, 0);
if (m != null) {
n.add(m);
}
return n;
}
else {
throw new InvalidOperationException(1, "Unrecognized data in ShapeColumn");
}
};
ShapeSeriesBase.prototype.get_x6 = function () {
return true;
};
Object.defineProperty(ShapeSeriesBase.prototype, "x6", {
get: function () {
return this.get_x6();
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.yf = function () {
return false;
};
ShapeSeriesBase.prototype.rs = function (a) {
this.zn(this.cv);
};
ShapeSeriesBase.prototype.rq = function (a, b, c, d, e) {
_super.prototype.rq.call(this, a, b, c, d, e);
var f = this.ba.a$j.item(d);
var g = f;
f.a3(c);
if (this.d5(f)) {
return;
}
this.zn(f);
};
ShapeSeriesBase.prototype.updateFillScaleGlobals = function () {
var a = new ActualRange();
a.b = NaN;
a.a = NaN;
if (this.xv != null) {
a.b = this.xv.minimum;
a.a = this.xv.maximum;
}
if (this.xa != null) {
this.xa.z(a.b, a.a);
}
};
ShapeSeriesBase.prototype.zn = function (a) {
var _this = this;
if (this.d5(a)) {
return;
}
if (this.xa != null) {
this.w6 = this.w7();
}
var b;
var c;
var d = a;
var e = a.getViewInfo(c, b);
c = e.p0;
b = e.p1;
if (c.width < 1 || c.height < 1 || this.xw == null) {
return;
}
var f = this.xe;
var g = this.xg;
var h = this.getEffectiveViewport1(a);
var i = new ScalerParams(1, b, c, f.ch);
i.c = h;
var j = new ScalerParams(1, b, c, g.ch);
j.c = h;
if (!this.gr) {
d.cu();
var k = new Rect(0, 0, 0, 0, 0);
var l = void 0;
var m = void 0;
var n = void 0;
var o = void 0;
var p = this.xw.count;
if (this.w1 == null || this.w1.length != p) {
this.w1 = new Array(p);
this.wz = new Array(p);
this.w0 = new Array(p);
this.wy = new Array(p);
}
var q = this.w1;
var r = this.wz;
var s = this.w0;
var t = this.wy;
var u = void 0;
for (var v = 0; v < p; v++) {
u = this.yg._inner[v];
q[v] = u.top;
r[v] = u.left;
s[v] = u.right;
t[v] = u.bottom;
}
this.xd.hq(boxArray$1(r), 0, r.length, i);
this.xd.hq(boxArray$1(s), 0, s.length, i);
this.xf.hq(boxArray$1(q), 0, q.length, j);
this.xf.hq(boxArray$1(t), 0, t.length, j);
d.cv(r, q, s, t);
var w = this.xw;
var x = this.dn;
this.zq(d);
var y = c.left;
var z = c.right;
var aa = c.top;
var ab = c.bottom;
var ac = null;
if (this.z4.isEmpty) {
ac = null;
}
else {
ac = new Clipper(1, this.z4.left, this.z4.bottom, this.z4.right, this.z4.top, this.x6);
}
var ad = this.yf();
if (ad) {
d.cc.clear();
}
var ae = false;
var af = true;
var ag = 0;
if (this.db != null) {
if (this.db.f4()) {
var ah = this.db.m4(b, i);
ae = ah.c;
ag = ah.d;
}
}
var ai = void 0;
for (var aj = 0; aj < p; aj++) {
n = r[aj];
l = q[aj];
m = t[aj];
o = s[aj];
k.x = Math.min(n, o);
k.y = Math.min(l, m);
k.width = Math.max(n, o) - k.x;
k.height = Math.max(l, m) - k.y;
if (k.intersectsWith(c)) {
if (k.x < y || k.y < aa || k.x > z || k.y > ab) {
ai = ac;
}
else {
ai = null;
}
var ak = this.yi(a, ai, w.item(aj), i, j, 0, ag);
if (ad) {
ShapeSeriesBase.zm(d, aj, ak);
}
d.ci(aj, x.item(aj), k, ak);
}
else if (ae) {
k.x = k.x + ag;
if (k.intersectsWith(c)) {
if (k.x < y || k.y < aa || k.x > z || k.y > ab) {
ai = ac;
}
else {
ai = null;
}
var al = this.yi(a, ai, w.item(aj), i, j, ag, ag);
if (ad) {
ShapeSeriesBase.zm(d, aj, al);
}
d.ci(aj, x.item(aj), k, al);
}
}
}
d.ct();
}
var am = this.ye();
this.xl.az(this, this.ye(), runOn(this, this.w4));
var an = false;
var ao = this.xl.b;
if (ao != null) {
an = true;
}
var ap = a.q;
var aq = this.fy;
var ar = d.ca;
d.cp(function (as) {
var at = as.dataContext != null ? as.dataContext.item : null;
var au = as.dataContext != null ? as.dataContext.c : -1;
d.cm(as, at, am);
if (an) {
_this.zj(as, aq, au, _this.xw.count, ap, ar);
}
else {
if (ar) {
{
_this.xl.a1(as, _this.ib, ar);
}
}
}
{
_this.xl.ad(as, false, false, false, false);
}
});
};
ShapeSeriesBase.prototype.w7 = function () {
var a = new ActualRange();
a.b = NaN;
a.a = NaN;
if (this.xv != null) {
a.b = this.xv.minimum;
a.a = this.xv.maximum;
}
var b = typeCast(ValueBrushScale.$, this.xa);
if (b != null) {
b.s();
if (this.x3 && this.xa.o.count > 1) {
a.b = b.q;
a.a = b.p;
}
}
return a;
};
ShapeSeriesBase.prototype.zj = function (a, b, c, d, e, f) {
var g = this.bx != 1;
var h = this.cp != 1;
var i = this.co != 1;
this.xl.a0(this.xl.b, c, d, false);
{
this.xl.a1(a, this.ib, f);
}
var j = this.xl.ax;
var k = null;
var l = null;
var m = null;
var n = this.dn;
if (this.xv != null && this.xa != null) {
if (j.z >= 0 && j.z < this.xv.count) {
var o = this.xv.item(j.z);
var p = this.w6;
var q = p.b;
var r = p.a;
var s = j.aa;
if (this.xb != null) {
s = this.xb.getBrush1(j.z, this.xv.count);
}
else if (this.xn != null && this.xv != null) {
var t = this.xv.item(j.z);
s = this.xn.getBrushByRange(t, q, r);
}
else if (this.xa != null) {
s = this.xa.getBrush(j.z);
}
j.aa = s;
}
}
if (g && this.db != null) {
k = this.db.dl.getHighlightingInfo(this, n, j.z, j.y, false);
j.c = k;
}
if (h && this.db != null) {
l = this.db.dm.getHighlightingInfo(this, n, j.z, j.y, false);
if (l == null && this.bn != null) {
l = this.db.dm.getHighlightingInfo(this.bn, this.bn.dn, j.z, j.y, false);
}
if (l == null && this.bk != null) {
l = this.db.dm.getHighlightingInfo(this.bk, this.bk.dn, j.z, j.y, true);
}
j.d = l;
}
if (i && this.db != null) {
m = this.db.dk.getHighlightingInfo(this, n, j.z, j.y, false);
j.b = m;
}
j.h = e;
this.zl(j);
this.xl.z(this, k, l, m, e, g, h, i, false);
};
ShapeSeriesBase.prototype.zi = function (a, b, c) {
var d = this.bx != 1;
var e = this.cp != 1;
var f = this.co != 1;
this.xl.a0(this.xl.d, a, b, true);
this.xl.aa(this.ib);
var g = this.xl.aw;
var h = null;
var i = null;
var j = null;
var k = this.dn;
var l = null;
var m = null;
var n = null;
if (d && this.db != null) {
h = this.db.dl.getHighlightingInfo(this, k, g.z, g.y, true);
if (this.db.dl.isCrossContextHighlight(this)) {
l = this.db.dl.getHighlightingInfo(this, k, g.z, g.y, true);
}
g.c = h;
}
if (e && this.db != null) {
i = this.db.dm.getHighlightingInfo(this, k, g.z, g.y, true);
if (i == null && this.bn != null) {
i = this.db.dm.getHighlightingInfo(this.bn, this.bn.dn, g.z, g.y, true);
}
if (this.db.dm.isCrossContextHighlight(this)) {
m = this.db.dm.getHighlightingInfo(this, k, g.z, g.y, true);
}
g.d = i;
}
if (f && this.db != null) {
j = this.db.dk.getHighlightingInfo(this, k, g.z, g.y, true);
if (this.db.dk.isCrossContextHighlight(this)) {
n = this.db.dk.getHighlightingInfo(this, k, g.z, g.y, true);
}
g.b = i;
}
g.h = c;
this.zk(g);
this.xl.y(this, h, i, j, c, d, e, f, g.v, this.db.dl.totalHighWaterMark, g.x, this.db.dm.totalHighWaterMark, g.t, this.db.dk.totalHighWaterMark);
};
ShapeSeriesBase.prototype.zl = function (a) {
if (this.assigningShapeStyle != null && this.xy) {
this.assigningShapeStyle(this, a);
}
};
ShapeSeriesBase.prototype.zk = function (a) {
if (this.assigningShapeMarkerStyle != null && this.xx) {
this.assigningShapeMarkerStyle(this, a);
}
};
ShapeSeriesBase.prototype.w4 = function (a, b) {
return this.w5(a, b);
};
ShapeSeriesBase.prototype.w5 = function (a, b) {
if (b < a || a < 0 || a > this.xw.count || b < 0 || b > this.xw.count) {
return null;
}
var c = new Array((b - a) + 1);
for (var d = a; d <= b; d++) {
var e = d;
c[d - a] = this.dn.item(d);
}
return c;
};
ShapeSeriesBase.zm = function (a, b, c) {
var d = 0;
var e = null;
for (var f = 0; f < c.count; f++) {
var g = c._inner[f];
var h = g.b.width * g.b.height;
if (h > d) {
d = h;
e = g;
}
}
a.cc.addItem(b, e);
};
ShapeSeriesBase.prototype.qb = function () {
_super.prototype.qb.call(this);
if (this.xe != null) {
this.xe.ia();
}
if (this.xg != null) {
this.xg.ia();
}
};
ShapeSeriesBase.prototype.sr = function (a, b) {
this.rr(false);
};
ShapeSeriesBase.prototype.sq = function (a, b) {
this.rr(false);
};
ShapeSeriesBase.prototype.pb = function (a, b, c, d) {
_super.prototype.pb.call(this, a, b, c, d);
switch (a) {
case 3:
if (d == this.y7) {
this.yg._inner[b] = this.z5(this.xw.item(b));
}
break;
case 1:
for (var e = b; e < b + c; e++) {
this.yg.insert(e, this.z5(this.xw.item(e)));
}
break;
case 0:
this.yg.v(b, c);
break;
case 2:
for (var f = b; f < b + c; f++) {
this.yg._inner[f] = this.z5(this.xw.item(f));
}
break;
case 4:
this.zo();
break;
}
this.rr(false);
};
ShapeSeriesBase.prototype.he = function (a, b, c) {
var d = true;
if (!_super.prototype.he.call(this, a, b, c) || (this.ya && this.xw == null) || b.isEmpty || a.isEmpty || this.xe == null || this.xg == null || this.xe.bi == null || this.xg.bi == null || this.xe.l4 == this.xe.l3 || this.xg.l4 == this.xg.l3 || this.xw == null || this.xw.count == 0 || this.yg == null || this.yg.count == 0 || this.yg.count != this.xw.count) {
d = false;
}
return d;
};
ShapeSeriesBase.prototype.get_ya = function () {
return true;
};
Object.defineProperty(ShapeSeriesBase.prototype, "ya", {
get: function () {
return this.get_ya();
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.q1 = function (a) {
_super.prototype.q1.call(this, a);
this.xm = typeCast(ShapeSeriesViewBase.$, a);
};
ShapeSeriesBase.prototype.yj = function (a, b, c, d, e, f, g) {
var h = new List$1(FlattenedShape.$, 0);
var i;
var j = c.count;
for (var k = 0; k < j; k++) {
i = c._inner[k];
var l = this.xc(a, b, i, d, e, f, g);
if (l == null) {
continue;
}
h.add(l);
}
return h;
};
ShapeSeriesBase.prototype.xc = function (a, b, c, d, e, f, g) {
var h = this.ze(c, d, e);
var i = h.c;
var j = h.d;
var k = i.length;
var l = 1.7976931348623157E+308;
var m = 1.7976931348623157E+308;
var n = -1.7976931348623157E+308;
var o = -1.7976931348623157E+308;
var p;
var q;
if (f != 0) {
for (var r = 0; r < k; r++) {
i[r] = i[r] + f;
}
}
for (var s = 0; s < k; s++) {
p = i[s];
q = j[s];
l = p < l ? p : l;
m = q < m ? q : m;
n = p > n ? p : n;
o = q > o ? q : o;
}
var t = !(l > this.z4.right || n < this.z4.left || m > this.z4.bottom || o < this.z4.top);
if (!t && f == 0 && g != 0) {
if (g != 0) {
for (var u = 0; u < k; u++) {
i[u] = i[u] + g;
}
}
for (var v = 0; v < k; v++) {
p = i[v];
q = j[v];
l = p < l ? p : l;
m = q < m ? q : m;
n = p > n ? p : n;
o = q > o ? q : o;
}
t = !(l > this.z4.right || n < this.z4.left || m > this.z4.bottom || o < this.z4.top);
}
if (!t) {
return null;
}
var w = b != null && (l < this.z4.left || m < this.z4.top || n > this.z4.right || o > this.z4.bottom);
var x = new Rect(0, l, m, n - l, o - m);
if (!a.cb(x)) {
return null;
}
l = l < this.z4.left ? this.z4.left : l;
n = n > this.z4.right ? this.z4.right : n;
m = m < this.z4.top ? this.z4.top : m;
o = o > this.z4.bottom ? this.z4.bottom : o;
var y = PolySimplification.b(h, this.id);
var z = new DefaultFlattener().c(h.c, h.d, y, this.yk);
var aa = z.count;
if (w) {
var ab = new List$1(Point_$type, 0);
b.i = ab;
for (var ac = 0; ac < aa; ac++) {
b.j(z._inner[ac]);
}
b.i = null;
z = ab;
}
if (z == null || z.count == 0) {
return null;
}
var ad = new FlattenedShape();
ad.a = z;
ad.b = new Rect(0, l, m, n - l, o - m);
ad.c = x;
return ad;
};
ShapeSeriesBase.prototype.ze = function (a, b, c) {
var d = this.xd;
var e = this.xf;
var f = a.count;
var g = new Array(f);
var h = new Array(f);
for (var i = 0; i < f; i++) {
g[i] = a._inner[i].x;
h[i] = a._inner[i].y;
}
d.hq(boxArray$1(g), 0, g.length, b);
e.hq(boxArray$1(h), 0, h.length, c);
return new Tuple$2(Array_$type, Array_$type, g, h);
};
ShapeSeriesBase.prototype.zq = function (a) {
a.c0();
};
ShapeSeriesBase.prototype.o5 = function (a, b) {
_super.prototype.o5.call(this, a, b);
var c = b;
c.cn();
};
ShapeSeriesBase.prototype.zh = function (a) {
if (a != null) {
a.ct(this);
}
};
ShapeSeriesBase.prototype.zp = function (a) {
if (a != null) {
a.b0(this);
}
};
ShapeSeriesBase.prototype.zf = function (a, b, c) {
var d = this.cv;
var e = d.bx;
var f = this.wr(a);
if (e.width < 1 || e.height < 1 || this.xw == null) {
return;
}
var g = this.getEffectiveViewport1(d);
var h = new ScalerParams(0, f, e, this.xe.ch, g);
var i = new ScalerParams(0, f, e, this.xg.ch, g);
d.cu();
var j = this.xw.count;
var k = new Array(j);
var l = new Array(j);
var m = new Array(j);
var n = new Array(j);
var o;
for (var p = 0; p < j; p++) {
o = this.yg._inner[p];
k[p] = o.top;
l[p] = o.left;
m[p] = o.right;
n[p] = o.bottom;
}
this.xe.hq(boxArray$1(l), 0, l.length, h);
this.xe.hq(boxArray$1(m), 0, m.length, h);
this.xg.hq(boxArray$1(k), 0, k.length, i);
this.xg.hq(boxArray$1(n), 0, n.length, i);
d.cv(l, k, m, n);
d.c0();
var q = null;
if (!this.z4.isEmpty) {
q = new Clipper(1, this.z4.left, this.z4.bottom, this.z4.right, this.z4.top, this.x6);
}
var r = false;
var s = 0;
if (this.db != null) {
if (this.db.f4()) {
var t = this.db.m4(f, h);
r = t.c;
s = t.d;
}
}
var u, v, w, x;
var y = new Rect(0, 0, 0, 0, 0);
for (var z = 0; z < j; z++) {
w = l[z];
u = k[z];
v = n[z];
x = m[z];
y.x = Math.min(w, x);
y.y = Math.min(u, v);
y.width = Math.max(w, x) - y.x;
y.height = Math.max(u, v) - y.y;
if (r) {
y.x = y.x + s;
}
if (!y.intersectsWith(e)) {
continue;
}
var aa = this.yi(d, q, this.xw.item(z), h, i, s, s);
if (aa.count <= 0) {
continue;
}
this.xz(b, c, z);
}
};
ShapeSeriesBase.prototype.xz = function (a, b, c) {
var _this = this;
if (b == 7 || b == 6) {
a.add(((function () {
var $ret = new ChartSelection();
$ret.series = _this;
return $ret;
})()));
return false;
}
else if (b == 1 || b == 2) {
a.add(((function () {
var $ret = new ChartSelection();
$ret.item = _this.dn.item(c);
return $ret;
})()));
return true;
}
else {
a.add(((function () {
var $ret = new ChartSelection();
$ret.item = _this.dn.item(c);
$ret.series = _this;
return $ret;
})()));
return true;
}
};
ShapeSeriesBase.prototype.a2 = function (a, b) {
var c = this.xm.c2(a, b);
var d = null;
if (c != null) {
d = c.dataContext;
}
if (d != null) {
return d;
}
return _super.prototype.a2.call(this, a, b);
};
ShapeSeriesBase.prototype.yr = function (a) {
return this.dn.item(a);
};
ShapeSeriesBase.prototype.get_g7 = function () {
return true;
};
ShapeSeriesBase.prototype.set_g7 = function (a) {
_super.prototype.set_g7.call(this, a);
};
ShapeSeriesBase.prototype.ay = function (a) {
var e_2, _a, e_3, _b;
if (typeCast(NumericXAxis.$, a) !== null && this.yg != null) {
var b = 1.7976931348623157E+308;
var c = -1.7976931348623157E+308;
try {
for (var _c = __values(fromEnum(this.yg)), _d = _c.next(); !_d.done; _d = _c.next()) {
var d = _d.value;
b = Math.min(b, d.left);
c = Math.max(c, d.right);
}
}
catch (e_2_1) {
e_2 = { error: e_2_1 };
}
finally {
try {
if (_d && !_d.done && (_a = _c.return))
_a.call(_c);
}
finally {
if (e_2)
throw e_2.error;
}
}
return new AxisRange(b, c);
}
if (typeCast(NumericYAxis.$, a) !== null && this.yg != null) {
var e = 1.7976931348623157E+308;
var f = -1.7976931348623157E+308;
try {
for (var _e = __values(fromEnum(this.yg)), _f = _e.next(); !_f.done; _f = _e.next()) {
var g = _f.value;
e = Math.min(e, g.top);
f = Math.max(f, g.bottom);
}
}
catch (e_3_1) {
e_3 = { error: e_3_1 };
}
finally {