UNPKG

igniteui-webcomponents-charts

Version:

Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.

205 lines (204 loc) 8.51 kB
import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core"; import { TimeAxisDisplayType_$type } from "./TimeAxisDisplayType"; import { IgcTimeAxisBaseComponent } from "./igc-time-axis-base-component"; import { CategoryDateTimeXAxis } from "./CategoryDateTimeXAxis"; import { getAllPropertyNames, toSpinal, ensureBool, ensureEnum, enumToString } from "igniteui-webcomponents-core"; import { RegisterElementHelper } from "igniteui-webcomponents-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. */ export let IgcCategoryDateTimeXAxisComponent = /*@__PURE__*/ (() => { class IgcCategoryDateTimeXAxisComponent extends IgcTimeAxisBaseComponent { createImplementation() { return new CategoryDateTimeXAxis(); } /** * @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 (IgcCategoryDateTimeXAxisComponent._observedAttributesIgcCategoryDateTimeXAxisComponent == null) { let names = getAllPropertyNames(IgcCategoryDateTimeXAxisComponent); for (let i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcCategoryDateTimeXAxisComponent._observedAttributesIgcCategoryDateTimeXAxisComponent = names; } return IgcCategoryDateTimeXAxisComponent._observedAttributesIgcCategoryDateTimeXAxisComponent; } static register() { if (!IgcCategoryDateTimeXAxisComponent._isElementRegistered) { IgcCategoryDateTimeXAxisComponent._isElementRegistered = true; RegisterElementHelper.registerElement(IgcCategoryDateTimeXAxisComponent.htmlTagName, IgcCategoryDateTimeXAxisComponent); } } /** * Gets if the current axis is a continuous rather than a discrete scale */ get isContinuous() { return this.i.cd; } /** * Gets or sets whether the axis labels can be unevenly spaced */ get unevenlySpacedLabels() { return this.i.nw; } set unevenlySpacedLabels(v) { this.i.nw = ensureBool(v); this._a("unevenlySpacedLabels", this.i.nw); } /** * 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. */ get displayType() { return this.i.nt; } set displayType(v) { this.i.nt = ensureEnum(TimeAxisDisplayType_$type, v); this._a("displayType", enumToString(TimeAxisDisplayType_$type, this.i.nt)); } /** * Gets or sets the X axis time interval. * * `Interval` property is used to get/sets the frequency of displayed labels. */ get interval() { return this.i.n5; } set interval(v) { this.i.n5 = +v; this._a("interval", this.i.n5); } /** * Gets the effective value for the current Interval. */ get actualInterval() { return this.i.n2; } set actualInterval(v) { this.i.n2 = +v; this._a("actualInterval", this.i.n2); } /** * 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.n6; } set minorInterval(v) { this.i.n6 = +v; this._a("minorInterval", this.i.n6); } /** * Gets the effective value for the current MinorInterval. */ get actualMinorInterval() { return this.i.n3; } set actualMinorInterval(v) { this.i.n3 = +v; this._a("actualMinorInterval", this.i.n3); } /** * Gets if the current axis is of category date time axis type */ get isCategoryDateTime() { return this.i.cc; } scrollDateRangeIntoView(minimum, maximum) { this.i.od(minimum, maximum); } 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 == 'N2') { 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 == 'N3') { if (this.beforeActualMinorIntervalChange) { this.beforeActualMinorIntervalChange(this, ext); } if (this._actualMinorIntervalChange) { this._actualMinorIntervalChange(this, ext); } } }; this.i.propertyChanged = delegateCombine(this.i.propertyChanged, this._actualMinorIntervalChange_wrapped); } } IgcCategoryDateTimeXAxisComponent._observedAttributesIgcCategoryDateTimeXAxisComponent = null; IgcCategoryDateTimeXAxisComponent.htmlTagName = "igc-category-date-time-x-axis"; IgcCategoryDateTimeXAxisComponent._isElementRegistered = false; return IgcCategoryDateTimeXAxisComponent; })();