Skip to content

Commit a848bd4

Browse files
committed
renamed examples again, expanded readme
1 parent 33bf580 commit a848bd4

File tree

5 files changed

+65
-13
lines changed

5 files changed

+65
-13
lines changed

MANIFEST

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ qtdataflow\model.py
88
qtdataflow\view.py
99
qtdataflow\examples\__init__.py
1010
qtdataflow\examples\example.py
11-
qtdataflow\examples\example2.py
11+
qtdataflow\examples\example_all_together.py
12+
qtdataflow\examples\example_matplotlib_on_canvas.py
1213
qtdataflow\examples\example_pyqtgraph.py
14+
qtdataflow\examples\example_widget_on_canvas.py
1315
qtdataflow\examples\icons\onebit_11.png
1416
qtdataflow\examples\icons\onebit_16.png
1517
qtdataflow\examples\icons\onebit_31.png

README.rst

Lines changed: 59 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@ qt-dataflow
33
===========
44
This package tries to provide components for building your own
55
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
77
know programming or Python.
8+
89
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+
1114
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.
1317

1418

1519
Requirements
@@ -18,19 +22,63 @@ It is made with Python 2.7. Not tested for lower versions or
1822
Python 3 (patches welcome). It should work with PySide and PyQt,
1923
but at the moment, the imports need to be manually changed.
2024

21-
The example has additional requirements:
25+
The examples have additional requirements:
2226
* numpy
2327
* matplotlib
28+
* pyqtgraph for the pyqtgraph example
2429

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.
2833
Hold the mousebutton to connect node Termials (only out-> in is allowed).
2934

3035
.. image:: https://github.com/Tillsten/qt-dataflow/raw/master/example.png
3136

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+
3482

3583

3684
Structure
@@ -58,7 +106,7 @@ Todo
58106

59107
Coding Style
60108
------------
61-
This projects trys to follow PEP8.
109+
This projects tries to follow PEP8.
62110

63111
License
64112
-------
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__author__ = 'Tillsten'

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
from distutils.core import setup
99

1010
setup(name='qt-dataflow',
11-
version='0.2.1',
11+
version='0.2.2',
1212
description='A base for custom visual programming enviroments',
13+
long_description = open('README.rst', 'rt').read(),
1314
author='Till Stensitzki',
1415
author_email='tillsten@zedat.fu-berlin.de',
1516
url='https://github.com/Tillsten/qt-dataflow',

0 commit comments

Comments
 (0)