igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
255 lines (254 loc) • 10.8 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 { delegateCombine, delegateRemove } from "igniteui-react-core";
import { IgrSeries } from "./igr-series";
import { IgrUserAnnotationCollection } from "./igr-user-annotation-collection";
import { IgrUserAnnotationInformationEventArgs } from "./igr-user-annotation-information-event-args";
import { IgrUserAxisAnnotationStylingEventArgs } from "./igr-user-axis-annotation-styling-event-args";
import { IgrUserSliceAnnotationStylingEventArgs } from "./igr-user-slice-annotation-styling-event-args";
import { IgrUserStripAnnotationStylingEventArgs } from "./igr-user-strip-annotation-styling-event-args";
import { IgrUserPointAnnotationStylingEventArgs } from "./igr-user-point-annotation-styling-event-args";
import { UserAnnotationLayer } from "./UserAnnotationLayer";
import { UserAnnotationCollection as UserAnnotationCollection_internal } from "./UserAnnotationCollection";
import { UserBaseAnnotation } from "./UserBaseAnnotation";
import { SyncableObservableCollection$1 } from "igniteui-react-core";
/**
* Represents an user annotation layer that can define UserPointAnnotation, UserSliceAnnotation, UserStripAnnotation
*/
export class IgrUserAnnotationLayer extends IgrSeries {
createImplementation() {
return new UserAnnotationLayer();
}
constructor(props) {
super(props);
this._annotations = null;
this._userAnnotationInformationRequested = null;
this._userAnnotationInformationRequested_wrapped = null;
this._stylingAxisAnnotation = null;
this._stylingAxisAnnotation_wrapped = null;
this._stylingSliceAnnotation = null;
this._stylingSliceAnnotation_wrapped = null;
this._stylingStripAnnotation = null;
this._stylingStripAnnotation_wrapped = null;
this._stylingPointAnnotation = null;
this._stylingPointAnnotation_wrapped = null;
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
/**
* Gets user annotations
*/
get annotations() {
if (this._annotations === null) {
let coll = new IgrUserAnnotationCollection();
let innerColl = this.i.annotations;
if (!innerColl) {
innerColl = new UserAnnotationCollection_internal();
}
this._annotations = coll._fromInner(innerColl);
}
return this._annotations;
}
set annotations(v) {
if (this._annotations !== null) {
this._annotations._setSyncTarget(null);
this._annotations = null;
}
let coll = new IgrUserAnnotationCollection();
this._annotations = coll._fromOuter(v);
let syncColl = new SyncableObservableCollection$1(UserBaseAnnotation.$type);
let innerColl = this.i.annotations;
if (!innerColl) {
innerColl = new UserAnnotationCollection_internal();
}
syncColl._inner = innerColl;
syncColl.clear();
this._annotations._setSyncTarget(syncColl);
}
get isAnnotationLayer() {
return this.i.ev;
}
get isUserAnnotationLayer() {
return this.i.f9;
}
/**
* Gets if the series should appear in any legends.
*/
get isUsableInLegend() {
return this.i.isUsableInLegend;
}
findByName(name) {
var baseResult = super.findByName(name);
if (baseResult) {
return baseResult;
}
if (this.annotations != null && this.annotations.findByName && this.annotations.findByName(name)) {
return this.annotations.findByName(name);
}
return null;
}
loadAnnotationsFromJson(jsonString) {
this.i.y6(jsonString);
}
saveAnnotationsToJson() {
let iv = this.i.yp();
return (iv);
}
cancelAnnotationFlow(annotationFlowID) {
this.i.yw(annotationFlowID);
}
finishAnnotationFlow(info) {
this.i.y4((info == null ? null : info.i));
}
bindAxes(axes) {
super.bindAxes(axes);
if (this.annotations) {
for (var i = 0; i < this.annotations.count; i++) {
this.annotations[i].bindAxes(axes);
}
}
}
bindSeries(series) {
super.bindSeries(series);
if (this.annotations) {
for (var i = 0; i < this.annotations.count; i++) {
this.annotations[i].bindSeries(series);
}
}
}
get userAnnotationInformationRequested() {
return this._userAnnotationInformationRequested;
}
set userAnnotationInformationRequested(ev) {
if (this._userAnnotationInformationRequested_wrapped !== null) {
this.i.userAnnotationInformationRequested = delegateRemove(this.i.userAnnotationInformationRequested, this._userAnnotationInformationRequested_wrapped);
this._userAnnotationInformationRequested_wrapped = null;
this._userAnnotationInformationRequested = null;
}
this._userAnnotationInformationRequested = ev;
this._userAnnotationInformationRequested_wrapped = (o, e) => {
let outerArgs = new IgrUserAnnotationInformationEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeUserAnnotationInformationRequested) {
this.beforeUserAnnotationInformationRequested(this, outerArgs);
}
if (this._userAnnotationInformationRequested) {
this._userAnnotationInformationRequested(this, outerArgs);
}
};
this.i.userAnnotationInformationRequested = delegateCombine(this.i.userAnnotationInformationRequested, this._userAnnotationInformationRequested_wrapped);
;
}
/**
* Event raised when updating style of UserAxisAnnotation
*/
get stylingAxisAnnotation() {
return this._stylingAxisAnnotation;
}
set stylingAxisAnnotation(ev) {
if (this._stylingAxisAnnotation_wrapped !== null) {
this.i.stylingAxisAnnotation = delegateRemove(this.i.stylingAxisAnnotation, this._stylingAxisAnnotation_wrapped);
this._stylingAxisAnnotation_wrapped = null;
this._stylingAxisAnnotation = null;
}
this._stylingAxisAnnotation = ev;
this._stylingAxisAnnotation_wrapped = (o, e) => {
let outerArgs = new IgrUserAxisAnnotationStylingEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeStylingAxisAnnotation) {
this.beforeStylingAxisAnnotation(this, outerArgs);
}
if (this._stylingAxisAnnotation) {
this._stylingAxisAnnotation(this, outerArgs);
}
};
this.i.stylingAxisAnnotation = delegateCombine(this.i.stylingAxisAnnotation, this._stylingAxisAnnotation_wrapped);
;
}
/**
* Event raised when updating style of UserSliceAnnotation
*/
get stylingSliceAnnotation() {
return this._stylingSliceAnnotation;
}
set stylingSliceAnnotation(ev) {
if (this._stylingSliceAnnotation_wrapped !== null) {
this.i.stylingSliceAnnotation = delegateRemove(this.i.stylingSliceAnnotation, this._stylingSliceAnnotation_wrapped);
this._stylingSliceAnnotation_wrapped = null;
this._stylingSliceAnnotation = null;
}
this._stylingSliceAnnotation = ev;
this._stylingSliceAnnotation_wrapped = (o, e) => {
let outerArgs = new IgrUserSliceAnnotationStylingEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeStylingSliceAnnotation) {
this.beforeStylingSliceAnnotation(this, outerArgs);
}
if (this._stylingSliceAnnotation) {
this._stylingSliceAnnotation(this, outerArgs);
}
};
this.i.stylingSliceAnnotation = delegateCombine(this.i.stylingSliceAnnotation, this._stylingSliceAnnotation_wrapped);
;
}
/**
* Event raised when updating style of UserStripAnnotation
*/
get stylingStripAnnotation() {
return this._stylingStripAnnotation;
}
set stylingStripAnnotation(ev) {
if (this._stylingStripAnnotation_wrapped !== null) {
this.i.stylingStripAnnotation = delegateRemove(this.i.stylingStripAnnotation, this._stylingStripAnnotation_wrapped);
this._stylingStripAnnotation_wrapped = null;
this._stylingStripAnnotation = null;
}
this._stylingStripAnnotation = ev;
this._stylingStripAnnotation_wrapped = (o, e) => {
let outerArgs = new IgrUserStripAnnotationStylingEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeStylingStripAnnotation) {
this.beforeStylingStripAnnotation(this, outerArgs);
}
if (this._stylingStripAnnotation) {
this._stylingStripAnnotation(this, outerArgs);
}
};
this.i.stylingStripAnnotation = delegateCombine(this.i.stylingStripAnnotation, this._stylingStripAnnotation_wrapped);
;
}
/**
* Event raised when updating style of UserPointAnnotation
*/
get stylingPointAnnotation() {
return this._stylingPointAnnotation;
}
set stylingPointAnnotation(ev) {
if (this._stylingPointAnnotation_wrapped !== null) {
this.i.stylingPointAnnotation = delegateRemove(this.i.stylingPointAnnotation, this._stylingPointAnnotation_wrapped);
this._stylingPointAnnotation_wrapped = null;
this._stylingPointAnnotation = null;
}
this._stylingPointAnnotation = ev;
this._stylingPointAnnotation_wrapped = (o, e) => {
let outerArgs = new IgrUserPointAnnotationStylingEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeStylingPointAnnotation) {
this.beforeStylingPointAnnotation(this, outerArgs);
}
if (this._stylingPointAnnotation) {
this._stylingPointAnnotation(this, outerArgs);
}
};
this.i.stylingPointAnnotation = delegateCombine(this.i.stylingPointAnnotation, this._stylingPointAnnotation_wrapped);
;
}
}