'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** *| 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([], function () { var ProvideImplementionError = 'Must provide implementation'; var EventTarget = function () { function EventTarget() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _classCallCheck(this, EventTarget); this.$el = options.$el; this.visAPI = options.visAPI; this.visualization = options.visualization; this.content = options.content; } /** * Determine whether visualization state (ie. zoom, pan, scroll) can be restored * @return {boolean} true if the visualization state can be restored, otherwise false */ EventTarget.prototype.canRestore = function canRestore() { return false; }; /** * Restore the visualization state * @param {Object} state object containing the state of the visualization */ EventTarget.prototype.restore = function restore() /* state */{}; /** * Get the target JQuery element * * @return {object} The target JQuery element */ EventTarget.prototype.getTargetElement = function getTargetElement() { return this.$el; }; /** * Get the axis items from event and offset * @param event - the event as generated by visEventHandler * @param offset - an optional offset (in pixels) to ensure the line does not become the target of selections etc. * @return {object} The axis items */ EventTarget.prototype.getValuesAtPoint = function getValuesAtPoint() /* event, offset */{ throw new Error(ProvideImplementionError); }; /** * 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 * * @return {array} An arrey of event targets */ EventTarget.prototype.getEventTargets = function getEventTargets() /* event */{ throw new Error(ProvideImplementionError); }; EventTarget.prototype.getTargetsByCords = function getTargetsByCords() { throw new Error(ProvideImplementionError); }; /* * Visually decorate the targets. (Not used on grid - we use the old logic for this) * * @return {boolean} Return a boolean indicating whether the target is decorated or not */ EventTarget.prototype.decorateTarget = function decorateTarget() { throw new Error(ProvideImplementionError); }; /** * Obtain the decoration value from the given target item and decoration name * @param item event target item containing the decoration * @param decorationName common decoration name defined by VisEventHandler.DECORATIONS * * @return {string} The decorated vale */ EventTarget.prototype.getDecoration = function getDecoration() /* item, decorationName */{ throw new Error(ProvideImplementionError); }; /** * Complete the series of decorations. * After clearing and adding multiple decorations, complete the decorations by rendering the visualization. */ EventTarget.prototype.completeDecorations = function completeDecorations() { throw new Error(ProvideImplementionError); }; /** * Apply selection on customdata target. * * @param target - Event target */ EventTarget.prototype.applyCustomDataSelection = function applyCustomDataSelection() /* targets */{ throw new Error(ProvideImplementionError); }; /** * Return the list of custom data selections in label/value pair * @param {Object} target event target item of the selected custom data * * @return {array} Array of custom data selections */ EventTarget.prototype.getCustomDataSelections = function getCustomDataSelections() /* target */{ throw new Error(ProvideImplementionError); }; /** * Determine whether the vipr visualization supports pan and zoom */ EventTarget.prototype.canZoom = function canZoom() { throw new Error(ProvideImplementionError); }; /** * Apply zooming * * @param event Event object */ EventTarget.prototype.zoom = function zoom() /* event */{ throw new Error(ProvideImplementionError); }; /** * Start the zooming session * * @param event Event object */ EventTarget.prototype.zoomStart = function zoomStart() /* event */{ throw new Error(ProvideImplementionError); }; /** * End the zooming session * * @param event Event object * @returns {Object|undefined} interactivity state containing the zoom level OR undefined if state is not supported */ EventTarget.prototype.zoomEnd = function zoomEnd() /* event */{ throw new Error(ProvideImplementionError); }; /** * Apply panning movements * * @param event Event object */ EventTarget.prototype.pan = function pan() /* event */{ throw new Error(ProvideImplementionError); }; /** * Start the panning session * * @param event Event object */ EventTarget.prototype.panStart = function panStart() /* event */{ throw new Error(ProvideImplementionError); }; /** * End the panning session * * @param event Event object * @returns {Object|undefined} interactivity state containing the pan OR undefined if state is not supported */ EventTarget.prototype.panEnd = function panEnd() /* event */{ throw new Error(ProvideImplementionError); }; EventTarget.prototype.processKeyDown = function processKeyDown() /* event */{ throw new Error(ProvideImplementionError); }; /** * explicitly remove unused object to prevent from memory leak */ EventTarget.prototype.remove = function remove() { this.$el = null; this.visualization = null; this.visAPI = null; this.content = null; }; EventTarget.prototype.getAPI = function getAPI() { return { canRestore: this.canRestore.bind(this), restore: this.restore.bind(this), getTargetElement: this.getTargetElement.bind(this), getEventTargets: this.getEventTargets.bind(this), getTargetsByCords: this.getTargetsByCords.bind(this), getValuesAtPoint: this.getValuesAtPoint.bind(this), decorateTarget: this.decorateTarget.bind(this), completeDecorations: this.completeDecorations.bind(this), getDecoration: this.getDecoration.bind(this), applyCustomDataSelection: this.applyCustomDataSelection.bind(this), getCustomDataSelections: this.getCustomDataSelections.bind(this), canZoom: this.canZoom.bind(this), zoom: this.zoom.bind(this), zoomStart: this.zoomStart.bind(this), zoomEnd: this.zoomEnd.bind(this), pan: this.pan.bind(this), panStart: this.panStart.bind(this), panEnd: this.panEnd.bind(this), processKeyDown: this.processKeyDown.bind(this), remove: this.remove.bind(this) }; }; return EventTarget; }(); return EventTarget; }); //# sourceMappingURL=EventTarget.js.map