Graph view

<< Click to Display Table of Contents >>

Navigation:  Building blocks of QGeNIe > QGeNIe workspace >

Graph view

The Graph View is the primary model view in QGeNIe. It shows a directed graph in which each node represents a variable and each arc represents an influence between two nodes. It is an intuitive environment for creating and editing networks, useful in gaining insight into models by making the structure of their graphs explicit. A slightly modified version of the Graph View is the Cost Graph View, described in a separate section.

An example of the graph view is shown below:

graph_view

Graph View can be enhanced dramatically by structuring the model hierarchically into submodels. Please see the section on QGeNIe submodels to learn more about it.

The Layout Menu and buttons on the Format Toolbar can be used to change the aesthetic properties of the Graph View.

Commands for displaying or hiding the grid and aligning the elements in the graph can be found in the Layout Menu.

The Format Toolbar has buttons for changing the font, color and size of the labels of the nodes, and buttons for performing the aligning operations on text and on the elements of the graph.

Please see Layout Menu and Format Toolbar for more information.

Opening a Graph View window

The graph view window is always open by default whenever a new model is opened or created. It is a large sheet with variables placed at user-designated locations. You can select the Open option from the File Menu to open a saved network file. You can create a new network by selecting the New option from the File Menu.

Closing a Graph View window

There are three ways in which you can close a Graph View window:

By clicking on the Close (close_icon) button at the top right of the Graph View window.

By selecting the Close option in the File Menu.

By selecting the Close Network option from the Network Pop-up menu in the Tree View.

If you close all the windows (the main window and all sub-model windows) of an open network then it will result in closing the file, and if any changes have been made on the network, QGeNIe will give you a warning with the dialog box shown below.

close_warning

You can save the changes by clicking on the Yes button. Click on Cancel to continue working on the network.

Working with models in the Graph View:

Each network is opened in a separate graph view sheet in the workspace. Double clicking on a clear area of the graph view sheet will open the Network Property Sheet. Right clicking on any clear area of the graph view sheet will display the Network Pop-up menu, which can be used to modify various properties of the network.

Working with nodes in the Graph View:

You can draw new nodes in the Graph View by selecting the appropriate tool from the Tool Menu or clicking on the appropriate button on the Standard Toolbar.

Double clicking on any node will open its Node Properties Sheet. Right clicking on the node will display the Node Pop-up menu. It can be used to modify the properties of the node.

By default, QGeNIe displays the node names within the node icons in the Graph View. If you want QGeNIe to display node identifiers instead, select Identifiers in the View Menu to switch the display to identifiers.

view_menu

Working with submodels in the Graph View:

Double clicking on any submodel in the Graph View will open a Graph View for that submodel. You can go back to the main network by either minimizing or closing the submodel using the buttons on the top right of the submodel window. Right clicking on the submodel will display the Submodel Pop-up Menu. It can be used to modify the properties of the submodel.

Adding model elements

You can draw the following model elements in the Graph View:

Nodes

Submodels

Arcs

Text Boxes

To add any model element to the Graph View, you have to first select a tool, either from the Tools menu below

tools_menu

or a button from the Standard Toolbar below

standard_toolbar

The next step is to click on any clear area of the Graph View. For all elements except the arc, QGeNIe will draw the icon of the element in the Graph View.

To add an arc between two nodes,

1. Select the arc tool and click on the parent node.

2. Drag the mouse cursor to the child node and release the mouse button.

QGeNIe will show the following dialog:

arc_type

Clicking on any of the four tiles, representing four types of causal connections, will add an arc of the corresponding type from the parent to the child node.

To learn more about creating nodes and arcs, See Building a Bayesian network.

 

Selecting, re-sizing, and moving model elements

You need to select an element to perform an operation that is specific to it.

You can select a single element by clicking on it. The element will show tracker points (small squares around the perimeter of the selected element) that can be used to re-size it. You can re-size the element in any direction by dragging one of these points. Arcs cannot be re-sized, as QGeNIe automatically draws them for you between pairs of nodes connected by arcs.

Sometimes, it may be convenient to select several nodes at a time. There are four ways of selecting nodes in groups in the Graph View:

Rectangular selection

You can select a group of nodes by clicking on an empty area of the Graph View and dragging a selection rectangle in any direction that you wish. Any node completely within the rectangle will be selected. When you draw a rectangular selection with SHIFT key pressed, the selection will be added to the existing selection. When you draw a rectangular selection with both CTRL and SHIFT pressed, the current selection status will be inverted, i.e., model elements selected will become unselected and model elements unselected will become selected.

