index.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.Histogram = void 0;
  4. var tslib_1 = require("tslib");
  5. var plot_1 = require("../../core/plot");
  6. var histogram_1 = require("../../utils/transform/histogram");
  7. var adaptor_1 = require("./adaptor");
  8. var constant_1 = require("./constant");
  9. var Histogram = /** @class */ (function (_super) {
  10. tslib_1.__extends(Histogram, _super);
  11. function Histogram() {
  12. var _this = _super !== null && _super.apply(this, arguments) || this;
  13. /** 图表类型 */
  14. _this.type = 'histogram';
  15. return _this;
  16. }
  17. /**
  18. * 获取 默认配置项
  19. * 供外部使用
  20. */
  21. Histogram.getDefaultOptions = function () {
  22. return constant_1.DEFAULT_OPTIONS;
  23. };
  24. Histogram.prototype.changeData = function (data) {
  25. this.updateOption({ data: data });
  26. var _a = this.options, binField = _a.binField, binNumber = _a.binNumber, binWidth = _a.binWidth, stackField = _a.stackField;
  27. this.chart.changeData((0, histogram_1.binHistogram)(data, binField, binWidth, binNumber, stackField));
  28. };
  29. /**
  30. * 获取直方图的适配器
  31. */
  32. Histogram.prototype.getDefaultOptions = function () {
  33. return Histogram.getDefaultOptions();
  34. };
  35. /**
  36. * 获取直方图的适配器
  37. */
  38. Histogram.prototype.getSchemaAdaptor = function () {
  39. return adaptor_1.adaptor;
  40. };
  41. return Histogram;
  42. }(plot_1.Plot));
  43. exports.Histogram = Histogram;
  44. //# sourceMappingURL=index.js.map