Giter Site home page Giter Site logo

datavlab / diagram Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tehmaze/diagram

0.0 2.0 0.0 184 KB

Text mode diagrams using UTF-8 characters and fancy colors

Home Page: https://pypi.python.org/pypi/diagram

License: MIT License

Python 99.01% Shell 0.99%

diagram's Introduction

diagram

Text mode diagrams using UTF-8 characters and fancy colors (using Python).

Build Status Code Health

Features

  • Axial graphs
  • Horizontal and vertical bar graphs
  • Supports both 3 bit (16 color) and 8 bit (256 color) mode colors with various pre-defined palettes (see below)
  • UTF-8 text graphics

Installation

It's recommended to use pip to install/update.

To install:

$ sudo pip install diagram

To update:

$ sudo pip install -U diagram

To install from github:

$ sudo pip install git+https://github.com/tehmaze/diagram.git

Examples

Pictures say more than a thousand words.

Axis graph

Axis Graph

Horizontal bar graph

Horizontal bar graph

Drawing characters used:

▏ ▎ ▍ ▌ ▋ ▊ ▉ █

Vertical bar graph

Vertical bar graph

Drawing characters used:

▁ ▂ ▃ ▄ ▅ ▆ ▇ █

Usage

Use diagram --help for documentation:

usage: diagram [-h] [-G] [-H] [-V] [-a] [-A] [-c] [-C] [-l] [-L]
               [-f function] [-p palette] [-x characters] [-y characters]
               [-r] [-b] [-s SLEEP] [-i file] [-o file] [-e ENCODING]

optional arguments:
  -h, --help            show this help message and exit

optional drawing mode:
  -G, --graph           axis drawing mode (default)
  -H, --horizontal-bars
                        horizontal drawing mode
  -V, --vertical-bars   vertical drawing mode

optional drawing arguments:
  -a, --axis            draw axis (default: yes)
  -A, --no-axis         don't draw axis
  -c, --color           use colors (default: yes)
  -C, --no-color        don't use colors
  -l, --legend          draw y-axis legend (default: yes)
  -L, --no-legend       don't draw y-axis legend
  -f function, --function function
                        curve manipulation function, use "help" for a list
  -p palette, --palette palette
                        palette name, use "help" for a list
  -x characters, --width characters
                        drawing width (default: auto)
  -y characters, --height characters
                        drawing height (default: auto)
  -r, --reverse         reverse draw graph

optional input and output arguments:
  -b, --batch           batch mode (default: no)
  -k, --keys            input are key-value pairs (default: no) (1)
  -s SLEEP, --sleep SLEEP
                        batch poll sleep time (default: none)
  -i file, --input file
                        input file (default: stdin)
  -o file, --output file
                        output file (default: stdout)
  -e ENCODING, --encoding ENCODING
                        output encoding (default: auto)

(1): only works for the horizontal bar graph, the first argument is the key
and the second value is the data point.

--function ...

The parameter can be just the function name or the function name with arguments, for example:

diagram -f log

or, with an argument:

diagram -f log:e

log

Symmetrical logarithmic scale.

smooth

Smooth (and optionally differentiate) data with a Savitzky-Golay filter.

--palette ...

default / spectrum

Palette Spectrum

grey

Palette Grey

red

Palette Red

green

Palette Green

blue

Palette Blue

diagram's People

Contributors

tehmaze avatar yegle avatar drnic avatar mrjink avatar

Watchers

James Cloos avatar john 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.