igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
355 lines (350 loc) • 13.2 kB
JavaScript
import { __extends } from "tslib";
import { IgcCategoryAxisBaseComponent } from "./igc-category-axis-base-component";
import { IgcNumericYAxisComponent } from "./igc-numeric-y-axis-component";
import { IgcRangeCategorySeriesComponent } from "./igc-range-category-series-component";
import { getAllPropertyNames, toSpinal, toPoint, fromPoint } from "igniteui-webcomponents-core";
/**
* Base class for ranged category series with a category X-axis and a numeric Y-axis.
*
* Instantiate HorizontalAnchoredCategorySeries
*/
var IgcHorizontalRangeCategorySeriesComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgcHorizontalRangeCategorySeriesComponent, _super);
function IgcHorizontalRangeCategorySeriesComponent() {
var _this = _super.call(this) || this;
_this._xAxisName = null;
_this._yAxisName = null;
return _this;
}
Object.defineProperty(IgcHorizontalRangeCategorySeriesComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgcHorizontalRangeCategorySeriesComponent.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();
}
};
IgcHorizontalRangeCategorySeriesComponent.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(IgcHorizontalRangeCategorySeriesComponent, "observedAttributes", {
get: function () {
if (IgcHorizontalRangeCategorySeriesComponent._observedAttributesIgcHorizontalRangeCategorySeriesComponent == null) {
var names = getAllPropertyNames(IgcHorizontalRangeCategorySeriesComponent);
for (var i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcHorizontalRangeCategorySeriesComponent._observedAttributesIgcHorizontalRangeCategorySeriesComponent = names;
}
return IgcHorizontalRangeCategorySeriesComponent._observedAttributesIgcHorizontalRangeCategorySeriesComponent;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcHorizontalRangeCategorySeriesComponent.prototype, "xAxis", {
/**
* Gets or sets the effective x-axis for the current CategorySeries object.
*
* Instantiate xAxis
*/
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(IgcHorizontalRangeCategorySeriesComponent.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(IgcHorizontalRangeCategorySeriesComponent.prototype, "yAxis", {
/**
* Gets or sets the effective y-axis for the current CategorySeries object.
*
* Instantiate yAxis
*/
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(IgcHorizontalRangeCategorySeriesComponent.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(IgcHorizontalRangeCategorySeriesComponent.prototype, "isRange", {
/**
* Checks if this series is a range series
*
* You can use the `IsRange` to get the current series is a range type series.
*
* <!-- Angular JS -->
*
* ```ts
* var r = this.series.isRange;
* ```
*/
get: function () {
return this.i.fv;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcHorizontalRangeCategorySeriesComponent.prototype, "lowMemberAsLegendLabel", {
/**
* Gets or sets the label displayed before series' Low value in the Data Legend.
*/
get: function () {
return this.i.abv;
},
set: function (v) {
this.i.abv = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcHorizontalRangeCategorySeriesComponent.prototype, "highMemberAsLegendLabel", {
/**
* Gets or sets the label displayed before series' High value in the Data Legend.
*/
get: function () {
return this.i.abr;
},
set: function (v) {
this.i.abr = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcHorizontalRangeCategorySeriesComponent.prototype, "lowMemberAsLegendUnit", {
/**
* Gets or sets the unit displayed after series' Low value in the Data Legend.
*/
get: function () {
return this.i.abx;
},
set: function (v) {
this.i.abx = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcHorizontalRangeCategorySeriesComponent.prototype, "highMemberAsLegendUnit", {
/**
* Gets or sets the unit displayed after series' High value in the Data Legend.
*/
get: function () {
return this.i.abt;
},
set: function (v) {
this.i.abt = v;
},
enumerable: false,
configurable: true
});
IgcHorizontalRangeCategorySeriesComponent.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];
}
}
};
IgcHorizontalRangeCategorySeriesComponent.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;
};
IgcHorizontalRangeCategorySeriesComponent.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.
*
* You can use the `GetOffsetValue` to get the offset value for this series if grouped on a category axis.
*
* <!-- Angular JS -->
*
* var g = series.getOffsetValue();
*
* <!-- Ignite JS -->
*
* N/A
*/
IgcHorizontalRangeCategorySeriesComponent.prototype.getOffsetValue = function () {
var iv = this.i.getOffsetValue();
return (iv);
};
/**
* Returns the width of the category grouping this series is in.
*
* You can use the `GetCategoryWidth` to get the width of the category grouping a series is in.
*
* <!-- Angular JS -->
*
* var x = this.financialSeries.CanUseAsXAxis(this.xAxis);
*
* <!-- Ignite JS -->
*
* N/A
*/
IgcHorizontalRangeCategorySeriesComponent.prototype.getCategoryWidth = function () {
var iv = this.i.getCategoryWidth();
return (iv);
};
IgcHorizontalRangeCategorySeriesComponent.prototype.getNextOrExactIndex = function (world, skipUnknowns) {
var iv = this.i.j9(toPoint(world), skipUnknowns);
return (iv);
};
IgcHorizontalRangeCategorySeriesComponent.prototype.getPreviousOrExactIndex = function (world, skipUnknowns) {
var iv = this.i.kb(toPoint(world), skipUnknowns);
return (iv);
};
IgcHorizontalRangeCategorySeriesComponent.prototype.getSeriesValue = function (world, useInterpolation, skipUnknowns) {
var iv = this.i.i6(toPoint(world), useInterpolation, skipUnknowns);
return (iv);
};
IgcHorizontalRangeCategorySeriesComponent.prototype.getSeriesLowValue = function (world, useInterpolation, skipUnknowns) {
var iv = this.i.i4(toPoint(world), useInterpolation, skipUnknowns);
return (iv);
};
IgcHorizontalRangeCategorySeriesComponent.prototype.getSeriesHighValue = function (world, useInterpolation, skipUnknowns) {
var iv = this.i.i2(toPoint(world), useInterpolation, skipUnknowns);
return (iv);
};
IgcHorizontalRangeCategorySeriesComponent.prototype.getSeriesHighValuePosition = function (world, useInterpolation, skipUnknowns) {
var iv = this.i.wd(toPoint(world), useInterpolation, skipUnknowns);
return fromPoint(iv);
};
IgcHorizontalRangeCategorySeriesComponent.prototype.getSeriesLowValuePosition = function (world, useInterpolation, skipUnknowns) {
var iv = this.i.wf(toPoint(world), useInterpolation, skipUnknowns);
return fromPoint(iv);
};
IgcHorizontalRangeCategorySeriesComponent.prototype.getSeriesValuePosition = function (world, useInterpolation, skipUnknowns) {
var iv = this.i.wh(toPoint(world), useInterpolation, skipUnknowns);
return fromPoint(iv);
};
/**
* Determine if object can be used as YAxis
* @param axis * The object to check
*
* You can use the `CanUseAsYAxis` method to determine if object can be used as YAxis
*/
IgcHorizontalRangeCategorySeriesComponent.prototype.canUseAsYAxis = function (axis) {
var iv = this.i.abq(axis);
return (iv);
};
/**
* Determine if object can be used as XAxis
* @param axis * The object to check
*
* You can use the `CanUseAsXAxis` method to determine if object can be used as XAxis
*
* <!-- Angular JS -->
*
* var x = this.financialSeries.CanUseAsXAxis(this.xAxis);
*/
IgcHorizontalRangeCategorySeriesComponent.prototype.canUseAsXAxis = function (axis) {
var iv = this.i.abp(axis);
return (iv);
};
IgcHorizontalRangeCategorySeriesComponent._observedAttributesIgcHorizontalRangeCategorySeriesComponent = null;
return IgcHorizontalRangeCategorySeriesComponent;
}(IgcRangeCategorySeriesComponent));
export { IgcHorizontalRangeCategorySeriesComponent };