Skip to content
Sparkline generator for the fish shell
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.travis.yml ▃▅▇ 1.0.0 Feb 18, 2019
LICENSE.md
README.md Simplify perf section; one benchmark is enough Feb 22, 2019
spark.fish Fix unescaped dollar char in usage help Feb 22, 2019

README.md

fish-spark

Build Status Releases

Spark is a sparkline generator for the fish shell. It's an unofficial port of the original spark.sh with options for adjusting the minimum and maximum values of the input and faster execution time.

Installation

Install with Fisher (recommended):

fisher add jorgebucaran/fish-spark
Not using a package manager?

Copy spark.fish to any directory on your function path.

set -q XDG_CONFIG_HOME; or set XDG_CONFIG_HOME ~/.config
curl https://git.io/spark.fish --create-dirs -sLo $XDG_CONFIG_HOME/fish/functions/spark.fish

To uninstall, remove the file.

System Requirements

Usage

You have a set of numbers which can be comma-delimited, separated by spaces, newlines, or tabs. What's a simple way to visualize these data on the terminal? Sparklines!

$ spark 0 1 2 3
▁▃▅█

Spark can read from standard input as well. Here is a random sequence of numbers.

$ seq 80 | sort -R | spark
▁▅▄▄▂▁▂▅▂▇▄▅▄▃▃▄▁▂▃▁▁▅▄▇▃▆▆▂▄▄▂▆▆▆▇▃▆▇▁▄▃▄▆▅▄█▅▁▃▆▁▁▁▂▆▁▅▅▇▇▅▇▅▇▃▆▄▂▇▃▃▅▂▁▇▆▂▇▂▃

Spark calculates the smallest and largest numbers from your dataset to calibrate the height of the sparklines. To force these values to anything else use --min=<number> and --max=<number>.

$ spark 10 20 30 40 50
▁▂▄▆█
$ spark --max=100 -- 10 20 30 40 50
▁▂▃▃▄

And this is just the tip of the iceberg.

Check out Wicked Cool Usage for more things you can do with Spark.

Performance

Spark is considerably faster than the original spark.sh, reading and writing relatively large datasets under milliseconds.

$ time fish -c "seq 10000 | sort -R | spark" >/dev/null
       0.19 real         0.19 user         0.01 sys

$ time fish -c "seq 10000 | sort -R | spark.sh" >/dev/null
       86.15 real        84.44 user         0.53 sys

License

MIT

You can’t perform that action at this time.