123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268 |
- '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
|