Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions NodeGraphQt/base/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down Expand Up @@ -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)

Expand All @@ -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.
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/ex_menu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/ex_node.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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_()

Expand Down