coinjar / react-native-wagmi-charts

A sweet & simple chart library for React Native that will make us feel like We're All Gonna Make It.
MIT License
588 stars 116 forks source link

Improve gesture handling #120

Closed nandorojo closed 1 year ago

nandorojo commented 1 year ago

The current behavior for the line chart is pretty jarring. If you start dragging, but then your finger moves out of the drag range, it just gets stuck. Luckily, this is easily fixed with shouldCancelWhenOutside={false}.

I would have added this as a prop directly to LineChartCursorLine, however, it wasn't forwarding the gesture props down to the LineChartCursor the way that the LineChartCursorCrossHair already does. So I fixed that too.

Before

Dragging below makes it just freeze in place:

https://user-images.githubusercontent.com/13172299/214705307-24215f4a-9445-4943-8370-abd4a79a4978.mov

After

Dragging is now more natural:

https://user-images.githubusercontent.com/13172299/214705338-dbb838be-4b60-41ee-a9a6-3b52d433272c.mov

Shafran123 commented 1 year ago

please merge this!

LeoAnt02 commented 1 year ago

hey let's merge this