UNPKG

igniteui-webcomponents-charts

Version:

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

261 lines (258 loc) 10.4 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { __extends } from "tslib"; import { IgcAxisComponent } from './igc-axis-component'; import { toPoint, fromRect, ensureBool, getAllPropertyNames, toSpinal } from "igniteui-webcomponents-core"; /** * Represents the base class for all IgxDataChartComponent category-based axes. */ export var IgcCategoryAxisBaseComponent = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgcCategoryAxisBaseComponent, _super); function IgcCategoryAxisBaseComponent() { var _this = _super.call(this) || this; _this._chartLevelData = null; _this._dataSource = null; return _this; } IgcCategoryAxisBaseComponent.prototype.provideData = function (data) { this._chartLevelData = data; this.updateDataSource(); }; IgcCategoryAxisBaseComponent.prototype.updateDataSource = function () { if (this._dataSource == null) { this.i.itemsSource = this._chartLevelData; } else { this.i.itemsSource = this._dataSource; } }; Object.defineProperty(IgcCategoryAxisBaseComponent.prototype, "dataSource", { get: function () { if (this._dataSource != null) { return this._dataSource; } return this.i.itemsSource; }, set: function (value) { this._dataSource = value; this.updateDataSource(); //console.log("setting axis data source: " + value) }, enumerable: false, configurable: true }); IgcCategoryAxisBaseComponent.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(); } }; IgcCategoryAxisBaseComponent.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(IgcCategoryAxisBaseComponent, "observedAttributes", { get: function () { if (IgcCategoryAxisBaseComponent._observedAttributesIgcCategoryAxisBaseComponent == null) { var names = getAllPropertyNames(IgcCategoryAxisBaseComponent); for (var i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcCategoryAxisBaseComponent._observedAttributesIgcCategoryAxisBaseComponent = names; } return IgcCategoryAxisBaseComponent._observedAttributesIgcCategoryAxisBaseComponent; }, enumerable: false, configurable: true }); Object.defineProperty(IgcCategoryAxisBaseComponent.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); Object.defineProperty(IgcCategoryAxisBaseComponent.prototype, "isContinuous", { /** * Gets if the current axis is a continuous rather than a discrete scale */ get: function () { return this.i.di; }, enumerable: false, configurable: true }); Object.defineProperty(IgcCategoryAxisBaseComponent.prototype, "isCategory", { /** * Checks if the axis is of category axis type */ get: function () { return this.i.df; }, enumerable: false, configurable: true }); Object.defineProperty(IgcCategoryAxisBaseComponent.prototype, "itemsCount", { /** * Gets the number of items in the current category axis items source. */ get: function () { return this.i.qb; }, set: function (v) { this.i.qb = +v; this._a("itemsCount", this.i.qb); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCategoryAxisBaseComponent.prototype, "gap", { /** * Gets or sets the amount of space between adjacent categories for the current axis object. * The gap is silently clamped to the range [0, 1] when used. * * Use the `Gap` property to configure the spacing between items on a category axis with item spacing. * * A `Gap` of 0 allocates no space between items. A `Gap` of 1 allocates a space between items equal to the width of one item. * * To set the item spacing to 75% the width of one item, set the `Gap` to 0.75, as in this code: */ get: function () { return this.i.pw; }, set: function (v) { this.i.pw = +v; this._a("gap", this.i.pw); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCategoryAxisBaseComponent.prototype, "maximumGap", { /** * Gets or sets the maximum gap value to allow. This defaults to 1.0. */ get: function () { return this.i.p3; }, set: function (v) { this.i.p3 = +v; this._a("maximumGap", this.i.p3); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCategoryAxisBaseComponent.prototype, "minimumGapSize", { /** * Gets or sets the minimum amount of pixels to use for the gap between categories, if possible. */ get: function () { return this.i.p4; }, set: function (v) { this.i.p4 = +v; this._a("minimumGapSize", this.i.p4); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCategoryAxisBaseComponent.prototype, "overlap", { /** * Gets or sets the amount of overlap between adjacent categories for the current axis object. * The overlap is silently clamped to the range [-1, 1] when used. * * Use the `Overlap` property to configure the spacing between items on a category axis with item spacing and more than one series. * * An `Overlap` of 0 places grouped items adjacent to each other. An `Overlap` of 1 places grouped items in the same axis space, completely overlapping. An `Overlap` of -1 places a space between grouped items equal to the width of one item. * * To place grouped items with 75% overlap, set the `Overlap` to 0.75, as in this code: */ get: function () { return this.i.p5; }, set: function (v) { this.i.p5 = +v; this._a("overlap", this.i.p5); }, enumerable: false, configurable: true }); Object.defineProperty(IgcCategoryAxisBaseComponent.prototype, "useClusteringMode", { /** * Gets or sets whether the category axis should use clustering display mode even if no series are present that would force clustering mode. * * `UseClusteringMode` applies grouping and spacing to a category axis equivalent to the grouping that occurs when grouping series, such as ColumnSeries, are used. * * Try setting it on an axis displaying financial series to adjust the spacing on the left and right sides of the axis: */ get: function () { return this.i.pq; }, set: function (v) { this.i.pq = ensureBool(v); this._a("useClusteringMode", this.i.pq); }, enumerable: false, configurable: true }); IgcCategoryAxisBaseComponent.prototype.getFullRange = function () { var iv = this.i.ag(); return (iv); }; IgcCategoryAxisBaseComponent.prototype.getMemberPathValue = function (memberPathName) { var iv = this.i.i6(memberPathName); return (iv); }; IgcCategoryAxisBaseComponent.prototype.getCategoryBoundingBox = function (point, useInterpolation, singularWidth) { var iv = this.i.ra(toPoint(point), useInterpolation, singularWidth); return fromRect(iv); }; IgcCategoryAxisBaseComponent.prototype.getCategoryBoundingBoxHelper = function (point, useInterpolation, singularWidth, isVertical) { var iv = this.i.rb(toPoint(point), useInterpolation, singularWidth, isVertical); return fromRect(iv); }; /** * Unscales a value from screen space into axis space. * @param unscaledValue * The scaled value in screen coordinates to unscale into axis space. */ IgcCategoryAxisBaseComponent.prototype.unscaleValue = function (unscaledValue) { var iv = this.i.p7(unscaledValue); return (iv); }; IgcCategoryAxisBaseComponent.prototype.notifySetItem = function (index, oldItem, newItem) { this.i.qv(index, oldItem, newItem); }; /** * Used to manually notify the axis that the data source has reset or cleared its items. */ IgcCategoryAxisBaseComponent.prototype.notifyClearItems = function () { this.i.qs(); }; IgcCategoryAxisBaseComponent.prototype.notifyInsertItem = function (index, newItem) { this.i.qt(index, newItem); }; IgcCategoryAxisBaseComponent.prototype.notifyRemoveItem = function (index, oldItem) { this.i.qu(index, oldItem); }; IgcCategoryAxisBaseComponent._observedAttributesIgcCategoryAxisBaseComponent = null; return IgcCategoryAxisBaseComponent; }(IgcAxisComponent));