DataPointSelectionsAPI.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. "use strict";
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. /**
  4. * Licensed Materials - Property of IBM
  5. * IBM Business Analytics (C) Copyright IBM Corp. 2019, 2020
  6. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. */
  8. /**
  9. * @typedef {Object} Category
  10. * @memberof DataPointSelectionsAPI
  11. * @property {String} dataItemId dataItem id of the category data
  12. * @property {String} columnId column id of the category data
  13. * @property {String} label display label of the category data
  14. * @property {String} value value of the category data
  15. */
  16. /**
  17. * @typedef {Object} Fact
  18. * @memberof DataPointSelectionsAPI
  19. * @property {String} dataItemId dataItem id of the fact data
  20. * @property {String} columnId column id of the fact data
  21. * @property {String} value value of the fact data
  22. */
  23. /**
  24. * @typedef {Object} DataPointSelection
  25. * @memberof DataPointSelectionsAPI
  26. * @property {Category[]} categories Array of categeory specs
  27. * @property {Fact[]} [facts] Array of categeory specs
  28. */
  29. /**
  30. * @interface DataPointSelectionsAPI
  31. * @classdesc API class that is used to control data point selections within a visualization.
  32. * @example content.getFeature('DataPointSelections')
  33. */
  34. define([], function () {
  35. var DataPointSelectionsAPI = function () {
  36. function DataPointSelectionsAPI() {
  37. _classCallCheck(this, DataPointSelectionsAPI);
  38. }
  39. /**
  40. * @function DataPointSelectionsAPI#select
  41. * @public
  42. * @description Selects data points of the visualization with the given selection spec.
  43. * @param {DataPointSelection[]} dataPointSelection Array of data point selection spec
  44. * @param {TransactionToken} transactionToken Transaction token
  45. * @fires DataPointSelectionsAPI#CanvasAPI change:content:selections:select
  46. * @fires DataPointSelectionsAPI#ContentAPI change:selections:select
  47. */
  48. DataPointSelectionsAPI.prototype.select = function select() {};
  49. /**
  50. * @function DataPointSelectionsAPI#deselect
  51. * @public
  52. * @description Deselects data points of the visualization with the given selection spec.
  53. * @param {DataPointSelection[]} dataPointSelection Array of data point selection spec
  54. * @param {TransactionToken} transactionToken Transaction token
  55. * @fires DataPointSelectionsAPI#CanvasAPI change:content:selections:deselect
  56. * @fires DataPointSelectionsAPI#ContentAPI change:selections:deselect
  57. */
  58. DataPointSelectionsAPI.prototype.deselect = function deselect() {};
  59. /**
  60. * @function DataPointSelectionsAPI#clearAll
  61. * @public
  62. * @description Clears all data point selections from the visualization
  63. * @param {TransactionToken} transactionToken Transaction token
  64. * @fires DataPointSelectionsAPI#CanvasAPI change:content:selections:clearAll
  65. * @fires DataPointSelectionsAPI#ContentAPI change:selections:clearAll
  66. */
  67. DataPointSelectionsAPI.prototype.clearAll = function clearAll() {};
  68. /**
  69. * @description Returns the list of data point selections.
  70. * @function DataPointSelectionsAPI#getSelections
  71. * @public
  72. *
  73. * @param {Array} selectedDataItemList Optional array containing the selected data items
  74. *
  75. * @return {DataPointSelection[]} Array of data point selections
  76. */
  77. DataPointSelectionsAPI.prototype.getSelections = function getSelections() /* selectedDataItemList */{};
  78. /**
  79. * @function DataPointSelectionsAPI#isSelected
  80. * @public
  81. * @description Checks whether the given resolved items are selected.
  82. *
  83. * @param {DataPointSelection[]} dataPointSelection Array of data point selection spec
  84. * @return {boolean} True if the resolved items are included in the current selections.
  85. */
  86. DataPointSelectionsAPI.prototype.isSelected = function isSelected() {};
  87. return DataPointSelectionsAPI;
  88. }();
  89. return DataPointSelectionsAPI;
  90. });
  91. //# sourceMappingURL=DataPointSelectionsAPI.js.map