Skip to content

Go package to make lightweight ASCII line graph ╭┈╯ in command line apps. Mindful fork of guptarohit/asciigraph.

Notifications You must be signed in to change notification settings

lithdew/asciigraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asciigraph

A hard fork of guptarohit/asciigraph with some radical changes to render ASCII graphs on terminal UIs.

  1. Width and heights provided are fully respected. In the original library, specifying the graphs width does not take into account the space needed for the left axis.
  2. The visible unicode width of each rune drawn in the graph are taken into account while drawing against the width and height of the graph.
  3. Any expensive calls to fmt.Sprintf are removed and replaced with strconv.FormatFloat.
  4. A slice of runes is kept for drawing the graph vs a slice of strings.
 15.00 ┤         ╭──────╮                                             ╭─────╮                       
 12.86 ┤       ╭─╯      ╰─╮                                         ╭─╯     ╰──╮                    
 10.71 ┤     ╭─╯          ╰─╮                                     ╭─╯          ╰╮                   
  8.57 ┤    ╭╯              ╰╮                                  ╭─╯             ╰─╮                 
  6.43 ┤   ╭╯                ╰─╮                               ╭╯                 ╰╮                
  4.29 ┤ ╭─╯                   ╰╮                             ╭╯                   ╰╮               
  2.14 ┤╭╯                      ╰╮                           ╭╯                     ╰─╮             
  0.00 ┼╯                        ╰╮                        ╭─╯                        ╰╮            
 -2.14 ┤                          ╰─╮                     ╭╯                           ╰╮           
 -4.29 ┤                            ╰╮                   ╭╯                             ╰╮          
 -6.43 ┤                             ╰╮                 ╭╯                               ╰─╮        
 -8.57 ┤                              ╰─╮             ╭─╯                                  ╰╮       
-10.71 ┤                                ╰╮          ╭─╯                                     ╰─╮     
-12.86 ┤                                 ╰──╮     ╭─╯                                         ╰─╮   
-15.00 ┤                                    ╰─────╯                                             ╰──  

This fork was done in a rush while building blanc. If you have any questions, please open a Github issue!

About

Go package to make lightweight ASCII line graph ╭┈╯ in command line apps. Mindful fork of guptarohit/asciigraph.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages