UNPKG

@antv/f2

Version:

Charts for mobile visualization.

22 lines 757 B
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2"; import { jsx } from '../../../jsx'; import { deepMix } from '@antv/util'; export default (function (props) { var _props$theme = props.theme, theme = _props$theme === void 0 ? {} : _props$theme; var _deepMix = deepMix(_objectSpread({}, theme.rect), props), points = _deepMix.points, style = _deepMix.style, animation = _deepMix.animation; var start = points[0] || {}; var end = points[1] || {}; return jsx("group", null, jsx("rect", { attrs: _objectSpread({ x: Math.min(start.x, end.x), y: Math.min(start.y, end.y), width: Math.abs(end.x - start.x), height: Math.abs(start.y - end.y) }, style), animation: animation })); });