Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Latest commit

 

History

History
104 lines (89 loc) · 5.46 KB

README.md

File metadata and controls

104 lines (89 loc) · 5.46 KB

Mattermost Plugin Ascii Plot

CircleCI branch codecov Releases

Modifies a post with plot data in Mattermost (or Matterhorn) and generates a simple ascii plot

img

Usage

Create a message with text asciiplot or asciigraph, followed by a space and a list of numbers separated by commas.
A bot or webhook can trigger this as well.

asciiplot 3, 4, 9, 6, 2, 4, 5, 8, 5, 10, 2, 7, 2, 5, 6

Messages can be multiline, where the pattern asciiplot 1,..,n is replaced by the ascii plot.

These are important figures.
asciigraph -1 ,0,-2 , 3, -12
Those were important figures.

Becomes

These are important figures.

   2.92 ┤                                          ╭─╮               
   1.92 ┤                                       ╭──╯ ╰╮              
   0.93 ┤                                    ╭──╯     ╰╮             
  -0.07 ┤       ╭──────────╮              ╭──╯         ╰╮            
  -1.06 ┼───────╯          ╰──────╮    ╭──╯             ╰╮           
  -2.06 ┤                         ╰────╯                 ╰╮          
  -3.05 ┤                                                 ╰╮         
  -4.05 ┤                                                  ╰╮        
  -5.04 ┤                                                   ╰╮       
  -6.03 ┤                                                    ╰╮      
  -7.03 ┤                                                     ╰╮     
  -8.02 ┤                                                      ╰╮    
  -9.02 ┼                                                       ╰╮   
 -10.01 ┤                                                        ╰╮  
 -11.01 ┤                                                         ╰╮ 
 -12.00 ┤                                                          ╰ 
 
Those were important figures.

Multiple asciiplot 1,..,n patterns can be in the same message.

this is cool
asciiplot 0,1
this is also cool
asciigraph -1,0,1,0,-1

Becomes

this is cool

 1.00 ┼                                                         ╭─ 
 0.93 ┤                                                     ╭───╯  
 0.87 ┤                                                 ╭───╯      
 0.80 ┤                                             ╭───╯          
 0.73 ┤                                         ╭───╯              
 0.67 ┤                                     ╭───╯                  
 0.60 ┤                                 ╭───╯                      
 0.53 ┤                             ╭───╯                          
 0.47 ┤                         ╭───╯                              
 0.40 ┤                     ╭───╯                                  
 0.33 ┤                 ╭───╯                                      
 0.27 ┤             ╭───╯                                          
 0.20 ┤         ╭───╯                                              
 0.13 ┤     ╭───╯                                                  
 0.07 ┤ ╭───╯                                                      
 0.00 ┼─╯                                                          

this is also cool

  0.97 ┤                           ╭───╮                            
  0.84 ┤                         ╭─╯   ╰─╮                          
  0.70 ┤                       ╭─╯       ╰─╮                        
  0.57 ┤                     ╭─╯           ╰─╮                      
  0.44 ┤                   ╭─╯               ╰─╮                    
  0.31 ┤                 ╭─╯                   ╰─╮                  
  0.18 ┤               ╭─╯                       ╰─╮                
  0.05 ┤             ╭─╯                           ╰─╮              
 -0.08 ┼           ╭─╯                               ╰─╮            
 -0.21 ┤         ╭─╯                                   ╰─╮          
 -0.34 ┤       ╭─╯                                       ╰─╮        
 -0.48 ┤      ╭╯                                           ╰╮       
 -0.61 ┤    ╭─╯                                             ╰─╮     
 -0.74 ┤  ╭─╯                                                 ╰─╮   
 -0.87 ┤╭─╯                                                     ╰─╮ 
 -1.00 ┼╯                                                         ╰ 
Build
make

This will produce a single plugin file (with support for multiple architectures) for upload to your Mattermost server:

dist/com.github.scottleedavis.mattermost-plugin-ascii-post.tar.gz