UNPKG

igniteui-angular-charts

Version:

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

253 lines (252 loc) 10.8 kB
import { __extends } from "tslib"; import { EventEmitter, Output, Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core'; import { delegateCombine } from "igniteui-angular-core"; import { TimeAxisDisplayType_$type } from "./TimeAxisDisplayType"; import { IgxTimeAxisBaseComponent } from "./igx-time-axis-base-component"; import { IgxCategoryAxisBaseComponent } from "./igx-category-axis-base-component"; import { IgxAxisComponent } from "./igx-axis-component"; import { CategoryDateTimeXAxis } from "./CategoryDateTimeXAxis"; import { ensureBool, ensureEnum } from "igniteui-angular-core"; import * as i0 from "@angular/core"; /** * Represents a category-based horizontal X axis that uses a DateTime scale. * * `CategoryDateTimeXAxis` class represents a category-based horizontal X axis that uses a DateTime scale. * * ```html * <igx-data-chart * [dataSource]="data"> * <igx-time-x-axis * dateTimeMemberPath="date" * #xAxis> * </igx-time-x-axis> * </igx-data-chart> * ``` * * ```ts * let xAxis = new IgxTimeXAxisComponent(); * xAxis.dataTimeMemberPath="date"; * this.chart.axes.add(xAxis); * ``` */ var IgxCategoryDateTimeXAxisComponent = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgxCategoryDateTimeXAxisComponent, _super); function IgxCategoryDateTimeXAxisComponent() { var _this = _super.call(this) || this; _this._actualIntervalChange = null; _this._actualMinorIntervalChange = null; return _this; } IgxCategoryDateTimeXAxisComponent.prototype.createImplementation = function () { return new CategoryDateTimeXAxis(); }; Object.defineProperty(IgxCategoryDateTimeXAxisComponent.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); Object.defineProperty(IgxCategoryDateTimeXAxisComponent.prototype, "isContinuous", { /** * Gets if the current axis is a continuous rather than a discrete scale */ get: function () { return this.i.cd; }, enumerable: false, configurable: true }); Object.defineProperty(IgxCategoryDateTimeXAxisComponent.prototype, "unevenlySpacedLabels", { /** * Gets or sets whether the axis labels can be unevenly spaced */ get: function () { return this.i.nw; }, set: function (v) { this.i.nw = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxCategoryDateTimeXAxisComponent.prototype, "displayType", { /** * Gets or sets the axis display type. * Continuous display type divides the axis into even intervals, where labels will not necessarily be aligned with data points. * Discrete display type will not use a constant interval, but will align each label with its data point. * * `displayType` property is used for axis display type. * * Continuous display type divides the axis into even intervals, where labels will not necessarily be aligned with data points. Discrete display type will not use a constant interval, but will align each label with its data point. * * ```html * <igx-data-chart * [dataSource]="data"> * <igx-time-x-axis * dateTimeMemberPath="date" * displayType ="continuous" * #xAxis> * </igx-time-x-axis> * </igx-data-chart> * ``` */ get: function () { return this.i.nt; }, set: function (v) { this.i.nt = ensureEnum(TimeAxisDisplayType_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxCategoryDateTimeXAxisComponent.prototype, "interval", { /** * Gets or sets the X axis time interval. * * `Interval` property is used to get/sets the frequency of displayed labels. * * ```html * <igx-data-chart * [dataSource]="data"> * <igx-time-x-axis * dateTimeMemberPath="date" * interval=2 * #xAxis> * </igx-time-x-axis> * </igx-data-chart> * ``` */ get: function () { return this.i.n5; }, set: function (v) { this.i.n5 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxCategoryDateTimeXAxisComponent.prototype, "actualInterval", { /** * Gets the effective value for the current Interval. */ get: function () { return this.i.n2; }, set: function (v) { this.i.n2 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxCategoryDateTimeXAxisComponent.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. */ get: function () { return this.i.n6; }, set: function (v) { this.i.n6 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxCategoryDateTimeXAxisComponent.prototype, "actualMinorInterval", { /** * Gets the effective value for the current MinorInterval. */ get: function () { return this.i.n3; }, set: function (v) { this.i.n3 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxCategoryDateTimeXAxisComponent.prototype, "isCategoryDateTime", { /** * Gets if the current axis is of category date time axis type */ get: function () { return this.i.cc; }, enumerable: false, configurable: true }); IgxCategoryDateTimeXAxisComponent.prototype.scrollIntoView = function (minimum, maximum) { this.i.od(minimum, maximum); }; Object.defineProperty(IgxCategoryDateTimeXAxisComponent.prototype, "actualIntervalChange", { get: function () { var _this = this; if (this._actualIntervalChange == null) { this._actualIntervalChange = new EventEmitter(); this.i.propertyChanged = delegateCombine(this.i.propertyChanged, function (o, e) { var iv = e; var ext = _this.actualInterval; if (_this.beforeActualIntervalChange) { _this.beforeActualIntervalChange(_this, ext); } _this._actualIntervalChange.emit(ext); }); } return this._actualIntervalChange; }, enumerable: false, configurable: true }); Object.defineProperty(IgxCategoryDateTimeXAxisComponent.prototype, "actualMinorIntervalChange", { get: function () { var _this = this; if (this._actualMinorIntervalChange == null) { this._actualMinorIntervalChange = new EventEmitter(); this.i.propertyChanged = delegateCombine(this.i.propertyChanged, function (o, e) { var iv = e; var ext = _this.actualMinorInterval; if (_this.beforeActualMinorIntervalChange) { _this.beforeActualMinorIntervalChange(_this, ext); } _this._actualMinorIntervalChange.emit(ext); }); } return this._actualMinorIntervalChange; }, enumerable: false, configurable: true }); IgxCategoryDateTimeXAxisComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxCategoryDateTimeXAxisComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); IgxCategoryDateTimeXAxisComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxCategoryDateTimeXAxisComponent, selector: "igx-category-date-time-x-axis", inputs: { unevenlySpacedLabels: "unevenlySpacedLabels", displayType: "displayType", interval: "interval", actualInterval: "actualInterval", minorInterval: "minorInterval", actualMinorInterval: "actualMinorInterval" }, outputs: { actualIntervalChange: "actualIntervalChange", actualMinorIntervalChange: "actualMinorIntervalChange" }, providers: [{ provide: IgxTimeAxisBaseComponent, useExisting: forwardRef(function () { return IgxCategoryDateTimeXAxisComponent; }) }, { provide: IgxCategoryAxisBaseComponent, useExisting: forwardRef(function () { return IgxCategoryDateTimeXAxisComponent; }) }, { provide: IgxAxisComponent, useExisting: forwardRef(function () { return IgxCategoryDateTimeXAxisComponent; }) }], usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); return IgxCategoryDateTimeXAxisComponent; }(IgxTimeAxisBaseComponent)); export { IgxCategoryDateTimeXAxisComponent }; i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxCategoryDateTimeXAxisComponent, decorators: [{ type: Component, args: [{ selector: 'igx-category-date-time-x-axis', template: "", providers: [{ provide: IgxTimeAxisBaseComponent, useExisting: forwardRef(function () { return IgxCategoryDateTimeXAxisComponent; }) }, { provide: IgxCategoryAxisBaseComponent, useExisting: forwardRef(function () { return IgxCategoryDateTimeXAxisComponent; }) }, { provide: IgxAxisComponent, useExisting: forwardRef(function () { return IgxCategoryDateTimeXAxisComponent; }) }], changeDetection: ChangeDetectionStrategy.OnPush }] }], ctorParameters: function () { return []; }, propDecorators: { unevenlySpacedLabels: [{ type: Input }], displayType: [{ type: Input }], interval: [{ type: Input }], actualInterval: [{ type: Input }], minorInterval: [{ type: Input }], actualMinorInterval: [{ type: Input }], actualIntervalChange: [{ type: Output }], actualMinorIntervalChange: [{ type: Output }] } });