igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
402 lines (401 loc) • 15.5 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 { Series } from "./Series";
import { DependencyProperty } from "igniteui-react-core";
import { IEnumerable_$type, runOn, delegateCombine, delegateRemove, typeCast, Point_$type, markType, markDep } from "igniteui-react-core";
import { NumericXAxis } from "./NumericXAxis";
import { NumericYAxis } from "./NumericYAxis";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { Triangulator } from "igniteui-react-core";
import { TriangulationStatusEventArgs } from "igniteui-react-core";
import { FastItemsSource } from "igniteui-react-core";
import { SeriesViewer } from "./SeriesViewer";
import { Axis } from "./Axis";
import { AxisRange } from "./AxisRange";
import { DataLegendSeriesValueInfo } from "igniteui-react-core";
import { DataLegendSeriesContext } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
/**
* @hidden
*/
export let ScatterTriangulationSeries = /*@__PURE__*/ (() => {
class ScatterTriangulationSeries extends Series {
constructor() {
super(...arguments);
this.xr = null;
this.xs = null;
this.x0 = false;
this.xn = null;
this.triangulationStatusChanged = null;
this.x3 = null;
this.xo = null;
this.xp = null;
this.xq = null;
}
pg() {
super.pg();
this.xk = null;
this.xl = null;
}
k0(a, b) {
let c = this.np(b);
if (c == ScatterTriangulationSeries.$$p[8]) {
return this.k1(a, b, this.ym);
}
if (c == ScatterTriangulationSeries.$$p[12]) {
return this.k1(a, b, this.yu);
}
return super.k0(a, b);
}
mp(a) {
let b = this.np(a);
if (b == ScatterTriangulationSeries.$$p[8]) {
return this.ym;
}
if (b == ScatterTriangulationSeries.$$p[12]) {
return this.yu;
}
return super.mp(a);
}
get xx() {
return this.xr;
}
set xx(a) {
let b = this.xx != a;
if (b) {
let c = this.xx;
this.xr = a;
this.raisePropertyChanged("XColumn", c, this.xx);
}
}
get xy() {
return this.xs;
}
set xy(a) {
let b = this.xy != a;
if (b) {
let c = this.xy;
this.xs = a;
this.raisePropertyChanged("YColumn", c, this.xy);
}
}
sa(a) {
let b = this.dp != null && this.xz == null && this.x3 == null && this.xx != null && this.xy != null && this.xx.count >= 3 && this.xy.count >= 3 && !this.x0;
if (b) {
this.yy();
this.x0 = true;
}
}
yy() {
this.xn = new Triangulator(this.dp.count, this.xx, this.xy);
let a = this.xn;
a.triangulationStatusChanged = delegateCombine(a.triangulationStatusChanged, runOn(this, this.yz));
this.xn.y();
}
yw() {
if (this.xn == null) {
return;
}
this.xn.r();
let a = this.xn;
a.triangulationStatusChanged = delegateRemove(a.triangulationStatusChanged, runOn(this, this.yz));
this.xn = null;
}
yz(a, b) {
if (this.triangulationStatusChanged != null) {
this.triangulationStatusChanged(this, new TriangulationStatusEventArgs(b.currentStatus));
}
if (b.currentStatus >= 100) {
if (this.xn == null) {
return;
}
let c = this.xn;
c.triangulationStatusChanged = delegateRemove(c.triangulationStatusChanged, runOn(this, this.yz));
this.x3 = this.xn.n();
this.xn = null;
let d = ((() => {
let $ret = new FastItemsSource();
$ret.e = this.x3;
return $ret;
})());
this.xu = this.xt(d, "v1");
this.xv = this.xt(d, "v2");
this.xw = this.xt(d, "v3");
this.r9(false);
}
}
xt(a, b) {
if (b == null) {
return a.registerColumnInt(null, null, false);
}
let c = null;
let d = SeriesViewer.de(b, this.coercionMethods);
c = d.a;
return a.registerColumnInt(b, c, this.expectFunctions);
}
rr(a, b, c, d) {
super.rr(a, b, c, d);
switch (b) {
case ScatterTriangulationSeries.$$p[6]:
case ScatterTriangulationSeries.$$p[10]:
case ScatterTriangulationSeries.$$p[7]:
case ScatterTriangulationSeries.$$p[11]:
this.qv();
break;
case "FastItemsSource":
let e = typeCast(IFastItemsSource_$type, c);
if (e != null) {
e.deregisterColumn(this.xx);
e.deregisterColumn(this.xy);
this.xx = null;
this.xy = null;
}
this.yx();
let f = typeCast(IFastItemsSource_$type, d);
if (f != null) {
this.xx = this.dl(this.ym);
this.xy = this.dl(this.yu);
}
this.r9(this.gn && c != null);
break;
case ScatterTriangulationSeries.$$p[8]:
if (this.dp != null) {
this.dp.deregisterColumn(this.xx);
this.xx = this.dl(this.ym);
}
this.yx();
this.r9(false);
this.q1();
break;
case ScatterTriangulationSeries.$$p[12]:
if (this.dp != null) {
this.dp.deregisterColumn(this.xy);
this.xy = this.dl(this.yu);
}
this.yx();
this.r9(false);
this.q1();
break;
case ScatterTriangulationSeries.$$p[5]:
if (c != null) {
(typeCast(Axis.$, c)).cx(this);
}
if (d != null) {
(typeCast(Axis.$, d)).d4(this);
}
if ((this.xk != null && !this.xk.ee()) || (d == null && c != null)) {
this.r9(false);
}
this.q1();
break;
case ScatterTriangulationSeries.$$p[9]:
if (c != null) {
(typeCast(Axis.$, c)).cx(this);
}
if (d != null) {
(typeCast(Axis.$, d)).d4(this);
}
if ((this.xl != null && !this.xl.ee()) || (d == null && c != null)) {
this.r9(false);
}
this.q1();
break;
case ScatterTriangulationSeries.$$p[4]:
if (this.trianglesSource != null) {
this.yw();
this.xz = ((() => {
let $ret = new FastItemsSource();
$ret.e = this.trianglesSource;
return $ret;
})());
}
else {
this.xz = null;
}
break;
case ScatterTriangulationSeries.$$p[0]:
let g = typeCast(IFastItemsSource_$type, c);
if (g != null) {
g.deregisterColumn(this.xu);
g.deregisterColumn(this.xv);
g.deregisterColumn(this.xw);
this.xu = null;
this.xv = null;
this.xw = null;
}
let h = typeCast(IFastItemsSource_$type, d);
if (h != null) {
this.xu = this.xt(h, this.ya);
this.xv = this.xt(h, this.yc);
this.xw = this.xt(h, this.ye);
}
this.r9(false);
this.q1();
break;
case ScatterTriangulationSeries.$$p[1]:
if (this.xz != null) {
this.xz.deregisterColumn(this.xu);
this.xu = this.xt(this.xz, this.ya);
}
this.r9(false);
this.q1();
break;
case ScatterTriangulationSeries.$$p[2]:
if (this.xz != null) {
this.xz.deregisterColumn(this.xv);
this.xv = this.xt(this.xz, this.yc);
}
this.r9(false);
this.q1();
break;
case ScatterTriangulationSeries.$$p[3]:
if (this.xz != null) {
this.xz.deregisterColumn(this.xw);
this.xw = this.xt(this.xz, this.ye);
}
this.r9(false);
this.q1();
break;
case "XColumn":
if (this.xk != null) {
this.xk.ee();
}
break;
case "YColumn":
if (this.xl != null) {
this.xl.ee();
}
break;
}
}
x2(a) {
if (typeCast(NumericYAxis.$, a) !== null) {
return true;
}
return false;
}
x1(a) {
if (typeCast(NumericXAxis.$, a) !== null) {
return true;
}
return false;
}
hl(a, b, c) {
return super.hl(a, b, c) && this.dp != null && this.xk != null && this.xl != null && this.xk.b7 != null && this.xl.b7 != null && a.width > 0 && a.height > 0 && this.xu != null && this.xu.count > 0 && this.xv != null && this.xv.count > 0 && this.xw != null && this.xw.count > 0 && this.xx != null && this.xx.count > 0 && this.xy != null && this.xy.count > 0;
}
yx() {
if (this.trianglesSource == null) {
this.x3 = null;
this.xu = null;
this.xv = null;
this.xw = null;
this.x0 = false;
}
}
qq() {
super.qq();
if (this.xk != null) {
this.xk.lz();
}
if (this.xl != null) {
this.xl.lz();
}
}
pp(a, b, c, d) {
super.pp(a, b, c, d);
this.yx();
this.r9(false);
}
ay(a) {
if (a != null && a == this.xk && this.xx != null) {
return new AxisRange(this.xx.minimum, this.xx.maximum);
}
if (a != null && a == this.xl && this.xy != null) {
return new AxisRange(this.xy.minimum, this.xy.maximum);
}
return null;
}
ta(a, b) {
this.r9(false);
}
s9(a, b) {
this.r9(false);
}
get xu() {
return this.xo;
}
set xu(a) {
let b = this.xu != a;
if (b) {
let c = this.xu;
this.xo = a;
this.raisePropertyChanged("TriangleVertexColumn1", c, this.xu);
}
}
get xv() {
return this.xp;
}
set xv(a) {
let b = this.xv != a;
if (b) {
let c = this.xv;
this.xp = a;
this.raisePropertyChanged("TriangleVertexColumn2", c, this.xv);
}
}
get xw() {
return this.xq;
}
set xw(a) {
let b = this.xw != a;
if (b) {
let c = this.xw;
this.xq = a;
this.raisePropertyChanged("TriangleVertexColumn3", c, this.xw);
}
}
get_f1() {
return true;
}
get_fp() {
return true;
}
getDataLegendSeriesContextAt(a, b) {
let c = { $type: Point_$type, x: a, y: b };
let d = this.kx(c);
let e = d == null ? NaN : this.i5(d, "XMemberPath");
let f = d == null ? NaN : this.i5(d, "YMemberPath");
let g = new DataLegendSeriesValueInfo();
g.l = e;
g.a = 13;
g.q = "X";
g.r = this.ym != null ? this.ym : "X";
g.s = this.yi != null ? this.yi : "X:";
g.t = this.yk != null ? this.yk : "";
let h = new DataLegendSeriesValueInfo();
h.l = f;
h.a = 14;
h.q = "Y";
h.r = this.yu != null ? this.yu : "Y";
h.s = this.yq != null ? this.yq : "Y:";
h.t = this.ys != null ? this.ys : "";
let i = new DataLegendSeriesContext();
i.e = ((() => {
let $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
$ret.add(g);
$ret.add(h);
return $ret;
})());
i.h = this.mo();
return i;
}
}
ScatterTriangulationSeries.$t = /*@__PURE__*/ markType(ScatterTriangulationSeries, 'ScatterTriangulationSeries', Series.$);
ScatterTriangulationSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, ScatterTriangulationSeries, 'raisePropertyChanged', ['FastTrianglesSource:xz:y0', [IFastItemsSource_$type, null], 'TriangleVertexMemberPath1:ya:y2', [2, null], 'TriangleVertexMemberPath2:yc:y3', [2, null], 'TriangleVertexMemberPath3:ye:y4', [2, null], 'TrianglesSource::y1', [IEnumerable_$type, null], 'XAxis:xk:y5', [NumericXAxis.$, null], 'XMemberAsLegendLabel:yi:y6', [2, null], 'XMemberAsLegendUnit:yk:y7', [2, null], 'XMemberPath:ym:y8', [2, null], 'YAxis:xl:y9', [NumericYAxis.$, null], 'YMemberAsLegendLabel:yq:za', [2, null], 'YMemberAsLegendUnit:ys:zb', [2, null], 'YMemberPath:yu:zc', [2, null]]);
return ScatterTriangulationSeries;
})();