index.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { __extends } from "tslib";
  2. import { Plot } from '../../core/plot';
  3. import { adaptor } from './adaptor';
  4. import { DEFAULT_OPTIONS } from './constant';
  5. import './interactions';
  6. import { enableInteraction, resetDrillDown, transformData } from './utils';
  7. var Treemap = /** @class */ (function (_super) {
  8. __extends(Treemap, _super);
  9. function Treemap() {
  10. var _this = _super !== null && _super.apply(this, arguments) || this;
  11. /** 图表类型 */
  12. _this.type = 'treemap';
  13. return _this;
  14. }
  15. /**
  16. * 获取 矩阵树图 默认配置项
  17. * 供外部使用
  18. */
  19. Treemap.getDefaultOptions = function () {
  20. return DEFAULT_OPTIONS;
  21. };
  22. /**
  23. * changeData
  24. */
  25. Treemap.prototype.changeData = function (data) {
  26. var _a = this.options, colorField = _a.colorField, interactions = _a.interactions, hierarchyConfig = _a.hierarchyConfig;
  27. this.updateOption({ data: data });
  28. var transData = transformData({
  29. data: data,
  30. colorField: colorField,
  31. enableDrillDown: enableInteraction(interactions, 'treemap-drill-down'),
  32. hierarchyConfig: hierarchyConfig,
  33. });
  34. this.chart.changeData(transData);
  35. resetDrillDown(this.chart);
  36. };
  37. /**
  38. * 获取 矩阵树图 默认配置
  39. */
  40. Treemap.prototype.getDefaultOptions = function () {
  41. return Treemap.getDefaultOptions();
  42. };
  43. Treemap.prototype.getSchemaAdaptor = function () {
  44. return adaptor;
  45. };
  46. return Treemap;
  47. }(Plot));
  48. export { Treemap };
  49. //# sourceMappingURL=index.js.map