GustikS / xdot.py

A custom visualizer of workflow graphs (written in a specific json format)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Requirements

Python 3

Installation

Do NOT use conda, create a new environment with venv. Try to install from the requirements.txt file.

If that does not work, follow the manual installation steps without virtual environment.

  1. install GraphViz - the graph layouting engine on the backend

sudo apt install graphviz

  1. Install PyGObjects - python library for GUI applications (like this one)
  • sudo apt install libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-3.0
  • pip3 install pycairo
  • pip3 install PyGObject
  • pip3 install pygraphviz

Acknowledgment

This package was created by my student Daniel Mareda. It is based on the xdot.py library which is explained below.

About xdot.py

xdot.py is an interactive viewer for graphs written in Graphviz's dot language.

It uses internally the GraphViz's xdot output format as an intermediate format, Python GTK bindings, and Cairo for rendering.

xdot.py can be used either as a standalone application from command line, or as a library embedded in your Python application.

Requirements

Windows users

Download and install:

Debian/Ubuntu users

Run:

apt-get install gir1.2-gtk-3.0 python3-gi python3-gi-cairo graphviz

Usage

Command Line

If you install xdot.py from PyPI or from your Linux distribution package managing system, you should have the xdot somewhere in your PATH automatically.

When running xdot.py from its source tree, you can run it by first setting PYTHONPATH environment variable to the full path of xdot.py's source tree, then running:

python3 -m xdot

You can also pass the following options:

Usage:
	xdot.py [file|-]

Options:
  -h, --help            show this help message and exit
  -f FILTER, --filter=FILTER
                        graphviz filter: dot, neato, twopi, circo, or fdp
                        [default: dot]
  -n, --no-filter       assume input is already filtered into xdot format (use
                        e.g. dot -Txdot)
  -g GEOMETRY           default window size in form WxH

Shortcuts:
  Up, Down, Left, Right     scroll
  PageUp, +, =              zoom in
  PageDown, -               zoom out
  R                         reload dot file
  F                         find
  Q                         quit
  P                         print
  Escape                    halt animation
  Ctrl-drag                 zoom in/out
  Shift-drag                zooms an area

If - is given as input file then xdot.py will read the dot graph from the standard input.

Embedding

See included sample.py script for an example of how to embedded xdot.py into another application.

Screenshot

Download

Links

About

A custom visualizer of workflow graphs (written in a specific json format)

License:GNU Lesser General Public License v3.0


Languages

Language:Python 85.7%Language:PostScript 14.1%Language:Makefile 0.1%Language:Shell 0.1%