igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
305 lines (304 loc) • 13.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 { __extends } from "tslib";
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
*/
var IgrUserAnnotationLayer = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgrUserAnnotationLayer, _super);
function IgrUserAnnotationLayer(props) {
var _this = _super.call(this, props) || this;
_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;
return _this;
}
IgrUserAnnotationLayer.prototype.createImplementation = function () {
return new UserAnnotationLayer();
};
Object.defineProperty(IgrUserAnnotationLayer.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrUserAnnotationLayer.prototype, "annotations", {
/**
* Gets user annotations
*/
get: function () {
if (this._annotations === null) {
var coll = new IgrUserAnnotationCollection();
var innerColl = this.i.annotations;
if (!innerColl) {
innerColl = new UserAnnotationCollection_internal();
}
this._annotations = coll._fromInner(innerColl);
}
return this._annotations;
},
set: function (v) {
if (this._annotations !== null) {
this._annotations._setSyncTarget(null);
this._annotations = null;
}
var coll = new IgrUserAnnotationCollection();
this._annotations = coll._fromOuter(v);
var syncColl = new SyncableObservableCollection$1(UserBaseAnnotation.$type);
var innerColl = this.i.annotations;
if (!innerColl) {
innerColl = new UserAnnotationCollection_internal();
}
syncColl._inner = innerColl;
syncColl.clear();
this._annotations._setSyncTarget(syncColl);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrUserAnnotationLayer.prototype, "isAnnotationLayer", {
get: function () {
return this.i.ev;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrUserAnnotationLayer.prototype, "isUserAnnotationLayer", {
get: function () {
return this.i.f9;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrUserAnnotationLayer.prototype, "isUsableInLegend", {
/**
* Gets if the series should appear in any legends.
*/
get: function () {
return this.i.isUsableInLegend;
},
enumerable: false,
configurable: true
});
IgrUserAnnotationLayer.prototype.findByName = function (name) {
var baseResult = _super.prototype.findByName.call(this, name);
if (baseResult) {
return baseResult;
}
if (this.annotations != null && this.annotations.findByName && this.annotations.findByName(name)) {
return this.annotations.findByName(name);
}
return null;
};
IgrUserAnnotationLayer.prototype.loadAnnotationsFromJson = function (jsonString) {
this.i.y6(jsonString);
};
IgrUserAnnotationLayer.prototype.saveAnnotationsToJson = function () {
var iv = this.i.yp();
return (iv);
};
IgrUserAnnotationLayer.prototype.cancelAnnotationFlow = function (annotationFlowID) {
this.i.yw(annotationFlowID);
};
IgrUserAnnotationLayer.prototype.finishAnnotationFlow = function (info) {
this.i.y4((info == null ? null : info.i));
};
IgrUserAnnotationLayer.prototype.bindAxes = function (axes) {
_super.prototype.bindAxes.call(this, axes);
if (this.annotations) {
for (var i = 0; i < this.annotations.count; i++) {
this.annotations[i].bindAxes(axes);
}
}
};
IgrUserAnnotationLayer.prototype.bindSeries = function (series) {
_super.prototype.bindSeries.call(this, series);
if (this.annotations) {
for (var i = 0; i < this.annotations.count; i++) {
this.annotations[i].bindSeries(series);
}
}
};
Object.defineProperty(IgrUserAnnotationLayer.prototype, "userAnnotationInformationRequested", {
get: function () {
return this._userAnnotationInformationRequested;
},
set: function (ev) {
var _this = this;
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 = function (o, e) {
var 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);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrUserAnnotationLayer.prototype, "stylingAxisAnnotation", {
/**
* Event raised when updating style of UserAxisAnnotation
*/
get: function () {
return this._stylingAxisAnnotation;
},
set: function (ev) {
var _this = this;
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 = function (o, e) {
var 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);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrUserAnnotationLayer.prototype, "stylingSliceAnnotation", {
/**
* Event raised when updating style of UserSliceAnnotation
*/
get: function () {
return this._stylingSliceAnnotation;
},
set: function (ev) {
var _this = this;
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 = function (o, e) {
var 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);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrUserAnnotationLayer.prototype, "stylingStripAnnotation", {
/**
* Event raised when updating style of UserStripAnnotation
*/
get: function () {
return this._stylingStripAnnotation;
},
set: function (ev) {
var _this = this;
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 = function (o, e) {
var 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);
;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrUserAnnotationLayer.prototype, "stylingPointAnnotation", {
/**
* Event raised when updating style of UserPointAnnotation
*/
get: function () {
return this._stylingPointAnnotation;
},
set: function (ev) {
var _this = this;
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 = function (o, e) {
var 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);
;
},
enumerable: false,
configurable: true
});
return IgrUserAnnotationLayer;
}(IgrSeries));
export { IgrUserAnnotationLayer };