UNPKG

igniteui-webcomponents-charts

Version:

Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.

234 lines (233 loc) 8.98 kB
import { __extends } from "tslib"; import { IgcSeriesComponent } from "./igc-series-component"; import { TrendLineType_$type } from "igniteui-webcomponents-core"; import { IgcAnnotationLayerComponent } from "./igc-annotation-layer-component"; import { TrendLineLayer } from "./TrendLineLayer"; import { getAllPropertyNames, toSpinal, ensureEnum, enumToString } from "igniteui-webcomponents-core"; import { RegisterElementHelper } from "igniteui-webcomponents-core"; /** * Represents the class of the value overlay. The value overlay is a line or circle representing a value on an axis. */ export var IgcTrendLineLayerComponent = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgcTrendLineLayerComponent, _super); function IgcTrendLineLayerComponent() { var _this = _super.call(this) || this; _this._targetSeriesName = null; return _this; } IgcTrendLineLayerComponent.prototype.createImplementation = function () { return new TrendLineLayer(); }; Object.defineProperty(IgcTrendLineLayerComponent.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); IgcTrendLineLayerComponent.prototype.connectedCallback = function () { if (_super.prototype["connectedCallback"]) { _super.prototype["connectedCallback"].call(this); } if (this.i.connectedCallback) { this.i.connectedCallback(); } if (!this._attached) { this._attached = true; this._flushQueuedAttributes(); } }; IgcTrendLineLayerComponent.prototype.disconnectedCallback = function () { if (_super.prototype["disconnectedCallback"]) { _super.prototype["disconnectedCallback"].call(this); } if (this.i.disconnectedCallback) { this.i.disconnectedCallback(); } if (this._attached) { this._attached = false; } }; Object.defineProperty(IgcTrendLineLayerComponent, "observedAttributes", { get: function () { if (IgcTrendLineLayerComponent._observedAttributesIgcTrendLineLayerComponent == null) { var names = getAllPropertyNames(IgcTrendLineLayerComponent); for (var i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcTrendLineLayerComponent._observedAttributesIgcTrendLineLayerComponent = names; } return IgcTrendLineLayerComponent._observedAttributesIgcTrendLineLayerComponent; }, enumerable: false, configurable: true }); IgcTrendLineLayerComponent.register = function () { if (!IgcTrendLineLayerComponent._isElementRegistered) { IgcTrendLineLayerComponent._isElementRegistered = true; RegisterElementHelper.registerElement(IgcTrendLineLayerComponent.htmlTagName, IgcTrendLineLayerComponent); } }; Object.defineProperty(IgcTrendLineLayerComponent.prototype, "isAnnotationLayer", { get: function () { return this.i.ev; }, enumerable: false, configurable: true }); Object.defineProperty(IgcTrendLineLayerComponent.prototype, "isLineOnly", { get: function () { return this.i.fn; }, enumerable: false, configurable: true }); Object.defineProperty(IgcTrendLineLayerComponent.prototype, "targetSeries", { /** * Gets or sets the series to target this annotation to. */ get: function () { var r = this.i.aat; if (r == null) { return null; } if (!r.externalObject) { var e = IgcSeriesComponent._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; }, set: function (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; }, enumerable: false, configurable: true }); Object.defineProperty(IgcTrendLineLayerComponent.prototype, "targetSeriesName", { /** * Gets or sets the name to use to resolve targetSeries from markup. */ get: function () { return this._targetSeriesName; }, set: function (v) { this._targetSeriesName = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgcTrendLineLayerComponent.prototype, "actualTargetSeries", { /** * Gets the actual series being targeted by this annotation. */ get: function () { var r = this.i.aas; if (r == null) { return null; } if (!r.externalObject) { var e = IgcSeriesComponent._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; }, set: function (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; }, enumerable: false, configurable: true }); Object.defineProperty(IgcTrendLineLayerComponent.prototype, "trendLineType", { /** * Gets or sets the trend type for the current series object. */ get: function () { return this.i.aav; }, set: function (v) { this.i.aav = ensureEnum(TrendLineType_$type, v); this._a("trendLineType", enumToString(TrendLineType_$type, this.i.aav)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcTrendLineLayerComponent.prototype, "trendLinePeriod", { /** * Gets or sets the trend line period for the target series. * The typical, and initial, value for trend line period is 7. */ get: function () { return this.i.aaw; }, set: function (v) { this.i.aaw = +v; this._a("trendLinePeriod", this.i.aaw); }, enumerable: false, configurable: true }); Object.defineProperty(IgcTrendLineLayerComponent.prototype, "isUsableInLegend", { get: function () { return this.i.isUsableInLegend; }, enumerable: false, configurable: true }); IgcTrendLineLayerComponent.prototype.bindSeries = function (series) { _super.prototype.bindSeries.call(this, series); for (var i = 0; i < series.length; i++) { if (this.targetSeriesName && this.targetSeriesName.length > 0 && series[i].name == this.targetSeriesName) { this.targetSeries = series[i]; } } }; IgcTrendLineLayerComponent.prototype.findByName = function (name) { var baseResult = _super.prototype.findByName.call(this, 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; }; IgcTrendLineLayerComponent.prototype._styling = function (container, component, parent) { _super.prototype._styling.call(this, 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; }; IgcTrendLineLayerComponent.prototype.onApplyTemplate = function () { this.i.ac(); }; IgcTrendLineLayerComponent.prototype.getManagerIdentifier = function () { var iv = this.i.aay(); return (iv); }; IgcTrendLineLayerComponent._observedAttributesIgcTrendLineLayerComponent = null; IgcTrendLineLayerComponent.htmlTagName = "igc-trend-line-layer"; IgcTrendLineLayerComponent._isElementRegistered = false; return IgcTrendLineLayerComponent; }(IgcAnnotationLayerComponent));