react-native-stonk-charts
Version:
A beautiful, performant chart library for React Native. Fork of react-native-wagmi-charts with Reanimated v4 support.
22 lines (19 loc) • 385 B
text/typescript
import { interpolate, Extrapolate } from 'react-native-reanimated';
import type { TDomain } from '../types';
export function getHeight({
value,
domain,
maxHeight,
}: {
value: number;
domain: TDomain;
maxHeight: number;
}) {
'worklet';
return interpolate(
value,
[0, Math.max(...domain) - Math.min(...domain)],
[0, maxHeight],
Extrapolate.CLAMP
);
}