UNPKG

igniteui-react-charts

Version:

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

148 lines (147 loc) 5.35 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 { 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 */ export let AxisLabelVisualData = /*@__PURE__*/ (() => { class AxisLabelVisualData extends Base { get labelValue() { return this._labelValue; } set labelValue(a) { this._labelValue = a; } get labelPosition() { return this._labelPosition; } set labelPosition(a) { this._labelPosition = a; } get position() { return this._position; } set position(a) { this._position = a; } get panelPosition() { return this._panelPosition; } set panelPosition(a) { this._panelPosition = a; } get chartPosition() { return this._chartPosition; } set chartPosition(a) { this._chartPosition = a; } get appearance() { return this._appearance; } set appearance(a) { this._appearance = a; } get size() { return this._size; } set size(a) { this._size = a; } get anchors() { return this._anchors; } set anchors(a) { this._anchors = a; } constructor() { super(); 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); } serialize() { let 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: ["); let b = false; let e = this.anchors; for (let d = 0; d < e.length; d++) { let 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(); } q(a, b) { if (b) { this.labelPosition = (this.labelPosition - a.left) / a.width; } else { this.labelPosition = (this.labelPosition - a.top) / a.height; } let c = (this.position.x - a.left) / a.width; let d = (this.position.y - a.top) / a.height; this.position = new PointData(c, d); let e = (this.size.width) / a.width; let f = (this.size.height) / a.height; this.size = new SizeData(e, f); } } AxisLabelVisualData.$t = /*@__PURE__*/ 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; })();