Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to make needle stop at max value? #171

Open
raukaute opened this issue Jul 6, 2023 · 3 comments
Open

Possible to make needle stop at max value? #171

raukaute opened this issue Jul 6, 2023 · 3 comments

Comments

@raukaute
Copy link

raukaute commented Jul 6, 2023

Hey,

I was wondering if it's possible to to prevent the needle going beyond the max-value?

Cheers!

@palerdot
Copy link
Owner

palerdot commented Jul 7, 2023

I don't understand. Please post a screenshot of what you are referring to.

@raukaute
Copy link
Author

raukaute commented Jul 7, 2023

Sorry for the confusion. What is the maxValue used for, if the needle will never actually stop, i.e. is prevented from going beyond that value? I hope I could make my point a bit clearer. 🙈

image

@palerdot
Copy link
Owner

palerdot commented Jul 7, 2023

Ok. I think you should validate your value and check if it is within your range, since you are controlling the value and maxValue.

For some use cases, current behaviour may be relevant, like animating a value going out of range slightly (for eg: a speedometer showing revving of engine, which crosses the threshold). I think in general, you should control the value being animated and not just directly inject the value directly to the speedometer. For eg: passing a string as a value, will show NaN and animate to the middle. The library leaves these scenarios for the consumers to handle. I hope it makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants