react-native-wagmi-charts
Version:
A sweet candlestick chart for React Native
22 lines (19 loc) • 389 B
text/typescript
import { interpolate, Extrapolation } 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],
Extrapolation.CLAMP
);
}