UNPKG

victory-native

Version:

A charting library for React Native with a focus on performance and customization.

21 lines (20 loc) 761 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getHorizontalBarGroupRect = void 0; const getBarGroupOffset_1 = require("./getBarGroupOffset"); const getHorizontalBarGroupRect = ({ point, baselineX, barWidth, groupWidth, gapWidth, barIndex, }) => { const { x, y } = point; if (typeof x !== "number" || typeof y !== "number" || !Number.isFinite(x) || !Number.isFinite(y)) { return null; } return { x: Math.min(baselineX, x), y: y + (0, getBarGroupOffset_1.getBarGroupOffset)({ groupWidth, barWidth, gapWidth, barIndex }), width: Math.abs(x - baselineX), height: barWidth, }; }; exports.getHorizontalBarGroupRect = getHorizontalBarGroupRect;