index.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.Venn = void 0;
  4. var tslib_1 = require("tslib");
  5. var plot_1 = require("../../core/plot");
  6. var adaptor_1 = require("./adaptor");
  7. var constant_1 = require("./constant");
  8. /**
  9. * 这个是一个图表开发的 模板代码!
  10. */
  11. var Venn = /** @class */ (function (_super) {
  12. tslib_1.__extends(Venn, _super);
  13. function Venn() {
  14. var _this = _super !== null && _super.apply(this, arguments) || this;
  15. /** 图表类型 */
  16. _this.type = 'venn';
  17. return _this;
  18. }
  19. Venn.getDefaultOptions = function () {
  20. return constant_1.DEFAULT_OPTIONS;
  21. };
  22. /**
  23. * 获取 韦恩图 默认配置
  24. */
  25. Venn.prototype.getDefaultOptions = function () {
  26. return Venn.getDefaultOptions();
  27. };
  28. /**
  29. * 获取适配器
  30. */
  31. Venn.prototype.getSchemaAdaptor = function () {
  32. return adaptor_1.adaptor;
  33. };
  34. /**
  35. * 覆写父类的方法
  36. */
  37. Venn.prototype.triggerResize = function () {
  38. if (!this.chart.destroyed) {
  39. // 首先自适应容器的宽高
  40. this.chart.forceFit(); // g2 内部执行 changeSize,changeSize 中执行 render(true)
  41. this.chart.clear();
  42. this.execAdaptor(); // 核心:宽高更新之后计算布局
  43. // 渲染
  44. this.chart.render(true);
  45. }
  46. };
  47. return Venn;
  48. }(plot_1.Plot));
  49. exports.Venn = Venn;
  50. //# sourceMappingURL=index.js.map