UNPKG

@antv/f2

Version:

Charts for mobile visualization.

28 lines 1.01 kB
import { __assign } from "tslib"; import { jsx } from '@antv/f-engine'; import { deepMix } from '@antv/util'; export default (function (props) { var _a = props.theme, theme = _a === void 0 ? {} : _a; var _b = deepMix(__assign({}, theme.line), props), coord = _b.coord, points = _b.points, style = _b.style, animation = _b.animation; var start = points[0] || {}; var end = points[1] || {}; var coordCenter = coord.center; var radius = Math.sqrt((start.x - coordCenter.x) * (start.x - coordCenter.x) + (start.y - coordCenter.y) * (start.y - coordCenter.y)); var startAngle = Math.atan2(start.y - coordCenter.y, start.x - coordCenter.x); var endAngle = Math.atan2(end.y - coordCenter.y, end.x - coordCenter.x); return jsx("group", null, jsx("arc", { style: __assign({ cx: coordCenter.x, cy: coordCenter.y, r: radius, startAngle: "".concat(startAngle, "rad"), endAngle: "".concat(endAngle, "rad") }, style), animation: animation })); });