Create and edit nodes
• • • • 5.3 •
To begin editing a diagram, if you are not already in edit mode, click the edit tool . This displays the node toolbar as an extension of the navigation toolbar.
For a description of each node shape (or class), see Classes of variables and other objects.
Create a node: To create a new node, press the mouse button with the cursor over the node class you want in the node toolbar, and drag the node to the location you want in the diagram. When creating a new node, you can type a title directly into it.
Edit a node title: To edit the title of an existing node:
- Make sure you are in edit mode with the diagram in focus.
- Hover over the node (i.e., position the mouse cursor over the node and wait half a second) until hover icons appear.
- Click on the hover icon.
- Type in a new title to replace the old one. Or click a third time to put a cursor into the existing title where you can add text. Or double-click to select a word to replace.
- After editing the title to your satisfaction, click outside the node (or press Tab or Alt-Enter) to accept the new title.
If the node is too small for the title text, it expands the node vertically to fit. It can accept a title of any length, but it’s usually best not to have titles longer than about 40 characters.
Click a node once to select it, showing its handles — small black squares at its corners when you are in edit mode. These black square are called resizing handles.
Identifiers and titles: Every object has a unique identifier of up to 20 characters. An identifier must start with a letter, and contain only letters, digits, or underscores (_). Formulas in the Definition of a variable or function refer to other variables or functions by their identifier.
Most objects also have a Title, which is usually displayed in its diagram node. A title can contain any number of characters of any type, including spaces. A title should be a meaningful word or phrase. Avoid obscure acronyms. It’s usually best to keep a title to under 50 characters.
Making an identifier from a title: By default, when you enter a title, it also generates an identifier for the object consisting of the first 20 characters of the title, using underscore (_) to replace any character that is not a letter or number. If the first character is not a letter, it substitutes A, because identifiers must start with a letter. Identifiers, unlike title, must be unique. So, if by chance an object exists with the same identifier, it appends a number to the new identifier to keep it unique.
If you edit the title again, it usually asks if you want to change the identifier to match the changed title. Generally, it’s best to have them match. But, sometimes you might want to retain the original identifier. You can change this default behavior by unchecking Preferences dialog in the Preferences dialog from the Edit menu.
Automatic update when identifier changes: If an identifier changes, Analytica automatically updates any definitions referring to that identifier it to use the new version, and so keeps the model consistent.
Show identifiers instead of titles: By default, it shows the title of each node in a diagram or Result window. To show the identifiers instead, select Show by Identifier from the Object menu, or press Control+y to toggle this behavior.
Select a node: To select a node, single-click it. Handles indicate that you have selected the node. To deselect a selected node, click anywhere outside of it.
To select or deselect multiple nodes, press and hold the Shift key while selecting the nodes. You can also select a group of nodes by dragging a rectangle around them. Move the cursor to a corner of the diagram (not in a node), press the mouse button, and drag the mouse to draw a rectangle. When you release the button, all the nodes completely inside the rectangle are selected.
Move a node: To move a node, press the right mouse button on the node (not on a handle) and drag it to where you want it.
You can also adjust the position of one or more selected nodes with the arrow keys (up, down, left, right). By default, each arrow press moves the node(s) by eight pixels. If you uncheck Snap-to-grid in the Diagram menu, each arrow press moves the node(s) by one pixel.
Move a node to another module: Simply drag the node onto the module until the module becomes highlighted. When you release the mouse button, the node moves into the module. It has the same location in the diagram of the new module that it had in the old one.
Alternatively, double-click the module to open its Diagram window. Move the Diagram windows so both you can see both the node and the new diagram. Then drag the node to the desired location in the new diagram.
Change the size of a node: Click the node to show its handles. Then drag a handle until the node is the size you desire. By default, it fixes the center of the node at the same location, and expands or contracts its four corners. This keeps node centers aligned with the grid. If you want to move one corner, leaving the opposite corner fixed, uncheck Resize Centered in the Diagram menu.
Delete a node: Select the node(s) and choose Clear from the Edit menu, or press the Delete key. It asks you to confirm your intention because deleting cannot be undone. Sometimes it is better to create a module and title it Trash. (There is a Trash library with a suitable icon.) Then you can drag nodes into it — and still retrieve them, just in case.
Cut, copy, and paste nodes: You can use the standard Cut (Control+x), Copy (Control+c), and Paste (Control+v) commands from the Edit menu on one or more nodes. If you cut a node, you can paste it just once. If you copy a node you can paste it as many times as you wish.
Duplicate nodes: Select the node(s) and choose Duplicate Nodes from the Edit menu (or press Control+d). This is equivalent to using Copy and Paste, but without writing to the clipboard. Duplicating a node creates a new object identical to the original, but it adds a number to its identifier to make it unique and locates it below and to the right of the original node.
Duplicating a set of nodes retains the same dependencies among the duplicated nodes as exists among the origin nodes. For example, suppose you have three variables:
Variable X := 100 Variable
Y := X^2 Variable
Z := X + Y
If you duplicate
Z, but not
X, you get two new variables:
Variable Y1 := X^2
Variable Z1 := X + Y1