line.js 895 B

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