Giter Club home page Giter Club logo

qtnodes's Introduction

qtnodes

Node graph visualization and editing with PySide.

Very WIP right now, the goal is to have a bunch of premade components that make it easy to implement a node graph to store and modify arbitrary data.

The UI part is coming along nicely, but no actual data handling is attached to it yet.

UI Example

Although this graph makes no sense, it shows the current look and feel:

Code Example

from PySide import QtGui
from qtnodes import (Header, Node, InputKnob,
                     OutputKnob, NodeGraphWidget)

class Multiply(Node):

    def __init__(self, *args, **kwargs):
        super(Multiply, self).__init__(*args, **kwargs)
        self.addHeader(Header(node=self, text=self.__class__.__name__))
        self.addKnob(InputKnob(name="x"))
        self.addKnob(InputKnob(name="y"))
        self.addKnob(OutputKnob(name="value"))

app = QtGui.QApplication([])
graph = NodeGraphWidget()
graph.registerNodeClass(Multiply)
graph.addNode(Multiply())
graph.show()
app.exec_()

Usage

To start a small demo:

$ python -m qtnodes

You can load example .json files from examples/.

Scene

  • Pan the viewport: Hold the middle mousebutton and drag.
  • Zoom the viewport: Use the mouse wheel.
  • Save scene to file: Rightclick > Scene > Save As...
  • Load scene from file: Rightclick > Scene > Open File...
  • Merge scene from file: Rightclick > Scene > Merge File...
  • Clear complete scene: Rightclick > Scene > Clear Scene
  • Hold scene state: Rightclick > Scene > Hold
  • Fetch scene state: Rightclick > Scene > Fetch
  • Autolayout scene: Rightclick > Scene > Auto Layout

Please note: The automatic layout needs graphviz, which means its dot command must be on PATH.

Nodes

  • Select a node: Leftclick its header.
  • Select multiple nodes: Leftclick and drag a rectangle over the nodes, release to select.
  • Create a node: Rightclick > Nodes, choose a node type.
  • Move a node: Leftclick and drag its header.
  • Delete a node: Select it then press DELETE.
  • Create a connection: Hover over a knob, then leftclick and drag to another knob. You can only connect inputs to outputs and vice versa.
  • Remove a connection: Hold ALT (on Windows, use CTRL on Linux/MacOs), the connections turn red, click one to remove it.

Credits

This started as a port of the original Qt/C++ tool qnodeseditor by Stanislaw Adaszewski, see:

http://algoholic.eu/qnodeseditor-qt-nodesports-based-data-processing-flow-editor/

Additional sources and inspirations:

License

MIT, see LICENSE.txt

qtnodes's People

Contributors

cb109 avatar

Watchers

 avatar

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.