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.aat = null;
this.xz = null;
this.xy = null;
this.x0 = null;
this.aar = { $type: Point_$type, x: NaN, y: NaN };
this.x1 = false;
this.aat = { $type: Point_$type, x: NaN, y: NaN };
this.zp();
}
ct() {
return new AnnotationLayerView(this);
}
rj(a) {
super.rj(a);
this.xx = a;
}
x6(a) {
if (a == null) {
return false;
}
if (a.ev) {
return false;
}
if (a.isValueOverlay) {
return false;
}
if (a == this) {
return false;
}
return a.hm(a.cw.b9, a.cw.ca, a.cw);
}
get_e4() {
return this.x3;
}
b3() {
if (this.b4 == 0) {
return 1;
}
else {
return super.b3();
}
}
get_fj() {
return this.x8 || this.x9;
}
get_isUsableInLegend() {
return this.x9;
}
rs(a, b, c, d) {
super.rs(a, b, c, d);
switch (b) {
case "SeriesViewer":
let e = c;
let f = d;
if (e != null) {
this.zo(e.b9);
let g = e.b9;
g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.zl));
if (typeCast(XamDataChart.$, e) !== null) {
let h = e;
this.zn(h.zu);
let i = h.zu;
i.collectionChanged = delegateRemove(i.collectionChanged, runOn(this, this.zb));
}
}
if (f != null) {
this.zj(f.b9);
let j = f.b9;
j.collectionChanged = delegateCombine(j.collectionChanged, runOn(this, this.zl));
if (typeCast(XamDataChart.$, f) !== null) {
let k = f;
this.zi(k.zu);
let l = k.zu;
l.collectionChanged = delegateCombine(l.collectionChanged, runOn(this, this.zb));
}
}
break;
case AnnotationLayer.$$p[19]:
case AnnotationLayer.$$p[18]:
if (this.fj) {
if (this.index == -1) {
this.index = XamDataChart.abv(this);
}
}
else {
this.index = -1;
this.vv = null;
this.vz = null;
}
if (this.dc != null) {
this.dc.q5();
}
this.sa(true);
break;
case "TransitionProgress":
this.x0.d(this.j1, this.xz, this.xy);
if (this.d7(this.cw)) {
return;
}
if (this.j1 == 1) {
this.zk(this.xy, this.cw);
this.q5();
}
else {
this.zk(this.x0, this.cw);
}
if (this.dc != null) {
this.dc.sv(this);
}
break;
case AnnotationLayer.$$p[16]:
if (this.dc != null) {
this.dc.qz();
}
break;
case AnnotationLayer.$$p[11]:
this.aat = this.aas;
this.q8(this.aas);
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.zp();
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.sa(true);
break;
}
}
zo(a) {
for (let b of fromEnum(a)) {
if (!(b == this)) {
b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.zm));
}
}
this.sa(true);
}
zn(a) {
for (let b of fromEnum(a)) {
b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.zc));
}
this.sa(true);
}
zj(a) {
for (let b of fromEnum(a)) {
if (!(b == this)) {
b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.zm));
}
}
this.sa(true);
}
zi(a) {
for (let b of fromEnum(a)) {
b.renderRequested = delegateCombine(b.renderRequested, runOn(this, this.zc));
}
this.sa(true);
}
x4(a) {
if (a == null) {
return false;
}
return true;
}
zc(a, b) {
if (this.x4(a)) {
this.ze(a, b.animate);
}
}
x5(a) {
if (a == null) {
return false;
}
if (a.ev) {
return false;
}
return true;
}
zm(a, b) {
if (this.x5(a)) {
this.zf(a, b.animate);
}
}
ze(a, b) {
}
zf(a, b) {
}
zl(a, b) {
this.zg(b);
}
zb(a, b) {
this.zd(b);
}
aad() {
if (this.vv != null) {
return this.vv;
}
return this.v1;
}
aae() {
if (this.vz != null) {
return this.vz;
}
return this.wh;
}
zd(a) {
if (a.oldItems != null) {
for (let b of fromEn(a.oldItems)) {
b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.zc));
}
}
if (a.newItems != null) {
for (let c of fromEn(a.newItems)) {
c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.zc));
}
}
this.sa(true);
}
zg(a) {
if (a.oldItems != null) {
for (let b of fromEn(a.oldItems)) {
b.renderRequested = delegateRemove(b.renderRequested, runOn(this, this.zm));
}
}
if (a.newItems != null) {
for (let c of fromEn(a.newItems)) {
c.renderRequested = delegateCombine(c.renderRequested, runOn(this, this.zm));
}
}
this.sa(true);
}
tb(a, b) {
this.sa(false);
}
ta(a, b) {
this.sa(true);
}
sb(a) {
super.sb(a);
if (this.d7(this.cw)) {
return;
}
if (this.gn(a) && !this.gz) {
let b = this.xz;
if (this.d4()) {
if (this.dd.g) {
this.dd.t();
}
this.xz = this.x0;
this.x0 = b;
}
else {
this.xz = this.xy;
this.xy = b;
}
this.zh(this.xy, this.cw);
this.sr();
}
else {
if (!this.gz) {
this.zh(this.xy, this.cw);
}
this.zk(this.xy, this.cw);
}
}
get_ev() {
return true;
}
zh(a, b) {
}
zk(a, b) {
this.rf();
this.xx.ch();
}
q8(a) {
if (!this.x2) {
return;
}
super.q8(a);
if (isNaN_(this.aat.x) && isNaN_(this.aat.y)) {
if (isNaN_(a.x) && isNaN_(a.y)) {
this.xx.cg();
return;
}
else {
this.xx.ci();
this.aar = a;
}
}
else {
this.xx.ci();
this.aar = this.aat;
}
this.sa(true);
}
hm(a, b, c) {
let d = super.hm(a, b, c);
if (this.dc == null) {
return false;
}
if (!this.cw.w()) {
d = false;
return d;
}
return d;
}
yj() {
if (isNaN_(this.ym)) {
switch (this.xl) {
case 1: return this.yd();
case 2: return this.yg();
case 4: return this.yf();
}
}
return this.ym;
}
yi() {
if (isNaN_(this.yl)) {
return this.yb;
}
return this.yl;
}
yk() {
if (isNaN_(this.yn)) {
return this.yb;
}
return this.yn;
}
xs() {
switch (this.xo) {
case 0: return this.xp();
}
return this.xo;
}
xt() {
switch (this.xv) {
case 0: return this.xl;
}
return this.xv;
}
xu() {
switch (this.xw) {
case 0: return this.xl;
}
return this.xw;
}
aam() {
if (this.aao == null) {
if (this.wo == null) {
return this.aaj();
}
return this.wo;
}
return this.aao;
}
aan() {
if (this.aap == null) {
if (this.wo == null) {
return this.aak();
}
return this.wo;
}
return this.aap;
}
aal() {
if (this.wo == null) {
return this.aai();
}
return this.wo;
}
xp() {
return 0;
}
xq() {
return this.xp();
}
xr() {
return this.xp();
}
yd() {
return NaN;
}
yg() {
return NaN;
}
yf() {
return NaN;
}
ye() {
return NaN;
}
yh() {
return NaN;
}
aaj() {
return null;
}
aak() {
return null;
}
aai() {
return null;
}
zp() {
this.xl = this.xs();
this.yb = this.yj();
this.xm = this.xt();
this.ya = this.yi();
this.xn = this.xu();
this.yc = this.yk();
this.aag = this.aam();
this.aah = this.aan();
this.aaf = this.aal();
}
get_hi() {
return this.x7;
}
get x7() {
return this.x1;
}
set x7(a) {
let b = this.x1;
this.x1 = a;
this.raisePropertyChanged("ShouldRenderAsOverlay", b, this.x1);
}
}
AnnotationLayer.$t = /*@__PURE__*/ markType(AnnotationLayer, 'AnnotationLayer', Series.$);
AnnotationLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, AnnotationLayer, 'raisePropertyChanged', ['ActualAppearanceMode:xl:zq', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualDashArray:aaf:zr', [DoubleCollection.$], 'ActualDashCap:aaq:zs', [PenLineCap_$type], 'ActualHorizontalAppearanceMode:xm:zt', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualHorizontalDashArray:aag:zu', [DoubleCollection.$], 'ActualHorizontalShiftAmount:ya:zv', [1, NaN], 'ActualShiftAmount:yb:zw', [1, NaN], 'ActualVerticalAppearanceMode:xn:zx', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'ActualVerticalDashArray:aah:zy', [DoubleCollection.$], 'ActualVerticalShiftAmount:yc:zz', [1, NaN], 'AppearanceMode:xo:z0', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'CursorPosition:aas:z1', [Point_$type, { $type: Point_$type, x: NaN, y: NaN }], 'CursorPositionUpdatesOnMove:x2:z2', [0, true], 'HorizontalAppearanceMode:xv:z3', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'HorizontalDashArray:aao:z4', [DoubleCollection.$], 'HorizontalShiftAmount:yl:z5', [1, NaN], 'IsDefaultCrosshairDisabled:x3:z6', [0, true], 'ShiftAmount:ym:z7', [1, NaN], 'UseIndex:x8:z8', [0, false], 'UseLegend:x9:z9', [0, false], 'VerticalAppearanceMode:xw:aaa', [AnnotationAppearanceMode_$type, /*@__PURE__*/ enumGetBox(AnnotationAppearanceMode_$type, 0)], 'VerticalDashArray:aap:aab', [DoubleCollection.$], 'VerticalShiftAmount:yn:aac', [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.aar = { $type: Point_$type, x: NaN, y: NaN };
this.cd.sa(true);
}
}
cg() {
this.ce = true;
if (this.f.ka != null) {
this.f.ka.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.q(a, b);
}
cm(a, b) {
if (a == null) {
return a;
}
return BrushUtil.s(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;
})();