GithubHelp home page GithubHelp logo

graphterm's Introduction

graphterm

graphterm provides basic support for interactive drawings of directed acyclic graphs in ASCII.

Usage

Create a TermDAG object and populate it with nodes and links. Call interactve() to draw in interactive form and printonly() to output the ASCII representation to stdout:

import graphterm as gt

dag = TermDAG()
dag.add_node('alpha')
dag.add_node('beta')
dag.add_node('gamma')
dag.add_node('delta')
dag.add_node('epsilon')
dag.add_node('zeta')

dag.add_link('alpha', 'beta')
dag.add_link('alpha', 'gamma')
dag.add_link('alpha', 'delta')
dag.add_link('beta', 'epsilon')
dag.add_link('gamma', 'epsilon')
dag.add_link('delta', 'epsilon')
dag.add_link('delta', 'zeta')

dag.printonly()

The resulting graph is shown below. As there is not enough room for the label for gamma, it is collected in a list on the right.

        o alpha                    
        |                          
       /|\                         
      | | |                        
 beta o o o delta [ gamma ]        
      | | |                        
       \|/|                        
        | |                        
epsilon o o zeta      

In interactive mode, nodes can be highlighted by typing a / followed by their name, for example /gamma would highlight the name and node for gamma as well as its connected neighbors. The highlighting can walk through the nodes from left to right, top to bottom with n and p.

For larger graphs, scrolling is accomplished with the arrow keys or w, a, s, d.

To quit the interactive mode, use q.

Authors

graphterm was written by Kate Isaacs.

License

graphterm is released under the LGPL v3 license. For more details, see the LICENSE file.

graphterm's People

Contributors

kisaacs avatar

Stargazers

Benjamin Datko avatar Matt avatar Ferenc Fejes avatar Tobias Brandt avatar Saad Al Muttakee avatar Leif Denby avatar zkchen avatar John Lunzer avatar Santiago Torres avatar Nikolaus Piccolotto avatar Axel Huebl avatar Layik Hama avatar Ryan McCuaig avatar Frank avatar Todd Gamblin avatar junji hashimoto avatar

Watchers

James Cloos avatar  avatar

Forkers

leifdenby

graphterm's Issues

LICENSE change?

Hi,

I like your algorithm and the ASCII diagrams it produces and would like to use it in some tools I'm considering building.

Unfortunately I think the GPL license is going to be a problem for that. Would you consider re-releasing it under a different license such as the MIT or Apache 2.0 license?

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.