| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
- var Geom = require('./base');
- var ShapeUtil = require('./shape/util');
- var Util = require('../util/common');
- require('./shape/line');
- var Path =
- /*#__PURE__*/
- function (_Geom) {
- _inheritsLoose(Path, _Geom);
- function Path() {
- return _Geom.apply(this, arguments) || this;
- }
- var _proto = Path.prototype;
- _proto.getDefaultCfg = function getDefaultCfg() {
- var cfg = _Geom.prototype.getDefaultCfg.call(this);
- cfg.type = 'path';
- cfg.shapeType = 'line';
- return cfg;
- };
- _proto.getDrawCfg = function getDrawCfg(obj) {
- var cfg = _Geom.prototype.getDrawCfg.call(this, obj);
- cfg.isStack = this.hasAdjust('stack');
- return cfg;
- };
- _proto.draw = function draw(data, shapeFactory) {
- var self = this;
- var container = self.get('container');
- var yScale = self.getYScale();
- var connectNulls = self.get('connectNulls');
- var splitArray = ShapeUtil.splitArray(data, yScale.field, connectNulls);
- var cfg = this.getDrawCfg(data[0]);
- cfg.origin = data;
- Util.each(splitArray, function (subData, splitedIndex) {
- cfg.splitedIndex = splitedIndex;
- cfg.points = subData;
- self.drawShape(cfg.shape, data[0], cfg, container, shapeFactory);
- });
- };
- return Path;
- }(Geom);
- Geom.Path = Path;
- module.exports = Path;
|