index.js 1.4 KB

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