Skip to main content

A qt-widget to visualize directed graphs

Project description

QtGraphVisuals

View directed graphs with a qt-widget implemented using pyside6!

I highly recommend making a virtual environment for new packages!

$ python3 -m venv /path/to/my/env
$ source /path/to/my/env/bin/activate
$ pip install --upgrade pip

Install w/ pip and run!

$ pip install QtGraphVisuals
$ python3 -m QtGraphVisuals

Viola!

Main features are:

  • Directed Graph visualisation: This library visualizes nx.DiGraph/MultiDigraph and also supports Keras / Onnx models.
  • Graph exploration: Zoom / Pan / Click / Move the graph and nodes!
  • Properties Viewer: View properties of the graph and nodes interactively!
  • Tabs: View many graphs, just one tab click away :)

Examples

View nx.DiGraphs:

from QtGraphVisuals import quick_view
import networkx as nx

G1 = nx.DiGraph([(1,2), (2,3), (3,4)])
G2 = nx.DiGraph([(1,2), (2,3), (3,4), (2,4)])

quick_view({'G1': G1, 'G2': G2})

View Keras or Onnx models. Note you will have to install Onnx and Tensorflow separately (pip install onnx and/or pip install tensorflow)!

import onnx
from tensorflow import keras

onnx_model = onnx.load('my_model.onnx')
keras_model = keras.applications.ResNet50()
quick_view({'onnx': onnx_model, 'keras': keras_model})

Integrate as widget into other Qt GUI projects

import sys
import networkx as nx
from PySide6.QtWidgets import QApplication
from QtGraphVisuals import QGraphViewer

if __name__ == "__main__":
    # Create the app
    app = QApplication(sys.argv)
    app.setApplicationName("QtGraphVisuals Demo")

    # Stylize (not necessary but it looks nice)
    extra={ "secondaryDarkColor":"#232629", "font_size": '15px',}
    apply_stylesheet(app, theme='dark_blue.xml', extra=extra)

    # Instantiate viewer
    viewer = QGraphViewer({'graph1': nx.path_graph([1,2,3], create_using=nx.DiGraph)})
    viewer.resize(800,600)
    viewer.show()

    sys.exit(app.exec())

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

qtgraphvisuals-0.0.8.tar.gz (41.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qtgraphvisuals-0.0.8-py3-none-any.whl (47.9 kB view details)

Uploaded Python 3

File details

Details for the file qtgraphvisuals-0.0.8.tar.gz.

File metadata

  • Download URL: qtgraphvisuals-0.0.8.tar.gz
  • Upload date:
  • Size: 41.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for qtgraphvisuals-0.0.8.tar.gz
Algorithm Hash digest
SHA256 cd28e7e2c1d6e24cfc92a54e1ebd5f88e48b183688ca04eada84b18d035c4813
MD5 eb628aea25f5c33a8e188851e22c30cb
BLAKE2b-256 265b50e99cf84d5187589acabe550c0902296e2beaddde81622718d0ea757d47

See more details on using hashes here.

File details

Details for the file qtgraphvisuals-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: qtgraphvisuals-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 47.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for qtgraphvisuals-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 299410b8db8c54f18bb7e08fe9357df3246aeba2c12797cbf6b9d2a73944b374
MD5 e2f273a3d308fedeaa1d205850a645e2
BLAKE2b-256 2445d979e9e355f187cac36917fe7a98c10c831f118298831a37727820784223

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