UNPKG

igniteui-react-charts

Version:

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

182 lines (181 loc) 6.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 { Base, typeCast, Date_$type, markType } from "igniteui-react-core"; import { PointData } from "igniteui-react-core"; import { SizeData } from "igniteui-react-core"; import { StringBuilder } from "igniteui-react-core"; import { isNaN_ } from "igniteui-react-core"; /** * @hidden */ var AxisLabelVisualData = /** @class */ /*@__PURE__*/ (function (_super) { __extends(AxisLabelVisualData, _super); function AxisLabelVisualData() { var _this = _super.call(this) || this; _this._labelValue = null; _this._labelPosition = 0; _this._position = null; _this._panelPosition = null; _this._chartPosition = null; _this._appearance = null; _this._size = null; _this._anchors = null; _this.position = new PointData(NaN, NaN); _this.size = new SizeData(NaN, NaN); _this.panelPosition = new PointData(NaN, NaN); return _this; } Object.defineProperty(AxisLabelVisualData.prototype, "labelValue", { get: function () { return this._labelValue; }, set: function (a) { this._labelValue = a; }, enumerable: false, configurable: true }); Object.defineProperty(AxisLabelVisualData.prototype, "labelPosition", { get: function () { return this._labelPosition; }, set: function (a) { this._labelPosition = a; }, enumerable: false, configurable: true }); Object.defineProperty(AxisLabelVisualData.prototype, "position", { get: function () { return this._position; }, set: function (a) { this._position = a; }, enumerable: false, configurable: true }); Object.defineProperty(AxisLabelVisualData.prototype, "panelPosition", { get: function () { return this._panelPosition; }, set: function (a) { this._panelPosition = a; }, enumerable: false, configurable: true }); Object.defineProperty(AxisLabelVisualData.prototype, "chartPosition", { get: function () { return this._chartPosition; }, set: function (a) { this._chartPosition = a; }, enumerable: false, configurable: true }); Object.defineProperty(AxisLabelVisualData.prototype, "appearance", { get: function () { return this._appearance; }, set: function (a) { this._appearance = a; }, enumerable: false, configurable: true }); Object.defineProperty(AxisLabelVisualData.prototype, "size", { get: function () { return this._size; }, set: function (a) { this._size = a; }, enumerable: false, configurable: true }); Object.defineProperty(AxisLabelVisualData.prototype, "anchors", { get: function () { return this._anchors; }, set: function (a) { this._anchors = a; }, enumerable: false, configurable: true }); AxisLabelVisualData.prototype.serialize = function () { var a = new StringBuilder(0); a.u("{"); a.u("position: " + "{ x: " + this.position.x + ", y: " + this.position.y + "},"); a.u("size: " + "{ width: " + this.size.width + ", height: " + this.size.height + "},"); a.u("labelPosition: " + this.labelPosition + ","); if (this.chartPosition != null) { a.u("chartPosition: " + this.chartPosition.serialize() + ","); } else { a.u("chartPosition: null,"); } if (this.labelValue != null) { if (typeof this.labelValue === 'string' || typeCast(Date_$type, this.labelValue) !== null) { a.u("labelValue: \"" + this.labelValue.toString() + "\","); } else { a.u("labelValue: " + this.labelValue.toString() + ","); } } else { a.u("labelValue: null,"); } if (!isNaN_(this.panelPosition.x)) { a.u("panelPosition: " + this.panelPosition.serialize() + ","); } if (this.anchors != null && this.anchors.length > 0) { a.l("anchors: ["); var b = false; var e = this.anchors; for (var d = 0; d < e.length; d++) { var c = e[d]; if (b) { a.l(","); } a.u(c.serialize()); b = true; } a.u("],"); } a.u("appearance: " + (this.appearance != null ? this.appearance.serialize() : "null")); a.u("}"); return a.toString(); }; AxisLabelVisualData.prototype.q = function (a, b) { if (b) { this.labelPosition = (this.labelPosition - a.left) / a.width; } else { this.labelPosition = (this.labelPosition - a.top) / a.height; } var c = (this.position.x - a.left) / a.width; var d = (this.position.y - a.top) / a.height; this.position = new PointData(c, d); var e = (this.size.width) / a.width; var f = (this.size.height) / a.height; this.size = new SizeData(e, f); }; AxisLabelVisualData.$t = markType(AxisLabelVisualData, 'AxisLabelVisualData'); AxisLabelVisualData.aNCHOR_TOP_LEFT = 0; AxisLabelVisualData.aNCHOR_TOP_RIGHT = 1; AxisLabelVisualData.aNCHOR_BOT_RIGHT = 2; AxisLabelVisualData.aNCHOR_BOT_LEFT = 3; AxisLabelVisualData.aNCHOR_START = 4; AxisLabelVisualData.aNCHOR_CENTER = 5; AxisLabelVisualData.aNCHOR_END = 6; return AxisLabelVisualData; }(Base)); export { AxisLabelVisualData };