igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
1,507 lines • 64.3 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, __read, __spreadArray, __values } from "tslib";
import { Series } from "./Series";
import { ISupportsFillScale_$type } from "./ISupportsFillScale";
import { DependencyProperty } from "igniteui-react-core";
import { BrushScale } from "./BrushScale";
import { HighlightingInfo } from "igniteui-react-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-react-core";
import { NumericXAxis } from "./NumericXAxis";
import { NumericYAxis } from "./NumericYAxis";
import { List$1 } from "igniteui-react-core";
import { Rect } from "igniteui-react-core";
import { StyleShapeEventArgs } from "./StyleShapeEventArgs";
import { FrameworkElement } from "igniteui-react-core";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { DataContext } from "igniteui-react-core";
import { Tuple$2 } from "igniteui-react-core";
import { ShapeHitRegion } from "./ShapeHitRegion";
import { RectUtil } from "igniteui-react-core";
import { Tuple$3 } from "igniteui-react-core";
import { CoreGeometryUtil } from "igniteui-react-core";
import { GeometryUtil } from "igniteui-react-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-react-core";
import { FlattenedShape } from "./FlattenedShape";
import { SeriesView } from "./SeriesView";
import { Clipper } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { Dictionary$2 } from "igniteui-react-core";
import { ActualRange } from "./ActualRange";
import { SeriesRenderManager } from "./SeriesRenderManager";
import { PolySimplification } from "igniteui-react-core";
import { DefaultFlattener } from "./DefaultFlattener";
import { ChartSelection } from "./ChartSelection";
import { AxisRange } from "./AxisRange";
import { Style } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { boxArray$1 } from "igniteui-react-core";
import { InvalidOperationException } from "igniteui-react-core";
import { isNaN_, truncate } from "igniteui-react-core";
import { FastItemObjectColumn } from "igniteui-react-core";
import { Path } from "igniteui-react-core";
import { Pool$1 } from "igniteui-react-core";
import { PointCollection } from "igniteui-react-core";
import { PathGeometry } from "igniteui-react-core";
import { PolyLineSegment } from "igniteui-react-core";
import { PathFigure } from "igniteui-react-core";
import { PolygonUtil } from "igniteui-react-core";
/**
* @hidden
*/
var ShapeSeriesBase = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(ShapeSeriesBase, _super);
function ShapeSeriesBase() {
var _this = _super.call(this) || this;
_this.ye = null;
_this.yj = false;
_this.yi = false;
_this.yc = null;
_this.yd = null;
_this.x2 = 1;
_this.xn = null;
_this.xo = null;
_this.assigningShapeStyle = null;
_this.assigningShapeMarkerStyle = null;
_this.x6 = null;
_this.yf = null;
_this.xy = null;
_this.x0 = null;
_this.y5 = 0;
_this.y1 = null;
_this.xk = null;
_this.xm = null;
_this.xl = null;
_this.xj = null;
_this.aap = null;
_this.xw = null;
_this.x8 = null;
_this.xr = null;
_this.y8 = 0;
_this.styleShape = null;
_this.x6 = new ShapeSeriesRenderManager();
FastItemObjectColumn.m();
_this.y8 = _this.y7;
_this.aap = Rect.empty;
return _this;
}
ShapeSeriesBase.prototype.pf = function () {
_super.prototype.pf.call(this);
this.xz = null;
this.x1 = null;
};
ShapeSeriesBase.prototype.ai = function () {
return [this.xz, this.x1];
};
ShapeSeriesBase.prototype.kz = function (a, b) {
var c = this.no(b);
if (c == ShapeSeriesBase.$$p[9]) {
return this.k0(a, b, this.zs);
}
return null;
};
ShapeSeriesBase.prototype.mo = function (a) {
var b = this.no(a);
if (b == ShapeSeriesBase.$$p[9]) {
return this.zs;
}
return _super.prototype.mo.call(this, a);
};
Object.defineProperty(ShapeSeriesBase.prototype, "yg", {
get: function () {
return this.ye;
},
set: function (a) {
if (this.ye != a) {
var b = this.yg;
this.ye = a;
this.raisePropertyChanged("FillColumn", b, this.yg);
}
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.get_fh = function () {
return true;
};
ShapeSeriesBase.prototype.get_ef = function () {
return true;
};
ShapeSeriesBase.prototype.ya = function (a, b, c) {
if (this.dp == null) {
return null;
}
var d = this.wr(b);
var e = this.x7.df(d, false);
var f = -1;
if (e == null) {
if (a != null) {
f = this.dp.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.yb = function (a, b, c) {
if (this.dp == null) {
return null;
}
var d = this.x7.ch(this.wr(b));
var e = -1;
if (d == null) {
if (a != null) {
e = this.dp.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, "x3", {
get: function () {
return this.x2;
},
set: function (a) {
var b = this.x2;
this.x2 = a;
if (b != this.x2) {
this.raisePropertyChanged("ActualItemSearchMode", enumGetBox(ShapeItemSearchMode_$type, b), enumGetBox(ShapeItemSearchMode_$type, this.x2));
}
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.x4 = function () {
if (this.x5 != 0) {
return this.x5;
}
return 1;
};
ShapeSeriesBase.prototype.iy = function (a) {
switch (this.x3) {
case 1: return this.zy(a).c;
case 2: return this.y6(a);
case 3: return this.y6(a);
}
return -1;
};
ShapeSeriesBase.prototype.zy = function (a) {
var b = this.wr(a);
var c = { $type: Point_$type, x: NaN, y: NaN };
var d = this.x7.cr;
if (d == null) {
return new Tuple$2(Number_$type, Point_$type, -1, c);
}
var e = this.x7.ci(b, false, !this.yl);
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.dp == null || this.xz == null || this.x1 == null || this.y1 == null) {
return new Tuple$2(Number_$type, Point_$type, -1, c);
}
if (this.dp.count > this.zb) {
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.zx = function (a) {
var b = this.wr(a);
var c = b.x;
var d = b.y;
var e = { $type: Point_$type, x: NaN, y: NaN };
if (this.dp == null || this.xz == null || this.x1 == null || this.y1 == null) {
return new Tuple$3(Number_$type, Point_$type, Point_$type, -1, e, e);
}
if (this.dp.count > this.zb) {
return new Tuple$3(Number_$type, Point_$type, Point_$type, -1, e, e);
}
var f = 1.7976931348623157E+308;
var g = this.x7.cr;
if (g == null) {
return new Tuple$3(Number_$type, Point_$type, Point_$type, -1, e, e);
}
var h = this.x7.ci(b, false, !this.yl);
if (h != null) {
var i = RectUtil.l(h.d);
var j = this.zw(b, h.a, this.yl);
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.zw(b, g._inner[q].a, this.yl);
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_yl = function () {
return true;
};
Object.defineProperty(ShapeSeriesBase.prototype, "yl", {
get: function () {
return this.get_yl();
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.zw = 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 = CoreGeometryUtil.q(a, d, j);
if (k < e) {
e = k;
g = true;
h = i;
}
}
d = j;
}
if (c) {
var l = b._inner[0];
var m = CoreGeometryUtil.q(a, d, l);
if (m < e) {
e = m;
var n = GeometryUtil.j(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.j(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.y6 = function (a) {
return this.zx(a).c;
};
ShapeSeriesBase.prototype.ww = function (a, b, c) {
if (this.xz == null || this.x1 == null || this.y1 == null) {
return { $type: Point_$type, x: NaN, y: NaN };
}
switch (this.x3) {
case 1:
var d = this.zy(a);
return d.d;
case 2:
var e = this.zx(a);
return e.e;
case 3:
var f = this.zx(a);
return f.d;
}
return { $type: Point_$type, x: NaN, y: NaN };
};
ShapeSeriesBase.prototype.kw = function (a) {
var b = this.kc(a);
if (this.dp != null && b >= 0 && b < this.dp.count) {
return this.dp.item(b);
}
return null;
};
ShapeSeriesBase.prototype.x9 = function (a, b, c) {
var d = new HighlightingInfo();
d.i = this;
d.g = 0;
d.f = this.dp.count - 1;
d.c = true;
if (c != null && c.g == d.g && c.f == d.f) {
return c;
}
return d;
};
ShapeSeriesBase.prototype.dh = function (a, b, c) {
if (this.ef && this.f2(this.by) && !c) {
var d = this.ya(a, b, this.yc);
this.yc = d;
return d;
}
else {
var e = this.x9(a, b, this.yc);
this.yc = e;
return e;
}
};
ShapeSeriesBase.prototype.di = function (a, b, c) {
if (this.f2(this.by) && !c) {
var d = this.yb(a, b, this.yd);
this.yd = d;
return d;
}
else {
var e = this.x9(a, b, this.yd);
e.d = true;
this.yd = e;
return e;
}
};
ShapeSeriesBase.prototype.yz = function () {
return (this.assigningShapeStyle != null && this.yj) || this.d3 || (this.by != 1) || (this.cq != 1) || (this.cp != 1) || (this.yg != null && this.xv != null);
};
ShapeSeriesBase.prototype.yy = function () {
return (this.assigningShapeMarkerStyle != null && this.yi) || this.d3 || (this.by != 1) || (this.cq != 1) || (this.cp != 1);
};
Object.defineProperty(ShapeSeriesBase.prototype, "zj", {
get: function () {
return this.c(ShapeSeriesBase.aaf);
},
set: function (a) {
this.h(ShapeSeriesBase.aaf, a);
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.gh = function () {
return this.highlightedItemsSource != null || this.zj != null;
};
ShapeSeriesBase.prototype.hz = function () {
var a = _super.prototype.hz.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.z1));
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.si));
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.si));
a.add(d);
}
return a;
};
ShapeSeriesBase.prototype.z1 = function (a, b) {
if (this.zj != null) {
b.value = this.zj;
return;
}
b.value = this.zs;
};
Object.defineProperty(ShapeSeriesBase.prototype, "yh", {
get: function () {
return this.yf;
},
set: function (a) {
var b = this.yh != a;
if (b) {
var c = this.yh;
this.yf = a;
this.raisePropertyChanged("ShapeColumn", c, this.yh);
}
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.yq = function (array_) {
var a = (Array.isArray(array_));
return a;
};
ShapeSeriesBase.yu = 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.yu(d)) && (isNaN_(e) || ShapeSeriesBase.yu(e))) {
d = (curr_.X);
e = (curr_.Y);
if (!isNaN_(d) && !ShapeSeriesBase.yu(d) && !isNaN_(e) && !ShapeSeriesBase.yu(e)) {
g = true;
f = true;
}
}
else {
g = true;
}
}
i.add({ $type: Point_$type, x: d, y: e });
}
b.add(i);
}
return b;
};
ShapeSeriesBase.prototype.dn = function (a) {
if (this.dp != null && this.yq(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.dn.call(this, a);
};
ShapeSeriesBase.prototype.rq = function (a, b, c, d) {
_super.prototype.rq.call(this, a, b, c, d);
var e = false;
var f = false;
switch (b) {
case ShapeSeriesBase.$$p[5]:
this.x3 = this.x4();
break;
case "FastItemsSource":
var g = typeCast(IFastItemsSource_$type, c);
if (g != null) {
if (this.yg != null) {
g.deregisterColumn(this.yg);
}
if (this.yh != null) {
g.deregisterColumn(this.yh);
}
this.yh = null;
}
var h = typeCast(IFastItemsSource_$type, d);
if (h != null) {
if (this.zs != null) {
this.yh = this.dn(this.zs);
}
if (this.zf != null) {
this.yg = this.dl(this.zf);
}
}
e = this.xz != null && !this.xz.ed();
f = this.x1 != null && !this.x1.ed();
if (e || f) {
this.r8(this.gm && c != null);
}
break;
case ShapeSeriesBase.$$p[9]:
if (this.dp != null) {
this.dp.deregisterColumn(this.yh);
this.yh = this.dn(this.zs);
}
break;
case "ShapeColumn":
this.z9();
e = this.xz != null && !this.xz.ed();
f = this.x1 != null && !this.x1.ed();
if (e || f) {
this.r8(this.gm && this.d9);
}
this.q0();
break;
case ShapeSeriesBase.$$p[10]:
case ShapeSeriesBase.$$p[11]:
this.xy = this.xz;
this.x0 = this.x1;
var i = c;
var j = d;
this.aaa(i);
this.z2(j);
if ((j != null && !j.ed()) || (j == null && i != null)) {
this.r8(false);
}
this.q0();
break;
case "ActualResolution":
this.y5 = this.ik;
this.q0();
break;
case "ActualBrush":
this.r8(false);
break;
case ShapeSeriesBase.$$p[8]:
this.y8 = this.y7;
this.r8(false);
this.q0();
break;
case ShapeSeriesBase.$$p[2]:
case "ActualThickness":
this.r8(false);
this.q0();
break;
case ShapeSeriesBase.$$p[4]:
this.yj = this.yx();
this.r8(false);
break;
case ShapeSeriesBase.$$p[3]:
this.yi = this.yw();
this.r8(false);
break;
case ShapeSeriesBase.$$p[1]:
if (c != null) {
c.o.remove(this);
c.x();
this.xw = null;
this.x8 = null;
}
if (d != null) {
d.o.add(this);
d.x();
this.xw = typeCast(CustomPaletteBrushScale.$, d);
this.x8 = typeCast(ValueBrushScale.$, d);
}
this.r8(false);
this.q0();
break;
case "FillColumn":
this.r8(this.gm && this.d9);
this.q0();
break;
case ShapeSeriesBase.$$p[0]:
if (this.xv != null) {
this.xv.x();
}
if (this.dp != null) {
this.dp.deregisterColumn(this.yg);
this.yg = this.dl(this.zf);
}
break;
}
};
ShapeSeriesBase.prototype.yx = function () {
return this.yt;
};
ShapeSeriesBase.prototype.yw = function () {
return this.ys;
};
ShapeSeriesBase.prototype.yn = function (a) {
if (typeCast(NumericYAxis.$, a) !== null) {
return true;
}
return false;
};
ShapeSeriesBase.prototype.ym = function (a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
};
ShapeSeriesBase.prototype.z9 = function () {
this.y1 = null;
if (this.yh == null) {
return;
}
this.y1 = new List$1(Rect.$, 2, this.yh.count);
for (var a = 0; a < this.yh.count; a++) {
this.y1.add(PointCollectionUtil.j(this.yh.item(a)));
}
};
ShapeSeriesBase.prototype.aaq = 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.y3 = function (a, b, c, d, e, f, g) {
var e_1, _a;
return this.y4(a, b, c, d, e, f, g);
if (typeCast(List$1.$.specialize(List$1.$.specialize(Point_$type)), c) !== null) {
return this.y4(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.xx(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.xx(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_yr = function () {
return true;
};
Object.defineProperty(ShapeSeriesBase.prototype, "yr", {
get: function () {
return this.get_yr();
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.y0 = function () {
return false;
};
ShapeSeriesBase.prototype.r9 = function (a) {
this.z8(this.cw);
};
ShapeSeriesBase.prototype.r7 = function (a, b, c, d, e) {
_super.prototype.r7.call(this, a, b, c, d, e);
var f = this.ba.a$k.item(d);
var g = f;
f.bd(c);
if (this.d7(f)) {
return;
}
this.z8(f);
};
ShapeSeriesBase.prototype.updateFillScaleGlobals = function () {
var a = new ActualRange();
a.b = NaN;
a.a = NaN;
if (this.yg != null) {
a.b = this.yg.minimum;
a.a = this.yg.maximum;
}
if (this.xv != null) {
this.xv.z(a.b, a.a);
}
};
ShapeSeriesBase.prototype.z8 = function (a) {
var _this = this;
if (this.d7(a)) {
return;
}
if (this.xv != null) {
this.xr = this.xs();
}
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.yh == null) {
return;
}
var f = this.xz;
var g = this.x1;
var h = this.getEffectiveViewport1(a);
var i = new ScalerParams(1, b, c, f.dn);
i.c = h;
var j = new ScalerParams(1, b, c, g.dn);
j.c = h;
if (!this.gx) {
d.c7();
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.yh.count;
if (this.xm == null || this.xm.length != p) {
this.xm = new Array(p);
this.xk = new Array(p);
this.xl = new Array(p);
this.xj = new Array(p);
}
var q = this.xm;
var r = this.xk;
var s = this.xl;
var t = this.xj;
var u = void 0;
for (var v = 0; v < p; v++) {
u = this.y1._inner[v];
q[v] = u.top;
r[v] = u.left;
s[v] = u.right;
t[v] = u.bottom;
}
this.xy.k1(boxArray$1(r), 0, r.length, i);
this.xy.k1(boxArray$1(s), 0, s.length, i);
this.x0.k1(boxArray$1(q), 0, q.length, j);
this.x0.k1(boxArray$1(t), 0, t.length, j);
d.c8(r, q, s, t);
var w = this.yh;
var x = this.dp;
this.aab(d);
var y = c.left;
var z = c.right;
var aa = c.top;
var ab = c.bottom;
var ac = null;
if (this.aap.isEmpty) {
ac = null;
}
else {
ac = new Clipper(1, this.aap.left, this.aap.bottom, this.aap.right, this.aap.top, this.yr);
}
var ad = this.y0();
if (ad) {
d.cp.clear();
}
var ae = false;
var af = true;
var ag = 0;
if (this.dc != null) {
if (this.dc.g0()) {
var ah = this.dc.oj(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.y3(a, ai, w.item(aj), i, j, 0, ag);
if (ad) {
ShapeSeriesBase.z7(d, aj, ak);
}
d.cv(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.y3(a, ai, w.item(aj), i, j, ag, ag);
if (ad) {
ShapeSeriesBase.z7(d, aj, al);
}
d.cv(aj, x.item(aj), k, al);
}
}
}
d.c6();
}
var am = this.yz();
this.x6.az(this, this.yz(), runOn(this, this.xp));
var an = false;
var ao = this.x6.b;
if (ao != null) {
an = true;
}
var ap = a.t;
var aq = this.f1;
var ar = d.cn;
d.c2(function (as) {
var at = as.dataContext != null ? as.dataContext.item : null;
var au = as.dataContext != null ? as.dataContext.c : -1;
d.cz(as, at, am);
if (an) {
_this.z4(as, aq, au, _this.yh.count, ap, ar);
}
else {
if (ar) {
{
_this.x6.a1(as, _this.ii, ar);
}
}
}
{
_this.x6.ad(as, false, false, false, false);
}
});
};
ShapeSeriesBase.prototype.xs = function () {
var a = new ActualRange();
a.b = NaN;
a.a = NaN;
if (this.yg != null) {
a.b = this.yg.minimum;
a.a = this.yg.maximum;
}
var b = typeCast(ValueBrushScale.$, this.xv);
if (b != null) {
b.s();
if (this.yo && this.xv.o.count > 1) {
a.b = b.q;
a.a = b.p;
}
}
return a;
};
ShapeSeriesBase.prototype.z4 = function (a, b, c, d, e, f) {
var g = this.by != 1;
var h = this.cq != 1;
var i = this.cp != 1;
this.x6.a0(this.x6.b, c, d, false);
{
this.x6.a1(a, this.ii, f);
}
var j = this.x6.ax;
var k = null;
var l = null;
var m = null;
var n = this.dp;
if (this.yg != null && this.xv != null) {
if (j.z >= 0 && j.z < this.yg.count) {
var o = this.yg.item(j.z);
var p = this.xr;
var q = p.b;
var r = p.a;
var s = j.aa;
if (this.xw != null) {
s = this.xw.getBrush1(j.z, this.yg.count);
}
else if (this.x8 != null && this.yg != null) {
var t = this.yg.item(j.z);
s = this.x8.getBrushByRange(t, q, r);
}
else if (this.xv != null) {
s = this.xv.getBrush(j.z);
}
j.aa = s;
}
}
if (g && this.dc != null) {
k = this.dc.d7.getHighlightingInfo(this, n, j.z, j.y, false);
j.c = k;
}
if (h && this.dc != null) {
l = this.dc.d8.getHighlightingInfo(this, n, j.z, j.y, false);
if (l == null && this.bo != null) {
l = this.dc.d8.getHighlightingInfo(this.bo, this.bo.dp, j.z, j.y, false);
}
if (l == null && this.bl != null) {
l = this.dc.d8.getHighlightingInfo(this.bl, this.bl.dp, j.z, j.y, true);
}
j.d = l;
}
if (i && this.dc != null) {
m = this.dc.d6.getHighlightingInfo(this, n, j.z, j.y, false);
j.b = m;
}
j.h = e;
this.z6(j);
this.x6.z(this, k, l, m, e, g, h, i, false);
};
ShapeSeriesBase.prototype.z3 = function (a, b, c) {
var d = this.by != 1;
var e = this.cq != 1;
var f = this.cp != 1;
this.x6.a0(this.x6.d, a, b, true);
this.x6.aa(this.ii);
var g = this.x6.aw;
var h = null;
var i = null;
var j = null;
var k = this.dp;
var l = null;
var m = null;
var n = null;
if (d && this.dc != null) {
h = this.dc.d7.getHighlightingInfo(this, k, g.z, g.y, true);
if (this.dc.d7.isCrossContextHighlight(this)) {
l = this.dc.d7.getHighlightingInfo(this, k, g.z, g.y, true);
}
g.c = h;
}
if (e && this.dc != null) {
i = this.dc.d8.getHighlightingInfo(this, k, g.z, g.y, true);
if (i == null && this.bo != null) {
i = this.dc.d8.getHighlightingInfo(this.bo, this.bo.dp, g.z, g.y, true);
}
if (this.dc.d8.isCrossContextHighlight(this)) {
m = this.dc.d8.getHighlightingInfo(this, k, g.z, g.y, true);
}
g.d = i;
}
if (f && this.dc != null) {
j = this.dc.d6.getHighlightingInfo(this, k, g.z, g.y, true);
if (this.dc.d6.isCrossContextHighlight(this)) {
n = this.dc.d6.getHighlightingInfo(this, k, g.z, g.y, true);
}
g.b = i;
}
g.h = c;
this.z5(g);
this.x6.y(this, h, i, j, c, d, e, f, g.v, this.dc.d7.totalHighWaterMark, g.x, this.dc.d8.totalHighWaterMark, g.t, this.dc.d6.totalHighWaterMark);
};
ShapeSeriesBase.prototype.z6 = function (a) {
if (this.assigningShapeStyle != null && this.yj) {
this.assigningShapeStyle(this, a);
}
};
ShapeSeriesBase.prototype.z5 = function (a) {
if (this.assigningShapeMarkerStyle != null && this.yi) {
this.assigningShapeMarkerStyle(this, a);
}
};
ShapeSeriesBase.prototype.xp = function (a, b) {
return this.xq(a, b);
};
ShapeSeriesBase.prototype.xq = function (a, b) {
if (b < a || a < 0 || a > this.yh.count || b < 0 || b > this.yh.count) {
return null;
}
var c = new Array((b - a) + 1);
for (var d = a; d <= b; d++) {
var e = d;
c[d - a] = this.dp.item(d);
}
return c;
};
ShapeSeriesBase.z7 = 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.cp.addItem(b, e);
};
ShapeSeriesBase.prototype.qp = function () {
_super.prototype.qp.call(this);
if (this.xz != null) {
this.xz.lx();
}
if (this.x1 != null) {
this.x1.lx();
}
};
ShapeSeriesBase.prototype.s9 = function (a, b) {
this.r8(false);
};
ShapeSeriesBase.prototype.s8 = function (a, b) {
this.r8(false);
};
ShapeSeriesBase.prototype.po = function (a, b, c, d) {
_super.prototype.po.call(this, a, b, c, d);
switch (a) {
case 3:
if (d == this.zs) {
this.y1._inner[b] = this.aaq(this.yh.item(b));
}
break;
case 1:
for (var e = b; e < b + c; e++) {
this.y1.insert(e, this.aaq(this.yh.item(e)));
}
break;
case 0:
this.y1.v(b, c);
break;
case 2:
for (var f = b; f < b + c; f++) {
this.y1._inner[f] = this.aaq(this.yh.item(f));
}
break;
case 4:
this.z9();
break;
}
this.r8(false);
};
ShapeSeriesBase.prototype.hk = function (a, b, c) {
var d = true;
if (!_super.prototype.hk.call(this, a, b, c) || (this.yv && this.yh == null) || b.isEmpty || a.isEmpty || this.xz == null || this.x1 == null || this.xz.b7 == null || this.x1.b7 == null || this.xz.qw == this.xz.qv || this.x1.qw == this.x1.qv || this.yh == null || this.yh.count == 0 || this.y1 == null || this.y1.count == 0 || this.y1.count != this.yh.count) {
d = false;
}
return d;
};
ShapeSeriesBase.prototype.get_yv = function () {
return true;
};
Object.defineProperty(ShapeSeriesBase.prototype, "yv", {
get: function () {
return this.get_yv();
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.rh = function (a) {
_super.prototype.rh.call(this, a);
this.x7 = typeCast(ShapeSeriesViewBase.$, a);
};
ShapeSeriesBase.prototype.y4 = 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.xx(a, b, i, d, e, f, g);
if (l == null) {
continue;
}
h.add(l);
}
return h;
};
ShapeSeriesBase.prototype.xx = function (a, b, c, d, e, f, g) {
var h = this.zz(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.aap.right || n < this.aap.left || m > this.aap.bottom || o < this.aap.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.aap.right || n < this.aap.left || m > this.aap.bottom || o < this.aap.top);
}
if (!t) {
return null;
}
var w = b != null && (l < this.aap.left || m < this.aap.top || n > this.aap.right || o > this.aap.bottom);
var x = new Rect(0, l, m, n - l, o - m);
if (!a.co(x)) {
return null;
}
l = l < this.aap.left ? this.aap.left : l;
n = n > this.aap.right ? this.aap.right : n;
m = m < this.aap.top ? this.aap.top : m;
o = o > this.aap.bottom ? this.aap.bottom : o;
var y = PolySimplification.b(h, this.ik);
var z = new DefaultFlattener().c(h.c, h.d, y, this.y5);
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.zz = function (a, b, c) {
var d = this.xy;
var e = this.x0;
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.k1(boxArray$1(g), 0, g.length, b);
e.k1(boxArray$1(h), 0, h.length, c);
return new Tuple$2(Array_$type, Array_$type, g, h);
};
ShapeSeriesBase.prototype.aab = function (a) {
a.dd();
};
ShapeSeriesBase.prototype.pi = function (a, b) {
_super.prototype.pi.call(this, a, b);
var c = b;
c.c0();
};
ShapeSeriesBase.prototype.z2 = function (a) {
if (a != null) {
a.d3(this);
}
};
ShapeSeriesBase.prototype.aaa = function (a) {
if (a != null) {
a.cx(this);
}
};
ShapeSeriesBase.prototype.z0 = function (a, b, c) {
var d = this.cw;
var e = d.b9;
var f = this.dc.y6(this.dc.yw(a));
if (e.width < 1 || e.height < 1 || this.yh == null) {
return;
}
var g = this.getEffectiveViewport1(d);
var h = new ScalerParams(0, f, e, this.xz.dn, g);
var i = new ScalerParams(0, f, e, this.x1.dn, g);
d.c7();
var j = this.yh.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.y1._inner[p];
k[p] = o.top;
l[p] = o.left;
m[p] = o.right;
n[p] = o.bottom;
}
this.xz.k1(boxArray$1(l), 0, l.length, h);
this.xz.k1(boxArray$1(m), 0, m.length, h);
this.x1.k1(boxArray$1(k), 0, k.length, i);
this.x1.k1(boxArray$1(n), 0, n.length, i);
d.c8(l, k, m, n);
d.dd();
var q = null;
if (!this.aap.isEmpty) {
q = new Clipper(1, this.aap.left, this.aap.bottom, this.aap.right, this.aap.top, this.yr);
}
var r = false;
var s = 0;
if (this.dc != null) {
if (this.dc.g0()) {
var t = this.dc.oj(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.y3(d, q, this.yh.item(z), h, i, s, s);
if (aa.count <= 0) {
continue;
}
this.yk(b, c, z);
}
};
ShapeSeriesBase.prototype.yk = 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.dp.item(c);
return $ret;
})()));
return true;
}
else {
a.add(((function () {
var $ret = new ChartSelection();
$ret.item = _this.dp.item(c);
$ret.series = _this;
return $ret;
})()));
return true;
}
};
ShapeSeriesBase.prototype.a2 = function (a, b) {
var c = this.x7.df(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.b3 = function () {
if (this.b4 == 0) {
return 1;
}
else {
return _super.prototype.b3.call(this);
}
};
ShapeSeriesBase.prototype.g2 = function (a, b) {
if (this.g5(a, b)) {
return true;
}
return false;
};
ShapeSeriesBase.prototype.g5 = function (a, b) {
if (this.a2(a, b) != null) {
return true;
}
return false;
};
ShapeSeriesBase.prototype.zc = function (a) {
return this.dp.item(a);
};
ShapeSeriesBase.prototype.get_hd = function () {
return true;
};
ShapeSeriesBase.prototype.set_hd = function (a) {
_super.prototype.set_hd.call(this, a);
};
ShapeSeriesBase.prototype.ay = function (a) {
var e_2, _a, e_3, _b;
if (typeCast(NumericXAxis.$, a) !== null && this.y1 != null) {
var b = 1.7976931348623157E+308;
var c = -1.7976931348623157E+308;
try {
for (var _c = __values(fromEnum(this.y1)), _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.y1 != null) {
var e = 1.7976931348623157E+308;
var f = -1.7976931348623157E+308;
try {
for (var _e = __values(fromEnum(this.y1)), _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 {
try {
if (_f && !_f.done && (_b = _e.return))
_b.call(_e);
}
finally {
if (e_3)
throw e_3.error;
}
}
return new AxisRange(e, f);
}
return null;
};
ShapeSeriesBase.prototype.get_f0 = function () {
return true;
};
ShapeSeriesBase.prototype.get_fo = function () {
return true;
};
Object.defineProperty(ShapeSeriesBase.prototype, "yp", {
get: function () {
return this.styleShape != null;
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.aar = function (a, b, c) {
if (this.styleShape != null) {
if (this.x7.dm != null && c == this.x7.dm) {
c =