palerdot / react-d3-speedometer

React Speedometer component using d3.js ⚛️
https://palerdot.in/react-d3-speedometer/
MIT License
230 stars 57 forks source link

any state change affects the needle movement due to force render. Initially, it starts from zero, then updates to the current percentage value upon re-rendering #186

Closed SuryaudayMishra closed 2 months ago

SuryaudayMishra commented 2 months ago

any state change affects the needle movement due to force render. Initially, it starts from zero, then updates to the current percentage value upon re-rendering

daniknewgarden commented 2 months ago

Hey @palerdot! Have you resolved the issue? Cause at the moment, on version 2.2.1 it still appears. I want to achieve the next result, as in the demo gif when I dynamically change a value:

https://github.com/palerdot/react-d3-speedometer/assets/38109617/452c862a-df2f-4406-811b-9a73a79b6c53

palerdot commented 2 months ago

Please explain the issue in detail, what do you expect to happen and what is happening with a possible stackblitz/codesanbox reproduction. It is difficult to comprehend what you are expecting to happen from the screenshot and issue title.

PS: forceRender option rerenders everything. If you want the need to animate smoothly, do not pass the force render option. Not sure if there is a confusion related to this prop.