Extended selection

Once you have an element, such as a node or a group of nodes or text boxes, selected, you can add or remove individual elements from the selection by holding the SHIFT key while clicking on them. This selection process acts as a toggle, i.e., nodes that are currently selected will be de-selected.

Group selection

You can select a specific group of nodes or all nodes in the current window by choosing Select All from the Edit Menu. The shortcut for this selection is CTRL+A.

edit_menu

Select Nodes... dialog

Select Nodes... dialog allows for selecting nodes based on their names or IDs. We will discuss this powerful selection tool in section Selection of model elements.

Select Evidence Nodes

This command selects all nodes that have observed evidence in them. If there are no evidence nodes in the network, this choice is dimmed.

Select Disconnected Nodes

This command selects all nodes that are disconnected from the graph, i.e., have neither parents no children. Typically, such nodes are left disconnected by mistake, so selecting and subsequently highlighting them is a good way of finding them in the model, which may be otherwise challenging in sizable models. If there are no disconnected nodes in the network, this choice is dimmed.

Select by Type sub-menu

You can select model element by type, i.e., nodes, submodels, arcs, and text boxes in the entire model by choosing the appropriate option from the Select by Type sub-menu shown below.

edit_menu_select

 

You can move a node or a group of nodes to another location by dragging it. When you press the Shift key (you need to do it after clicking on the node or the selection, as SHIFT-Click has the meaning of adding an object to the selection), the moving is limited to horizontal and vertical directions.

A node or a set of nodes can be also moved between submodels. To move a node to a different submodel, drag and drop it into a submodel icon or into a submodel window.

Highlighting selected model elements

QGeNIe allows for highlighting the selected model elements (nodes, arcs, submodels, etc.) through the command Highlight Selection in the Edit Menu (short-cut CTRL-L) or through pressing the Highlight selection (highlight_button) button. The following screen shot shows a rectangular selection of model elements in Graph View,

rectangular_selection

This results in selecting a group of nodes and arcs

nodes_selected

When these elements are highlighted, the Graph View changes to the following

highlighted_model_elements

Pressing the ESC button or selecting Clear Highlight from the Edit Menu clears the selection.

Extending the workspace

QGeNIe is somewhat restrictive in how far the Graph View space stretches in every direction and there is typically not too much space beyond the borders. If you want to move model elements in any direction, please bring them close to the border and this will force QGeNIe to move the border.

Deleting model elements

To delete an element or a group of elements, select them and press the Delete key on the keyboard.

Deleting a node deletes all its incoming and outgoing arcs.

Copying, cutting, and pasting model elements

Model elements or group of elements can be copied or cut into the Windows Clipboard, and subsequently pasted into the same or a different Graph View window or into another application. To invoke any of these commands, please select them from the Edit Menu or from the Standard Toolbar (shown above, buttons copy_button, cut_button, and paste_button, respectively). Nodes pasted into the same window will preserve their incoming arcs but will lose their outgoing arcs. The reason for this is simple - the nodes need their parents in order to preserve their definition, which is typically conditional on its parents. On the other hand, preserving the outgoing arcs would mean that their child nodes would have double set of parents, i.e., the original nodes and their copies.

Clipboard supports multiple formats. QGeNIe stores data simultaneously in three formats:

1. Native QGeNIe format for cut, copy, and paste operations between models

2. Standard text, for example names of selected nodes and comments

3. Standard bitmap, which is used for selected objects that have a graphical component

4. Picture (enhanced metafile), used for objects that have a graphical component

Each time you invoke Copy or Cut, data in all three formats are sent to the Clipboard. When pasting into a different application, all you need to do is select Paste special from that application's Edit menu (e.g., in Word or PowerPoint). This should bring the dialog box with all format names. Plain Paste command does different things in different programs - it pastes data as text into Word by default but may paste a bitmap image in Paint.

To copy a complete model as an image, first select all elements in the model using the CTRL+A shortcut. Then use the CTRL+C shortcut to copy the model to the clipboard. Subsequently, open the program in which you want to paste the model image (e.g., Adobe Photoshop or MS Word) and use Paste special and then Bitmap or (better yet!) Picture in Word. If you use Photo Editor or any graphics editing program, Paste will paste the model image by default.

