@@ -3,13 +3,17 @@ qt-dataflow
3
3
===========
4
4
This package tries to provide components for building your own
5
5
visual programming environment. The authors aim is to make his
6
- data analysis programmes available to his colleagues who don't
6
+ data analysis tool available to his colleagues who don't
7
7
know programming or Python.
8
+
8
9
Because a standard gui is not very flexible, this projects tries
9
- to make visual canvas on which the dataflow is defined. Extensibility
10
- is given through simply adding or modifying Nodes.
10
+ to make visual canvas on which the dataflow can be defined and modified.
11
+ Extensibility is given through simply adding or modifying Nodes.
12
+
13
+
11
14
This project is inspired by Orange - where i did not see an easy way to just
12
- use the canvas part (also: license differences).
15
+ use the canvas part (also: license differences). Also the design tries
16
+ to be more flexible.
13
17
14
18
15
19
Requirements
@@ -18,19 +22,63 @@ It is made with Python 2.7. Not tested for lower versions or
18
22
Python 3 (patches welcome). It should work with PySide and PyQt,
19
23
but at the moment, the imports need to be manually changed.
20
24
21
- The example has additional requirements:
25
+ The examples have additional requirements:
22
26
* numpy
23
27
* matplotlib
28
+ * pyqtgraph for the pyqtgraph example
24
29
25
- Usage
26
- -----
27
- See example.py for an easy example using icons whic react to double click.
30
+ Examples
31
+ --------
32
+ See example.py for an simple example using icons whic react to double click.
28
33
Hold the mousebutton to connect node Termials (only out-> in is allowed).
29
34
30
35
.. image :: https://github.com/Tillsten/qt-dataflow/raw/master/example.png
31
36
32
- Example2 uses widgets directly, also uses callback to propagate changes.
33
- Warning, there is no circular detection yet.
37
+ example_widget uses widgets on the canvas directly, it also show how to make
38
+
39
+ example_pyqtgraph need also the pyqtgraph package. It plot directly on the
40
+ canvas.
41
+
42
+ example_matplotlib_on_canvas does the same, but uses matplotlib via
43
+ a temporary file.
44
+
45
+ Code Example
46
+ ------------
47
+ To make custom nodes you need to subclass Node. It must return
48
+ a NodeView via its 'get_view' method. The following example
49
+ implements a Node which make a random number.
50
+
51
+ ```python
52
+ class RandomNumber(Node):
53
+ """
54
+ A test node which outputs a random number. Widget allow to set the number.
55
+ """
56
+ def __init__(self):
57
+ super(DataGenNode, self).__init__()
58
+ #Node type/name
59
+ self.node_type = 'Random Array'
60
+ #Icon_path is needed for the PixmapNodeView
61
+ self.icon_path = 'icons/onebit_11.png'
62
+ #The makes the node have an output terminal.
63
+ self.generates_output = True
64
+
65
+ def get_view(self):
66
+ return PixmapNodeView(self)
67
+
68
+ def get(self):
69
+ #Method which can be called by other nodes. The name is just
70
+ #a convention.
71
+ num = [random.random() for i in range(self.num_points)]
72
+ return num
73
+
74
+ def show_widget(self):
75
+ #Method called by double clicking on the icon.
76
+ int, ok = Qt.QtGui.QInputDialog.getInteger(None, 'Input Dialog',
77
+ 'Number of Points', self.num_points)
78
+ if ok:
79
+ self.num_points = int
80
+ ` ``
81
+
34
82
35
83
36
84
Structure
58
106
59
107
Coding Style
60
108
------------
61
- This projects trys to follow PEP8.
109
+ This projects tries to follow PEP8.
62
110
63
111
License
64
112
-------
0 commit comments