Skip to main content

A PyQt5 widget to manipulate (build, render, interact, load and save) Graphviz graphs

Project description

QGraphViz

A PyQT based GraphViz builder/renderer (100% opensource)

Introduction

I was searching for a handy tool to code graphs using python then visualize them within my software. I found about graphviz which is a great tool to build graphs.

The problem is that you need to install the graphviz software in order to compile your file and render it. There is a graphviz package on PYPI that allows creating dot code that can then be processed by graphviz, but in practice, you need to install graphviz and somehow add it to your path in order to execute the render command.

PyGraphviz is another package that can be used. But as you can read in their documentation, you still need to install Graphviz.

I also found this visualizer based on pyQt4. It is a simple Qt based visualizer that tracks the updates on the .gv file and redraws it in realtime: DDorch/GraphVizLiveUpdateViewer

So since I didn't find any package out there that satifies my needs, I decided to create a pyQT5 based Graphviz tool that can visualize Graphviz code without the need to install Graphviz and provide it with MIT licence, so that other people can simply use it in their software.

Objective

Build python pyQT5 based QWidget that can visualize graphs and allow realtime interaction with graphs add edges and nodes, change attributes ...

Requirements

As its name suggests, this module needs you to install pyqt5 package first.

pip install pyqt5

Installation

pip install QGraphViz

Actual status

  1. Simple graphs visualization (nodes + edges)
  2. Simple gv files read/write
  3. Graph nodes can hold custom parameters that can be used by the application
  4. Graph nodes are now manipulable and we can add nodes and link them using the QWidget gui, wa can also delete nodes.
  5. The application can accept or refuse edges creation and even add custom parameters to the edges
  6. The nodes can be double clicked and an event is sent to the application allowing it to do custom
  7. User application is informed wen a new connection is created between two nodes, when a node is selected or when it is double clicked.
  8. User application is informed when a edge is selected or double clicked.
  9. Only two supported node shapes (box or oval)
  10. Advanced nodes shapes are not yet implemented
  11. Subgraphs are not supported yet
  12. Only the dot layout is implemented

Example code

You can find an example code for manipulating graphs in examples/QGraphViewer.py.

Changelog

V 0.0.19 :

Bugfix in opening files with clusters Cluster paramters syntax is still incompatible with Standard GraphViz syntax: subgraph [parameters]{ put nodes here }

V 0.0.20 :

Better compatibility with Graphviz. Clusters can now have graphviz style parameters Semicolumn at the end of each line is no more needed

V 0.0.21 :

Fixed subgraph loading code

V 0.0.24 :

Added save and load json format graphs

V 0.0.25 :

Added the possibility to add multiple edges between the same nodes two nodes The cycles are still forbidden as they break the Dot engine

V 0.0.26 :

Edge selection when more than a single edge is used between two nodes

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

QGraphViz-0.0.26.tar.gz (11.7 kB view details)

Uploaded Source

File details

Details for the file QGraphViz-0.0.26.tar.gz.

File metadata

  • Download URL: QGraphViz-0.0.26.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for QGraphViz-0.0.26.tar.gz
Algorithm Hash digest
SHA256 47e3f3e6433c750ffc64caac80e93c1e858018d3dfff4aaea2446b066f389b9b
MD5 789eedb8e8def6ddfc39794e39bf1075
BLAKE2b-256 0cd56476739c19cce29c8f27876bf161a3b962319e0f096e74631bf8d5ab0104

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page