UNPKG

suoqiu-f2

Version:

Charts for mobile visualization.

36 lines (35 loc) 1.02 kB
"use strict"; exports.__esModule = true; exports["default"] = void 0; var _shape = _interopRequireDefault(require("./shape")); var _common = require("../../util/common"); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } var Polygon = _shape["default"].registerFactory('polygon', { defaultShapeType: 'polygon', getDefaultPoints: function getDefaultPoints(pointInfo) { var points = []; var x = pointInfo.x, y = pointInfo.y; for (var i = 0, len = x.length; i < len; i++) { points.push({ x: x[i], y: y[i] }); } return points; } }); _shape["default"].registerShape('polygon', 'polygon', { draw: function draw(cfg, container) { var points = this.parsePoints(cfg.points); var style = (0, _common.mix)({ fill: cfg.color, points: points }, cfg.style); return container.addShape('Polygon', { className: 'polygon', attrs: style }); } }); var _default = exports["default"] = Polygon;