igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
229 lines (224 loc) • 8.46 kB
JavaScript
import { __extends } from "tslib";
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.
*/
var IgcVerticalStackedSeriesBaseComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgcVerticalStackedSeriesBaseComponent, _super);
function IgcVerticalStackedSeriesBaseComponent() {
var _this = _super.call(this) || this;
_this._xAxisName = null;
_this._yAxisName = null;
return _this;
}
Object.defineProperty(IgcVerticalStackedSeriesBaseComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgcVerticalStackedSeriesBaseComponent.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();
}
};
IgcVerticalStackedSeriesBaseComponent.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(IgcVerticalStackedSeriesBaseComponent, "observedAttributes", {
get: function () {
if (IgcVerticalStackedSeriesBaseComponent._observedAttributesIgcVerticalStackedSeriesBaseComponent == null) {
var names = getAllPropertyNames(IgcVerticalStackedSeriesBaseComponent);
for (var i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcVerticalStackedSeriesBaseComponent._observedAttributesIgcVerticalStackedSeriesBaseComponent = names;
}
return IgcVerticalStackedSeriesBaseComponent._observedAttributesIgcVerticalStackedSeriesBaseComponent;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcVerticalStackedSeriesBaseComponent.prototype, "xAxis", {
/**
* Gets or sets the effective x-axis for the current CategorySeries object.
*/
get: function () {
var r = this.i.xAxis;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = IgcNumericXAxisComponent._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(IgcVerticalStackedSeriesBaseComponent.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(IgcVerticalStackedSeriesBaseComponent.prototype, "yAxis", {
/**
* Gets or sets the effective y-axis for the current CategorySeries object.
*/
get: function () {
var r = this.i.yAxis;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = IgcCategoryYAxisComponent._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(IgcVerticalStackedSeriesBaseComponent.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
});
Object.defineProperty(IgcVerticalStackedSeriesBaseComponent.prototype, "isVertical", {
/**
* Gets whether or not the current series is vertical series
*/
get: function () {
return this.i.isVertical;
},
enumerable: false,
configurable: true
});
IgcVerticalStackedSeriesBaseComponent.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];
}
}
};
IgcVerticalStackedSeriesBaseComponent.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;
};
IgcVerticalStackedSeriesBaseComponent.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.
*/
IgcVerticalStackedSeriesBaseComponent.prototype.getOffsetValue = function () {
var iv = this.i.getOffsetValue();
return (iv);
};
/**
* Returns the width of the category grouping this series is in.
*/
IgcVerticalStackedSeriesBaseComponent.prototype.getCategoryWidth = function () {
var iv = this.i.getCategoryWidth();
return (iv);
};
/**
* Determine if object can be used as YAxis
* @param axis * The object to check
*/
IgcVerticalStackedSeriesBaseComponent.prototype.canUseAsYAxis = function (axis) {
var iv = this.i.ab4(axis);
return (iv);
};
/**
* Determine if object can be used as XAxis
* @param axis * The object to check
*/
IgcVerticalStackedSeriesBaseComponent.prototype.canUseAsXAxis = function (axis) {
var iv = this.i.ab3(axis);
return (iv);
};
IgcVerticalStackedSeriesBaseComponent._observedAttributesIgcVerticalStackedSeriesBaseComponent = null;
return IgcVerticalStackedSeriesBaseComponent;
}(IgcStackedSeriesBaseComponent));
export { IgcVerticalStackedSeriesBaseComponent };