'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 Cognos Products: Dashboard *| (C) Copyright IBM Corp. 2019 *| *| US Government Users Restricted Rights - Use, duplication or disclosure *| restricted by GSA ADP Schedule Contract with IBM Corp. *+------------------------------------------------------------------------+ */ define(['jquery', '../common/NonVIPREventTarget'], function ($, NonVIPREventTarget) { var InfographicEventTarget = function (_NonVIPREventTarget) { _inherits(InfographicEventTarget, _NonVIPREventTarget); function InfographicEventTarget() { var _ret; _classCallCheck(this, InfographicEventTarget); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var _this = _possibleConstructorReturn(this, _NonVIPREventTarget.call.apply(_NonVIPREventTarget, [this].concat(args))); var options = args[0] || {}; _this.visControl = options.visControl; _this.view = options.view; return _ret = _this.getAPI(), _possibleConstructorReturn(_this, _ret); } /** * Get the array of event targets based on the event. * Event target represents a data point object that corresponds to the event. * * @param event Event object */ InfographicEventTarget.prototype.getEventTargets = function getEventTargets(event) { var node = this._getTargetNode(event); //return null on click since no action will be taken for infographic targets if (!node || event.type === 'click') { return []; } var $node = $(node); if (!this.mouseWithinBoundCheck(event)) { return []; } return this._getTargets(event, $node); }; InfographicEventTarget.prototype.remove = function remove() { this.visControl = null; this.view = null; _NonVIPREventTarget.prototype.remove.call(this); }; InfographicEventTarget.prototype._getTargets = function _getTargets(event, $node) { var targets = []; targets.push({ key: 'label', type: 'itemclass', source: $node, isEdgeSelect: true, values: this._getTargetValues(), area: 'visualization' }); return targets; }; InfographicEventTarget.prototype._getTargetValues = function _getTargetValues() { var slots = []; var value = this.view.infographicValue; if (value) { slots.push({ value: value }); } return slots; }; return InfographicEventTarget; }(NonVIPREventTarget); return InfographicEventTarget; }); //# sourceMappingURL=InfographicEventTarget.js.map