'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 * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ define(['underscore', './VIPRCatDataItem', './VIPRFormatter'], function (_, VIPRCatDataItem, VIPRFormatter) { // implements ICatDataItem based on a continuous data item var VIPRCatContDataItem = function (_VIPRCatDataItem) { _inherits(VIPRCatContDataItem, _VIPRCatDataItem); function VIPRCatContDataItem(resultItem, context) { _classCallCheck(this, VIPRCatContDataItem); var _this = _possibleConstructorReturn(this, _VIPRCatDataItem.call(this, resultItem, context)); _this.formatter = new VIPRFormatter(_this.context.index.dataitem, 0, _this.context); _this.postProcessing(); return _this; } VIPRCatContDataItem.prototype.getType = function getType() { return 'cont'; }; VIPRCatContDataItem.prototype.getFormatter = function getFormatter() { return this.formatter; }; VIPRCatContDataItem.prototype.postProcessing = function postProcessing() { var index = this.context.index.dataitem; var subType = this.dataset.slots[index].getDefinition().getSubType(); if (subType && subType === 'latitude' || subType === 'longitude') { for (var _index = 0; _index < this.resultItem.getRowCount(); _index++) { var row = this.resultItem.getValue(_index); if (row[0].hasOwnProperty('label') && row[0].hasOwnProperty('value') && row[0].label !== row[0].value) { row[0].value = row[0].label; } } } }; VIPRCatContDataItem.prototype.getItemClass = function getItemClass() { return null; }; VIPRCatContDataItem.prototype.getDomain = function getDomain() { return null; }; return VIPRCatContDataItem; }(VIPRCatDataItem); return VIPRCatContDataItem; }); //# sourceMappingURL=VIPRCatContDataItem.js.map