Node Editor

Summary

NodeEditor

A canvas specific to graph node workflow.

NodeLink

Holds info about a link between two NodeAttribute objects.

Node

A NodeEditor node.

input_attribute

Shortcut constructor for NodeAttribute(NodeAttributeType.Input)

output_attribute

Shortcut constructor for NodeAttribute(NodeAttributeType.Output)

static_attribute

Shortcut constructor for NodeAttribute(NodeAttributeType.Static)

NodeAttribute

An attachment point for a Node.

NodeAttributeType

Specifies how a NodeAttribute will link to other nodes.

NodeEditor

class dearpygui_obj.node.NodeEditor(**config)[source]

Bases: dearpygui_obj.wrapper.widget.Widget, dearpygui_obj.wrapper.widget.ItemWidgetMx, dearpygui_obj.wrapper.widget.ContainerWidgetMx[NodeEditor]

A canvas specific to graph node workflow.

Should only contain Node objects. Any other kind of widget will not be displayed.

Get all linkages between any NodeAttribute objects in the editor.

Adds a link between two NodeAttribute objects.

Returns

A NodeLink representing the link that was created, or None if the link was invalid.

delete_link(end1: dearpygui_obj.node.NodeAttribute, end2: dearpygui_obj.node.NodeAttribute) None

Deletes a link between two NodeAttribute objects if a link exists.

Get all links in the selected state.

Clears all links from being in the selection state.

get_selected_nodes() Iterable[Node][source]

Get all nodes in the selected state.

clear_node_selection() None[source]

Clears all nodes from being in the selection state.

Set the link callback, can be used as a decorator.

Set the delink callback, can be used as a decorator.

Bases: tuple

Holds info about a link between two NodeAttribute objects.

input: dearpygui_obj.node.NodeAttribute

The input end of the link.

output: dearpygui_obj.node.NodeAttribute

The output end of the link.

Node

class dearpygui_obj.node.Node(label: Optional[str] = None, **config)[source]

Bases: dearpygui_obj.wrapper.widget.Widget, dearpygui_obj.wrapper.widget.ItemWidgetMx, dearpygui_obj.wrapper.widget.ContainerWidgetMx[Node]

A NodeEditor node.

Should only contain NodeAttribute objects, any other kind of widget will not be displayed. Note that NodeAttribute objects may contain any kind or number of widget though.

label: str

Read or modify the ‘label’ config property.

draggable: bool

Read or modify the ‘draggable’ config property.

NodeAttribute

dearpygui_obj.node.input_attribute(*, id: Optional[int] = None) NodeAttribute[source]

Shortcut constructor for NodeAttribute(NodeAttributeType.Input)

dearpygui_obj.node.output_attribute(*, id: Optional[int] = None) NodeAttribute[source]

Shortcut constructor for NodeAttribute(NodeAttributeType.Output)

dearpygui_obj.node.static_attribute(*, id: Optional[int] = None) NodeAttribute[source]

Shortcut constructor for NodeAttribute(NodeAttributeType.Static)

class dearpygui_obj.node.NodeAttribute(type: dearpygui_obj.node.NodeAttributeType = NodeAttributeType.Input, **config)[source]

Bases: dearpygui_obj.wrapper.widget.Widget, dearpygui_obj.wrapper.widget.ItemWidgetMx, dearpygui_obj.wrapper.widget.ContainerWidgetMx[NodeAttribute]

An attachment point for a Node.

type: NodeAttributeType

Read or modify the ‘type’ config property.

is_input() bool[source]

Shortcut for self.type == NodeAttributeType.Input.

is_output() bool[source]

Shortcut for self.type == NodeAttributeType.Output.

is_static() bool[source]

Shortcut for self.type == NodeAttributeType.Static.

class dearpygui_obj.node.NodeAttributeType(value)[source]

Bases: enum.Enum

Specifies how a NodeAttribute will link to other nodes.

Input = None

Input nodes may only link to Output nodes.

Output = 'output'

Output nodes may only link to Input nodes.

Static = 'static'

Static nodes do not link. They are still useful as containers to place widgets inside a node.