UNPKG

igniteui-angular-charts

Version:

Ignite UI Angular charting components for building rich data visualizations for modern web apps.

150 lines (149 loc) 6.35 kB
import { Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core'; import { IgxSeriesComponent } from "./igx-series-component"; import { TrendLineType_$type } from "igniteui-angular-core"; import { IgxAnnotationLayerComponent } from "./igx-annotation-layer-component"; import { TrendLineLayer } from "./TrendLineLayer"; import { ensureEnum } from "igniteui-angular-core"; import * as i0 from "@angular/core"; /** * Represents the class of the value overlay. The value overlay is a line or circle representing a value on an axis. */ export let IgxTrendLineLayerComponent = /*@__PURE__*/ (() => { class IgxTrendLineLayerComponent extends IgxAnnotationLayerComponent { constructor() { super(); } createImplementation() { return new TrendLineLayer(); } /** * @hidden */ get i() { return this._implementation; } get isAnnotationLayer() { return this.i.ev; } get isLineOnly() { return this.i.fn; } /** * Gets or sets the series to target this annotation to. */ get targetSeries() { const r = this.i.aat; if (r == null) { return null; } if (!r.externalObject) { let e = IgxSeriesComponent._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; } set targetSeries(v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.aat = null : this.i.aat = v.i; } /** * Gets the actual series being targeted by this annotation. */ get actualTargetSeries() { const r = this.i.aas; if (r == null) { return null; } if (!r.externalObject) { let e = IgxSeriesComponent._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; } set actualTargetSeries(v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.aas = null : this.i.aas = v.i; } /** * Gets or sets the trend type for the current series object. */ get trendLineType() { return this.i.aav; } set trendLineType(v) { this.i.aav = ensureEnum(TrendLineType_$type, v); } /** * Gets or sets the trend line period for the target series. * The typical, and initial, value for trend line period is 7. */ get trendLinePeriod() { return this.i.aaw; } set trendLinePeriod(v) { this.i.aaw = +v; } get isUsableInLegend() { return this.i.isUsableInLegend; } findByName(name) { var baseResult = super.findByName(name); if (baseResult) { return baseResult; } if (this.targetSeries && this.targetSeries.name && this.targetSeries.name == name) { return this.targetSeries; } if (this.actualTargetSeries && this.actualTargetSeries.name && this.actualTargetSeries.name == name) { return this.actualTargetSeries; } return null; } _styling(container, component, parent) { super._styling(container, component, parent); this._inStyling = true; if (this.targetSeries && this.targetSeries._styling) { this.targetSeries._styling(container, component, this); } if (this.actualTargetSeries && this.actualTargetSeries._styling) { this.actualTargetSeries._styling(container, component, this); } this._inStyling = false; } onApplyTemplate() { this.i.ac(); } getManagerIdentifier() { let iv = this.i.aay(); return (iv); } } IgxTrendLineLayerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxTrendLineLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); IgxTrendLineLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxTrendLineLayerComponent, selector: "igx-trend-line-layer", inputs: { targetSeries: "targetSeries", actualTargetSeries: "actualTargetSeries", trendLineType: "trendLineType", trendLinePeriod: "trendLinePeriod" }, providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(() => IgxTrendLineLayerComponent) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxTrendLineLayerComponent) }], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); return IgxTrendLineLayerComponent; })(); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxTrendLineLayerComponent, decorators: [{ type: Component, args: [{ selector: 'igx-trend-line-layer', template: ``, providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(() => IgxTrendLineLayerComponent) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxTrendLineLayerComponent) }], changeDetection: ChangeDetectionStrategy.OnPush }] }], ctorParameters: function () { return []; }, propDecorators: { targetSeries: [{ type: Input }], actualTargetSeries: [{ type: Input }], trendLineType: [{ type: Input }], trendLinePeriod: [{ type: Input }] } });