UNPKG

ag-charts-community

Version:

Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue

63 lines 2.29 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var bandScale_1 = require("../../scale/bandScale"); var chartAxis_1 = require("../chartAxis"); var CategoryAxis = /** @class */ (function (_super) { __extends(CategoryAxis, _super); function CategoryAxis() { var _this = _super.call(this, new bandScale_1.BandScale()) || this; _this.scale.paddingInner = 0.2; _this.scale.paddingOuter = 0.3; return _this; } Object.defineProperty(CategoryAxis.prototype, "paddingInner", { get: function () { return this.scale.paddingInner; }, set: function (value) { this.scale.paddingInner = value; }, enumerable: true, configurable: true }); Object.defineProperty(CategoryAxis.prototype, "paddingOuter", { get: function () { return this.scale.paddingOuter; }, set: function (value) { this.scale.paddingOuter = value; }, enumerable: true, configurable: true }); Object.defineProperty(CategoryAxis.prototype, "domain", { get: function () { return this.scale.domain.slice(); }, set: function (values) { // Prevent duplicate categories. this.scale.domain = values .filter(function (s, i, arr) { return arr.indexOf(s) === i; }); }, enumerable: true, configurable: true }); CategoryAxis.className = 'CategoryAxis'; CategoryAxis.type = 'category'; return CategoryAxis; }(chartAxis_1.ChartAxis)); exports.CategoryAxis = CategoryAxis; //# sourceMappingURL=categoryAxis.js.map