igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
1,504 lines (1,503 loc) • 63.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-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 { 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.xy = null;
_this.x3 = false;
_this.x2 = false;
_this.xw = null;
_this.xx = null;
_this.xm = 1;
_this.w7 = null;
_this.w8 = null;
_this.assigningShapeStyle = null;
_this.assigningShapeMarkerStyle = null;
_this.xq = null;
_this.xz = null;
_this.xi = null;
_this.xk = null;
_this.yp = 0;
_this.yl = null;
_this.w4 = null;
_this.w6 = null;
_this.w5 = null;
_this.w3 = null;
_this.z9 = null;
_this.xg = null;
_this.xs = null;
_this.xb = null;
_this.ys = 0;
_this.styleShape = null;
_this.xq = new ShapeSeriesRenderManager();
FastItemObjectColumn.m();
_this.ys = _this.yr;
_this.z9 = Rect.empty;
return _this;
}
ShapeSeriesBase.prototype.o4 = function () {
_super.prototype.o4.call(this);
this.xj = null;
this.xl = null;
};
ShapeSeriesBase.prototype.ai = function () {
return [this.xj, this.xl];
};
ShapeSeriesBase.prototype.kr = function (a, b) {
var c = this.nf(b);
if (c == ShapeSeriesBase.$$p[9]) {
return this.ks(a, b, this.zc);
}
return null;
};
ShapeSeriesBase.prototype.mf = function (a) {
var b = this.nf(a);
if (b == ShapeSeriesBase.$$p[9]) {
return this.zc;
}
return _super.prototype.mf.call(this, a);
};
Object.defineProperty(ShapeSeriesBase.prototype, "x0", {
get: function () {
return this.xy;
},
set: function (a) {
if (this.xy != a) {
var b = this.x0;
this.xy = a;
this.raisePropertyChanged("FillColumn", b, this.x0);
}
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.get_ff = function () {
return true;
};
ShapeSeriesBase.prototype.get_ef = function () {
return true;
};
ShapeSeriesBase.prototype.xu = function (a, b, c) {
if (this.dp == null) {
return null;
}
var d = this.wc(b);
var e = this.xr.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.xv = function (a, b, c) {
if (this.dp == null) {
return null;
}
var d = this.xr.ch(this.wc(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, "xn", {
get: function () {
return this.xm;
},
set: function (a) {
var b = this.xm;
this.xm = a;
if (b != this.xm) {
this.raisePropertyChanged("ActualItemSearchMode", enumGetBox(ShapeItemSearchMode_$type, b), enumGetBox(ShapeItemSearchMode_$type, this.xm));
}
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.xo = function () {
if (this.xp != 0) {
return this.xp;
}
return 1;
};
ShapeSeriesBase.prototype.is = function (a) {
switch (this.xn) {
case 1: return this.zi(a).c;
case 2: return this.yq(a);
case 3: return this.yq(a);
}
return -1;
};
ShapeSeriesBase.prototype.zi = function (a) {
var b = this.wc(a);
var c = { $type: Point_$type, x: NaN, y: NaN };
var d = this.xr.cr;
if (d == null) {
return new Tuple$2(Number_$type, Point_$type, -1, c);
}
var e = this.xr.ci(b, false, !this.x5);
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.xj == null || this.xl == null || this.yl == null) {
return new Tuple$2(Number_$type, Point_$type, -1, c);
}
if (this.dp.count > this.yv) {
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.zh = function (a) {
var b = this.wc(a);
var c = b.x;
var d = b.y;
var e = { $type: Point_$type, x: NaN, y: NaN };
if (this.dp == null || this.xj == null || this.xl == null || this.yl == null) {
return new Tuple$3(Number_$type, Point_$type, Point_$type, -1, e, e);
}
if (this.dp.count > this.yv) {
return new Tuple$3(Number_$type, Point_$type, Point_$type, -1, e, e);
}
var f = 1.7976931348623157E+308;
var g = this.xr.cr;
if (g == null) {
return new Tuple$3(Number_$type, Point_$type, Point_$type, -1, e, e);
}
var h = this.xr.ci(b, false, !this.x5);
if (h != null) {
var i = RectUtil.l(h.d);
var j = this.zg(b, h.a, this.x5);
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.zg(b, g._inner[q].a, this.x5);
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_x5 = function () {
return true;
};
Object.defineProperty(ShapeSeriesBase.prototype, "x5", {
get: function () {
return this.get_x5();
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.zg = 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.yq = function (a) {
return this.zh(a).c;
};
ShapeSeriesBase.prototype.wh = function (a, b, c) {
if (this.xj == null || this.xl == null || this.yl == null) {
return { $type: Point_$type, x: NaN, y: NaN };
}
switch (this.xn) {
case 1:
var d = this.zi(a);
return d.d;
case 2:
var e = this.zh(a);
return e.e;
case 3:
var f = this.zh(a);
return f.d;
}
return { $type: Point_$type, x: NaN, y: NaN };
};
ShapeSeriesBase.prototype.ko = function (a) {
var b = this.j4(a);
if (this.dp != null && b >= 0 && b < this.dp.count) {
return this.dp.item(b);
}
return null;
};
ShapeSeriesBase.prototype.xt = 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.f0(this.by) && !c) {
var d = this.xu(a, b, this.xw);
this.xw = d;
return d;
}
else {
var e = this.xt(a, b, this.xw);
this.xw = e;
return e;
}
};
ShapeSeriesBase.prototype.di = function (a, b, c) {
if (this.f0(this.by) && !c) {
var d = this.xv(a, b, this.xx);
this.xx = d;
return d;
}
else {
var e = this.xt(a, b, this.xx);
e.d = true;
this.xx = e;
return e;
}
};
ShapeSeriesBase.prototype.yj = function () {
return (this.assigningShapeStyle != null && this.x3) || this.d3 || (this.by != 1) || (this.cq != 1) || (this.cp != 1) || (this.x0 != null && this.xf != null);
};
ShapeSeriesBase.prototype.yi = function () {
return (this.assigningShapeMarkerStyle != null && this.x2) || this.d3 || (this.by != 1) || (this.cq != 1) || (this.cp != 1);
};
Object.defineProperty(ShapeSeriesBase.prototype, "y3", {
get: function () {
return this.c(ShapeSeriesBase.zz);
},
set: function (a) {
this.h(ShapeSeriesBase.zz, a);
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.gc = function () {
return this.highlightedItemsSource != null || this.y3 != null;
};
ShapeSeriesBase.prototype.hu = function () {
var a = _super.prototype.hu.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.zl));
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.r4));
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.r4));
a.add(d);
}
return a;
};
ShapeSeriesBase.prototype.zl = function (a, b) {
if (this.y3 != null) {
b.value = this.y3;
return;
}
b.value = this.zc;
};
Object.defineProperty(ShapeSeriesBase.prototype, "x1", {
get: function () {
return this.xz;
},
set: function (a) {
var b = this.x1 != a;
if (b) {
var c = this.x1;
this.xz = a;
this.raisePropertyChanged("ShapeColumn", c, this.x1);
}
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.ya = function (array_) {
var a = (Array.isArray(array_));
return a;
};
ShapeSeriesBase.ye = 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.ye(d)) && (isNaN_(e) || ShapeSeriesBase.ye(e))) {
d = (curr_.X);
e = (curr_.Y);
if (!isNaN_(d) && !ShapeSeriesBase.ye(d) && !isNaN_(e) && !ShapeSeriesBase.ye(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.ya(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.rc = function (a, b, c, d) {
_super.prototype.rc.call(this, a, b, c, d);
var e = false;
var f = false;
switch (b) {
case ShapeSeriesBase.$$p[5]:
this.xn = this.xo();
break;
case "FastItemsSource":
var g = typeCast(IFastItemsSource_$type, c);
if (g != null) {
if (this.x0 != null) {
g.deregisterColumn(this.x0);
}
if (this.x1 != null) {
g.deregisterColumn(this.x1);
}
this.x1 = null;
}
var h = typeCast(IFastItemsSource_$type, d);
if (h != null) {
if (this.zc != null) {
this.x1 = this.dn(this.zc);
}
if (this.yz != null) {
this.x0 = this.dl(this.yz);
}
}
e = this.xj != null && !this.xj.c1();
f = this.xl != null && !this.xl.c1();
if (e || f) {
this.ru(this.gh && c != null);
}
break;
case ShapeSeriesBase.$$p[9]:
if (this.dp != null) {
this.dp.deregisterColumn(this.x1);
this.x1 = this.dn(this.zc);
}
break;
case "ShapeColumn":
this.zt();
e = this.xj != null && !this.xj.c1();
f = this.xl != null && !this.xl.c1();
if (e || f) {
this.ru(this.gh && this.d9);
}
this.qn();
break;
case ShapeSeriesBase.$$p[10]:
case ShapeSeriesBase.$$p[11]:
this.xi = this.xj;
this.xk = this.xl;
var i = c;
var j = d;
this.zu(i);
this.zm(j);
if ((j != null && !j.c1()) || (j == null && i != null)) {
this.ru(false);
}
this.qn();
break;
case "ActualResolution":
this.yp = this.ie;
this.qn();
break;
case "ActualBrush":
this.ru(false);
break;
case ShapeSeriesBase.$$p[8]:
this.ys = this.yr;
this.ru(false);
this.qn();
break;
case ShapeSeriesBase.$$p[2]:
case "ActualThickness":
this.ru(false);
this.qn();
break;
case ShapeSeriesBase.$$p[4]:
this.x3 = this.yh();
this.ru(false);
break;
case ShapeSeriesBase.$$p[3]:
this.x2 = this.yg();
this.ru(false);
break;
case ShapeSeriesBase.$$p[1]:
if (c != null) {
c.o.remove(this);
c.x();
this.xg = null;
this.xs = null;
}
if (d != null) {
d.o.add(this);
d.x();
this.xg = typeCast(CustomPaletteBrushScale.$, d);
this.xs = typeCast(ValueBrushScale.$, d);
}
this.ru(false);
this.qn();
break;
case "FillColumn":
this.ru(this.gh && this.d9);
this.qn();
break;
case ShapeSeriesBase.$$p[0]:
if (this.xf != null) {
this.xf.x();
}
if (this.dp != null) {
this.dp.deregisterColumn(this.x0);
this.x0 = this.dl(this.yz);
}
break;
}
};
ShapeSeriesBase.prototype.yh = function () {
return this.yd;
};
ShapeSeriesBase.prototype.yg = function () {
return this.yc;
};
ShapeSeriesBase.prototype.x7 = function (a) {
if (typeCast(NumericYAxis.$, a) !== null) {
return true;
}
return false;
};
ShapeSeriesBase.prototype.x6 = function (a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
};
ShapeSeriesBase.prototype.zt = function () {
this.yl = null;
if (this.x1 == null) {
return;
}
this.yl = new List$1(Rect.$, 2, this.x1.count);
for (var a = 0; a < this.x1.count; a++) {
this.yl.add(PointCollectionUtil.j(this.x1.item(a)));
}
};
ShapeSeriesBase.prototype.aaa = 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.yn = function (a, b, c, d, e, f, g) {
var e_1, _a;
return this.yo(a, b, c, d, e, f, g);
if (typeCast(List$1.$.specialize(List$1.$.specialize(Point_$type)), c) !== null) {
return this.yo(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.xh(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.xh(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_yb = function () {
return true;
};
Object.defineProperty(ShapeSeriesBase.prototype, "yb", {
get: function () {
return this.get_yb();
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.yk = function () {
return false;
};
ShapeSeriesBase.prototype.rv = function (a) {
this.zs(this.cw);
};
ShapeSeriesBase.prototype.rt = function (a, b, c, d, e) {
_super.prototype.rt.call(this, a, b, c, d, e);
var f = this.ba.a$j.item(d);
var g = f;
f.bd(c);
if (this.d7(f)) {
return;
}
this.zs(f);
};
ShapeSeriesBase.prototype.updateFillScaleGlobals = function () {
var a = new ActualRange();
a.b = NaN;
a.a = NaN;
if (this.x0 != null) {
a.b = this.x0.minimum;
a.a = this.x0.maximum;
}
if (this.xf != null) {
this.xf.z(a.b, a.a);
}
};
ShapeSeriesBase.prototype.zs = function (a) {
var _this = this;
if (this.d7(a)) {
return;
}
if (this.xf != null) {
this.xb = this.xc();
}
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.x1 == null) {
return;
}
var f = this.xj;
var g = this.xl;
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.gs) {
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.x1.count;
if (this.w6 == null || this.w6.length != p) {
this.w6 = new Array(p);
this.w4 = new Array(p);
this.w5 = new Array(p);
this.w3 = new Array(p);
}
var q = this.w6;
var r = this.w4;
var s = this.w5;
var t = this.w3;
var u = void 0;
for (var v = 0; v < p; v++) {
u = this.yl._inner[v];
q[v] = u.top;
r[v] = u.left;
s[v] = u.right;
t[v] = u.bottom;
}
this.xi.hq(boxArray$1(r), 0, r.length, i);
this.xi.hq(boxArray$1(s), 0, s.length, i);
this.xk.hq(boxArray$1(q), 0, q.length, j);
this.xk.hq(boxArray$1(t), 0, t.length, j);
d.c8(r, q, s, t);
var w = this.x1;
var x = this.dp;
this.zv(d);
var y = c.left;
var z = c.right;
var aa = c.top;
var ab = c.bottom;
var ac = null;
if (this.z9.isEmpty) {
ac = null;
}
else {
ac = new Clipper(1, this.z9.left, this.z9.bottom, this.z9.right, this.z9.top, this.yb);
}
var ad = this.yk();
if (ad) {
d.cp.clear();
}
var ae = false;
var af = true;
var ag = 0;
if (this.dc != null) {
if (this.dc.f8()) {
var ah = this.dc.nm(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.yn(a, ai, w.item(aj), i, j, 0, ag);
if (ad) {
ShapeSeriesBase.zr(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.yn(a, ai, w.item(aj), i, j, ag, ag);
if (ad) {
ShapeSeriesBase.zr(d, aj, al);
}
d.cv(aj, x.item(aj), k, al);
}
}
}
d.c6();
}
var am = this.yj();
this.xq.az(this, this.yj(), runOn(this, this.w9));
var an = false;
var ao = this.xq.b;
if (ao != null) {
an = true;
}
var ap = a.t;
var aq = this.fz;
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.zo(as, aq, au, _this.x1.count, ap, ar);
}
else {
if (ar) {
{
_this.xq.a1(as, _this.ic, ar);
}
}
}
{
_this.xq.ad(as, false, false, false, false);
}
});
};
ShapeSeriesBase.prototype.xc = function () {
var a = new ActualRange();
a.b = NaN;
a.a = NaN;
if (this.x0 != null) {
a.b = this.x0.minimum;
a.a = this.x0.maximum;
}
var b = typeCast(ValueBrushScale.$, this.xf);
if (b != null) {
b.s();
if (this.x8 && this.xf.o.count > 1) {
a.b = b.q;
a.a = b.p;
}
}
return a;
};
ShapeSeriesBase.prototype.zo = function (a, b, c, d, e, f) {
var g = this.by != 1;
var h = this.cq != 1;
var i = this.cp != 1;
this.xq.a0(this.xq.b, c, d, false);
{
this.xq.a1(a, this.ic, f);
}
var j = this.xq.ax;
var k = null;
var l = null;
var m = null;
var n = this.dp;
if (this.x0 != null && this.xf != null) {
if (j.z >= 0 && j.z < this.x0.count) {
var o = this.x0.item(j.z);
var p = this.xb;
var q = p.b;
var r = p.a;
var s = j.aa;
if (this.xg != null) {
s = this.xg.getBrush1(j.z, this.x0.count);
}
else if (this.xs != null && this.x0 != null) {
var t = this.x0.item(j.z);
s = this.xs.getBrushByRange(t, q, r);
}
else if (this.xf != null) {
s = this.xf.getBrush(j.z);
}
j.aa = s;
}
}
if (g && this.dc != null) {
k = this.dc.dn.getHighlightingInfo(this, n, j.z, j.y, false);
j.c = k;
}
if (h && this.dc != null) {
l = this.dc.dp.getHighlightingInfo(this, n, j.z, j.y, false);
if (l == null && this.bo != null) {
l = this.dc.dp.getHighlightingInfo(this.bo, this.bo.dp, j.z, j.y, false);
}
if (l == null && this.bl != null) {
l = this.dc.dp.getHighlightingInfo(this.bl, this.bl.dp, j.z, j.y, true);
}
j.d = l;
}
if (i && this.dc != null) {
m = this.dc.dm.getHighlightingInfo(this, n, j.z, j.y, false);
j.b = m;
}
j.h = e;
this.zq(j);
this.xq.z(this, k, l, m, e, g, h, i, false);
};
ShapeSeriesBase.prototype.zn = function (a, b, c) {
var d = this.by != 1;
var e = this.cq != 1;
var f = this.cp != 1;
this.xq.a0(this.xq.d, a, b, true);
this.xq.aa(this.ic);
var g = this.xq.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.dn.getHighlightingInfo(this, k, g.z, g.y, true);
if (this.dc.dn.isCrossContextHighlight(this)) {
l = this.dc.dn.getHighlightingInfo(this, k, g.z, g.y, true);
}
g.c = h;
}
if (e && this.dc != null) {
i = this.dc.dp.getHighlightingInfo(this, k, g.z, g.y, true);
if (i == null && this.bo != null) {
i = this.dc.dp.getHighlightingInfo(this.bo, this.bo.dp, g.z, g.y, true);
}
if (this.dc.dp.isCrossContextHighlight(this)) {
m = this.dc.dp.getHighlightingInfo(this, k, g.z, g.y, true);
}
g.d = i;
}
if (f && this.dc != null) {
j = this.dc.dm.getHighlightingInfo(this, k, g.z, g.y, true);
if (this.dc.dm.isCrossContextHighlight(this)) {
n = this.dc.dm.getHighlightingInfo(this, k, g.z, g.y, true);
}
g.b = i;
}
g.h = c;
this.zp(g);
this.xq.y(this, h, i, j, c, d, e, f, g.v, this.dc.dn.totalHighWaterMark, g.x, this.dc.dp.totalHighWaterMark, g.t, this.dc.dm.totalHighWaterMark);
};
ShapeSeriesBase.prototype.zq = function (a) {
if (this.assigningShapeStyle != null && this.x3) {
this.assigningShapeStyle(this, a);
}
};
ShapeSeriesBase.prototype.zp = function (a) {
if (this.assigningShapeMarkerStyle != null && this.x2) {
this.assigningShapeMarkerStyle(this, a);
}
};
ShapeSeriesBase.prototype.w9 = function (a, b) {
return this.xa(a, b);
};
ShapeSeriesBase.prototype.xa = function (a, b) {
if (b < a || a < 0 || a > this.x1.count || b < 0 || b > this.x1.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.zr = 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.qd = function () {
_super.prototype.qd.call(this);
if (this.xj != null) {
this.xj.ia();
}
if (this.xl != null) {
this.xl.ia();
}
};
ShapeSeriesBase.prototype.sv = function (a, b) {
this.ru(false);
};
ShapeSeriesBase.prototype.su = function (a, b) {
this.ru(false);
};
ShapeSeriesBase.prototype.pd = function (a, b, c, d) {
_super.prototype.pd.call(this, a, b, c, d);
switch (a) {
case 3:
if (d == this.zc) {
this.yl._inner[b] = this.aaa(this.x1.item(b));
}
break;
case 1:
for (var e = b; e < b + c; e++) {
this.yl.insert(e, this.aaa(this.x1.item(e)));
}
break;
case 0:
this.yl.v(b, c);
break;
case 2:
for (var f = b; f < b + c; f++) {
this.yl._inner[f] = this.aaa(this.x1.item(f));
}
break;
case 4:
this.zt();
break;
}
this.ru(false);
};
ShapeSeriesBase.prototype.hf = function (a, b, c) {
var d = true;
if (!_super.prototype.hf.call(this, a, b, c) || (this.yf && this.x1 == null) || b.isEmpty || a.isEmpty || this.xj == null || this.xl == null || this.xj.bi == null || this.xl.bi == null || this.xj.l4 == this.xj.l3 || this.xl.l4 == this.xl.l3 || this.x1 == null || this.x1.count == 0 || this.yl == null || this.yl.count == 0 || this.yl.count != this.x1.count) {
d = false;
}
return d;
};
ShapeSeriesBase.prototype.get_yf = function () {
return true;
};
Object.defineProperty(ShapeSeriesBase.prototype, "yf", {
get: function () {
return this.get_yf();
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.q3 = function (a) {
_super.prototype.q3.call(this, a);
this.xr = typeCast(ShapeSeriesViewBase.$, a);
};
ShapeSeriesBase.prototype.yo = 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.xh(a, b, i, d, e, f, g);
if (l == null) {
continue;
}
h.add(l);
}
return h;
};
ShapeSeriesBase.prototype.xh = function (a, b, c, d, e, f, g) {
var h = this.zj(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.z9.right || n < this.z9.left || m > this.z9.bottom || o < this.z9.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.z9.right || n < this.z9.left || m > this.z9.bottom || o < this.z9.top);
}
if (!t) {
return null;
}
var w = b != null && (l < this.z9.left || m < this.z9.top || n > this.z9.right || o > this.z9.bottom);
var x = new Rect(0, l, m, n - l, o - m);
if (!a.co(x)) {
return null;
}
l = l < this.z9.left ? this.z9.left : l;
n = n > this.z9.right ? this.z9.right : n;
m = m < this.z9.top ? this.z9.top : m;
o = o > this.z9.bottom ? this.z9.bottom : o;
var y = PolySimplification.b(h, this.ie);
var z = new DefaultFlattener().c(h.c, h.d, y, this.yp);
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.zj = function (a, b, c) {
var d = this.xi;
var e = this.xk;
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.zv = function (a) {
a.dd();
};
ShapeSeriesBase.prototype.o7 = function (a, b) {
_super.prototype.o7.call(this, a, b);
var c = b;
c.c0();
};
ShapeSeriesBase.prototype.zm = function (a) {
if (a != null) {
a.ct(this);
}
};
ShapeSeriesBase.prototype.zu = function (a) {
if (a != null) {
a.b0(this);
}
};
ShapeSeriesBase.prototype.zk = function (a, b, c) {
var d = this.cw;
var e = d.b9;
var f = this.dc.w8(this.dc.wy(a));
if (e.width < 1 || e.height < 1 || this.x1 == null) {
return;
}
var g = this.getEffectiveViewport1(d);
var h = new ScalerParams(0, f, e, this.xj.ch, g);
var i = new ScalerParams(0, f, e, this.xl.ch, g);
d.c7();
var j = this.x1.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.yl._inner[p];
k[p] = o.top;
l[p] = o.left;
m[p] = o.right;
n[p] = o.bottom;
}
this.xj.hq(boxArray$1(l), 0, l.length, h);
this.xj.hq(boxArray$1(m), 0, m.length, h);
this.xl.hq(boxArray$1(k), 0, k.length, i);
this.xl.hq(boxArray$1(n), 0, n.length, i);
d.c8(l, k, m, n);
d.dd();
var q = null;
if (!this.z9.isEmpty) {
q = new Clipper(1, this.z9.left, this.z9.bottom, this.z9.right, this.z9.top, this.yb);
}
var r = false;
var s = 0;
if (this.dc != null) {
if (this.dc.f8()) {
var t = this.dc.nm(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.yn(d, q, this.x1.item(z), h, i, s, s);
if (aa.count <= 0) {
continue;
}
this.x4(b, c, z);
}
};
ShapeSeriesBase.prototype.x4 = 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.xr.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.yw = function (a) {
return this.dp.item(a);
};
ShapeSeriesBase.prototype.get_g8 = function () {
return true;
};
ShapeSeriesBase.prototype.set_g8 = function (a) {
_super.prototype.set_g8.call(this, a);
};
ShapeSeriesBase.prototype.ay = function (a) {
var e_2, _a, e_3, _b;
if (typeCast(NumericXAxis.$, a) !== null && this.yl != null) {
var b = 1.7976931348623157E+308;
var c = -1.7976931348623157E+308;
try {
for (var _c = __values(fromEnum(this.yl)), _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.yl != null) {
var e = 1.7976931348623157E+308;
var f = -1.7976931348623157E+308;
try {
for (var _e = __values(fromEnum(this.yl)), _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_fy = function () {
return true;
};
ShapeSeriesBase.prototype.get_fm = function () {
return true;
};
Object.defineProperty(ShapeSeriesBase.prototype, "x9", {
get: function () {
return this.styleShape != null;
},
enumerable: false,
configurable: true
});
ShapeSeriesBase.prototype.aab = function (a, b, c) {
if (this.styleShape != null) {
if (this.xr.dm != null && c == this.xr.dm) {
c = new Style();
var d = this.xr.dm;
c.fill = d.fill;
c.opacity = d.opacity;
c.stroke = d.stroke;
c.strokeThickness = d.strokeThickness;
}
else {
if (c != null) {
var e = new Style();
e.fill = c.fill;
e.opacity = c.opacity;
e.stroke = c.stroke;
e.strokeThickness = c.strokeThickness;
c = e;
}
else {
c = new Style();