Open kojix2 opened 3 years ago
Update: It's not perfect, but it's been implemented. https://github.com/kojix2/YouPlot#how-to-plot-real-time-data
ruby -rnumo/narray -e "puts Numo::Float32.new(1000,2).rand_norm.to_a.map{_1.join(\"\t\")}" | uplot s
https://user-images.githubusercontent.com/5798442/121475272-27b64700-ca00-11eb-9c1d-67403d1aa4c1.mp4
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.
I will consider the appropriate command line options. Idea:
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 =)
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.