UNPKG

@antv/f2

Version:

Charts for mobile visualization.

28 lines (27 loc) 850 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _tslib = require("tslib"); var _fEngine = require("@antv/f-engine"); var _util = require("@antv/util"); var _default = exports.default = function _default(props) { var _a = props.theme, theme = _a === void 0 ? {} : _a; var _b = (0, _util.deepMix)((0, _tslib.__assign)({}, theme.rect), props), points = _b.points, style = _b.style, animation = _b.animation; var start = points[0] || {}; var end = points[1] || {}; return (0, _fEngine.jsx)("group", null, (0, _fEngine.jsx)("rect", { style: (0, _tslib.__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 })); };