victory-native
Version:
A charting library for React Native with a focus on performance and customization.
18 lines (15 loc) • 404 B
text/typescript
import type {
ChartPressState,
ChartPressStateInit,
} from "../hooks/useChartPressState";
export const resetChartPressState = <Init extends ChartPressStateInit>(
state: ChartPressState<Init>,
) => {
state.isActive.value = false;
state.matchedIndex.value = -1;
state.yIndex.value = -1;
state.x.position.value = 0;
for (const key in state.y) {
state.y[key].position.value = 0;
}
};