index.js 1.3 KB

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