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 Graph on Reading Each Data #89

Open
monsieurDuke opened this issue Sep 9, 2021 · 0 comments
Open

Progressive Graph on Reading Each Data #89

monsieurDuke opened this issue Sep 9, 2021 · 0 comments

Comments

@monsieurDuke
Copy link

monsieurDuke commented Sep 9, 2021

Hey there. So I was wondering if there are some way to make the graph become progressive, since it reads new data on the new next line in a file. Here is my snippet on the Bash script.

#!/bin/bash
while IFS= read -r each_stat; do
  echo "$each_stat" > "log/each_result.csv" & wait
  termgraph "log/each_result.csv" --color {cyan,red,yellow,green}; sleep 0.01s
  printf "\033[6A ";
done < "log/result.csv"

First I passed each line of the file to a temp file, so termgraph can read only one data at a time. then I return the cursor 6 line before and continue to read the next data. But its not updating the bar quite what I wanted to, which become overlapped with the previous bar. Are there any solution to overwrite the previous one, without clearing the screen ?

Thanks for the opportunity, really cool stuff !

image
image
image

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