UNPKG

igniteui-webcomponents-charts

Version:

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

232 lines (227 loc) 8.58 kB
import { __extends } from "tslib"; import { IgcCategoryAxisBaseComponent } from "./igc-category-axis-base-component"; import { IgcNumericYAxisComponent } from "./igc-numeric-y-axis-component"; import { IgcStackedSeriesBaseComponent } from "./igc-stacked-series-base-component"; import { getAllPropertyNames, toSpinal } from "igniteui-webcomponents-core"; /** * Base class for stacked series with a category x-axis and a numeric y-axis. */ export var IgcHorizontalStackedSeriesBaseComponent = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgcHorizontalStackedSeriesBaseComponent, _super); function IgcHorizontalStackedSeriesBaseComponent() { var _this = _super.call(this) || this; _this._xAxisName = null; _this._yAxisName = null; return _this; } Object.defineProperty(IgcHorizontalStackedSeriesBaseComponent.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); IgcHorizontalStackedSeriesBaseComponent.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(); } }; IgcHorizontalStackedSeriesBaseComponent.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(IgcHorizontalStackedSeriesBaseComponent, "observedAttributes", { get: function () { if (IgcHorizontalStackedSeriesBaseComponent._observedAttributesIgcHorizontalStackedSeriesBaseComponent == null) { var names = getAllPropertyNames(IgcHorizontalStackedSeriesBaseComponent); for (var i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcHorizontalStackedSeriesBaseComponent._observedAttributesIgcHorizontalStackedSeriesBaseComponent = names; } return IgcHorizontalStackedSeriesBaseComponent._observedAttributesIgcHorizontalStackedSeriesBaseComponent; }, enumerable: false, configurable: true }); Object.defineProperty(IgcHorizontalStackedSeriesBaseComponent.prototype, "xAxis", { /** * Gets or sets the effective x-axis for this series. */ get: function () { var r = this.i.xAxis; if (r == null) { return null; } if (!r.externalObject) { var e = IgcCategoryAxisBaseComponent._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.xAxis = null : this.i.xAxis = v.i; }, enumerable: false, configurable: true }); Object.defineProperty(IgcHorizontalStackedSeriesBaseComponent.prototype, "xAxisName", { /** * Gets or sets the name to use to resolve xAxis from markup. */ get: function () { return this._xAxisName; }, set: function (v) { this._xAxisName = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgcHorizontalStackedSeriesBaseComponent.prototype, "hasValueAxis", { get: function () { return this.i.em; }, enumerable: false, configurable: true }); Object.defineProperty(IgcHorizontalStackedSeriesBaseComponent.prototype, "isValueAxisInverted", { get: function () { return this.i.gb; }, enumerable: false, configurable: true }); Object.defineProperty(IgcHorizontalStackedSeriesBaseComponent.prototype, "yAxis", { /** * Gets or sets the effective y-axis for this series. */ get: function () { var r = this.i.yAxis; if (r == null) { return null; } if (!r.externalObject) { var e = IgcNumericYAxisComponent._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.yAxis = null : this.i.yAxis = v.i; }, enumerable: false, configurable: true }); Object.defineProperty(IgcHorizontalStackedSeriesBaseComponent.prototype, "yAxisName", { /** * Gets or sets the name to use to resolve yAxis from markup. */ get: function () { return this._yAxisName; }, set: function (v) { this._yAxisName = v; }, enumerable: false, configurable: true }); IgcHorizontalStackedSeriesBaseComponent.prototype.bindAxes = function (axes) { _super.prototype.bindAxes.call(this, axes); for (var i = 0; i < axes.length; i++) { if (this.xAxisName && this.xAxisName.length > 0 && axes[i].name == this.xAxisName) { this.xAxis = axes[i]; } } for (var i = 0; i < axes.length; i++) { if (this.yAxisName && this.yAxisName.length > 0 && axes[i].name == this.yAxisName) { this.yAxis = axes[i]; } } }; IgcHorizontalStackedSeriesBaseComponent.prototype.findByName = function (name) { var baseResult = _super.prototype.findByName.call(this, name); if (baseResult) { return baseResult; } if (this.xAxis && this.xAxis.name && this.xAxis.name == name) { return this.xAxis; } if (this.yAxis && this.yAxis.name && this.yAxis.name == name) { return this.yAxis; } return null; }; IgcHorizontalStackedSeriesBaseComponent.prototype._styling = function (container, component, parent) { _super.prototype._styling.call(this, container, component, parent); this._inStyling = true; if (this.xAxis && this.xAxis._styling) { this.xAxis._styling(container, component, this); } if (this.yAxis && this.yAxis._styling) { this.yAxis._styling(container, component, this); } this._inStyling = false; }; /** * Returns the offset value for this series if grouped on a category axis. */ IgcHorizontalStackedSeriesBaseComponent.prototype.getOffsetValue = function () { var iv = this.i.getOffsetValue(); return (iv); }; /** * Returns the width of the category grouping this series is in. */ IgcHorizontalStackedSeriesBaseComponent.prototype.getCategoryWidth = function () { var iv = this.i.getCategoryWidth(); return (iv); }; /** * Determine if object can be used as YAxis * @param axis * The object to check */ IgcHorizontalStackedSeriesBaseComponent.prototype.canUseAsYAxis = function (axis) { var iv = this.i.ack(axis); return (iv); }; /** * Determine if object can be used as XAxis * @param axis * The object to check */ IgcHorizontalStackedSeriesBaseComponent.prototype.canUseAsXAxis = function (axis) { var iv = this.i.acj(axis); return (iv); }; IgcHorizontalStackedSeriesBaseComponent._observedAttributesIgcHorizontalStackedSeriesBaseComponent = null; return IgcHorizontalStackedSeriesBaseComponent; }(IgcStackedSeriesBaseComponent));