index.js 1.3 KB

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