igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
540 lines (539 loc) • 17.7 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, 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 { 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.aar = null;
this.xx = null;
this.xw = null;
this.xy = null;
this.aap = { $type: Point_$type, x: NaN, y: NaN };
this.xz = false;
this.aar = { $type: Point_$type, x: NaN, y: NaN };
this.zn();
}
ct() {
return new AnnotationLayerView(this);
}
rh(a) {
super.rh(a);
this.xv = a;
}
x4(a) {
if (a == null) {
return false;
}
if (a.ev) {
return false;
}
if (a.isValueOverlay) {
return false;
}
if (a == this) {
return false;
}
return a.hk(a.cw.b9, a.cw.ca, a.cw);
}
get_e4() {
return this.x1;
}
b3() {
if (this.b4 == 0) {
return 1;
}
else {
return super.b3();
}
}
get_fj() {
return this.x6 || this.x7;
}
get_isUsableInLegend() {
return this.x7;
}
rq(a, b, c, d) {
super.rq(a, b, c, d);
switch (b) {
case "SeriesViewer":
let e = c;
let f = d;
if (e != null) {
this.zm(e.b9);
let g = e.b9;
g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.zj));
if (typeCast(XamDataChart.$, e) !== null) {
let h = e;
this.zl(h.zq);
let i = h.zq;
i.collectionChanged = delegateRemove(i.collectionChanged, runOn(this, this.y9));
}
}
if (f != null) {
this.zh(f.b9);
let j = f.b9;
j.collectionChanged = delegateCombine(j.collectionChanged, runOn(this, this.zj));
if (typeCast(XamDataChart.$, f) !== null) {
let k = f;
this.zg(k.zq);
let l = k.zq;
l.collectionChanged = delegateCombine(l.collectionChanged, runOn(this, this.y9));
}
}
break;
case AnnotationLayer.$$p[19]:
case AnnotationLayer.$$p[18]:
if (this.fj) {
if (this.index == -1) {
this.index = XamDataChart.abr(this);
}
}
else {
this.index = -1;
this.vt = null;
this.vx = null;
}
if (this.dc != null) {
this.dc.q3();
}
this.r8(true);
break;
case "TransitionProgress":
this.xy.d(this.jz, this.xx, this.xw);
if (this.d7(this.cw)) {
return;
}
if (this.jz == 1) {
this.zi(this.xw, this.cw);
this.q3();
}
else {
this.zi(this.xy, this.cw);
}
if (this.dc != null) {
this.dc.st(this);
}
break;
case AnnotationLayer.$$p[16]:
if (this.dc != null) {
this.dc.qx();
}
break;
case AnnotationLayer.$$p[11]:
this.aar = this.aaq;
this.q6(this.aaq);
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[17]:
case "DashArray":
case AnnotationLayer.$$p[13]:
case AnnotationLayer.$$p[20]:
case AnnotationLayer.$$p[15]:
case AnnotationLayer.$$p[22]:
case AnnotationLayer.$$p[14]:
case AnnotationLayer.$$p[21]:
this.zn();
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.r8(true);
break;
}
}
zm(a) {
for (let b of fromEnum(a)) {
if (!(b == this)) {
b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.zk));
}
}
this.r8(true);
}
zl(a) {
for (let b of fromEnum(a)) {
b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.za));
}
this.r8(true);
}
zh(a) {
for (let b of fromEnum(a)) {
if (!(b == this)) {
b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.zk));
}
}
this.r8(true);
}
zg(a) {
for (let b of fromEnum(a)) {
b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.za));
}
this.r8(true);
}
x2(a) {
if (a == null) {
return false;
}
return true;
}
za(a, b) {
if (this.x2(a)) {
this.zc(a, b.animate);
}
}
x3(a) {
if (a == null) {
return false;
}
if (a.ev) {
return false;
}
return true;
}
zk(a, b) {
if (this.x3(a)) {
this.zd(a, b.animate);
}
}
zc(a, b) {
}
zd(a, b) {
}
zj(a, b) {
this.ze(b);
}
y9(a, b) {
this.zb(b);
}
aab() {
if (this.vt != null) {
return this.vt;
}
return this.vz;
}
aac() {
if (this.vx != null) {
return this.vx;
}
return this.wf;
}
zb(a) {
if (a.oldItems != null) {
for (let b of fromEn(a.oldItems)) {
b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.za));
}
}
if (a.newItems != null) {
for (let c of fromEn(a.newItems)) {
c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.za));
}
}
this.r8(true);
}
ze(a) {
if (a.oldItems != null) {
for (let b of fromEn(a.oldItems)) {
b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.zk));
}
}
if (a.newItems != null) {
for (let c of fromEn(a.newItems)) {
c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.zk));
}
}
this.r8(true);
}
s9(a, b) {
this.r8(false);
}
s8(a, b) {
this.r8(true);
}
r9(a) {
super.r9(a);
if (this.d7(this.cw)) {
return;
}
if (this.gl(a) && !this.gx) {
let b = this.xx;
if (this.d4()) {
if (this.dd.g) {
this.dd.t();
}
this.xx = this.xy;
this.xy = b;
}
else {
this.xx = this.xw;
this.xw = b;
}
this.zf(this.xw, this.cw);
this.sp();
}
else {
if (!this.gx) {
this.zf(this.xw, this.cw);
}
this.zi(this.xw, this.cw);
}
}
get_ev() {
return true;
}
zf(a, b) {
}
zi(a, b) {
this.rd();
this.xv.ch();
}
q6(a) {
if (!this.x0) {
return;
}
super.q6(a);
if (isNaN_(this.aar.x) && isNaN_(this.aar.y)) {
if (isNaN_(a.x) && isNaN_(a.y)) {
this.xv.cg();
return;
}
else {
this.xv.ci();
this.aap = a;
}
}
else {
this.xv.ci();
this.aap = this.aar;
}
this.r8(true);
}
hk(a, b, c) {
let d = super.hk(a, b, c);
if (this.dc == null) {
return false;
}
if (!this.cw.w()) {
d = false;
return d;
}
return d;
}
yh() {
if (isNaN_(this.yk)) {
switch (this.xj) {
case 1: return this.yb();
case 2: return this.ye();
case 4: return this.yd();
}
}
return this.yk;
}
yg() {
if (isNaN_(this.yj)) {
return this.x9;
}
return this.yj;
}
yi() {
if (isNaN_(this.yl)) {
return this.x9;
}
return this.yl;
}
xq() {
switch (this.xm) {
case 0: return this.xn();
}
return this.xm;
}
xr() {
switch (this.xt) {
case 0: return this.xj;
}
return this.xt;
}
xs() {
switch (this.xu) {
case 0: return this.xj;
}
return this.xu;
}
aak() {
if (this.aam == null) {
if (this.wm == null) {
return this.aah();
}
return this.wm;
}
return this.aam;
}
aal() {
if (this.aan == null) {
if (this.wm == null) {
return this.aai();
}
return this.wm;
}
return this.aan;
}
aaj() {
if (this.wm == null) {
return this.aag();
}
return this.wm;
}
xn() {
return 0;
}
xo() {
return this.xn();
}
xp() {
return this.xn();
}
yb() {
return NaN;
}
ye() {
return NaN;
}
yd() {
return NaN;
}
yc() {
return NaN;
}
yf() {
return NaN;
}
aah() {
return null;
}
aai() {
return null;
}
aag() {
return null;
}
zn() {
this.xj = this.xq();
this.x9 = this.yh();
this.xk = this.xr();
this.x8 = this.yg();
this.xl = this.xs();
this.ya = this.yi();
this.aae = this.aak();
this.aaf = this.aal();
this.aad = this.aaj();
}
get_hg() {
return this.x5;
}
get x5() {
return this.xz;
}
set x5(a) {
let b = this.xz;
this.xz = a;
this.raisePropertyChanged("ShouldRenderAsOverlay", b, this.xz);
}
}
AnnotationLayer.$t = /*@__PURE__*/ markType(AnnotationLayer, 'AnnotationLayer', Series.$);
AnnotationLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, AnnotationLayer, 'raisePropertyChanged', ['ActualAppearanceMode:xj:zo', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualDashArray:aad:zp', [DoubleCollection.$], 'ActualDashCap:aao:zq', [PenLineCap_$type], 'ActualHorizontalAppearanceMode:xk:zr', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualHorizontalDashArray:aae:zs', [DoubleCollection.$], 'ActualHorizontalShiftAmount:x8:zt', [1, NaN], 'ActualShiftAmount:x9:zu', [1, NaN], 'ActualVerticalAppearanceMode:xl:zv', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualVerticalDashArray:aaf:zw', [DoubleCollection.$], 'ActualVerticalShiftAmount:ya:zx', [1, NaN], 'AppearanceMode:xm:zy', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'CursorPosition:aaq:zz', [Point_$type, { $type: Point_$type, x: NaN, y: NaN }], 'CursorPositionUpdatesOnMove:x0:z0', [0, true], 'HorizontalAppearanceMode:xt:z1', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'HorizontalDashArray:aam:z2', [DoubleCollection.$], 'HorizontalShiftAmount:yj:z3', [1, NaN], 'IsDefaultCrosshairDisabled:x1:z4', [0, true], 'ShiftAmount:yk:z5', [1, NaN], 'UseIndex:x6:z6', [0, false], 'UseLegend:x7:z7', [0, false], 'VerticalAppearanceMode:xu:z8', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'VerticalDashArray:aan:z9', [DoubleCollection.$], 'VerticalShiftAmount:yl:aaa', [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.aap = { $type: Point_$type, x: NaN, y: NaN };
this.cd.r8(true);
}
}
cg() {
this.ce = true;
if (this.f.j8 != null) {
this.f.j8.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;
})();