All Projects → esimov → Diagram

esimov / Diagram

Licence: mit
CLI app to convert ASCII arts into hand drawn diagrams.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Diagram

Tart
Tart - draw ASCII art in the terminal with your mouse!
Stars: ✭ 296 (-53.89%)
Mutual labels:  terminal, drawing, ascii, ascii-art
Cfonts
Sexy fonts for the console
Stars: ✭ 789 (+22.9%)
Mutual labels:  cli, ascii, ascii-art
Cowsay Files
A collection of additional/alternative cowsay files.
Stars: ✭ 216 (-66.36%)
Mutual labels:  terminal, ascii, ascii-art
Qov
The terminal presentation tool.
Stars: ✭ 141 (-78.04%)
Mutual labels:  cli, terminal, ascii
Vim Boxdraw
An ASCII box drawing plugin for Vim
Stars: ✭ 122 (-81%)
Mutual labels:  ascii, ascii-art, diagram
Lehar
Visualize data using relative ordering
Stars: ✭ 81 (-87.38%)
Mutual labels:  terminal, ascii, ascii-art
Ervy
Bring charts to terminal.
Stars: ✭ 1,530 (+138.32%)
Mutual labels:  cli, terminal, ascii
Ascii canvas
ASCII canvas for drawing in console
Stars: ✭ 11 (-98.29%)
Mutual labels:  drawing, ascii, ascii-art
Ascii py
Make some ascii arts
Stars: ✭ 211 (-67.13%)
Mutual labels:  cli, terminal, ascii
durdraw
Animated Unicode, ANSI and ASCII Art Editor for Linux/Unix/macOS
Stars: ✭ 55 (-91.43%)
Mutual labels:  drawing, ascii, ascii-art
Simpletable
Simple tables in terminal with Go
Stars: ✭ 288 (-55.14%)
Mutual labels:  cli, terminal, ascii
Video To Ascii
It is a simple python package to play videos in the terminal using characters as pixels
Stars: ✭ 960 (+49.53%)
Mutual labels:  cli, terminal, ascii
Ascii
👾 ASCII Roulette :: ascii art video chat on the cli
Stars: ✭ 202 (-68.54%)
Mutual labels:  cli, terminal, ascii-art
Csconsoleformat
.NET C# library for advanced formatting of console output [Apache]
Stars: ✭ 296 (-53.89%)
Mutual labels:  terminal, ascii, ascii-art
Ftxui
💻 C++ Functional Terminal User Interface. ❤️
Stars: ✭ 433 (-32.55%)
Mutual labels:  terminal, ascii, ascii-art
Freedrawview
A View on which you can freely draw, customizing paint width, alpha and color, and take a screenshot of the content. Useful for note apps, signatures or free hand writing.
Stars: ✭ 627 (-2.34%)
Mutual labels:  drawing, canvas
Whipper
Python CD-DA ripper preferring accuracy over speed
Stars: ✭ 517 (-19.47%)
Mutual labels:  cli, terminal
Saws
A supercharged AWS command line interface (CLI).
Stars: ✭ 4,886 (+661.06%)
Mutual labels:  cli, terminal
Sultan
Sultan: Command and Rule over your Shell
Stars: ✭ 625 (-2.65%)
Mutual labels:  cli, terminal
Diagram
☊ Tool for making node graphs. Inspired by dependency graph. Used mainly for automation services 📈
Stars: ✭ 510 (-20.56%)
Mutual labels:  diagram, canvas

Diagram

Build Status GoDoc

Diagram is a CLI tool to generate ASCII art from hand drawn diagrams.

It's a full fledged CLI application which converts the ASCII text into a hand drawn diagram. The CLI part is based on gocui package and the ASCII to PNG conversion is realized using the gg library.

screencast

Installation

In order to run the application please make sure that Go is installed on your local machine and check if $GOPATH/bin is included into the PATH directory.

$ export GOPATH="$HOME/go"
$ export PATH="$PATH:$GOPATH/bin"

Download the library

$ go get -u -f github.com/esimov/diagram
$ go install

# Start the application
$ diagram

Prior checking the generated output by invoking the visualization command (with CTRL-d) please make sure that glfw is installed on your local machine.

For a full list of the required external dependencies check the official documentation of go-glfw (https://github.com/go-gl/glfw/blob/master/README.md).

Build

A shell script is bundled into the library to mitigate the generation of binary files for the most widespread operating systems, but take care: different dependencies are needed for different operating systems. To build the executable file run:

$ make all

Usage

Once you are inside the terminal application you can create, edit or delete the ASCII diagrams. By pressing CTRL+d you can convert the ASCII art into a handwritten diagram. The generated PNG file will be saved into the output folder relative to the current path.

Command Line support

The application also supports the generation of hand drawn diagrams directly from command line without to enter into the CLI application.

$ diagram --help will show the currently supported options:

┌┬┐┬┌─┐┌─┐┬─┐┌─┐┌┬┐
 │││├─┤│ ┬├┬┘├─┤│││
─┴┘┴┴ ┴└─┘┴└─┴ ┴┴ ┴
    Version: 1.0.4

CLI app to convert ASCII arts into hand drawn diagrams.

  -font string
    	Path to the font file (default "/Users/esimov/Projects/Go/src/github.com/esimov/diagram/font/gloriahallelujah.ttf")
  -in string
    	Source
  -out string
    	Destination
  -preview
    	Show the preview window (default true)

CLI Examples

Read input from sample.txt and write image to sample.png showing a preview window with the hand drawn diagram:

diagram -in sample.txt -out sample.png

Read input from sample.txt and write image to sample.png, and exit immediately without showing a preview window:

diagram -in sample.txt -out sample.png -preview=false

Generate diagram as above but use a font at a different location:

diagram -in sample.txt -out sample.png -preview=false -font /path/to/my/font/MyHandwriting.ttf

Key bindings

Key Action
Tab Next Panel
Shift+Tab Previous Panel
Ctrl+s Open Save Diagram Modal
Ctrl+s Save Diagram
Ctrl+d Convert Ascii to PNG
Ctrl+x Clear the editor content
Ctrl+z Restore the editor content
PageUp Jump to the top
PageDown Jump to the bottom
Home Jump to the line start
End Jump to the line end
Delete/Backspace Delete diagram
Ctrl+c Quit

Example

Input Output

The application was tested only on Ubuntu and MacOS.

Acknowledgements

The ascii to png conversion was ported from shaky.dart.

Dependencies

Author

License

Copyright © 2017 Endre Simo

This project is under the MIT License. See the LICENSE file for the full license text.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].