Skip to content

Commit 2771698

Browse files
committed
doc updates
1 parent 879ca29 commit 2771698

File tree

9 files changed

+102
-74
lines changed

9 files changed

+102
-74
lines changed

NodeGraphQt/base/graph.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __init__(self, parent=None, tab_search_key='tab'):
5050
self._undo_stack = QtWidgets.QUndoStack(self)
5151

5252
self._properties_bin = None
53-
self._nodes_list = None
53+
self._nodes_tree = None
5454

5555
tab = QtWidgets.QAction('Search Nodes', self)
5656
tab.setShortcut(tab_search_key)
@@ -252,17 +252,17 @@ def properties_bin(self):
252252
)
253253
return self._properties_bin
254254

255-
def nodes_list(self):
255+
def nodes_tree(self):
256256
"""
257257
Initializes the nodes list widget when first called.
258258
259259
Returns:
260260
NodeTreeWidget: the initialized widget.
261261
"""
262-
if self._nodes_list is None:
263-
self._nodes_list = NodeTreeWidget()
264-
self._nodes_list.set_node_factory(self._node_factory)
265-
return self._nodes_list
262+
if self._nodes_tree is None:
263+
self._nodes_tree = NodeTreeWidget()
264+
self._nodes_tree.set_node_factory(self._node_factory)
265+
return self._nodes_tree
266266

267267
def undo_stack(self):
268268
"""

NodeGraphQt/widgets/properties_bin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def add_node(self, node):
114114
Add node to the properties bin.
115115
116116
Args:
117-
node (NodeGraphQt.BaseNode): node object.
117+
node (NodeGraphQt.NodeObject): node object.
118118
"""
119119
if self.limit() == 0:
120120
return
@@ -157,7 +157,7 @@ def prop_widget(self, node):
157157
Returns the node property widget.
158158
159159
Args:
160-
node (NodeGraphQt.BaseNode): node object.
160+
node (NodeGraphQt.NodeObject): node object.
161161
162162
Returns:
163163
NodePropWidget: node property widget.

docs/classes.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Classes
2+
*******
3+
4+
.. image:: _images/screenshot.png
5+
:width: 95%
6+
7+
8+
.. toctree::
9+
:maxdepth: 3
10+
11+
graph
12+
nodes
13+
connections

docs/index.rst

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
NodeGraphQt API
2-
***************
1+
NodeGraphQt
2+
***********
33

4-
Welcome to the ``NodeGraphQt`` api documentation and just like the project on GitHub this is also a work in progress.
4+
Welcome to the ``NodeGraphQt`` documentation.
55

6-
.. image:: _images/screenshot.png
7-
:width: 95%
86

97
Project: https://github.com/jchanvfx/NodeGraphQt
108

@@ -16,10 +14,9 @@ Contents
1614
:maxdepth: 3
1715

1816
overview
19-
graph
20-
nodes
21-
connections
22-
menu
2317
constants
18+
classes
19+
widgets
20+
menu
2421

2522

docs/menu.rst

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
Menus
22
*****
33

4+
.. image:: _images/menu_hotkeys.png
5+
:width: 50%
6+
7+
The ``NodeGraphQt.setup_context_menu`` has a built in function that'll populate the node graphs context menu a few
8+
default menus and commands.
9+
10+
.. code-block:: python
11+
:linenos:
12+
13+
from NodeGraphQt import NodeGraph, setup_context_menu
14+
15+
graph = NodeGraph()
16+
setup_context_menu(graph)
17+
418
example adding "Foo" menu to the node graphs context menu.
519

620
.. code-block:: python
@@ -30,23 +44,6 @@ add "Bar" command to the "Foo" menu.
3044
# add "Bar" command to the "Foo" menu.
3145
foo_menu.add_command('Bar', my_test, 'Shift+t')
3246
33-
Default Setup
34-
=============
35-
36-
.. image:: _images/menu_hotkeys.png
37-
:width: 50%
38-
39-
The ``NodeGraphQt.setup_context_menu`` has a built in function that'll populate the node graphs context menu a few
40-
default menus and commands.
41-
42-
.. code-block:: python
43-
:linenos:
44-
45-
from NodeGraphQt import NodeGraph, setup_context_menu
46-
47-
graph = NodeGraph()
48-
setup_context_menu(graph)
49-
5047
----
5148

5249
.. autofunction:: NodeGraphQt.setup_context_menu

