git.shiar.nl
/
barcat.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3bdbf5b
)
indicate average value in bar
author
Mischa POSLAWSKY
<perl@shiar.org>
Wed, 4 Sep 2019 14:57:08 +0000
(16:57 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Thu, 5 Sep 2019 03:11:33 +0000
(
05:11
+0200)
graph
patch
|
blob
|
history
diff --git
a/graph
b/graph
index 83a3a880adaeab4cde199de30081bdb5a92e5125..b53ac6a8496e2f1f46886ab21cc39a7bc6bc6c78 100755
(executable)
--- a/
graph
+++ b/
graph
@@
-1,7
+1,7
@@
#!/usr/bin/env perl
use 5.014;
use warnings;
#!/usr/bin/env perl
use 5.014;
use warnings;
-use List::Util qw( max );
+use List::Util qw( max
sum
);
my $width = $ENV{COLUMNS} || 80;
my $width = $ENV{COLUMNS} || 80;
@@
-15,6
+15,7
@@
my $size = ($width - $lenval - $len) / $order[0]; # bar multiplication
sub orderpos { ($order[$_[0]] + $order[$_[0] + .5]) / 2 * $size }
my @barmark;
sub orderpos { ($order[$_[0]] + $order[$_[0] + .5]) / 2 * $size }
my @barmark;
+$barmark[ sum(@values) / @values * $size ] = '='; # average
$barmark[ orderpos($#order / 2) ] = '+'; # mean
defined and $_ = "\e[36m$_\e[0m" for @barmark;
$barmark[ orderpos($#order / 2) ] = '+'; # mean
defined and $_ = "\e[36m$_\e[0m" for @barmark;