Chapter 2. Using KGraphViewer

The Main Window

The main window displays the loaded graphs, each in its own tab. Initially, if you start KGraphViewer without arguments, its main window will be empty as in the screenshot below. In this case, the toolbar contains only the Open File and the (empty) Recently Opened Files items. Click on the first one to open the standard Open File dialog.


The initial main window when opening KGraphViewer for the first time

The initial main window when opening KGraphViewer for the first time


After selecting one or several DOT files, the main window looks like the next screenshot below:


The main window of KGraphViewer with several files opened

The main window of KGraphViewer with several files opened


As you can see, if the graph is larger than the available area, a bird's-eye view is shown in one corner. You can choose with the context menu whether the optimal position of this overview should be automatically computed for you, or place it where you want yourself.

Moving the Graph inside the Window

To move the graph, you can:

  • Click and drag it;

  • Use the scroll bars;

  • Press the arrows keys;

  • Click somewhere in the bird's-eye view;

  • Use the mouse wheel (up and down with no modifier, left and right with the Alt key pressed);

  • or click and drag in the bird's-eye view.

Zooming

To zoom, you can either use the and toolbar buttons to zoom in and out, or hold down the Shift key while rolling your mouse wheel. While zooming in, the red rectangle in the bird's-eye view that indicates the displayed zone gets smaller and smaller. If it were to get smaller than 10 pixels in its shorter side, it will be replaced by a filled red rectangle in order to stay visible. You can see that on the screenshot below.


A graph at the maximal zoom in level

A graph at the maximal zoom in level


Zooming is limited in both directions by a factor of 10. You can see below the maximum zoom-out factor on a graph.


A graph at the maximum zoom-out level

A graph at the maximum zoom-out level


Graph Files Handling

Files Modified on Disk

If a file currently loaded in KGraphViewer is modified by another program, the following dialog is shown:


Dialog to reload a file modified on disk

Dialog to reload a file modified on disk


You can choose to reload the graph or to ignore the change. You can also get KGraphViewer to remember your choice, so it will do the same thing the next time. If you later want to modify your choice, choose the SettingsConfigure KGraphViewer menu item. See the section called “Configuring KGraphViewer.

Files and Windows

When you open a graph file from outside a running KGraphViewer instance, e.g. from a file browser or the command line, you have the choice to open a new KGraphViewer window or to open the graph in a new tab in the existing window. This is done with the dialog below.


Dialog to open a new window

Dialog to open a new window


As for the previous option, you can save your default choice and modify it later in the configuration dialog.

Session Handling

At start-up, you can choose to reopen the graphs that you had opened the previous time. Again, you can save your choice and change it later.


Dialog to reload the graph of the previous session at start-up

Dialog to reload the graph of the previous session at start-up