UNPKG

igniteui-webcomponents-charts

Version:

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

199 lines (194 loc) 6.93 kB
import { IgcNumericXAxisComponent } from "./igc-numeric-x-axis-component"; import { IgcCategoryYAxisComponent } from "./igc-category-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 numeric x-axis and a category y-axis. */ export let IgcVerticalStackedSeriesBaseComponent = /*@__PURE__*/ (() => { class IgcVerticalStackedSeriesBaseComponent extends IgcStackedSeriesBaseComponent { /** * @hidden */ get i() { return this._implementation; } constructor() { super(); this._xAxisName = null; this._yAxisName = null; } connectedCallback() { if (super["connectedCallback"]) { super["connectedCallback"](); } if (this.i.connectedCallback) { this.i.connectedCallback(); } if (!this._attached) { this._attached = true; this._flushQueuedAttributes(); } } disconnectedCallback() { if (super["disconnectedCallback"]) { super["disconnectedCallback"](); } if (this.i.disconnectedCallback) { this.i.disconnectedCallback(); } if (this._attached) { this._attached = false; } } static get observedAttributes() { if (IgcVerticalStackedSeriesBaseComponent._observedAttributesIgcVerticalStackedSeriesBaseComponent == null) { let names = getAllPropertyNames(IgcVerticalStackedSeriesBaseComponent); for (let i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcVerticalStackedSeriesBaseComponent._observedAttributesIgcVerticalStackedSeriesBaseComponent = names; } return IgcVerticalStackedSeriesBaseComponent._observedAttributesIgcVerticalStackedSeriesBaseComponent; } /** * Gets or sets the effective x-axis for the current CategorySeries object. */ get xAxis() { const r = this.i.xAxis; if (r == null) { return null; } if (!r.externalObject) { let e = IgcNumericXAxisComponent._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; } set xAxis(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; } /** * Gets or sets the name to use to resolve xAxis from markup. */ get xAxisName() { return this._xAxisName; } set xAxisName(v) { this._xAxisName = v; } /** * Gets or sets the effective y-axis for the current CategorySeries object. */ get yAxis() { const r = this.i.yAxis; if (r == null) { return null; } if (!r.externalObject) { let e = IgcCategoryYAxisComponent._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; } set yAxis(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; } /** * Gets or sets the name to use to resolve yAxis from markup. */ get yAxisName() { return this._yAxisName; } set yAxisName(v) { this._yAxisName = v; } /** * Gets whether or not the current series is vertical series */ get isVertical() { return this.i.isVertical; } bindAxes(axes) { super.bindAxes(axes); for (let i = 0; i < axes.length; i++) { if (this.xAxisName && this.xAxisName.length > 0 && axes[i].name == this.xAxisName) { this.xAxis = axes[i]; } } for (let i = 0; i < axes.length; i++) { if (this.yAxisName && this.yAxisName.length > 0 && axes[i].name == this.yAxisName) { this.yAxis = axes[i]; } } } findByName(name) { var baseResult = super.findByName(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; } _styling(container, component, parent) { super._styling(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. */ getOffsetValue() { let iv = this.i.getOffsetValue(); return (iv); } /** * Returns the width of the category grouping this series is in. */ getCategoryWidth() { let iv = this.i.getCategoryWidth(); return (iv); } /** * Determine if object can be used as YAxis * @param axis * The object to check */ canUseAsYAxis(axis) { let iv = this.i.ab4(axis); return (iv); } /** * Determine if object can be used as XAxis * @param axis * The object to check */ canUseAsXAxis(axis) { let iv = this.i.ab3(axis); return (iv); } } IgcVerticalStackedSeriesBaseComponent._observedAttributesIgcVerticalStackedSeriesBaseComponent = null; return IgcVerticalStackedSeriesBaseComponent; })();