Coder Social home page Coder Social logo

stag's Introduction

STAG

Stag Progress

DESCRIPTION

Stag generates a streaming bar graph inside the terminal from the data (newline separated floats) passed through stdin.

SYNOPSIS

stag [-t TITLE] [-m MARGIN] [-s SCALE_MODE] [-w BAR_WIDTH] [-y Y_SPLITS]

OPTIONS

   -t, --title=TITLE
          Set the title displayed above the graph.

   -m, --margin=T,R,B,L
          Set the margin around the edge of the graph, defined as a comma 
          delimited list of 4 integers: top,right,bottom,left.

   -s, --scale=SCALE_MODE
          Choose how to scale the y-axis of the graph.
          dynamic: update the max using the values currently on the graph
          global: update the max to be the global maximum of all data seen
          min,max: specify the max and min using two integers

   -w, --width=BAR_WIDTH
          Set the width of the bars.

   -y, --split=Y_SPLITS
          Set the number of intermediate y-axis ticks between the min and max.

For unicode support (8x better resolution on the graph using the bar characters) install from the unicode feature branch and then use -u.

EXAMPLES

Trivial example:

  echo -e "1\n2\n3" | ./stag

See examples/ directory for more.

AUTHOR

Seena Burns (nnkd)

Stag 1.0 August 26, 2014

stag's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stag's Issues

Color

can a brother get some color in his bars? I have a dream, where one day white bars and black bars can graph together

Segfault on terminal resize

When resizing the terminal while data is being piped in, stag occasionally segfaults.

To reprodue:

  1. Run (while true; do echo $RANDOM; done)|stag-graph
  2. Resize the terminal incessantly :)

Thanks for making stag!

Segmentation fault on run

I get segmentation fault when I try to run it.

Tried on compiling on both Ubuntu server and OSX.

OSX:
Ncurses - 5.7.2 (Brew)
CC - Apple LLVM version 6.0 (clang-600.0.51)

Ubuntu Server:
Ncruses - 5.9.20140118 (Installed dev version for headers)
CC - Ubuntu 4.8.2-19ubuntu1 4.8.2

Cannot build

cc -Wall -Werror -Wextra -std=c99 -pedantic -Wno-unused-parameter stag.c view.c data.c -o stag -lncurses -lm -D_BSD_SOURCE 
In file included from /usr/include/stdio.h:27:0,
                 from stag.c:1:
/usr/include/features.h:148:3: error: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Werror=cpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
   ^
cc1: all warnings being treated as errors
In file included from /usr/include/string.h:25:0,
                 from view.c:1:
/usr/include/features.h:148:3: error: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Werror=cpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
   ^
cc1: all warnings being treated as errors
In file included from /usr/include/string.h:25:0,
                 from data.c:1:
/usr/include/features.h:148:3: error: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Werror=cpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
   ^
cc1: all warnings being treated as errors
Makefile:9: recipe for target 'stag' failed
make: *** [stag] Error 1

Completion of error handling

I have looked at a few source files for your current software. I have noticed that some checks for return codes are missing.

Would you like to add more error handling for return values from functions like the following?

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.