After loading a graph with this command, the layout algorithm for edge crossing minimization is not started automatically. You can either do this later using menu(layout(improve_all)) or by combining both steps with command menu(file(open_graph_placed(...))), see below. The advantage of the second method is that the user will not see an unplaced graph without having applied crossing minimization.
As an alternative, you can avoid file access by sending the graph in
term representation directly to the API using command
graph(new(...)).
menu(file(open_graph_placed(filename)))
This command combines
menu(file(open_graph(...)))
(i.e. loading a graph) and
menu(layout(improve_all))
(i.e. starting layout algorithm to minimize edge crossings) in one step.
The advantage of using this command (instead of the previous one) is that
the user will not see an unplaced graph without applied crossing minimization.
The parameter filename (should not be relative!) specifies a file
containing a daVinci graph in
term representation.
As an alternative, you can avoid file access by sending the graph in
term representation directly to the API using command
graph(new_placed(...)).
menu(file(open_status(filename)))
Loads a
status
from file filename (should not be relative!). The file has to
exist and must contain a status previously saved by daVinci.
A status is a graph together with layout informations and user interface
settings.
menu(file(save_graph(filename)))
Saves the current graph in
term representation
to the specified file filename (should not be relative!). The filename
should have the prefix .daVinci. By saving a term
representation, only the graph structure will be stored and the layout
informations will be lost.
menu(file(save_status(filename)))
Saves the
status
of the current graph to the specified file filename
(should not be relative!). The filename should have the prefix
.status. By saving a status, the graph structure will be stored
as well as layout informations and user interface settings.
menu(file(print(filename)))
Saves a PostScript representation of the current graph to the specified file
filename (should not be relative!). The filename should have the
prefix .ps.
The generated file is EPSF compliant (encapsulated PostScript) and can
either be printed on a PostScript printer or imported with appropriated
software. Read
more about the PostScript interface
in the reference.
The options of the PostScript interface, available in the
print dialog window
of the user interface, are not accessible from the API. This command will
always use PostScript scale 1:1 without centering.
menu(file(print))
Opens the
print dialog window
if a graph is loaded. When no graph is loaded in the current context, nothing
will happen.
menu(file(close))
-> Returns answer close!
Closes the current context in multi-graph multi-window mode. This will remove all windows which shows the graph of the current context. Afterwards, the closed context cannot be used any further. To proceed, the application has to open a new context with command multi(new_context) or specify one of the remaining contexts to be the current context with command multi(set_context(...)). All other commands will be ignored as long as a new current context is not specified!
This command is not available in single-graph mode. Even the last context may
be closed without quitting daVinci. When closing the last context,
no window will be visible, but the daVinci process is still running
and accepts commands to open a new first context.
menu(file(exit))
Quits daVinci.
This will immediately terminate the daVinci process.
View Menu Category:
The commands of the view category are used to open additional views (windows)
to the current graph, to set the scale and to show some windows with
information. The view category is the API equivalent of the
View menu
of the user interface.
menu(view(open_new_view))
Opens a new view of the current graph which is an additional
base window
showing the same graph
(multi-view).
Each view of a graph is based on the
same logical structure, so selection of a node or fine-tuning operations
in one view will manipulate all the other views of the same graph, too.
One exception is the scale, so each view may have its own scale.
From a technical point of view, multi-view windows are not the same as multi-graph windows which show different graphs and are independent from eachother. Multi-view is a feature of the user interface, so an application is not able to control multi-view windows (e.g. to close one particular window). But the application has the opportunity to open additional views by using this command. All views (i.e. base windows) of a context (i.e. graph) will be removed when the context is closed, either by the user or the application with command menu(file(close)). The user may open and close new views for a graph at any time.
Note: In multi-view mode, all commands dealing with one base window rather than a graph (e.g. setting the scale, focusing nodes or setting the window position) are always applied only to the master view and not to all views of the current context. The master view is the oldest view of a context.
In multi-window mode this command
returns answer open_window. All commands dealing with one base window
rather than a graph (e.g.
setting the scale,
focusing nodes or
setting the window position)
are always applied to the current window.
menu(view(open_survey_view))
This command can be used to open a special survey view showing the whole graph
in reduced scale, whereby the currently visible part of the
master view
is visualized with a blue rectangle. This rectangle is updated as soon as
scrolling is used in the master view. When the user selects a node in the
survey view, daVinci will automatically scroll to this node in the
master view.
Refer to command menu(view(open_new_view)) for general information about multi-view.
In multi-window mode this command
returns answer open_window.
menu(view(full_scale))
Sets the scale to 100% such that all details are visible. In
multi-view
mode, this operation will only affect the
master view
of the current context.
menu(view(fit_scale_to_window))
Sets the scale to the maximal value such that the graph is completely
visible. In
multi-view
mode, this operation will only affect the
master view
of the current context.
menu(view(scale(integer)))
Sets the scale to the given parameter integer.
The integer is a percent value and has to be in the range between
1 and 100. So, with a scale of 20 the graph is drawn five
times smaller than usual. In scales smaller than 100, the text of nodes
is not displayed and other details are dropped as well.
If you like to have the graph in a smaller scale and need to see
the text of nodes, you can set a smaller font size or gap width/height
by using the API commands
set(font_size(...)),
set(gap_width(...)) and
set(gap_height(...)). In
multi-view
mode, this operation will only affect the
master view
of the current context.
menu(view(scale))
Opens the
scale dialog window
if a graph is loaded. When no graph is loaded in the current context, nothing
will happen.
menu(view(graph_info))
Opens the
graph info dialog window
if a graph is loaded. When no graph is loaded in the current context, nothing
will happen.
menu(view(daVinci_info))
Opens the
daVinci info dialog window.
All commands of this category do not return answer ok for confirmation. Instead, they return the new selection by using answer node_selections_labels(...). Of course the corresponding operation of a navigation command may fail, for example when none of the nodes match with the string used in command menu(navigation(find(...))). A failed navigation command will not modify the selection and will return the current (former) selection as result. So, to see if the command was successful or not, you have to compare the node selection before and after sending the navigation command. If both selections are the same, then the navigation has failed, otherwise it was successful.
Note: If you are looking for an API command to select a specified set of
nodes and edges in the graph, then this category is obviously the wrong place
(because nodes are not selected via menus in daVinci, but with
the mouse). You can select particular nodes and edges with the API commands
found in the
special(...) category.
menu(navigation(select_parents(node_ids)))
-> Returns answer node_selections_labels(...)!
Selects all parent nodes of the nodes specified by list node_ids.
The returned answer is either the list of parents (which is the new current
selection) or the former selection when this operation fails (i.e. if there
are no parents for the given nodes).
menu(navigation(select_siblings(node_ids)))
-> Returns answer node_selections_labels(...)!
Selects all sibling nodes (i.e. children or all parents) of the nodes specified
by list node_ids.
The returned answer is either the list of siblings (which is the new current
selection) or the former selection when this operation fails (i.e. if there
are no siblings for the given nodes).
menu(navigation(select_children(node_ids)))
-> Returns answer node_selections_labels(...)!
(Only available in daVinci V2.1 or higher. This command was
menu(navigation(select_childs(..))) in daVinci V2.0.x which is still supported
by V2.1.x for backward compatibility.)
Selects all child nodes of the nodes specified by list node_ids.
The returned answer is either the list of children (which is the new current
selection) or the former selection when this operation fails (i.e. if there
are no children for the given nodes).
menu(navigation(navigator(node_id,direction,boolean)))
-> Returns answer node_selections_labels(...)!
Selects the nearest neighbour node according to the given direction by starting at the specified node node_id. If the boolean parameter is false, geometrical navigation is used. This ignores the relations (edges) in the graph, so for example, if you navigate upwards, you will go to the nearest node at the previous level. On the other side, by using true for the boolean parameter, structural navigation is used which takes the relations of a graph into account. Navigating upwards with structural navigation will select the nearest parent node, according to the center x-coordinates of all parents.
Note: The navigation command will always consider the current layout orientation which can be set with command menu(layout(orientation(...))). So, down in a graph with left-to-right layout will go to the same node as left in a top-down layout of the same graph.
The returned answer is either the node the navigation command has moved to
(which is the new current selection) or the former selection when this
operation fails (e.g. by navigating upwards starting at the topmost node
in a top-down layout).
menu(navigation(navigator))
Opens the
navigator dialog window.
menu(navigation(find(string,boolean,boolean)))
-> Returns answer node_selections_labels(...)!
Searches for a node with text string. The node text is the value of the node attribute OBJECT in the term representation. The first boolean parameter of the command is a flag to consider the case or not. If this parameter is false, then upper and lower case characters (e.g. 'A' and 'a') are not distinguished from eachother for the search. The second boolean parameter is a flag to use exact match or not. If this parameter is false, then for example the search string "Vin" will match a node with text "daVinci", otherwise not. If exactly one node is selected before using this commands, then search will start at this node. Otherwise, the search will start at the leftmost and topmost node (for top-down layouts).
The returned answer is either the first node found by the search operation
(which is the new current selection) or the former selection when this
operation fails (e.g. when there is no node in graph that matches the string).
menu(navigation(find))
Opens the
find dialog window.