1 | import { __assign } from "tslib";
|
2 | import { jsx } from '@antv/f-engine';
|
3 | import { deepMix } from '@antv/util';
|
4 | export default (function (props, context) {
|
5 | var _a = props.theme,
|
6 | theme = _a === void 0 ? {} : _a;
|
7 | var _b = deepMix(__assign({}, theme.polyline), props),
|
8 | points = _b.points,
|
9 | style = _b.style,
|
10 | offsetX = _b.offsetX,
|
11 | offsetY = _b.offsetY,
|
12 | animation = _b.animation;
|
13 | var checkNaN = points.some(function (d) {
|
14 | return isNaN(d.x) || isNaN(d.y);
|
15 | });
|
16 | if (checkNaN) return;
|
17 | var offsetXNum = context.px2hd(offsetX);
|
18 | var offsetYNum = context.px2hd(offsetY);
|
19 | return jsx("group", null, jsx("polyline", {
|
20 | style: __assign({
|
21 | points: points.map(function (point) {
|
22 | return [point.x + offsetXNum, point.y + offsetYNum];
|
23 | })
|
24 | }, style),
|
25 | animation: animation
|
26 | }));
|
27 | }); |
\ | No newline at end of file |