You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when we pass data stream to cli of asciigraph it outputs the graph to stdout by default.
While this works fine in general, it becomes problematic when plotting in realtime mode as terminal retains the previous graph outputs.
To address this, it would be nice to keep only the latest plot copy in the terminal. To achieve it, clear the already plotted graph first before plotting new when we plotting realtime graph from stdin.
Possible solution: we can utilise ANSI escape sequences to move the cursor and clear the old graph. The following snippets might be helpful:
Move cursor n lines up: fmt.Sprintf("\033[%dA", n)
Clear the line: fmt.Sprintf("\033[2K")
The text was updated successfully, but these errors were encountered:
Currently, when we pass data stream to cli of asciigraph it outputs the graph to stdout by default.
While this works fine in general, it becomes problematic when plotting in realtime mode as terminal retains the previous graph outputs.
To address this, it would be nice to keep only the latest plot copy in the terminal. To achieve it, clear the already plotted graph first before plotting new when we plotting realtime graph from stdin.
Possible solution: we can utilise ANSI escape sequences to move the cursor and clear the old graph. The following snippets might be helpful:
Move cursor n lines up: fmt.Sprintf("\033[%dA", n)
Clear the line: fmt.Sprintf("\033[2K")
The text was updated successfully, but these errors were encountered: