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

Feature request: Live updating plots #2570

Open
cool-RR opened this issue Oct 16, 2024 · 6 comments
Open

Feature request: Live updating plots #2570

cool-RR opened this issue Oct 16, 2024 · 6 comments
Labels

Comments

@cool-RR
Copy link
Contributor

cool-RR commented Oct 16, 2024

It is time for the greatest VisiData feature request of all time. I've wanted this for a long time, and it's pretty ambitious so it might never get implemented, but let's put it on the table anyway.

I want to have live plots. I'm running experiments that take a while to produce output. I'm anxiously awaiting the interesting parts of their results so I could draw conculsions and run the next experiment. I want to see that progress on a plot, live. This means I want to draw a plot of a certain sheet, and then as more rows are written to that sheet, I want the plot to automatically add new points on the screen.

@midichef
Copy link
Contributor

midichef commented Nov 6, 2024

Hi @cool-RR, I submitted #2597 and #2598. Once you install both of those, you should be able to monitor your graphs with reload-every.

It was not especially complicated to implement as the basic functionality was already implemented. So imo the greatest VisiData feature request of all time is still #2: make a package for visidata.

Also, until these patches are incorporated into visidata, you may find the watch shell tool useful. Something like: watch -n 10 vd -p draw_graph.vdj

@cool-RR
Copy link
Contributor Author

cool-RR commented Nov 6, 2024

Hmm, this doesn't work for me. I checked out the develop branch and then merged your two branches. I did pip install -e . and I ran VisiData on a jsonl file that's getting new data pushed into it continuously. First I tried to use reload-modified on the sheet and draw a plot, and increased the x range expecting to see more points automatically, but I didn't. Then I went back to the sheet and tried reload-every instead which didn't work. Am I doing something wrong.

@anjakefala
Copy link
Collaborator

Hey @cool-RR!

To make things easier, both commits are now in develop.

The steps I would do are:
pip uninstall visidata - Make sure this is the only version of VisiData in your environment
pip install git+https://github.com:saulpw/visidata.git

And then try it out. I believe the step is to use reload-every on the underlying sheet and on the graph sheet. Let us know if you get it working!

@midichef
Copy link
Contributor

midichef commented Nov 7, 2024

Hmm, I hadn't actually tested reloading graphs while another sheet reloads from a file. That case is not working. It looks like the source sheet changes are not being reflected on the graph. I'll continue to look into it.

(My test case was a custom sheet that generates more rows over time in memory, not on disk.)

@cool-RR
Copy link
Contributor Author

cool-RR commented Nov 7, 2024

Thanks, let me know when that can be tested. Also, I think that a good UX would not require the user to go back to the source sheet and use one of the reload-* commands, but rather allow making the plot live without leaving the plot sheet. So maybe something like allowing to run the reload-* commands on the plot sheet and propagating them to the source sheet.

@cool-RR
Copy link
Contributor Author

cool-RR commented Nov 21, 2024

I recently discovered btm:

image

https://github.com/ClementTsang/bottom

It's like htop except it shows live updating plots of CPU usage, memory usage etc, with braille dots like VisiData. I recommend giving it a try. It's a good example of how to show a live updating plot.

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

No branches or pull requests

3 participants