docs/nodes.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ Nodes
22
*****
33

44

5-
Object
6-
======
5+
NodeObject
6+
==========
77

88
**Inherited by:** :class:`NodeGraphQt.BaseNode`, :class:`NodeGraphQt.BackdropNode`
99

10-
The ``NodeObject`` class is the main base class that all nodes inherit from.
10+
The ``NodeGraphQt.NodeObject`` class is the main base class that all nodes inherit from.
1111

1212
----
1313

@@ -20,12 +20,13 @@ Attributes
2020
.. autoattribute:: NodeGraphQt.NodeObject.__identifier__
2121
.. autoattribute:: NodeGraphQt.NodeObject.NODE_NAME
2222

23-
Node
24-
====
23+
24+
BaseNode
25+
========
2526

2627
**Inherited from:** :class:`NodeGraphQt.NodeObject`
2728

28-
The ``BaseNode`` class is the base class for nodes that allows port connections from one node to another.
29+
The ``NodeGraphQt.BaseNode`` class is the base class for nodes that allows port connections from one node to another.
2930

3031

3132
.. image:: _images/node.png
@@ -38,12 +39,12 @@ The ``BaseNode`` class is the base class for nodes that allows port connections
3839
:exclude-members: update_model
3940

4041

41-
Backdrop
42-
========
42+
BackdropNode
43+
============
4344

4445
**Inherited from:** :class:`NodeGraphQt.NodeObject`
4546

46-
The ``BackdropNode`` class allows other node object to be nested inside, it's mainly good for grouping nodes together.
47+
The ``NodeGraphQt.BackdropNode`` class allows other node object to be nested inside, it's mainly good for grouping nodes together.
4748

4849
.. image:: _images/backdrop.png
4950
:width: 250px

docs/overview.rst

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,33 +32,6 @@ Node can be created with the tab node search widget.
3232
+-------------------+--------+
3333

3434

35-
Properties Bin
36-
==============
37-
38-
.. image:: _images/prop_bin.png
39-
:width: 950px
40-
41-
.. code-block:: python
42-
:linenos:
43-
44-
from NodeGraphQt import NodeGraph
45-
46-
graph = NodeGraph()
47-
48-
properties_bin = graph.properties_bin()
49-
properties_bin.show()
50-
51-
52-
Menu Setup
53-
==========
54-
55-
The NodeGraphQt has a ``setup_context_menu`` method that'll setup the node graphs with basic menus and commands.
56-
57-
`(see line:32 in the example code below)`
58-
59-
see also: :ref:`Menus`
60-
61-
6235
Example
6336
=======
6437

docs/widgets.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
Widgets
2+
*******
3+
4+
5+
PropertiesBinWidget
6+
===================
7+
8+
.. image:: _images/prop_bin.png
9+
:width: 950px
10+
11+
.. code-block:: python
12+
:linenos:
13+
14+
from NodeGraphQt import NodeGraph
15+
16+
graph = NodeGraph()
17+
18+
# create properties bin widget.
19+
properties_bin = graph.properties_bin()
20+
properties_bin.show()
21+
22+
----
23+
24+
.. autoclass:: NodeGraphQt.widgets.properties_bin.PropertiesBinWidget
25+
:members:
26+
27+
NodeTreeWidget
28+
==============
29+
30+
.. image:: _images/nodes_tree.png
31+
:width: 300px
32+
33+
.. code-block:: python
34+
:linenos:
35+
36+
from NodeGraphQt import NodeGraph
37+
38+
graph = NodeGraph()
39+
40+
# create node tree widget.
41+
nodes_tree = graph.nodes_tree()
42+
nodes_tree.show()
43+
44+
----
45+
46+
.. autoclass:: NodeGraphQt.widgets.node_tree.NodeTreeWidget
47+
:members:

example.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ def show_prop_bin(node):
5555

5656

5757
# show the nodes list when a node is "double clicked" in the graph.
58-
node_list = graph.nodes_list()
58+
node_tree = graph.nodes_tree()
5959
def show_nodes_list(node):
60-
if not node_list.isVisible():
61-
node_list.update()
62-
node_list.show()
60+
if not node_tree.isVisible():
61+
node_tree.update()
62+
node_tree.show()
6363
graph.node_double_clicked.connect(show_nodes_list)
6464

6565

0 commit comments

Comments
 (0)