igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
180 lines (179 loc) • 7.26 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 { DataAnnotationPointLayer } from "./DataAnnotationPointLayer";
import { DependencyProperty } from "igniteui-react-core";
import { typeCast, markType, markDep } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { DataAnnotationInfo } from "./DataAnnotationInfo";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { isNaN_ } from "igniteui-react-core";
/**
* @hidden
*/
export let DataAnnotationBandLayer = /*@__PURE__*/ (() => {
class DataAnnotationBandLayer extends DataAnnotationPointLayer {
constructor() {
super();
this.ak7 = null;
this.ab = DataAnnotationBandLayer.$;
}
bk() {
return new DataAnnotationBandLayer();
}
afp(a) {
if (!this.adv(a)) {
return;
}
let b = this.ad5._inner[a];
b.c = new List$1(DataAnnotationInfo.$, 0);
b.b = new List$1(DataAnnotationInfo.$, 0);
b.centerLabelX = this.aet(a, this.ail);
b.centerLabelY = this.aet(a, this.aim);
b.startLabelX = this.aet(a, this.air);
b.startLabelY = this.aet(a, this.ais);
b.endLabelX = this.aet(a, this.ain);
b.endLabelY = this.aet(a, this.aio);
b.shapeStartX = this.aea(a, this.ait, this.ade);
b.shapeStartY = this.aea(a, this.aiu, this.adf);
b.shapeEndX = this.aea(a, this.aip, this.ade);
b.shapeEndY = this.aea(a, this.aiq, this.adf);
let c = this.aea(a, this.ak8, this.adf);
if (isNaN_(c)) {
c = this.adx ? 0.2 : 20;
}
let d = c / 2;
if (isNaN_(b.shapeStartX)) {
b.shapeStartX = b.shapeEndX;
}
if (isNaN_(b.shapeStartY)) {
b.shapeStartY = b.shapeEndY;
}
if (isNaN_(b.shapeEndX)) {
b.shapeEndX = b.shapeStartX;
}
if (isNaN_(b.shapeEndY)) {
b.shapeEndY = b.shapeStartY;
}
b.shapeCenterX = b.shapeStartX + ((b.shapeEndX - b.shapeStartX) / 2);
b.shapeCenterY = b.shapeStartY + ((b.shapeEndY - b.shapeStartY) / 2);
b.c.add(((() => {
let $ret = new DataAnnotationInfo();
$ret.q = b.ab.x;
$ret.r = b.ab.y + d;
return $ret;
})()));
b.c.add(((() => {
let $ret = new DataAnnotationInfo();
$ret.q = b.ab.x;
$ret.r = b.ab.y - d;
return $ret;
})()));
b.c.add(((() => {
let $ret = new DataAnnotationInfo();
$ret.q = b.aa.x;
$ret.r = b.aa.y - d;
return $ret;
})()));
b.c.add(((() => {
let $ret = new DataAnnotationInfo();
$ret.q = b.aa.x;
$ret.r = b.aa.y + d;
return $ret;
})()));
let e = this.aav != null && this.aav != this.ade;
let f = this.aav != null && this.aav != this.adf;
b.b.add(((() => {
let $ret = new DataAnnotationInfo();
$ret.isStartLabel = true;
$ret.textColor = this.ahm;
$ret.background = this.ahk;
$ret.borderColor = this.ahl;
$ret.q = b.ab.x;
$ret.r = b.ab.y;
$ret.dataLabelX = b.startLabelX;
$ret.dataLabelY = b.startLabelY;
$ret.dataValueX = b.ab.x;
$ret.dataValueY = b.ab.y;
$ret.a = this.ahs(this.aht, e);
$ret.b = this.ahs(this.ahu, f);
return $ret;
})()));
b.b.add(((() => {
let $ret = new DataAnnotationInfo();
$ret.isEndLabel = true;
$ret.textColor = this.ahj;
$ret.background = this.ahh;
$ret.borderColor = this.ahi;
$ret.q = b.aa.x;
$ret.r = b.aa.y;
$ret.dataLabelX = b.endLabelX;
$ret.dataLabelY = b.endLabelY;
$ret.dataValueX = b.aa.x;
$ret.dataValueY = b.aa.y;
$ret.a = this.ahs(this.ahp, e);
$ret.b = this.ahs(this.ahq, f);
return $ret;
})()));
let g = this.ahr(this.ahn, e, b.centerLabelX);
let h = this.ahr(this.aho, f, b.centerLabelY);
b.b.add(((() => {
let $ret = new DataAnnotationInfo();
$ret.isCenterLabel = true;
$ret.textColor = this.ahg;
$ret.background = this.ahe;
$ret.borderColor = this.ahf;
$ret.q = b.z.x;
$ret.r = b.z.y;
$ret.dataLabelX = b.centerLabelX;
$ret.dataLabelY = b.centerLabelY;
$ret.dataValueX = b.z.x;
$ret.dataValueY = b.z.y;
$ret.a = g;
$ret.b = h;
return $ret;
})()));
}
rq(a, b, c, d) {
super.rq(a, b, c, d);
switch (b) {
case "BreadthAnnotationColumn":
this.aca();
break;
case DataAnnotationBandLayer.$$p[0]:
if (this.dp != null) {
this.dp.deregisterColumn(this.ak8);
this.ak8 = this.dl(this.ak9);
}
break;
}
}
afr(a, b) {
super.afr(a, b);
if (typeCast(IFastItemsSource_$type, a) != null) {
a.deregisterColumn(this.ak8);
this.ak8 = null;
}
if (typeCast(IFastItemsSource_$type, b) != null) {
this.ak8 = this.dl(this.ak9);
}
}
get ak8() {
return this.ak7;
}
set ak8(a) {
if (this.ak7 != a) {
let b = this.ak7;
this.ak7 = a;
this.raisePropertyChanged("BreadthAnnotationColumn", b, this.ak7);
}
}
}
DataAnnotationBandLayer.$t = /*@__PURE__*/ markType(DataAnnotationBandLayer, 'DataAnnotationBandLayer', DataAnnotationPointLayer.$);
DataAnnotationBandLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, DataAnnotationBandLayer, 'raisePropertyChanged', ['AnnotationBreadthMemberPath:ak9:alc', [2, null]]);
return DataAnnotationBandLayer;
})();