igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
291 lines (285 loc) • 10.9 kB
JavaScript
import { __extends } from "tslib";
import { IgcCategoryAxisBaseComponent } from "./igc-category-axis-base-component";
import { IgcNumericYAxisComponent } from "./igc-numeric-y-axis-component";
import { IgcAnchoredCategorySeriesComponent } from "./igc-anchored-category-series-component";
import { getAllPropertyNames, toSpinal, toPoint, fromRect, fromPoint } from "igniteui-webcomponents-core";
/**
* Base class for anchored category series with a category x-axis and a numeric y-axis.
*
* Instantiate HorizontalAnchoredCategorySeries
*/
export var IgcHorizontalAnchoredCategorySeriesComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgcHorizontalAnchoredCategorySeriesComponent, _super);
function IgcHorizontalAnchoredCategorySeriesComponent() {
var _this = _super.call(this) || this;
_this._xAxisName = null;
_this._yAxisName = null;
return _this;
}
Object.defineProperty(IgcHorizontalAnchoredCategorySeriesComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgcHorizontalAnchoredCategorySeriesComponent.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();
}
};
IgcHorizontalAnchoredCategorySeriesComponent.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(IgcHorizontalAnchoredCategorySeriesComponent, "observedAttributes", {
get: function () {
if (IgcHorizontalAnchoredCategorySeriesComponent._observedAttributesIgcHorizontalAnchoredCategorySeriesComponent == null) {
var names = getAllPropertyNames(IgcHorizontalAnchoredCategorySeriesComponent);
for (var i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcHorizontalAnchoredCategorySeriesComponent._observedAttributesIgcHorizontalAnchoredCategorySeriesComponent = names;
}
return IgcHorizontalAnchoredCategorySeriesComponent._observedAttributesIgcHorizontalAnchoredCategorySeriesComponent;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcHorizontalAnchoredCategorySeriesComponent.prototype, "xAxis", {
/**
* Gets or sets the effective x-axis for this series.
*
* 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(IgcHorizontalAnchoredCategorySeriesComponent.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(IgcHorizontalAnchoredCategorySeriesComponent.prototype, "yAxis", {
/**
* Gets or sets the effective y-axis for this series.
*
* 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(IgcHorizontalAnchoredCategorySeriesComponent.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
});
IgcHorizontalAnchoredCategorySeriesComponent.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];
}
}
};
IgcHorizontalAnchoredCategorySeriesComponent.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;
};
IgcHorizontalAnchoredCategorySeriesComponent.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;
};
/**
* If possible, will return the best available value marker bounding box within the series that has the best value match for the world position provided.
* @param world * The world coordinates for which to get a value marker bounding box for
*
* You can use the `GetCategoryWidth` to get the width of the category grouping a series is in.
*
* <!-- Angular JS -->
*
* var x = financialSeries.GetSeriesValueMarkerBoundingBox(new IgxPoint());
*
* <!-- Ignite JS -->
*
* N/A
*/
IgcHorizontalAnchoredCategorySeriesComponent.prototype.getSeriesValueMarkerBoundingBox = function (world) {
var iv = this.i.xa(toPoint(world));
return fromRect(iv);
};
/**
* 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
*/
IgcHorizontalAnchoredCategorySeriesComponent.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
*/
IgcHorizontalAnchoredCategorySeriesComponent.prototype.getCategoryWidth = function () {
var iv = this.i.getCategoryWidth();
return (iv);
};
IgcHorizontalAnchoredCategorySeriesComponent.prototype.getSeriesValue = function (world, useInterpolation, skipUnknowns) {
var iv = this.i.jd(toPoint(world), useInterpolation, skipUnknowns);
return (iv);
};
IgcHorizontalAnchoredCategorySeriesComponent.prototype.getPreviousOrExactIndex = function (world, skipUnknowns) {
var iv = this.i.kj(toPoint(world), skipUnknowns);
return (iv);
};
IgcHorizontalAnchoredCategorySeriesComponent.prototype.getNextOrExactIndex = function (world, skipUnknowns) {
var iv = this.i.kh(toPoint(world), skipUnknowns);
return (iv);
};
IgcHorizontalAnchoredCategorySeriesComponent.prototype.getSeriesValuePosition = function (world, useInterpolation, skipUnknowns) {
var iv = this.i.ww(toPoint(world), useInterpolation, skipUnknowns);
return fromPoint(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);
*/
IgcHorizontalAnchoredCategorySeriesComponent.prototype.canUseAsXAxis = function (axis) {
var iv = this.i.ac8(axis);
return (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
*
* <!-- Ignite JS -->
*
* N/A
*/
IgcHorizontalAnchoredCategorySeriesComponent.prototype.canUseAsYAxis = function (axis) {
var iv = this.i.ac9(axis);
return (iv);
};
IgcHorizontalAnchoredCategorySeriesComponent._observedAttributesIgcHorizontalAnchoredCategorySeriesComponent = null;
return IgcHorizontalAnchoredCategorySeriesComponent;
}(IgcAnchoredCategorySeriesComponent));