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

Module for large time-series data and lot's of plots #584

Open
helmutbuhler opened this issue Aug 3, 2024 · 0 comments
Open

Module for large time-series data and lot's of plots #584

helmutbuhler opened this issue Aug 3, 2024 · 0 comments

Comments

@helmutbuhler
Copy link

First of all, thank you for providing this library! It helped me a great deal in my project!

I had some issues with it though when dealing with very large time-series data and a lot of different plots. When you have a certain number of plots, it no longer makes sense to have a single listbox with them. You need a way to structure that in ImGui.

I made a small helper module that deals with those issues. It assumes that the data is ordered by time and uses that to render only the visible part. It also separates the ui element that enables a specific plot (plot_history()) from the actual drawing of the ui element with all the plots in it (plot_draw()).
Using this, you can place lots of plot_history calls in your UI code and structure it however you like.
The downside is that you need to keep track of a Plot pointer for each plot window, but usually you just have one plot window, so it's not really an issue.
Another feature is that plot_history() will call your get_value-lambda only for the parts of the plot that are visible. This way it will remain fast, even if you have lots of data, and you can compute values on the fly.
You can also supply different units to the plots in a very simple way (with Plot_Y_Axis).
Different units can then by scaled independently and a separate axis is shown for each visible unit.

I think this code might also be useful for others. You can look at it here:
https://github.com/helmutbuhler/odrive_control_ui/blob/master/control_ui/plot.h
In that repo is also an application and a short video that demonstrates the usage.
Do you guys think it makes sense to integrate that stuff in implot, or maybe as an example in implot_demos?

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

1 participant