VisToSmartsMapping.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. 'use strict';
  2. /*
  3. *+------------------------------------------------------------------------+
  4. *| Licensed Materials - Property of IBM
  5. *| IBM Cognos Products: Dashboard
  6. *| (C) Copyright IBM Corp. 2017, 2020
  7. *|
  8. *| US Government Users Restricted Rights - Use, duplication or disclosure
  9. *| restricted by GSA ADP Schedule Contract with IBM Corp.
  10. *+------------------------------------------------------------------------+
  11. */
  12. define(['./SmartsToVizMapping'], function (SmartsToVisMapping) {
  13. 'use strict';
  14. var VisToSmartMapping = {};
  15. var smartsChartTypes = Object.keys(SmartsToVisMapping);
  16. smartsChartTypes.forEach(function (chartType) {
  17. var oldMapInfo = SmartsToVisMapping[chartType];
  18. if (!VisToSmartMapping[oldMapInfo.visId]) {
  19. VisToSmartMapping[oldMapInfo.visId] = {};
  20. }
  21. var newMapInfo = VisToSmartMapping[oldMapInfo.visId];
  22. var chartProps = Object.keys(SmartsToVisMapping[chartType]);
  23. chartProps.forEach(function (prop) {
  24. if (prop === 'visId') {
  25. if (!newMapInfo.chartType) {
  26. newMapInfo.chartType = chartType;
  27. }
  28. } else {
  29. if (!newMapInfo[oldMapInfo[prop]]) {
  30. newMapInfo[oldMapInfo[prop]] = prop;
  31. }
  32. }
  33. });
  34. });
  35. return VisToSmartMapping;
  36. });
  37. //# sourceMappingURL=VisToSmartsMapping.js.map