NAME
Term::Vspark
SYNOPSIS
Displays beautiful graphs to use in the terminal
DESCRIPTION
METHODS
Returns a string with a single utf8 bar according to the values
Term::Vspark::show_single_bar($value_for_this_bar, $max_value, $number_of_columns_to_display);
Returns a string with a various utf8 bars according to the values
Term::Vspark::show_graph('values' => \@values_for_this_graph, 'max' => $max_value, 'columns' => $number_of_columns_to_display);
Example:
use Term::Vspark;
use Term::Size;
chomp( @ARGV = <STDIN> ) unless @ARGV;
my @list = sort { $a <=> $b } @ARGV;
my ($columns, $rows) = Term::Size::chars *STDOUT{IO};
print Term::Vspark::show_graph(
'max' => $list[-1],
'columns' => $columns,
'values' => \@ARGV,
);
Example 2:
chomp( @ARGV = <STDIN> ) unless @ARGV;
my %k_values = @ARGV;
my @list = sort { $a <=> $b } values %k_values;
print Term::Vspark::show_labeled_graph(
'max' => $list[-1],
'columns' => 10,
'k_values' => \%k_values,
);
This will receive numbers from ARGV or STDIN and print out beutiful graph based on that data.
NAME
Term::Vspark - Perl extension for dispaying bars in the terminal
SEE ALSO
Original repo: https://github.com/LuRsT/vspark
AUTHOR
Gil Gonçalves <lurst@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Gil Gonçalves.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.