VisIndicators.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 Cognos Products: BI Cloud (C) Copyright IBM Corp. 2019
  6. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. */
  8. define(['../../../lib/@waca/dashboard-common/dist/core/APIFactory', './api/VisIndicatorsAPI', 'underscore'], function (APIFactory, VisIndicatorsAPI, _) {
  9. var VisIndicators = function () {
  10. function VisIndicators() {
  11. _classCallCheck(this, VisIndicators);
  12. this.api = APIFactory.createAPI(this, [VisIndicatorsAPI]);
  13. this.providers = [];
  14. }
  15. VisIndicators.prototype.registerProvider = function registerProvider(provider) {
  16. this.providers.push(provider);
  17. };
  18. VisIndicators.prototype.getIndicatorList = function getIndicatorList() {
  19. var indicators = [];
  20. _.each(this.providers, function (provider) {
  21. if (provider.getIndicatorList) {
  22. indicators.push.apply(indicators, provider.getIndicatorList());
  23. }
  24. });
  25. return indicators;
  26. };
  27. VisIndicators.prototype.getAPI = function getAPI() {
  28. return this.api;
  29. };
  30. return VisIndicators;
  31. }();
  32. return VisIndicators;
  33. });
  34. //# sourceMappingURL=VisIndicators.js.map