UNPKG

igniteui-react-charts

Version:

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

278 lines (277 loc) 9.15 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, __values } from "tslib"; import { Base, fromEnum, markType } from "igniteui-react-core"; import { AxisVisualDataList } from "./AxisVisualDataList"; import { SeriesVisualDataList } from "./SeriesVisualDataList"; import { RectData } from "igniteui-react-core"; import { List$1 } from "igniteui-react-core"; import { StringBuilder } from "igniteui-react-core"; import { PointData } from "igniteui-react-core"; /** * @hidden */ var ChartVisualData = /** @class */ /*@__PURE__*/ (function (_super) { __extends(ChartVisualData, _super); function ChartVisualData() { var _this = _super.call(this) || this; _this._axes = null; _this._series = null; _this._title = null; _this._subtitle = null; _this._width = 0; _this._height = 0; _this._contentArea = null; _this._centralArea = null; _this._plotArea = null; _this._name = null; _this._isViewportScaled = false; _this._dipScalingRatio = 0; _this.dipScalingRatio = 1; _this.axes = new AxisVisualDataList(); _this.series = new SeriesVisualDataList(); return _this; } Object.defineProperty(ChartVisualData.prototype, "axes", { get: function () { return this._axes; }, set: function (a) { this._axes = a; }, enumerable: false, configurable: true }); Object.defineProperty(ChartVisualData.prototype, "series", { get: function () { return this._series; }, set: function (a) { this._series = a; }, enumerable: false, configurable: true }); Object.defineProperty(ChartVisualData.prototype, "title", { get: function () { return this._title; }, set: function (a) { this._title = a; }, enumerable: false, configurable: true }); Object.defineProperty(ChartVisualData.prototype, "subtitle", { get: function () { return this._subtitle; }, set: function (a) { this._subtitle = a; }, enumerable: false, configurable: true }); Object.defineProperty(ChartVisualData.prototype, "width", { get: function () { return this._width; }, set: function (a) { this._width = a; }, enumerable: false, configurable: true }); Object.defineProperty(ChartVisualData.prototype, "height", { get: function () { return this._height; }, set: function (a) { this._height = a; }, enumerable: false, configurable: true }); Object.defineProperty(ChartVisualData.prototype, "contentArea", { get: function () { return this._contentArea; }, set: function (a) { this._contentArea = a; }, enumerable: false, configurable: true }); Object.defineProperty(ChartVisualData.prototype, "centralArea", { get: function () { return this._centralArea; }, set: function (a) { this._centralArea = a; }, enumerable: false, configurable: true }); Object.defineProperty(ChartVisualData.prototype, "plotArea", { get: function () { return this._plotArea; }, set: function (a) { this._plotArea = a; }, enumerable: false, configurable: true }); Object.defineProperty(ChartVisualData.prototype, "name", { get: function () { return this._name; }, set: function (a) { this._name = a; }, enumerable: false, configurable: true }); Object.defineProperty(ChartVisualData.prototype, "isViewportScaled", { get: function () { return this._isViewportScaled; }, set: function (a) { this._isViewportScaled = a; }, enumerable: false, configurable: true }); ChartVisualData.prototype.scaleByViewport = function () { var e_1, _a, e_2, _b; try { for (var _c = __values(fromEnum(this.axes)), _d = _c.next(); !_d.done; _d = _c.next()) { var a = _d.value; a.p(); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_d && !_d.done && (_a = _c.return)) _a.call(_c); } finally { if (e_1) throw e_1.error; } } try { for (var _e = __values(fromEnum(this.series)), _f = _e.next(); !_f.done; _f = _e.next()) { var b = _f.value; b.n(); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_f && !_f.done && (_b = _e.return)) _b.call(_e); } finally { if (e_2) throw e_2.error; } } if (this.title != null) { this.title.g(); } if (this.subtitle != null) { this.subtitle.g(); } }; ChartVisualData.prototype.getBounds = function () { return new RectData(0, 0, this.width, this.height); }; ChartVisualData.prototype.serialize = function () { var a = new StringBuilder(0); a.u("{"); if (this.name != null) { a.u("name: '" + this.name + "',"); } a.u("width: " + this.width + ","); a.u("height: " + this.height + ","); a.u("plotArea: { left: " + this.plotArea.left + ", top: " + this.plotArea.top + ", width: " + this.plotArea.width + ", height: " + this.plotArea.height + "}, "); a.u("contentArea: { left: " + this.contentArea.left + ", top: " + this.contentArea.top + ", width: " + this.contentArea.width + ", height: " + this.contentArea.height + "}, "); a.u("centralArea: { left: " + this.centralArea.left + ", top: " + this.centralArea.top + ", width: " + this.centralArea.width + ", height: " + this.centralArea.height + "}, "); a.u("isViewportScaled: " + (this.isViewportScaled ? "true" : "false") + ", "); a.u("axes: ["); for (var b = 0; b < this.axes.count; b++) { if (b != 0) { a.l(", "); } a.l(this.axes._inner[b].serialize()); } a.u("],"); a.u("series: ["); for (var c = 0; c < this.series.count; c++) { if (c != 0) { a.l(", "); } a.l(this.series._inner[c].serialize()); } a.u("]"); if (this.title != null) { a.u(", title: " + this.title.serialize()); } if (this.subtitle != null) { a.u(", subtitle: " + this.subtitle.serialize()); } a.l(", dipScalingRatio: " + this.dipScalingRatio.toString()); a.u("}"); return a.toString(); }; ChartVisualData.prototype.getSerializedSeriesPoints = function (a, b, c) { var d = new List$1(List$1.$.specialize(PointData.$), 0); for (var e = 0; e < this.series.count; e++) { if (this.series._inner[e].name == a) { var f = this.series._inner[e].shapes.containingTag(b); for (var g = 0; g < f.count; g++) { var h = f._inner[e]; h.getPointsOverride(d, c); } } } var i = new StringBuilder(0); i.u("["); for (var j = 0; j < d.count; j++) { var k = d._inner[j]; i.u("["); for (var l = 0; l < k.count; l++) { if (l != 0) { i.l(", "); } i.l("{ x: " + k._inner[l].x + ", y: " + k._inner[l].y + "}"); } i.u("]"); } i.u("]"); return i.toString(); }; Object.defineProperty(ChartVisualData.prototype, "dipScalingRatio", { get: function () { return this._dipScalingRatio; }, set: function (a) { this._dipScalingRatio = a; }, enumerable: false, configurable: true }); ChartVisualData.$t = markType(ChartVisualData, 'ChartVisualData'); return ChartVisualData; }(Base)); export { ChartVisualData };