diff --git a/README.md b/README.md index 3c7b298..e984dd7 100644 --- a/README.md +++ b/README.md @@ -236,11 +236,31 @@ Output: plot data from stdin ``` + Example of **real-time graph** for data points stream via stdin: -```bash + +Realtime graph for data points via stdin (google ping) using asciigraph + +
+command for above graph + +```sh ping -i.2 google.com | grep -oP '(?<=time=).*(?=ms)' --line-buffered | asciigraph -r -h 10 -w 40 -c "realtime plot data (google ping in ms) from stdin" ``` -[![asciinema][]][7] +
+ + +Example of **multi-series real-time graph** for data points stream via stdin: + +Ping latency comparison: Google (Blue) vs. DuckDuckGo (Red) with asciigraph + +
+command for above graph + +```sh +{unbuffer paste -d, <(ping -i 0.4 google.com | sed -u -n -E 's/.*time=(.*)ms.*/\1/p') <(ping -i 0.4 duckduckgo.com | sed -u -n -E 's/.*time=(.*)ms.*/\1/p') } | asciigraph -r -h 15 -w 60 -sn 2 -sc "blue,red" -c "Ping Latency Comparison" -sl "Google, DuckDuckGo" +``` +
## Acknowledgement @@ -269,6 +289,4 @@ Feel free to make a pull request! :octocat: [colored_graph_image]: https://user-images.githubusercontent.com/7895001/166443444-40ad8113-2c0f-46d7-9c75-1cf08435ce15.png [releases]: https://github.com/guptarohit/asciigraph/releases [asciichart]: https://github.com/kroitor/asciichart -[asciinema]: https://asciinema.org/a/382383.svg -[7]: https://asciinema.org/a/382383 [graph_with_legends_image]: https://github.com/guptarohit/asciigraph/assets/7895001/4066ee95-55ca-42a4-8a03-e73ce20df5d3