react-native-wagmi-charts
Version:
A sweet candlestick chart for React Native
18 lines (15 loc) • 353 B
text/typescript
import { interpolate, Extrapolation } from 'react-native-reanimated';
import type { TDomain } from '../types';
export function getPrice({
y,
domain,
maxHeight,
}: {
y: number;
domain: TDomain;
maxHeight: number;
}) {
'worklet';
if (y === -1) return -1;
return interpolate(y, [0, maxHeight], domain.reverse(), Extrapolation.CLAMP);
}