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

Progressive mode #2

Open
kojix2 opened this issue Nov 6, 2020 · 5 comments
Open

Progressive mode #2

kojix2 opened this issue Nov 6, 2020 · 5 comments

Comments

@kojix2
Copy link
Member

kojix2 commented Nov 6, 2020

It may not be a very practical idea. But I would like to see a progressive mode. Some programs take a long time to run and gradually output the results to standard output. In that case, waiting until all the output is finished would take a long time. I'd like to have a mechanism to pass the results to the next pipeline before all the outputs are finished. However, I think it would be very difficult to create such a mechanism.

@kojix2
Copy link
Member Author

kojix2 commented Dec 3, 2020

@kojix2
Copy link
Member Author

kojix2 commented May 28, 2021

Update: It's not perfect, but it's been implemented.
https://github.com/kojix2/YouPlot#how-to-plot-real-time-data

@kojix2
Copy link
Member Author

kojix2 commented Jun 10, 2021

scatter: xlim ylim does not change automatically in progress mode

expected behavior

ruby -rnumo/narray -e "puts Numo::Float32.new(1000,2).rand_norm.to_a.map{_1.join(\"\t\")}" | uplot s

image

actual behavior

up.mp4

@kojix2
Copy link
Member Author

kojix2 commented Jun 13, 2021

Progressive mode will work.

However, it can be very slow if there are many lines of data.
YouPlot reads one new line of data from the standard input and passes all the previous data to UnicodePlot. This slows down the behavior.
There are two solutions that come to mind right away.

  • One is to set the display interval. For example, you can wait until you receive 10 new rows of data before drawing the plot.
    • Per lines
      • lines
      • Auto mode to make UnicodePlot benchmark measurements and take their reciprocals
    • Per time
      • Period or Frequency
  • The other is to set the range. For example, you can choose to use only the last 100 data and not display the data before that.

I will consider the appropriate command line options.
Idea:

  • --interval SECOND
  • --window

@joaociocca
Copy link

I thought this could be a nice way to try and make an alert count histogram using the line charting... but progressive mode keeps the previous values, right? I notice that if I feed it an array with 10 items, shift the first and add a new one, instead of updating it'll add the new set along with the previous ones, instead of rewriting the whole set.

ah, now I understand the idea for the --window option, only the new item should be fed to it, and uplot itself would discard items over the window count. Can't wait to see if this ever comes to light =)

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

2 participants