UNPKG

@antv/g2

Version:

the Grammar of Graphics in Javascript

33 lines 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var base_1 = require("../base"); var get_style_1 = require("../util/get-style"); var path_1 = require("../util/path"); var split_points_1 = require("../util/split-points"); var EdgeShapeFactory = base_1.registerShapeFactory('edge', { defaultShapeType: 'line', getDefaultPoints: function (pointInfo) { return split_points_1.splitPoints(pointInfo); }, }); base_1.registerShape('edge', 'line', { draw: function (cfg, container) { var style = get_style_1.getStyle(cfg, true, false, 'lineWidth'); var path = path_1.getLinePath(this.parsePoints(cfg.points), this.coordinate.isPolar); return container.addShape('path', { attrs: tslib_1.__assign(tslib_1.__assign({}, style), { path: path }), }); }, getMarker: function (markerCfg) { return { symbol: 'circle', style: { r: 4.5, fill: markerCfg.color, }, }; }, }); exports.default = EdgeShapeFactory; //# sourceMappingURL=index.js.map