igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
316 lines (312 loc) • 13 kB
JavaScript
import { __extends } from "tslib";
import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core";
import { IgcCategoryAxisBaseComponent } from "./igc-category-axis-base-component";
import { CategoryXAxis } from "./CategoryXAxis";
import { getAllPropertyNames, toSpinal } from "igniteui-webcomponents-core";
import { RegisterElementHelper } from "igniteui-webcomponents-core";
/**
* Represents a IgxDataChartComponent category X axis.
*
* `CategoryXAxis` class represents a IgxDataChartComponent category X axis.
*/
var IgcCategoryXAxisComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgcCategoryXAxisComponent, _super);
function IgcCategoryXAxisComponent() {
var _this = _super.call(this) || this;
_this._actualIntervalChange = null;
_this._actualIntervalChange_wrapped = null;
_this._actualMinorIntervalChange = null;
_this._actualMinorIntervalChange_wrapped = null;
return _this;
}
IgcCategoryXAxisComponent.prototype.createImplementation = function () {
return new CategoryXAxis();
};
Object.defineProperty(IgcCategoryXAxisComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgcCategoryXAxisComponent.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();
}
};
IgcCategoryXAxisComponent.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(IgcCategoryXAxisComponent, "observedAttributes", {
get: function () {
if (IgcCategoryXAxisComponent._observedAttributesIgcCategoryXAxisComponent == null) {
var names = getAllPropertyNames(IgcCategoryXAxisComponent);
for (var i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcCategoryXAxisComponent._observedAttributesIgcCategoryXAxisComponent = names;
}
return IgcCategoryXAxisComponent._observedAttributesIgcCategoryXAxisComponent;
},
enumerable: false,
configurable: true
});
IgcCategoryXAxisComponent.register = function () {
if (!IgcCategoryXAxisComponent._isElementRegistered) {
IgcCategoryXAxisComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcCategoryXAxisComponent.htmlTagName, IgcCategoryXAxisComponent);
}
};
Object.defineProperty(IgcCategoryXAxisComponent.prototype, "zoomMaximumCategoryRange", {
/**
* Gets or sets number of visible categories at maximum zooming level
* This property is overridden by chart's WindowRectMinWidth property
*/
get: function () {
return this.i.zoomMaximumCategoryRange;
},
set: function (v) {
this.i.zoomMaximumCategoryRange = +v;
this._a("zoomMaximumCategoryRange", this.i.zoomMaximumCategoryRange);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcCategoryXAxisComponent.prototype, "zoomMaximumItemSpan", {
/**
* Gets or sets maximum pixel span of series item that will be visible at maximum zooming level
* This property ensures that series item does not get stretch above specified value.
* This property is overridden by chart's WindowRectMinWidth property
*/
get: function () {
return this.i.zoomMaximumItemSpan;
},
set: function (v) {
this.i.zoomMaximumItemSpan = +v;
this._a("zoomMaximumItemSpan", this.i.zoomMaximumItemSpan);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcCategoryXAxisComponent.prototype, "zoomToCategoryRange", {
/**
* Gets or sets range of categories that the chart will zoom in to and fill plot area
* This property is overridden by chart's WindowRect or WindowScaleHorizontal properties
*/
get: function () {
return this.i.zoomToCategoryRange;
},
set: function (v) {
this.i.zoomToCategoryRange = +v;
this._a("zoomToCategoryRange", this.i.zoomToCategoryRange);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcCategoryXAxisComponent.prototype, "zoomToCategoryStart", {
/**
* Gets or sets starting category that chart will move its zoom window. Acceptable value is between 0 and number of data items
* This property is overridden by chart's WindowRect or WindowScaleHorizontal properties
*/
get: function () {
return this.i.zoomToCategoryStart;
},
set: function (v) {
this.i.zoomToCategoryStart = +v;
this._a("zoomToCategoryStart", this.i.zoomToCategoryStart);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcCategoryXAxisComponent.prototype, "zoomToItemSpan", {
/**
* Gets or sets pixel span of series item that will be used to zoom chart such that the item has desired span
* Chart will automatically zoom in until series item has specified pixel span.
* This property is overridden by chart's WindowRect or WindowScaleHorizontal properties
*/
get: function () {
return this.i.zoomToItemSpan;
},
set: function (v) {
this.i.zoomToItemSpan = +v;
this._a("zoomToItemSpan", this.i.zoomToItemSpan);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcCategoryXAxisComponent.prototype, "interval", {
/**
* Gets or sets the frequency of displayed labels.
* The set value is a factor that determines which labels will be hidden. For example, an interval of 2 will display every other label.
*
* `Interval` determines how often to show a label, tickmark, and/or gridline along the x-axis. Set this property to _n_ to display a label every _nth_ item.
*/
get: function () {
return this.i.mw;
},
set: function (v) {
this.i.mw = +v;
this._a("interval", this.i.mw);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcCategoryXAxisComponent.prototype, "actualInterval", {
/**
* Gets the effective value for the current Interval.
*
* ```ts
* let effectiveInterval: number = xAxis.actualInterval;
* ```
*/
get: function () {
return this.i.mr;
},
set: function (v) {
this.i.mr = +v;
this._a("actualInterval", this.i.mr);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcCategoryXAxisComponent.prototype, "minorInterval", {
/**
* Gets or sets the frequency of displayed minor lines.
* The set value is a factor that determines how the minor lines will be displayed.
*
* `MinorInterval` determines how often to show a minor gridline along the x-axis. This property is relevant only when the displayed series is a type with grouping, like column series.
*
* `MinorInterval` is expressed as a number between 0 and 1, representing the frequency of the interval. To display minor gridlines representing 10ths of an item width, set `MinorInterval` to 0.1.
*/
get: function () {
return this.i.mx;
},
set: function (v) {
this.i.mx = +v;
this._a("minorInterval", this.i.mx);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcCategoryXAxisComponent.prototype, "actualMinorInterval", {
/**
* Gets the effective value for the current MinorInterval.
*
* ```ts
* let effectiveMinorInterval: number = xAxis.actualMinorInterval;
* ```
*/
get: function () {
return this.i.ms;
},
set: function (v) {
this.i.ms = +v;
this._a("actualMinorInterval", this.i.ms);
},
enumerable: false,
configurable: true
});
/**
* Scrolls the specified item into view.
* @param item * Data item to scroll into view
*/
IgcCategoryXAxisComponent.prototype.scrollIntoView = function (item) {
this.i.nc(item);
};
IgcCategoryXAxisComponent.prototype.scrollRangeIntoView = function (minimum, maximum) {
this.i.nd(minimum, maximum);
};
/**
* Gets window zoom scale required to zoom to specified number of categories
*/
IgcCategoryXAxisComponent.prototype.getWindowZoomFromCategories = function (categoriesCount) {
var iv = this.i.getWindowZoomFromCategories(categoriesCount);
return (iv);
};
/**
* Gets window zoom scale required to zoom to specified span of series item
*/
IgcCategoryXAxisComponent.prototype.getWindowZoomFromItemSpan = function (pixels) {
var iv = this.i.getWindowZoomFromItemSpan(pixels);
return (iv);
};
Object.defineProperty(IgcCategoryXAxisComponent.prototype, "actualIntervalChange", {
get: function () {
return this._actualIntervalChange;
},
set: function (ev) {
var _this = this;
if (this._actualIntervalChange_wrapped !== null) {
this.i.propertyChanged = delegateRemove(this.i.propertyChanged, this._actualIntervalChange_wrapped);
this._actualIntervalChange_wrapped = null;
this._actualIntervalChange = null;
}
this._actualIntervalChange = ev;
this._actualIntervalChange_wrapped = function (o, e) {
var ext = _this.actualInterval;
if (e.propertyName == 'Mr') {
if (_this.beforeActualIntervalChange) {
_this.beforeActualIntervalChange(_this, ext);
}
if (_this._actualIntervalChange) {
_this._actualIntervalChange(_this, ext);
}
}
};
this.i.propertyChanged = delegateCombine(this.i.propertyChanged, this._actualIntervalChange_wrapped);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcCategoryXAxisComponent.prototype, "actualMinorIntervalChange", {
get: function () {
return this._actualMinorIntervalChange;
},
set: function (ev) {
var _this = this;
if (this._actualMinorIntervalChange_wrapped !== null) {
this.i.propertyChanged = delegateRemove(this.i.propertyChanged, this._actualMinorIntervalChange_wrapped);
this._actualMinorIntervalChange_wrapped = null;
this._actualMinorIntervalChange = null;
}
this._actualMinorIntervalChange = ev;
this._actualMinorIntervalChange_wrapped = function (o, e) {
var ext = _this.actualMinorInterval;
if (e.propertyName == 'Ms') {
if (_this.beforeActualMinorIntervalChange) {
_this.beforeActualMinorIntervalChange(_this, ext);
}
if (_this._actualMinorIntervalChange) {
_this._actualMinorIntervalChange(_this, ext);
}
}
};
this.i.propertyChanged = delegateCombine(this.i.propertyChanged, this._actualMinorIntervalChange_wrapped);
},
enumerable: false,
configurable: true
});
IgcCategoryXAxisComponent._observedAttributesIgcCategoryXAxisComponent = null;
IgcCategoryXAxisComponent.htmlTagName = "igc-category-x-axis";
IgcCategoryXAxisComponent._isElementRegistered = false;
return IgcCategoryXAxisComponent;
}(IgcCategoryAxisBaseComponent));
export { IgcCategoryXAxisComponent };