Text-based search for model elements (Find command)

Find (search_button) button from the toolbar or selecting Find from the Edit Menu (shortcut CTRL-F) invokes the following dialog, which allows for finding model elements, such as nodes, through text search

search_dialog

The Find dialog allows for finding the text string specified in the Find what box in the names and identifiers of all elements of the models and submodels. It will also search within annotations if the Look in annotations check box is checked. Match case flag allows for additional customization of the search. Pressing the Find button starts the search. If any matches are found, they are displayed in the dialog box and the Find button changes into the Locate button. Selecting one of the results and pressing the Locate button locates the selected node in the Graph View, centers it, and flashes three times. You can also locate a node by double clicking on one of the results.

Network Pop-up menu for Graph View

The Network Popup Menu for the Graph View can be accessed by right clicking on any clear area of the Graph View. Some of the options might be disabled depending on the properties of the network selected.

network_popup_menu

Most of the commands found here can be also invoked from the Network Menu.

Network Properties (the default operation) opens the Network Properties sheet for the network.

Clear All Evidence is the same command as in the corresponding command in the Network Menu.

Fit to Window makes the network as large or as small as it takes to fit entirely in the Graph View.

Zoom In zooms into the network. Every application of this command increases the zoom by 25%. The current zoom percentage is displayed on the top right of the Standard Toolbar. A similar effect can be obtained by using the zoom tool from the Standard Toolbar or the Tool Menu.

Zoom Out is the opposite of the Zoom In and it zooms out of the network. Every application of this command decreases the zoom by 25%. The current zoom percentage is displayed on the top right of the Standard Toolbar.

Zoom 100% brings the model in the Graph View to its normal size.

Open Parent Submodel is enabled only if the current network in the Graph View is a submodel of another network. The result of this command is opening the Graph View window displaying the parent submodel.

Locate Color Source is active only when the Network Popup Menu is executed inside a submodel. It finds the node that feeds its color to the submodel icon in the Graph View.

Show External Connections is a switch that helps in model navigation. When the switch is on, QGeNIe shows all nodes that are either direct predecessors (parents) or direct successors (children) of the nodes in the current submodel but are not present in the current submodel. QGeNIe will display these nodes at the margin of the Graph View.

Locate Focus Node finds the node designated as focus.

Paste Here pastes the contents of the clipboard onto the Graph View into the exact position of the mouse click that invoked the pop-up menu. This choice will be active only if the clipboard has data that have been entered using the Cut or Copy command within QGeNIe. You cannot Cut or Copy items from other programs into QGeNIe Graph View. You can Cut or Copy nodes between two running instances of QGeNIe.

Insert Here submenu

network_popup_menu_insert_here

The Insert Here submenu contains a list of all elements that can be drawn in the Graph View. Select any of the items on the list to place that item at the current cursor position. See Components of QGeNIe models section for more information on each item.

Select submenu

Selection of items enables certain operations to be performed on them without affecting other items that are not selected. Some options in QGeNIe will not be enabled unless some item has been selected.

network_popup_menu_select

The Select submenu contains the following options: All (select all items in the Graph View), Nodes (select all nodes in the Graph View), Submodels (select all submodels in the Graph View), and Arcs (select all arcs in the Graph View).

Selection modifiers

Simple selection, such as rectangular selection and the selections by color, by type and by the diagnostic type can be modified by pressing the SHIFT key or CTRL and SHIFT keys simultaneously. Effectively, three selection modes are available:

Default selection: When neither SHIFT nor CTRL keys are pressed, leads to selection of only objects selected. The remainder of the model elements becomes unselected.

Add-to election: When the SHIFT key is pressed but CTRL key is not pressed, the objects selected by the selection operation are selected, the remaining model elements do not change their selection status.

Invert selection: When both the SHIFT and the CTRL keys are pressed, the objects selected by the selection operation invert their selection status, the remaining model elements do not change their selection status.

For example, consider the Project model. Let us select all model elements (nodes and arcs) with Ctrl+A first, then go to the Edit Menu and Select submenu. When keeping both SHIFT and CTRL pressed, we select Arcs. The selection status for arcs will invert and only nodes will remain selected.

View nodes as submenu

network_popup_menu_view_nodes_as

The View nodes as submenu is used to select how the nodes should be displayed in the Graph View. It is similar to the View As submenu in the Node menu but it applies to all nodes rather than to the selected nodes.