VisRecommenderUtils.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. 'use strict';
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. /*
  4. *+------------------------------------------------------------------------+
  5. *| Licensed Materials - Property of IBM
  6. *| IBM Cognos Products: Dashboard
  7. *| (C) Copyright IBM Corp. 2019
  8. *|
  9. *| US Government Users Restricted Rights - Use, duplication or disclosure
  10. *| restricted by GSA ADP Schedule Contract with IBM Corp.
  11. *+------------------------------------------------------------------------+
  12. */
  13. define([], function () {
  14. var VisRecommenderUtils = function () {
  15. function VisRecommenderUtils() {
  16. _classCallCheck(this, VisRecommenderUtils);
  17. }
  18. /**
  19. * Build a list of smart service chart types that dashboard supports
  20. * @param {Array<VisDefinitionAPI>} visDefinitions VisDefinitionAPI's
  21. * @returns {Array<String>} Smart service chart types supported by dashboard
  22. */
  23. VisRecommenderUtils.buildChartTypes = function buildChartTypes(visDefinitions) {
  24. var chartTypes = [];
  25. if (!visDefinitions) {
  26. return chartTypes;
  27. }
  28. chartTypes = visDefinitions.map(function (visDefinition) {
  29. return visDefinition.getType();
  30. });
  31. chartTypes.push('ClusteredBar', 'ClusteredColumn', 'ClusteredLine', 'ClusteredPoint', 'HierarchicalPie', 'StackedArea');
  32. return chartTypes;
  33. };
  34. return VisRecommenderUtils;
  35. }();
  36. return VisRecommenderUtils;
  37. });
  38. //# sourceMappingURL=VisRecommenderUtils.js.map