Skip to content

Jonbean/graphscii

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graphscii

Print ASCII graphs in the terminal.

Risk graph

Installation

The easiest way to install is with pip:

sudo pip install graphscii

To manually install, use:

sudo python ./setup.py install

Usage

To draw a graph, create a Graph object, add nodes and edges, and invoke the draw() method:

from graphscii import Graph

g = Graph()
g.add_node('n0', pos=[0.1, 0.1])
g.add_node('n1', pos=[0.9, 0.1])
g.add_node('n2', pos=[0.5, 0.9])
g.add_edge('n0', 'n1', label='e0')
g.add_edge('n1', 'n2', label='e1')
g.add_edge('n2', 'n0', label='e2')
g.draw()

Simple triangle graph

For more examples, see the examples directory.

About

Print ASCII graphs in the terminal.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%