line.js 1001 B

123456789101112131415161718192021222324252627282930
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var tslib_1 = require("tslib");
  4. var util_1 = require("@antv/util");
  5. var base_1 = require("./base");
  6. var Line = /** @class */ (function (_super) {
  7. tslib_1.__extends(Line, _super);
  8. function Line() {
  9. return _super !== null && _super.apply(this, arguments) || this;
  10. }
  11. Line.prototype.getDefaultCfg = function () {
  12. var cfg = _super.prototype.getDefaultCfg.call(this);
  13. return tslib_1.__assign(tslib_1.__assign({}, cfg), { type: 'line' });
  14. };
  15. Line.prototype.getGridPath = function (points) {
  16. var path = [];
  17. util_1.each(points, function (point, index) {
  18. if (index === 0) {
  19. path.push(['M', point.x, point.y]);
  20. }
  21. else {
  22. path.push(['L', point.x, point.y]);
  23. }
  24. });
  25. return path;
  26. };
  27. return Line;
  28. }(base_1.default));
  29. exports.default = Line;
  30. //# sourceMappingURL=line.js.map