UNPKG

@antv/f2

Version:

Charts for mobile visualization.

27 lines 829 B
import { __assign } from "tslib"; import { jsx } from '@antv/f-engine'; import { deepMix } from '@antv/util'; export default (function (props, context) { var _a = props.theme, theme = _a === void 0 ? {} : _a; var _b = deepMix(__assign({}, theme.polyline), props), points = _b.points, style = _b.style, offsetX = _b.offsetX, offsetY = _b.offsetY, animation = _b.animation; var checkNaN = points.some(function (d) { return isNaN(d.x) || isNaN(d.y); }); if (checkNaN) return; var offsetXNum = context.px2hd(offsetX); var offsetYNum = context.px2hd(offsetY); return jsx("group", null, jsx("polyline", { style: __assign({ points: points.map(function (point) { return [point.x + offsetXNum, point.y + offsetYNum]; }) }, style), animation: animation })); });