-
Notifications
You must be signed in to change notification settings - Fork 8
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
Stream in values support #16
Comments
I'm glad you like Chartistry! I agree this is a missing example. I have done a little bit of exploration on this in the past and I wasn't sure on the best answer so I left it out. Here are my thoughts on this... The problem comes down to lines being drawn with an SVG This kind of makes sense as the browser would be redrawing the whole line when you add a point and shuffle another off the other end. I have some ideas that could improve things but they would likely just come down to benchmarking browser implementations. I've noticed that when (through the power of Leptos) just the lines are updated, performance is fairly good. Have you given it a go yet? Did you run into problems? Here are a bunch of ideas that should help:
With these in place it should reduce updates to just "redraw the lines" which is where you want things to be. I've found Firefox's performance profiler to be good at measuring what's happening. |
Hi @feral-dot-io! Thanks so much for the quick prompt! Yeah, I have been trying different approaches so far, but the one that worked well for me Given that I have a continuous data stream where every item is a Hope this sketch is of help: So whenever an item is pulled from the stream:
The downside from this approach is related to performance, given that Im resetting the |
That sounds about right! If you enable debug on your chart it will print debug statements to your browser console so you can see when components re-render. That should give an idea of when things are re-rendering. Ideally you'd see no re-renders -- this is fine-grained reactivity in action. If you do then it's probably a good idea to look at why. Sharing your call and a screenshot might be a good start. Otherwise I've spotted that there's no debug call on lines so you won't see feedback on that. I also found create_owning_memo released a few weeks ago that fits your usecase quite well. |
Also, do you mind sharing what approaches you've taken? What did you start with? What did you try? A general idea of what you ran into would be helpful so I can adjust the docs accordingly. I'm thinking about switching the site to an mdbook. |
Hi @feral-dot-io! Yeah! Im planning to bring up a repro repository! I will let you know when ready! |
Hi @feral-dot-io!
Thanks so much for creating this crate! While checking out the examples available here:
https://feral-dot-io.github.io/leptos-chartistry/examples.html
I was wondering if it's possible to support a continuously updated chart? So I can have a window from a set of values rendered in the chart while data is being streamed-in?
Thanks in advance!
The text was updated successfully, but these errors were encountered: