index.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. "use strict";
  2. exports.__esModule = true;
  3. exports.default = void 0;
  4. var _translation = require("@superset-ui/translation");
  5. var _chart = require("@superset-ui/chart");
  6. var _transformProps = _interopRequireDefault(require("../transformProps"));
  7. var _thumbnail = _interopRequireDefault(require("./images/thumbnail.png"));
  8. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9. function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
  10. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  11. const metadata = new _chart.ChartMetadata({
  12. credits: ['http://nvd3.org'],
  13. description: '',
  14. name: (0, _translation.t)('Bullet Chart'),
  15. thumbnail: _thumbnail.default,
  16. useLegacyApi: true
  17. });
  18. class BulletChartPlugin extends _chart.ChartPlugin {
  19. constructor() {
  20. super({
  21. loadChart: () => Promise.resolve().then(() => _interopRequireWildcard(require('../ReactNVD3'))),
  22. metadata,
  23. transformProps: _transformProps.default
  24. });
  25. }
  26. }
  27. exports.default = BulletChartPlugin;