igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
560 lines (559 loc) • 18.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 { Point_$type, Boolean_$type, enumGetBox, runOn, delegateRemove, typeCast, delegateCombine, fromEnum, fromEn, markType, markDep } from "igniteui-react-core";
import { AnnotationAppearanceMode_$type } from "./AnnotationAppearanceMode";
import { DoubleCollection } from "igniteui-react-core";
import { PenLineCap_$type } from "igniteui-react-core";
import { SeriesView } from "./SeriesView";
import { XamDataChart } from "./XamDataChart";
import { Brush } from "igniteui-react-core";
import { Tuple$2 } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { isNaN_, truncate } from "igniteui-react-core";
import { BrushUtil } from "igniteui-react-core";
import { Color } from "igniteui-react-core";
/**
* @hidden
*/
export let AnnotationLayer = /*@__PURE__*/ (() => {
class AnnotationLayer extends Series {
constructor() {
super();
this.aaf = null;
this.xn = null;
this.xm = null;
this.xo = null;
this.aad = { $type: Point_$type, x: NaN, y: NaN };
this.xp = false;
this.aaf = { $type: Point_$type, x: NaN, y: NaN };
this.zc();
}
ct() {
return new AnnotationLayerView(this);
}
q8(a) {
super.q8(a);
this.xl = a;
}
xt(a) {
if (a == null) {
return false;
}
if (a.eu) {
return false;
}
if (a.isValueOverlay) {
return false;
}
if (a == this) {
return false;
}
return a.hf(a.cw.b9, a.cw.ca, a.cw);
}
get_e3() {
return this.xq;
}
b3() {
if (this.b4 == 0) {
return 1;
}
else {
return super.b3();
}
}
get_fh() {
return this.xv || this.xw;
}
get_isUsableInLegend() {
return this.xw;
}
rh(a, b, c, d) {
super.rh(a, b, c, d);
switch (b) {
case "SeriesViewer":
let e = c;
let f = d;
if (e != null) {
this.zb(e.series);
let g = e.series;
g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.y8));
if (typeCast(XamDataChart.$, e) !== null) {
let h = e;
this.za(h.axes);
let i = h.axes;
i.collectionChanged = delegateRemove(i.collectionChanged, runOn(this, this.yy));
}
}
if (f != null) {
this.y6(f.series);
let j = f.series;
j.collectionChanged = delegateCombine(j.collectionChanged, runOn(this, this.y8));
if (typeCast(XamDataChart.$, f) !== null) {
let k = f;
this.y5(k.axes);
let l = k.axes;
l.collectionChanged = delegateCombine(l.collectionChanged, runOn(this, this.yy));
}
}
break;
case AnnotationLayer.$$p[18]:
case AnnotationLayer.$$p[17]:
if (this.fh) {
if (this.index == -1) {
this.index = XamDataChart.aae(this);
}
}
else {
this.index = -1;
this.vk = null;
this.vo = null;
}
if (this.dc != null) {
this.dc.qe();
}
this.rz(true);
break;
case "TransitionProgress":
this.xo.c(this.ju, this.xn, this.xm);
if (this.d7(this.cw)) {
return;
}
if (this.ju == 1) {
this.y7(this.xm, this.cw);
this.qv();
}
else {
this.y7(this.xo, this.cw);
}
if (this.dc != null) {
this.dc.r0(this);
}
break;
case AnnotationLayer.$$p[15]:
if (this.dc != null) {
this.dc.p8();
}
break;
case AnnotationLayer.$$p[11]:
this.aaf = this.aae;
this.qy(this.aae);
break;
case "ShouldRenderAsOverlay":
if (this.dc != null) {
this.cw.at(this.dc);
this.cw.ao(this.dc);
}
break;
case AnnotationLayer.$$p[10]:
case AnnotationLayer.$$p[16]:
case "DashArray":
case AnnotationLayer.$$p[12]:
case AnnotationLayer.$$p[19]:
case AnnotationLayer.$$p[14]:
case AnnotationLayer.$$p[21]:
case AnnotationLayer.$$p[13]:
case AnnotationLayer.$$p[20]:
this.zc();
break;
case AnnotationLayer.$$p[0]:
case AnnotationLayer.$$p[6]:
case AnnotationLayer.$$p[3]:
case AnnotationLayer.$$p[7]:
case AnnotationLayer.$$p[5]:
case AnnotationLayer.$$p[9]:
case AnnotationLayer.$$p[4]:
case AnnotationLayer.$$p[8]:
this.rz(true);
break;
}
}
zb(a) {
for (let b of fromEnum(a)) {
if (!(b == this)) {
b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.y9));
}
}
this.rz(true);
}
za(a) {
for (let b of fromEnum(a)) {
b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.yz));
}
this.rz(true);
}
y6(a) {
for (let b of fromEnum(a)) {
if (!(b == this)) {
b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.y9));
}
}
this.rz(true);
}
y5(a) {
for (let b of fromEnum(a)) {
b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.yz));
}
this.rz(true);
}
xr(a) {
if (a == null) {
return false;
}
return true;
}
yz(a, b) {
if (this.xr(a)) {
this.y1(a, b.animate);
}
}
xs(a) {
if (a == null) {
return false;
}
if (a.eu) {
return false;
}
return true;
}
y9(a, b) {
if (this.xs(a)) {
this.y2(a, b.animate);
}
}
y1(a, b) {
}
y2(a, b) {
}
y8(a, b) {
this.y3(b);
}
yy(a, b) {
this.y0(b);
}
zz() {
if (this.vk != null) {
return this.vk;
}
return this.vq;
}
z0() {
if (this.vo != null) {
return this.vo;
}
return this.v6;
}
y0(a) {
if (a.oldItems != null) {
for (let b of fromEn(a.oldItems)) {
b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.yz));
}
}
if (a.newItems != null) {
for (let c of fromEn(a.newItems)) {
c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.yz));
}
}
this.rz(true);
}
y3(a) {
if (a.oldItems != null) {
for (let b of fromEn(a.oldItems)) {
b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.y9));
}
}
if (a.newItems != null) {
for (let c of fromEn(a.newItems)) {
c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.y9));
}
}
this.rz(true);
}
s0(a, b) {
this.rz(false);
}
sz(a, b) {
this.rz(true);
}
r0(a) {
super.r0(a);
if (this.d7(this.cw)) {
return;
}
if (this.gg(a) && !this.gs) {
let b = this.xn;
if (this.d4()) {
if (this.dd.g) {
this.dd.t();
}
this.xn = this.xo;
this.xo = b;
}
else {
this.xn = this.xm;
this.xm = b;
}
this.y4(this.xm, this.cw);
this.sg();
}
else {
if (!this.gs) {
this.y4(this.xm, this.cw);
}
this.y7(this.xm, this.cw);
}
}
get_eu() {
return true;
}
y4(a, b) {
}
y7(a, b) {
this.q4();
this.xl.ch();
}
yx(a) {
let b = { $type: Point_$type, x: this.aad.x, y: this.aad.y };
if (a.isVertical) {
if (isNaN_(this.aad.y)) {
return new Tuple$2(Boolean_$type, Point_$type, false, b);
}
if (isNaN_(this.aad.x)) {
b.x = 0;
return new Tuple$2(Boolean_$type, Point_$type, true, b);
}
}
else {
if (isNaN_(this.aad.x)) {
return new Tuple$2(Boolean_$type, Point_$type, false, b);
}
if (isNaN_(this.aad.y)) {
b.y = 0;
return new Tuple$2(Boolean_$type, Point_$type, true, b);
}
}
return new Tuple$2(Boolean_$type, Point_$type, true, b);
}
qy(a) {
super.qy(a);
if (isNaN_(this.aaf.x) && isNaN_(this.aaf.y)) {
if (isNaN_(a.x) && isNaN_(a.y)) {
this.xl.cg();
return;
}
else {
this.xl.ci();
this.aad = a;
}
}
else {
this.xl.ci();
this.aad = this.aaf;
}
this.rz(true);
}
hf(a, b, c) {
let d = super.hf(a, b, c);
if (this.dc == null) {
return false;
}
if (!this.cw.w()) {
d = false;
return d;
}
return d;
}
x6() {
if (isNaN_(this.x9)) {
switch (this.w9) {
case 1: return this.x0();
case 2: return this.x3();
case 4: return this.x2();
}
}
return this.x9;
}
x5() {
if (isNaN_(this.x8)) {
return this.xy;
}
return this.x8;
}
x7() {
if (isNaN_(this.ya)) {
return this.xy;
}
return this.ya;
}
xg() {
switch (this.xc) {
case 0: return this.xd();
}
return this.xc;
}
xh() {
switch (this.xj) {
case 0: return this.w9;
}
return this.xj;
}
xi() {
switch (this.xk) {
case 0: return this.w9;
}
return this.xk;
}
z8() {
if (this.aaa == null) {
if (this.wd == null) {
return this.z5();
}
return this.wd;
}
return this.aaa;
}
z9() {
if (this.aab == null) {
if (this.wd == null) {
return this.z6();
}
return this.wd;
}
return this.aab;
}
z7() {
if (this.wd == null) {
return this.z4();
}
return this.wd;
}
xd() {
return 0;
}
xe() {
return this.xd();
}
xf() {
return this.xd();
}
x0() {
return NaN;
}
x3() {
return NaN;
}
x2() {
return NaN;
}
x1() {
return NaN;
}
x4() {
return NaN;
}
z5() {
return null;
}
z6() {
return null;
}
z4() {
return null;
}
zc() {
this.w9 = this.xg();
this.xy = this.x6();
this.xa = this.xh();
this.xx = this.x5();
this.xb = this.xi();
this.xz = this.x7();
this.z2 = this.z8();
this.z3 = this.z9();
this.z1 = this.z7();
}
get_hb() {
return this.xu;
}
get xu() {
return this.xp;
}
set xu(a) {
let b = this.xp;
this.xp = a;
this.raisePropertyChanged("ShouldRenderAsOverlay", b, this.xp);
}
}
AnnotationLayer.$t = /*@__PURE__*/ markType(AnnotationLayer, 'AnnotationLayer', Series.$);
AnnotationLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, AnnotationLayer, 'raisePropertyChanged', ['ActualAppearanceMode:w9:zd', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualDashArray:z1:ze', [DoubleCollection.$], 'ActualDashCap:aac:zf', [PenLineCap_$type], 'ActualHorizontalAppearanceMode:xa:zg', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualHorizontalDashArray:z2:zh', [DoubleCollection.$], 'ActualHorizontalShiftAmount:xx:zi', [1, NaN], 'ActualShiftAmount:xy:zj', [1, NaN], 'ActualVerticalAppearanceMode:xb:zk', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualVerticalDashArray:z3:zl', [DoubleCollection.$], 'ActualVerticalShiftAmount:xz:zm', [1, NaN], 'AppearanceMode:xc:zn', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'CursorPosition:aae:zo', [Point_$type, { $type: Point_$type, x: NaN, y: NaN }], 'HorizontalAppearanceMode:xj:zp', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'HorizontalDashArray:aaa:zq', [DoubleCollection.$], 'HorizontalShiftAmount:x8:zr', [1, NaN], 'IsDefaultCrosshairDisabled:xq:zs', [0, true], 'ShiftAmount:x9:zt', [1, NaN], 'UseIndex:xv:zu', [0, false], 'UseLegend:xw:zv', [0, false], 'VerticalAppearanceMode:xk:zw', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'VerticalDashArray:aab:zx', [DoubleCollection.$], 'VerticalShiftAmount:ya:zy', [1, NaN]]);
return AnnotationLayer;
})();
/**
* @hidden
*/
export let AnnotationLayerView = /*@__PURE__*/ (() => {
class AnnotationLayerView extends SeriesView {
constructor(a) {
super(a);
this.cd = null;
this.ce = false;
this.cf = -1;
this.cd = a;
}
cj() {
if (this.ce) {
this.ce = false;
this.cf = -1;
this.cd.aad = { $type: Point_$type, x: NaN, y: NaN };
this.cd.rz(true);
}
}
cg() {
this.ce = true;
if (this.f.j3 != null) {
this.f.j3.setTimeout(runOn(this, this.cj), 300);
}
else {
this.cf = window.setTimeout(runOn(this, this.cj), 300);
}
}
ci() {
if (this.ce == true) {
this.ce = false;
if (this.cf != -1) {
window.clearTimeout(this.cf);
this.cf = -1;
}
}
}
ch() {
this.a2();
}
ck(a, b) {
if (a == null) {
return a;
}
return BrushUtil.o(a, b);
}
cm(a, b) {
if (a == null) {
return a;
}
return BrushUtil.q(a, b);
}
cl(a, b) {
if (a == null) {
return a;
}
let c = new Brush();
c.color = Color.u(truncate((a.color.l * b)), a.color.o, a.color.n, a.color.m);
return c;
}
}
AnnotationLayerView.$t = /*@__PURE__*/ markType(AnnotationLayerView, 'AnnotationLayerView', SeriesView.$);
return AnnotationLayerView;
})();