index.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { __extends } from "tslib";
  2. import { Plot } from '../../core/plot';
  3. import { adaptor } from './adaptor';
  4. import { DEFAULT_OPTIONS } from './constant';
  5. import { transformData } from './utils';
  6. /**
  7. * 瀑布图
  8. */
  9. var Waterfall = /** @class */ (function (_super) {
  10. __extends(Waterfall, _super);
  11. function Waterfall() {
  12. var _this = _super !== null && _super.apply(this, arguments) || this;
  13. /** 图表类型 */
  14. _this.type = 'waterfall';
  15. return _this;
  16. }
  17. /**
  18. * 获取 瀑布图 默认配置项
  19. * 供外部使用
  20. */
  21. Waterfall.getDefaultOptions = function () {
  22. return DEFAULT_OPTIONS;
  23. };
  24. /**
  25. * @override
  26. * @param data
  27. */
  28. Waterfall.prototype.changeData = function (data) {
  29. var _a = this.options, xField = _a.xField, yField = _a.yField, total = _a.total;
  30. this.updateOption({ data: data });
  31. this.chart.changeData(transformData(data, xField, yField, total));
  32. };
  33. /**
  34. * 获取 瀑布图 的适配器
  35. */
  36. Waterfall.prototype.getSchemaAdaptor = function () {
  37. return adaptor;
  38. };
  39. /**
  40. * 获取 瀑布图 的默认配置
  41. */
  42. Waterfall.prototype.getDefaultOptions = function () {
  43. return Waterfall.getDefaultOptions();
  44. };
  45. return Waterfall;
  46. }(Plot));
  47. export { Waterfall };
  48. //# sourceMappingURL=index.js.map