igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
276 lines (272 loc) • 11.3 kB
JavaScript
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";
let IgcCategoryXAxisComponent = /*@__PURE__*/ (() => {
class IgcCategoryXAxisComponent extends IgcCategoryAxisBaseComponent {
createImplementation() {
return new CategoryXAxis();
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
constructor() {
super();
this._actualIntervalChange = null;
this._actualIntervalChange_wrapped = null;
this._actualMinorIntervalChange = null;
this._actualMinorIntervalChange_wrapped = 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 (IgcCategoryXAxisComponent._observedAttributesIgcCategoryXAxisComponent == null) {
let names = getAllPropertyNames(IgcCategoryXAxisComponent);
for (let i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcCategoryXAxisComponent._observedAttributesIgcCategoryXAxisComponent = names;
}
return IgcCategoryXAxisComponent._observedAttributesIgcCategoryXAxisComponent;
}
static register() {
if (!IgcCategoryXAxisComponent._isElementRegistered) {
IgcCategoryXAxisComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcCategoryXAxisComponent.htmlTagName, IgcCategoryXAxisComponent);
}
}
/**
* Gets or sets interval of labels on the companion axis.
*/
get companionAxisInterval() {
return this.i.rk;
}
set companionAxisInterval(v) {
this.i.rk = +v;
this._a("companionAxisInterval", this.i.rk);
}
/**
* Gets or sets label angle on the companion axis.
*/
get companionAxisMinorInterval() {
return this.i.rl;
}
set companionAxisMinorInterval(v) {
this.i.rl = +v;
this._a("companionAxisMinorInterval", this.i.rl);
}
/**
* Gets or sets number of visible categories at maximum zooming level
* This property is overridden by chart's WindowRectMinWidth property
*/
get zoomMaximumCategoryRange() {
return this.i.zoomMaximumCategoryRange;
}
set zoomMaximumCategoryRange(v) {
this.i.zoomMaximumCategoryRange = +v;
this._a("zoomMaximumCategoryRange", this.i.zoomMaximumCategoryRange);
}
/**
* 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 zoomMaximumItemSpan() {
return this.i.zoomMaximumItemSpan;
}
set zoomMaximumItemSpan(v) {
this.i.zoomMaximumItemSpan = +v;
this._a("zoomMaximumItemSpan", this.i.zoomMaximumItemSpan);
}
/**
* 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 zoomToCategoryRange() {
return this.i.zoomToCategoryRange;
}
set zoomToCategoryRange(v) {
this.i.zoomToCategoryRange = +v;
this._a("zoomToCategoryRange", this.i.zoomToCategoryRange);
}
/**
* 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 zoomToCategoryStart() {
return this.i.zoomToCategoryStart;
}
set zoomToCategoryStart(v) {
this.i.zoomToCategoryStart = +v;
this._a("zoomToCategoryStart", this.i.zoomToCategoryStart);
}
/**
* 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 zoomToItemSpan() {
return this.i.zoomToItemSpan;
}
set zoomToItemSpan(v) {
this.i.zoomToItemSpan = +v;
this._a("zoomToItemSpan", this.i.zoomToItemSpan);
}
/**
* 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 interval() {
return this.i.rp;
}
set interval(v) {
this.i.rp = +v;
this._a("interval", this.i.rp);
}
/**
* Gets the effective value for the current Interval.
*
* ```ts
* let effectiveInterval: number = xAxis.actualInterval;
* ```
*/
get actualInterval() {
return this.i.ri;
}
set actualInterval(v) {
this.i.ri = +v;
this._a("actualInterval", this.i.ri);
}
/**
* 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 minorInterval() {
return this.i.rq;
}
set minorInterval(v) {
this.i.rq = +v;
this._a("minorInterval", this.i.rq);
}
/**
* Gets the effective value for the current MinorInterval.
*
* ```ts
* let effectiveMinorInterval: number = xAxis.actualMinorInterval;
* ```
*/
get actualMinorInterval() {
return this.i.rj;
}
set actualMinorInterval(v) {
this.i.rj = +v;
this._a("actualMinorInterval", this.i.rj);
}
/**
* Scrolls the specified item into view.
* @param item * Data item to scroll into view
*/
scrollIntoView(item) {
this.i.r7(item);
}
scrollRangeIntoView(minimum, maximum) {
this.i.r8(minimum, maximum);
}
/**
* Gets window zoom scale required to zoom to specified number of categories
*/
getWindowZoomFromCategories(categoriesCount) {
let iv = this.i.getWindowZoomFromCategories(categoriesCount);
return (iv);
}
/**
* Gets window zoom scale required to zoom to specified span of series item
*/
getWindowZoomFromItemSpan(pixels) {
let iv = this.i.getWindowZoomFromItemSpan(pixels);
return (iv);
}
get actualIntervalChange() {
return this._actualIntervalChange;
}
set actualIntervalChange(ev) {
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 = (o, e) => {
let ext = this.actualInterval;
if (e.propertyName == 'Ri') {
if (this.beforeActualIntervalChange) {
this.beforeActualIntervalChange(this, ext);
}
if (this._actualIntervalChange) {
this._actualIntervalChange(this, ext);
}
}
};
this.i.propertyChanged = delegateCombine(this.i.propertyChanged, this._actualIntervalChange_wrapped);
}
get actualMinorIntervalChange() {
return this._actualMinorIntervalChange;
}
set actualMinorIntervalChange(ev) {
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 = (o, e) => {
let ext = this.actualMinorInterval;
if (e.propertyName == 'Rj') {
if (this.beforeActualMinorIntervalChange) {
this.beforeActualMinorIntervalChange(this, ext);
}
if (this._actualMinorIntervalChange) {
this._actualMinorIntervalChange(this, ext);
}
}
};
this.i.propertyChanged = delegateCombine(this.i.propertyChanged, this._actualMinorIntervalChange_wrapped);
}
}
IgcCategoryXAxisComponent._observedAttributesIgcCategoryXAxisComponent = null;
IgcCategoryXAxisComponent.htmlTagName = "igc-category-x-axis";
IgcCategoryXAxisComponent._isElementRegistered = false;
return IgcCategoryXAxisComponent;
})();
export { IgcCategoryXAxisComponent };