Skip to content

Commit 1631ea9

Browse files
committed
docs update clean up.
1 parent 955a06a commit 1631ea9

File tree

12 files changed

+106
-61
lines changed

12 files changed

+106
-61
lines changed

NodeGraphQt/base/graph.py

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -585,16 +585,17 @@ def set_grid_color(self, r, g, b):
585585

586586
def set_grid_mode(self, mode=None):
587587
"""
588-
Set node graph grid mode.
588+
Set node graph background grid mode.
589589
590-
Note:
591-
By default grid mode is set to "VIEWER_GRID_LINES".
590+
(default: :attr:`NodeGraphQt.constants.ViewerEnum.GRID_DISPLAY_LINES`).
591+
592+
See: :attr:`NodeGraphQt.constants.ViewerEnum`
592593
593-
Node graph background types:
594+
.. code-block:: python
595+
:linenos:
594596
595-
* :attr:`NodeGraphQt.constants.ViewerEnum.GRID_DISPLAY_NONE.value`
596-
* :attr:`NodeGraphQt.constants.ViewerEnum.GRID_DISPLAY_DOTS.value`
597-
* :attr:`NodeGraphQt.constants.ViewerEnum.GRID_DISPLAY_LINES.value`
597+
graph = NodeGraph()
598+
graph.set_grid_mode(ViewerEnum.CURVED.value)
598599
599600
Args:
600601
mode (int): background style.
@@ -695,7 +696,8 @@ def get_context_menu(self, menu):
695696
"""
696697
Returns the context menu specified by the name.
697698
698-
Menu Types:
699+
menu types:
700+
699701
- ``"graph"`` context menu from the node graph.
700702
- ``"nodes"`` context menu for the nodes.
701703
@@ -840,7 +842,8 @@ def disable_context_menu(self, disabled=True, name='all'):
840842
"""
841843
Disable/Enable context menus from the node graph.
842844
843-
Menu Types:
845+
menu types:
846+
844847
- ``"all"`` all context menus from the node graph.
845848
- ``"graph"`` context menu from the node graph.
846849
- ``"nodes"`` context menu for the nodes.
@@ -947,19 +950,19 @@ def set_pipe_slicing(self, mode=True):
947950

948951
def set_pipe_style(self, style=PipeLayoutEnum.CURVED.value):
949952
"""
950-
Set node graph pipes to be drawn as straight, curved or angled.
953+
Set node graph pipes to be drawn as curved `(default)`, straight or angled.
951954
952-
.. image:: _images/pipe_layout_types.gif
953-
:width: 80%
955+
.. code-block:: python
956+
:linenos:
954957
955-
Note:
956-
By default pipe layout is set to "PIPE_LAYOUT_CURVED".
958+
graph = NodeGraph()
959+
graph.set_pipe_style(PipeLayoutEnum.CURVED.value)
957960
958-
Pipe Layout Styles:
961+
See: :attr:`NodeGraphQt.constants.PipeLayoutEnum`
962+
963+
.. image:: _images/pipe_layout_types.gif
964+
:width: 80%
959965
960-
* :attr:`NodeGraphQt.constants.PipeLayoutEnum.CURVED.value`
961-
* :attr:`NodeGraphQt.constants.PipeLayoutEnum.STRAIGHT.value`
962-
* :attr:`NodeGraphQt.constants.PipeLayoutEnum.ANGLE.value`
963966
964967
Args:
965968
style (int): pipe layout style.

NodeGraphQt/base/menu.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ class NodeGraphMenu(object):
1212
"""
1313
The ``NodeGraphMenu`` is the main context menu triggered from the node graph.
1414
15+
.. inheritance-diagram:: NodeGraphQt.NodeGraphMenu
16+
:parts: 1
17+
1518
example for accessing the node graph context menu.
1619
1720
.. code-block:: python
@@ -86,7 +89,7 @@ def get_command(self, name):
8689
name (str): name of the command.
8790
8891
Returns:
89-
NodeGraphQt.MenuCommand: context menu command.
92+
NodeGraphQt.NodeGraphCommand: context menu command.
9093
"""
9194
return self._commands.get(name)
9295

