diff --git a/NodeGraphQt/base/graph.py b/NodeGraphQt/base/graph.py index 22d5f202..88dafcc2 100644 --- a/NodeGraphQt/base/graph.py +++ b/NodeGraphQt/base/graph.py @@ -357,7 +357,7 @@ def _on_node_data_dropped(self, mimedata, pos): node_ids = sorted(re.findall(r'node:([\w\.]+)', search_str)) x, y = pos.x(), pos.y() for node_id in node_ids: - self.create_node(node_id, pos=[x, y]) + self.create_node(node_id, pos=(x, y)) x += 80 y += 80 elif mimedata.hasFormat('text/uri-list'): @@ -422,7 +422,7 @@ def _on_search_triggered(self, node_type, pos): Args: node_type (str): node identifier. - pos (tuple or list): x, y position for the node. + pos (tuple[int, int]): x, y position for the node. """ self.create_node(node_type, pos=pos) @@ -431,7 +431,7 @@ def _on_connection_changed(self, disconnected, connected): called when a pipe connection has been changed in the viewer. Args: - disconnected (list[list[widgets.port.PortItem]): + disconnected (list[list[widgets.port.PortItem]]): pair list of port view items. connected (list[list[widgets.port.PortItem]]): pair list of port view items. @@ -1200,7 +1200,7 @@ def create_node(self, node_type, name=None, selected=True, color=None, selected (bool): set created node to be selected. color (tuple or str): node color ``(255, 255, 255)`` or ``"#FFFFFF"``. text_color (tuple or str): text color ``(255, 255, 255)`` or ``"#FFFFFF"``. - pos (list[int, int]): initial x, y position for the node (default: ``(0, 0)``). + pos (tuple[int, int]): initial x, y position for the node (default: ``(0, 0)``). push_undo (bool): register the command to the undo stack. (default: True) Returns: diff --git a/docs/examples/ex_menu.rst b/docs/examples/ex_menu.rst index bea0ea05..3673944d 100644 --- a/docs/examples/ex_menu.rst +++ b/docs/examples/ex_menu.rst @@ -100,7 +100,7 @@ can override context menus on a per node type basis. # create some nodes. foo_node = graph.create_node('io.github.jchanvfx.FooNode') - bar_node = graph.create_node('io.github.jchanvfx', pos=[300, 100]) + bar_node = graph.create_node('io.github.jchanvfx', pos=(300, 100)) # show widget. node_graph.widget.show() diff --git a/docs/examples/ex_node.rst b/docs/examples/ex_node.rst index c363fc73..0b97f2c4 100644 --- a/docs/examples/ex_node.rst +++ b/docs/examples/ex_node.rst @@ -35,7 +35,7 @@ Creating Nodes # here we create a couple nodes in the node graph. node_a = node_graph.create_node('io.github.jchanvfx.MyNode', name='node a') - node_b = node_graph.create_node('io.github.jchanvfx.MyNode', name='node b', pos=[300, 100]) + node_b = node_graph.create_node('io.github.jchanvfx.MyNode', name='node b', pos=(300, 100)) app.exec_()