'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** * Licensed Materials - Property of IBM * IBM Business Analytics (C) Copyright IBM Corp. 2019, 2020 * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ define(['underscore', './VIPRDecoratable', './VIPRDataSet'], function (_, VIPRDecoratable, VIPRDataSet) { var VIPRData = function (_VIPRDecoratable) { _inherits(VIPRData, _VIPRDecoratable); /** * @param {Object[]} queryResults */ function VIPRData(queryResults, visualization, hideAggTypeInAxisLabels, content) { _classCallCheck(this, VIPRData); var _this = _possibleConstructorReturn(this, _VIPRDecoratable.call(this)); _this.context = { version: 0, VIPRData: _this, hideAggTypeInAxisLabels: hideAggTypeInAxisLabels }; _this._aVIPRDataSets = []; var mappedSlots = visualization.getSlots().getMappedSlotList(); var datasetIds = visualization.getDefinition().getDatasetList().map(function (dataset) { return dataset.id; }); _.each(datasetIds, function (datasetId) { var slots = _.filter(mappedSlots, function (slot) { return slot.getDefinition().getDatasetIdList().indexOf(datasetId) !== -1; }); var queryResult = queryResults.getResult(datasetId); if (queryResult) { var minmaxResult = queryResults.getResult(datasetId, queryResults.QUERY_RESULT_TYPE.MINMAX); if (minmaxResult) { this.context.minmaxResult = minmaxResult; } this._aVIPRDataSets.push(new VIPRDataSet(datasetId, queryResult, slots, this.context, content)); } else { this._aVIPRDataSets.push(null); } }.bind(_this)); return _this; } VIPRData.prototype.getDataSetAt = function getDataSetAt(index) { return this._aVIPRDataSets[index]; }; VIPRData.prototype.getDataSetCount = function getDataSetCount() { return this._aVIPRDataSets.length; }; VIPRData.prototype.getDecorationsVersion = function getDecorationsVersion() { return this.context.version; }; return VIPRData; }(VIPRDecoratable); return VIPRData; }); //# sourceMappingURL=VIPRData.js.map