@@ -159,7 +162,8 @@ class NodesMenu(NodeGraphMenu):
159162
"""
160163
The ``NodesMenu`` is the context menu triggered from a node.
161164
162-
**Inherited from:** :class:`NodeGraphQt.NodeGraphMenu`
165+
.. inheritance-diagram:: NodeGraphQt.NodesMenu
166+
:parts: 1
163167
164168
example for accessing the nodes context menu.
165169
@@ -230,6 +234,10 @@ def add_command(self, name, func=None, node_type=None, node_class=None):
230234
class NodeGraphCommand(object):
231235
"""
232236
Node graph menu command.
237+
238+
.. inheritance-diagram:: NodeGraphQt.NodeGraphCommand
239+
:parts: 1
240+
233241
"""
234242

235243
def __init__(self, graph, qaction, func=None):

docs/_images/pipe_layout_menu.png

16.1 KB
Loading

docs/custom_widgets.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Built-in Widgets
22
################
33

4-
The ``NodeGraphQt`` framework comes included with a few custom widgets.
4+
| The ``NodeGraphQt`` framework comes included with a few custom widgets.
55
66

77
Properties Bin

docs/examples/ex_menu.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Menu Overview
88
Default Context Menu
99
********************
1010

11-
The ``NodeGraphQt.NodeGraph`` has a context menu can be accessed with
11+
The :class:`NodeGraphQt.NodeGraph` has a context menu can be accessed with
1212
:meth:`NodeGraph.context_menu`.
1313

1414

@@ -19,7 +19,8 @@ It can also be populated it with a config file in ``JSON`` format by using
1919
:width: 300px
2020

2121
| Here's a link to the example config file with a few essential menu commands.
22-
| https://github.com/jchanvfx/NodeGraphQt/blob/master/examples/hotkeys/hotkeys.json
22+
| `example JSON config file <https://github.com/jchanvfx/NodeGraphQt/blob/master/examples/hotkeys/hotkeys.json>`_
23+
2324

2425
Adding to the Graph Menu
2526
************************

docs/examples/ex_node.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Creating Nodes
3939
4040
app.exec_()
4141
42+
|
4243
4344
Creating Node Widgets
4445
*********************
@@ -80,6 +81,8 @@ To you update the widget you can call the
8081

8182
See: :ref:`Node Widgets` for more node widget types.
8283

84+
|
85+
8386
Embedding Custom Widgets
8487
************************
8588

@@ -230,6 +233,7 @@ connecting nodes with the port objects:
230233
- :func:`NodeGraphQt.Port.connect_to`
231234
- :func:`NodeGraphQt.Port.disconnect_from`
232235

236+
|
233237
234238
Connecting a PropertiesBin
235239
**************************

docs/examples/ex_overview.rst

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ User interface overview for the node graph.
99
Navigation
1010
**********
1111

12-
+---------------+----------------------------------------------+
13-
| action | controls |
14-
+===============+==============================================+
15-
| Zoom in/out | *Alt + MMB + Drag* or *Mouse Scroll Up/Down* |
16-
+---------------+----------------------------------------------+
17-
| Pan | *Alt + LMB + Drag* or *MMB + Drag* |
18-
+---------------+----------------------------------------------+
12+
+---------------+----------------------------------------------------+
13+
| action | controls |
14+
+===============+====================================================+
15+
| Zoom In/Out | ``Alt + MMB + Drag`` or ``Mouse Scroll Up/Down`` |
16+
+---------------+----------------------------------------------------+
17+
| Pan | ``Alt + LMB + Drag`` or ``MMB + Drag`` |
18+
+---------------+----------------------------------------------------+
1919

2020
Node Selection
2121
**************
@@ -33,11 +33,11 @@ Tab Search
3333

3434
Nodes registered in the node graph can be created with the tab search widget.
3535

36-
+-------------------+--------+
37-
| action | hotkey |
38-
+===================+========+
39-
| Toggle Visibility | *Tab* |
40-
+-------------------+--------+
36+
+-------------------+----------+
37+
| action | hotkey |
38+
+===================+==========+
39+
| Toggle Visibility | ``Tab`` |
40+
+-------------------+----------+
4141

4242
Pipe Slicing
4343
************
@@ -47,11 +47,11 @@ Pipe Slicing
4747

4848
Connection pipes can be disconnected easily with the built in slice tool.
4949

50-
+---------------------+----------------------------+
51-
| action | controls |
52-
+=====================+============================+
53-
| Slice connections | *Alt + Shift + LMB + Drag* |
54-
+---------------------+----------------------------+
50+
+---------------------+------------------------------+
51+
| action | controls |
52+
+=====================+==============================+
53+
| Slice Connections | ``Alt + Shift + LMB + Drag`` |
54+
+---------------------+------------------------------+
5555

5656
Additional Info:
5757
To disable or enable the pipe slicer see

docs/examples/ex_pipe.rst

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,26 @@ The :class:`NodeGraphQt.NodeGraph` class has 3 different pipe layout styles as
1111
shown above this can be set easily with the :meth:`NodeGraphQt.NodeGraph.set_pipe_style`
1212
function.
1313

14-
Here's a super simple example snippet for setting the pipe layout style to be angled.
14+
|
15+
| Here's a example snippet for setting the pipe layout style to be "angled".
1516
1617
.. code-block:: python
1718
:linenos:
1819
1920
from NodeGraphQt import NodeGraph
20-
from NodeGraphQt.constants import PIPE_LAYOUT_ANGLE
21+
from NodeGraphQt.constants import PipeLayoutEnum
2122
2223
graph = NodeGraph()
23-
graph.set_pipe_style(PIPE_LAYOUT_ANGLE)
24+
graph.set_pipe_style(PipeLayoutEnum.ANGLE.value)
2425
25-
Constants variables for the 3 different pipe layout styles:
26+
| There are 3 different pipe layout styles see: :attr:`NodeGraphQt.constants.PipeLayoutEnum`
2627
27-
- ``Curved``: :attr:`NodeGraphQt.constants.PIPE_LAYOUT_CURVED`
28-
- ``Straight``: :attr:`NodeGraphQt.constants.PIPE_LAYOUT_STRAIGHT`
29-
- ``Angle``: :attr:`NodeGraphQt.constants.PIPE_LAYOUT_ANGLE`
28+
.. note::
3029

31-
Note: if you've set up your node graph with the ``NodeGraphQt.setup_context_menu``
32-
is a convenience function then you'll already have the actions to set the pipe
33-
layout under "Edit>Pipe".
30+
If you've set up your node graph with the :meth:`NodeGraph.set_context_menu_from_file`
31+
function and the example
32+
`example JSON <https://github.com/jchanvfx/NodeGraphQt/blob/master/examples/hotkeys/hotkeys.json>`_
33+
then you'll already have the actions to set the pipe layout under the
34+
"Pipes" menu.
3435

35-
.. image:: ../_images/pipe_layout_menu.png
36+
.. image:: ../_images/pipe_layout_menu.png

docs/examples/ex_port.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Port Overview
44
Creating Custom Shapes
55
**********************
66

7-
(*Implemented on* ``v0.1.1``)
7+
| (*Implemented on* ``v0.1.1``)
88
99
To have custom port shapes the :meth:`NodeGraphQt.BaseNode.add_input` and
1010
:meth:`NodeGraphQt.BaseNode.add_output` functions now have a ``painter_func``
@@ -13,6 +13,8 @@ argument where you specify you custom port painter function.
1313
.. image:: ../_images/custom_ports.png
1414
:width: 178px
1515

16+
|
17+
1618
Example Triangle Port
1719
*********************
1820

@@ -89,6 +91,8 @@ The ``draw_triangle_port`` painter function can then be passed to the ``painter_
8991
# create a input port with custom painter function.
9092
self.add_input('triangle', painter_func=draw_triangle_port)
9193
94+
|
95+
9296
Example Square Port
9397
*******************
9498

docs/menu.rst

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,35 @@ Menus
88
Context menus can also be set from a config file or a dictionary with:
99
:meth:`NodeGraph.set_context_menu_from_file`, :meth:`NodeGraph.set_context_menu`
1010

11+
|
1112
12-
Graph Menu
13-
**********
13+
GraphMenu
14+
*********
1415

1516
| The context menu triggered from the node graph.
1617
1718
.. autoclass:: NodeGraphMenu
1819
:members:
1920
:exclude-members: qmenu
21+
:member-order: bysource
2022

23+
|
2124
22-
Nodes Menu
23-
**********
25+
NodesMenu
26+
*********
2427

2528
| The context menu triggered from a node.
2629
2730
.. autoclass:: NodesMenu
2831
:members:
32+
:member-order: bysource
2933

34+
|
3035
31-
Command
32-
*******
36+
NodeGraphCommand
37+
****************
3338

3439
.. autoclass:: NodeGraphCommand
3540
:members:
3641
:exclude-members: qaction
42+
:member-order: bysource

0 commit comments

Comments
 (0)