UNPKG

igniteui-angular-charts

Version:

Ignite UI Angular charting components for building rich data visualizations for modern web apps.

240 lines (236 loc) 10.3 kB
import { EventEmitter, Output, Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core'; import { delegateCombine } from "igniteui-angular-core"; import { IgxCategoryAxisBaseComponent } from "./igx-category-axis-base-component"; import { IgxAxisComponent } from "./igx-axis-component"; import { CategoryYAxis } from "./CategoryYAxis"; import { toPoint, fromRect } from "igniteui-angular-core"; import * as i0 from "@angular/core"; /** * Represents a IgxDataChartComponent category Y axis. */ export let IgxCategoryYAxisComponent = /*@__PURE__*/ (() => { class IgxCategoryYAxisComponent extends IgxCategoryAxisBaseComponent { constructor() { super(); this._actualIntervalChange = null; this._actualMinorIntervalChange = null; } createImplementation() { return new CategoryYAxis(); } /** * @hidden */ get i() { return this._implementation; } /** * Gets if the current axis is a vertical axis. */ get isVertical() { return this.i.dy; } /** * 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. */ get interval() { return this.i.rm; } set interval(v) { this.i.rm = +v; } /** * Gets the effective value for the current Interval. */ get actualInterval() { return this.i.rh; } set actualInterval(v) { this.i.rh = +v; } /** * Gets or sets the frequency of displayed minor lines. * The set value is a factor that determines how the minor lines will be displayed. */ get minorInterval() { return this.i.rn; } set minorInterval(v) { this.i.rn = +v; } /** * Gets the effective value for the current MinorInterval. */ get actualMinorInterval() { return this.i.ri; } set actualMinorInterval(v) { this.i.ri = +v; } /** * Gets or sets interval of labels on the companion axis. */ get companionAxisInterval() { return this.i.rj; } set companionAxisInterval(v) { this.i.rj = +v; } /** * Gets or sets label angle on the companion axis. */ get companionAxisMinorInterval() { return this.i.rk; } set companionAxisMinorInterval(v) { this.i.rk = +v; } /** * 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; } /** * 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; } /** * Gets or sets range of categories that the chart will zoom in 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; } /** * 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; } /** * 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; } getCategoryBoundingBox(point, useInterpolation, singularWidth) { let iv = this.i.ra(toPoint(point), useInterpolation, singularWidth); return fromRect(iv); } scrollRangeIntoView(minimum, maximum) { this.i.r4(minimum, maximum); } /** * Scrolls the specified item into view. * @param item * Data item to scroll into view */ scrollIntoView(item) { this.i.r3(item); } /** * 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() { if (this._actualIntervalChange == null) { this._actualIntervalChange = new EventEmitter(); this.i.propertyChanged = delegateCombine(this.i.propertyChanged, (o, e) => { let iv = e; let ext = this.actualInterval; if (this.beforeActualIntervalChange) { this.beforeActualIntervalChange(this, ext); } this._actualIntervalChange.emit(ext); }); } return this._actualIntervalChange; } get actualMinorIntervalChange() { if (this._actualMinorIntervalChange == null) { this._actualMinorIntervalChange = new EventEmitter(); this.i.propertyChanged = delegateCombine(this.i.propertyChanged, (o, e) => { let iv = e; let ext = this.actualMinorInterval; if (this.beforeActualMinorIntervalChange) { this.beforeActualMinorIntervalChange(this, ext); } this._actualMinorIntervalChange.emit(ext); }); } return this._actualMinorIntervalChange; } } IgxCategoryYAxisComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxCategoryYAxisComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); IgxCategoryYAxisComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxCategoryYAxisComponent, selector: "igx-category-y-axis", inputs: { interval: "interval", actualInterval: "actualInterval", minorInterval: "minorInterval", actualMinorInterval: "actualMinorInterval", companionAxisInterval: "companionAxisInterval", companionAxisMinorInterval: "companionAxisMinorInterval", zoomMaximumCategoryRange: "zoomMaximumCategoryRange", zoomMaximumItemSpan: "zoomMaximumItemSpan", zoomToCategoryRange: "zoomToCategoryRange", zoomToCategoryStart: "zoomToCategoryStart", zoomToItemSpan: "zoomToItemSpan" }, outputs: { actualIntervalChange: "actualIntervalChange", actualMinorIntervalChange: "actualMinorIntervalChange" }, providers: [{ provide: IgxCategoryAxisBaseComponent, useExisting: forwardRef(() => IgxCategoryYAxisComponent) }, { provide: IgxAxisComponent, useExisting: forwardRef(() => IgxCategoryYAxisComponent) }], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); return IgxCategoryYAxisComponent; })(); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxCategoryYAxisComponent, decorators: [{ type: Component, args: [{ selector: 'igx-category-y-axis', template: ``, providers: [{ provide: IgxCategoryAxisBaseComponent, useExisting: forwardRef(() => IgxCategoryYAxisComponent) }, { provide: IgxAxisComponent, useExisting: forwardRef(() => IgxCategoryYAxisComponent) }], changeDetection: ChangeDetectionStrategy.OnPush }] }], ctorParameters: function () { return []; }, propDecorators: { interval: [{ type: Input }], actualInterval: [{ type: Input }], minorInterval: [{ type: Input }], actualMinorInterval: [{ type: Input }], companionAxisInterval: [{ type: Input }], companionAxisMinorInterval: [{ type: Input }], zoomMaximumCategoryRange: [{ type: Input }], zoomMaximumItemSpan: [{ type: Input }], zoomToCategoryRange: [{ type: Input }], zoomToCategoryStart: [{ type: Input }], zoomToItemSpan: [{ type: Input }], actualIntervalChange: [{ type: Output }], actualMinorIntervalChange: [{ type: Output }] } });