margelo / react-native-graph

📈 Beautiful, high-performance Graphs and Charts for React Native built with Skia
https://margelo.io
MIT License
2.08k stars 118 forks source link

Feat: Indicator #21

Closed chrispader closed 2 years ago

chrispader commented 2 years ago

Allow the user to show an indicator at the end of the graph. This indicator gets hidden once the hold/pan gesture gets started.

chrispader commented 2 years ago

@mrousavy Ready for review! This PR is based on #17 and #18.

gtokman commented 2 years ago

@chrispader do you have a video example of what the indicator looks like? Wondering what the use case would be!

chrispader commented 2 years ago

This is how it looks in the app i originally had the need for this feature.

This includes the basic indicator and also a "live" pulse animation.

https://user-images.githubusercontent.com/20173411/177016519-4513ee97-0bf8-4bc8-ac5d-2ed005638ecb.MOV

chrispader commented 2 years ago

Not completely finished yet though 😬

gtokman commented 2 years ago

@chrispader the live pulse looks super nice!

gtokman commented 2 years ago

Have you tried integrating a gradient?

Saw some discussion here https://github.com/margelo/react-native-graph/issues/11#issuecomment-1119861429.

chrispader commented 2 years ago

Not yet! Implemented a lot of features for use cases in one of our own projects at Margelo. I'll talk to @mrousavy on this. If i find some time, i may be implementing this for general use.

Leoputera2407 commented 2 years ago

Hey Chris Pader, I was playing around with the Spline interpolation method you integration in this PR. I think it might not be implemented correctly, as there were a few of my datapoints with higher Y positions, got rendered lower

chrispader commented 2 years ago

Hey Chris Pader, I was playing around with the Spline interpolation method you integration in this PR. I think it might not be implemented correctly, as there were a few of my datapoints with higher Y positions, got rendered lower

Hi! Thanks for your input.

I already made some changes in a project for one of our clients, that address these issues..

I'll update this PR soon, so everhing works.

Sorry for the delay, kinda busy right now 😅😬

Leoputera2407 commented 2 years ago

No worries, thanks for working on this! I have been trying to fix the interpolation issue as well. The current bezier curves only results in such blocky graphs when data is sparse.

Leoputera2407 commented 2 years ago

@chrispader, are there any updates on this?

chrispader commented 2 years ago

Not supposed to be closed, just an issue with squashing the commits. To be continued

mrousavy commented 2 years ago

LGTM! 🚀 nice work chris!