@antv/f2
Version:
Charts for mobile visualization.
22 lines • 659 B
JavaScript
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.rect), props),
points = _b.points,
style = _b.style,
animation = _b.animation;
var start = points[0] || {};
var end = points[1] || {};
return jsx("group", null, jsx("rect", {
style: __assign({
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
}));
});