igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
258 lines (257 loc) • 12.4 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 { EventEmitter, Output, Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
import { IgxSeriesComponent } from "./igx-series-component";
import { IgxUserAnnotationCollection } from "./igx-user-annotation-collection";
import { IgxUserAnnotationInformationEventArgs } from "./igx-user-annotation-information-event-args";
import { IgxUserAxisAnnotationStylingEventArgs } from "./igx-user-axis-annotation-styling-event-args";
import { IgxUserSliceAnnotationStylingEventArgs } from "./igx-user-slice-annotation-styling-event-args";
import { IgxUserStripAnnotationStylingEventArgs } from "./igx-user-strip-annotation-styling-event-args";
import { IgxUserPointAnnotationStylingEventArgs } from "./igx-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-angular-core";
import * as i0 from "@angular/core";
/**
* Represents an user annotation layer that can define UserPointAnnotation, UserSliceAnnotation, UserStripAnnotation
*/
export let IgxUserAnnotationLayerComponent = /*@__PURE__*/ (() => {
class IgxUserAnnotationLayerComponent extends IgxSeriesComponent {
constructor() {
super();
this._annotations = null;
this._userAnnotationInformationRequested = null;
this._stylingAxisAnnotation = null;
this._stylingSliceAnnotation = null;
this._stylingStripAnnotation = null;
this._stylingPointAnnotation = null;
}
createImplementation() {
return new UserAnnotationLayer();
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
/**
* Gets user annotations
*/
get annotations() {
if (this._annotations === null) {
let coll = new IgxUserAnnotationCollection();
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 IgxUserAnnotationCollection();
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.y5(jsonString);
}
saveAnnotationsToJson() {
let iv = this.i.yo();
return (iv);
}
cancelAnnotationFlow(annotationFlowID) {
this.i.yv(annotationFlowID);
}
finishAnnotationFlow(info) {
this.i.y3((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() {
if (this._userAnnotationInformationRequested == null) {
this._userAnnotationInformationRequested = new EventEmitter();
this.i.userAnnotationInformationRequested = delegateCombine(this.i.userAnnotationInformationRequested, (o, e) => {
this._runInZone(() => {
let outerArgs = new IgxUserAnnotationInformationEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeUserAnnotationInformationRequested) {
this.beforeUserAnnotationInformationRequested(this, outerArgs);
}
this._userAnnotationInformationRequested.emit({
sender: this,
args: outerArgs
});
});
});
}
return this._userAnnotationInformationRequested;
}
/**
* Event raised when updating style of UserAxisAnnotation
*/
get stylingAxisAnnotation() {
if (this._stylingAxisAnnotation == null) {
this._stylingAxisAnnotation = new EventEmitter();
this.i.stylingAxisAnnotation = delegateCombine(this.i.stylingAxisAnnotation, (o, e) => {
this._runInZone(() => {
let outerArgs = new IgxUserAxisAnnotationStylingEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeStylingAxisAnnotation) {
this.beforeStylingAxisAnnotation(this, outerArgs);
}
this._stylingAxisAnnotation.emit({
sender: this,
args: outerArgs
});
});
});
}
return this._stylingAxisAnnotation;
}
/**
* Event raised when updating style of UserSliceAnnotation
*/
get stylingSliceAnnotation() {
if (this._stylingSliceAnnotation == null) {
this._stylingSliceAnnotation = new EventEmitter();
this.i.stylingSliceAnnotation = delegateCombine(this.i.stylingSliceAnnotation, (o, e) => {
this._runInZone(() => {
let outerArgs = new IgxUserSliceAnnotationStylingEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeStylingSliceAnnotation) {
this.beforeStylingSliceAnnotation(this, outerArgs);
}
this._stylingSliceAnnotation.emit({
sender: this,
args: outerArgs
});
});
});
}
return this._stylingSliceAnnotation;
}
/**
* Event raised when updating style of UserStripAnnotation
*/
get stylingStripAnnotation() {
if (this._stylingStripAnnotation == null) {
this._stylingStripAnnotation = new EventEmitter();
this.i.stylingStripAnnotation = delegateCombine(this.i.stylingStripAnnotation, (o, e) => {
this._runInZone(() => {
let outerArgs = new IgxUserStripAnnotationStylingEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeStylingStripAnnotation) {
this.beforeStylingStripAnnotation(this, outerArgs);
}
this._stylingStripAnnotation.emit({
sender: this,
args: outerArgs
});
});
});
}
return this._stylingStripAnnotation;
}
/**
* Event raised when updating style of UserPointAnnotation
*/
get stylingPointAnnotation() {
if (this._stylingPointAnnotation == null) {
this._stylingPointAnnotation = new EventEmitter();
this.i.stylingPointAnnotation = delegateCombine(this.i.stylingPointAnnotation, (o, e) => {
this._runInZone(() => {
let outerArgs = new IgxUserPointAnnotationStylingEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeStylingPointAnnotation) {
this.beforeStylingPointAnnotation(this, outerArgs);
}
this._stylingPointAnnotation.emit({
sender: this,
args: outerArgs
});
});
});
}
return this._stylingPointAnnotation;
}
}
IgxUserAnnotationLayerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxUserAnnotationLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
IgxUserAnnotationLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxUserAnnotationLayerComponent, selector: "igx-user-annotation-layer", inputs: { annotations: "annotations" }, outputs: { userAnnotationInformationRequested: "userAnnotationInformationRequested", stylingAxisAnnotation: "stylingAxisAnnotation", stylingSliceAnnotation: "stylingSliceAnnotation", stylingStripAnnotation: "stylingStripAnnotation", stylingPointAnnotation: "stylingPointAnnotation" }, providers: [{ provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxUserAnnotationLayerComponent) }], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
return IgxUserAnnotationLayerComponent;
})();
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxUserAnnotationLayerComponent, decorators: [{
type: Component,
args: [{
selector: 'igx-user-annotation-layer',
template: ``,
providers: [{ provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxUserAnnotationLayerComponent) }],
changeDetection: ChangeDetectionStrategy.OnPush
}]
}], ctorParameters: function () { return []; }, propDecorators: { annotations: [{
type: Input
}], userAnnotationInformationRequested: [{
type: Output
}], stylingAxisAnnotation: [{
type: Output
}], stylingSliceAnnotation: [{
type: Output
}], stylingStripAnnotation: [{
type: Output
}], stylingPointAnnotation: [{
type: Output
}] } });