victory-native
Version:
A charting library for React Native with a focus on performance and customization.
21 lines (20 loc) • 632 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getVerticalStackedBarRect = void 0;
const getVerticalStackedBarRect = ({ segment, yScale, barWidth, }) => {
const { x } = segment.point;
const startY = yScale(segment.startValue);
const endY = yScale(segment.endValue);
if (!Number.isFinite(x) ||
!Number.isFinite(startY) ||
!Number.isFinite(endY)) {
return null;
}
return {
x: x - barWidth / 2,
y: endY,
width: barWidth,
height: startY - endY,
};
};
exports.getVerticalStackedBarRect = getVerticalStackedBarRect;