react-plot
Version:
Library of React components to render SVG 2D plots.
15 lines • 566 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { useRectanglePosition } from '../../hooks.js';
export function Rectangle(props) {
const { x1: oldX1, y1: oldY1, x2: oldX2, y2: oldY2, color, xAxis = 'x', yAxis = 'y', ...otherProps } = props;
const { x, y, width, height } = useRectanglePosition({
x1: oldX1,
y1: oldY1,
x2: oldX2,
y2: oldY2,
xAxis,
yAxis,
});
return (_jsx("rect", { x: x, y: y, width: width, height: height, fill: color, ...otherProps }));
}
//# sourceMappingURL=Rectangle.js.map