Building a network

Add nodes, connect their ports, set their widgets, read and change their code, and group them into macros.

Add a node

Drag a node from the libraries on the left onto the network, or double-click it in the list. While you drag, the node itself is drawn under the cursor, with its ports and widgets, at the network's zoom and where it will land: dimmed over the libraries, solid over the network. To find a node, type part of its name in Find a node; hovering over a node in the list shows what it does.

A Dial node dragged from the library list over the network editor
A Dial dragged to the network. The list was narrowed by typing dial; the dashed outline marks where the node will land.

Only the Standard library is loaded when the server starts. Libraries… loads the others (see Node libraries); opening a network or an example loads the libraries it uses.

Ports and data types

A node's inputs are on its left edge and its outputs on its right edge, one row each. The shape and color of a port show the type of data it takes or gives (float, int, string, list, image, geometry, molecule…); hovering over a port shows its name, its type, and whether it is optional. An input given a widget shows the widget on its row instead of a port icon.

Two small squares are special ports: the one on the top edge (runNode) runs the node when a connection brings anything to it, and the one on the bottom edge (trigger) runs the nodes connected to it after this one.

Connect

Drag from an output port to an input port. While you drag, the inputs that can take the data light up, and the others dim. An input that takes a single connection and already has one is dimmed too: disconnect it first.

A connection dragged from the Dial's value output; print's input and Op2's inputs are marked as able to take it
Connecting the Dial's value. The inputs of print and Op2 accept a float.

To remove a connection, right-click it and choose Delete connection, or click it and press Delete. Right-clicking a port offers Show data (the value it holds now) and Disconnect.

Widgets

An input with a widget gets its value from the widget, shown on its row in the node or in the parameter column. Right-click a widget for its menu:

The menu of the operator widget of an Op2 node
A widget's menu, then the node's own entries.
The menu of the print node
A node's menu. Double-clicking a node opens its code.

Numbers. Scroll over a number (mouse wheel, or two fingers on a trackpad) to change it step by step: Shift makes the steps 10 times finer, Alt/Option 10 times coarser. Drag its ⇄ handle to change it continuously, or use its ▲▼ arrows. Edit > Reverse the scrolling direction on numbers changes which way the wheel goes.

The parameter column

The parameter column of an Op2 node
The selected node's parameters. Its name (edit it to rename the node), its library and class, its widgets, buttons, and its ports, each with data (show the value) and ✕ (delete the port); unbind removes an input's widget.

Click a node to select it. The column on the right shows its widgets, Run node, Edit code…, Freeze (a frozen node does not run, and stops the data there), its ports, and Add a port. Shift-click or Shift-drag selects several nodes; the column then offers to group or delete them.

A node's code

Every node is a Python function you can read and change. Double-click a node, or use Edit code…:

The code editor showing the compute function of a Filelist node
The code of a Filelist node (in the tutorial network cartoon1b, which adds values.sort()). The arguments are the input ports, in order; self.outputData(filelist=filenames) sends a value out of the filelist port. Save and run keeps the new code and runs the node.

A changed node keeps its code in the network file. Writing your own nodes explains the function, the ports and returning 'Stop'.

Select, move, copy

todo
select a nodeclick it
select severalShift-drag a rectangle on the background, or Shift-click nodes
movedrag a node (the selected nodes move together)
pan, zoomdrag the background; mouse wheel
copy, paste, deleteCtrl-C, Ctrl-V, Delete (or the Edit menu)
see the whole networkf, or Edit > Fit the network in view
tidy itEdit > Arrange the nodes from left to right

Macros

Select some nodes and choose Group into a macro… (node menu, Edit menu or the parameter column): they become one node, and the connections that crossed the group's edge become its ports. Double-click the macro node to open its network in a tab:

The inside of the indexMax macro, open in a tab next to the network
The indexMax macro of the tutorial network cartoon2b, opened in a tab. Its input ports come from the input Ports node on the left, its outputs go to the output Ports node on the right.

Inside a macro, connecting a node to the new port of input Ports or output Ports adds a port to the macro. Explode macro puts its nodes back in the network around it. Library macros (Icosahedral1, IcosCage, UTiso…) open the same way.