Giter Club home page Giter Club logo

aspark's Introduction

ASPARK README
===

aspark is a C program to display ASCII Sparklines.
It is completely useless in 2011.

It is a bloated versions of https://github.com/holman/spark
and is intended for Enterprise Companies.

Basic usage
---

The program has different operation modes to get data in different ways. The
simplest default operation mode is getting data from the command line:

$ ./aspark 1,2,3,4,10,7,6,5
    `-_ 
__-`   `

By default the program prints graphs using two rows. For better resolution you
can change this using the --rows option:

$ ./aspark 1,2,3,4,5,6,7,8,9,10,10,8,5,3,1 --rows 4
       _-``_   
     _`        
   -`       `  
_-`          `_

Sometimes graphs are more readable if the area under the curve is filled,
so a --fill option is provided:

$ ./aspark 1,2,3,4,5,6,7,8,9,10,10,8,5,3,1 --rows 4 --fill
       _o##_   
     _#|||||   
   o#|||||||#  
_o#||||||||||#_

It is possible to use labels, specifying them using a ':' character followed
by the label in the list of comma separated values, like in the following
example:

$ ./aspark '1,2,3,4,5:peak,4,3,1,0:base'
  _-`-_  
-`     -_
         
    p   b
    e   a
    a   s
    k   e

Sometimes a logarithmic scale is to be preferred since difference betwen values
can be too big:

$ ./aspark 1,2,3,10,50,100
     `
____` 

$ ./aspark 1,2,3,10,50,100 --log
    -`
__-`  

Stream mode
---

In stream mode data is read form standard input, one value per each line:

$ echo -e "1\n2\n3\n" | ./aspark --stream
 _`
_  

In this mode it is still possible to use labels, using a space and the label
after the actual value, like in the following example:

$ echo -e "1\n2 foo\n3\n" | ./aspark --stream
 _`
_  
   
 f 
 o 
 o 

In stream mode it is often interesting to pipe data form other programs:

$ ruby -e '(1..40).each{|x| print Math.sin(x/2),"\n"}' | ./aspark --stream --rows 4 --fill
 ####        __##          ##__        #
 ||||__      ||||##      ##||||      __|
#||||||    oo||||||      ||||||oo    |||
|||||||oo__||||||||##__##||||||||__oo|||

Characters frequency mode
---

The last mode is enabled usign --txtfreq or --binfreq options. It is used to
create a frequency table of the data received from standard input:

$ cat /etc/passwd | ./aspark --txtfreq --fill --rows 4
              o          #          #            _        
              |          |      #   |            |#_      
              |          |      |_  |   #  __#o_ |||__    
_________#____|__#_______|______||##|#o_|__|||||_|||||__#_
                                                          
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ

You can see the frequency of every single byte using --binfreq.

Check aspark --help for more information about the usage.

Author
---

aspark was developed by Salvatore Sanfilippo <[email protected]> during a few
hours of complete relax. Since it is completely useless it will not be further
developed by the author.

aspark's People

Contributors

antirez avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.