Open manuelF opened 4 months ago
That's really cool!
Super cool, thanks for the contribution! I will try to take a closer look soon!
One thing that catches my eye from a quick glance is the chartValues being a simple variable/object, rather than using react state for it. I suspect the chart is only coincidentally getting re-drawn because other elements are also being re-rendered when new data comes in, but it would be best to make the chart data reactive state itself via a useState hook.
Let me know if you'd like to try making those changes, otherwise I'm happy to poke around a bit in the PR when I get some free time.
If you can play around with it and come up with a solution that would be great, no rush!
I am woefully unfamiliar with React state management so probably anything is better than what my current changes express.
Thanks!
This PR introduces a toggleable graph (default off) to the webpage. This plots Voltage and Current out, collected every time there is a data point.
This is my first PR using React, so my apologies for probably not the most idiomatic code.
Thanks!
Preview: