Overview ->
Reference ->
API Reference ->
Transition Guide
daVinci API - Transition Guide
This document is a migration guide for transition to the daVinci
V2.x API. It is intended for programmers who have implemented
applications for the previous release daVinci V1.x.
Term Representation of Graphs
The syntax of daVinci graphs
(term representation)
has not been modified in V2.x, but the following important restriction
has to be considered:
In daVinci V2.x, all nodes and edges of a graph must have
a unique node/edge-ID in the term representation.
Node- and edge-ID's were called labels in former
releases. A node/edge-ID is the l constructor in front of each
n and e term in a term representation (see
syntax).
So please consider that the ID's are now mandatory.
New API Syntax
With version V2.x, the former V1.x API was subject to a major revision.
Unlike the answers, which have been left untouched, all commands have got a
new syntax and are now grouped into categories with respect to their semantic.
For example, all commands dealing with graph transmission and
updates are member of the
graph category.
Commands for calling the menu functions of the user interface can be found
in the menu category and are further divided
into sub-categories to reflect the menu they belong to, e.g.
menu(layout(improve_all)) or
menu(file(exit)).
This drastic modification of the API was neccessary to realize new features
in daVinci V2.x (e.g. the
multi-graph mode)
and to simplify the use by structuring the API with intuitive categories.
The former V1.x API has had a grown structure without a clear concept, so the
time has come to put this in order.
Applications written for the daVinci V1.x API are still supported in
backward compatibility mode which is automatically activated if an obsolete
V1.x command is sent to the API. So usually, all V1.x applications should be
able to communicate with daVinci V2.x without any modification.
Transform V1.x to V2.x API Commands
As soon as an application would like to use new features of
daVinci V2.x, all commands sent to the API have to be in V2.x
syntax, because most new features will not work in the compatibility mode.
Transition to the new API is easy.
Unless the application does not use any new feature of daVinci V2.x
(e.g.
application icons,
multi-graph mode, etc.),
it will not receive new kinds of answers. The syntax of the answers
that already exist in the previous V1.x API is left untouched.
Moreover, the parameters of the commands, for example the
term representation
of a graph or the specification of
application menus,
have not been modified, too. So, the only task an application programmer
has to do to migrate to the new API is transforming the commands to the new
V2.x syntax according to the following rules. The list shows all V1.x API
commands (in alphabetic order) and their replacement in the V2.x API.
- activate_menu_entries(menu_ids)
V2.x API: app_menu(activate_menus(menu_ids)) Details.
- activation
V2.x API: window(activate) Details.
- change_node_color(node_id,string)
V2.x API: graph(change_attr([node(node_id,[a("COLOR",string)])])) Details.
- close_window
V2.x API: window(iconify) Details.
- compact_graph
V2.x API: menu(layout(compact_all)) Details.
- confirmer(string,strings,string)
Not available in V2.x API. Use daVinci Tcl/Tk interface for arbitrary dialogs.
- create_menu(menus)
V2.x API: app_menu(create_menus(menus)) Details.
- deactivation
V2.x API: window(deactivate) Details.
- focus_node(node_id)
V2.x API: special(focus_node(node_id)) Details.
- focus_node_animated(node_id)
V2.x API: special(focus_node_animated(node_id)) Details.
- hide_or_show_edges
Not available in V2.x API. Use menu(abstraction(hide_edges(...))) or menu(abstraction(show_edges(...))) with current selection instead. Details.
- hide_or_show_subgraph
Not available in V2.x API. Use menu(abstraction(hide_subgraph(...))) or menu(abstraction(show_subgraph(...))) with current selection instead. Details.
- hide_subgraphs(node_ids)
V2.x API: menu(abstraction(hide_subgraph(node_ids))) Details.
- load_graph(filename)
V2.x API: menu(file(open_graph(filename))) Details.
- load_graph_placed(filename)
V2.x API: menu(file(open_graph_placed(filename))) Details.
- load_status(filename)
V2.x API: menu(file(open_status(filename))) Details.
- new_term(graphterm)
V2.x API: graph(new(graphterm)) Details.
- new_term_placed(graphtrees)
V2.x API: graph(new_placed(graphterm)) Details.
- nothing
V2.x API: not changed, still nothing
- open_window
V2.x API: window(deiconify) Details.
- place_all_nodes
V2.x API: menu(layout(improve_all)) Details.
- place_visible_nodes
V2.x API: menu(layout(improve_visible)) Details.
- question_boolean(string,strings,string,string,boolean)
Not available in V2.x API. Use daVinci Tcl/Tk interface for arbitrary dialogs.
- question_string(string,strings,string)
Not available in V2.x API. Use daVinci Tcl/Tk interface for arbitrary dialogs.
- quit
V2.x API: menu(file(exit)) Details.
- restore_edges
V2.x API: menu(abstraction(restore_all_edges)) Details.
- restore_subgraphs
V2.x API: menu(abstraction(restore_all_subgraphs)) Details.
- save_graph(filename)
V2.x API: menu(file(save_graph(filename))) Details.
- save_postscript(filename)
V2.x API: menu(file(print(filename))) Details.
- save_status(filename)
V2.x API: menu(file(save_status(filename))) Details.
- select_nodes_labels(node_ids)
V2.x API: special(select_nodes(node_ids)) Details.
- set_accuracy_phase_1(integer)
V2.x API: set(layout_accuracy(new_integer!)
Details.
Note:
The mechanism to set the accuracy has been simplified to use only one value
in the range between 1 and 5 instead of individual values for phase1 and
phase2. Consider the following relations between the new value and the former
phase1/phase2 values to choose an appropriate setting. Other phase1/phase2
values are no longer supported.
V2.x API |
V1.x API (phase1,phase2) |
1 |
(1,2) |
2 |
(2,3) |
3 |
(3,4) |
4 |
(4,8) |
5 |
(4,12) |
- set_accuracy_phase_2(integer)
V2.x API: set(layout_accuracy(new_integer!)) Details.
Note:
Read comments for previous command set_accuracy_phase_1 above!
- set_font_size(integer)
V2.x API: set(font_size(integer)) Details.
- set_gap_height(integer)
V2.x API: set(gap_height(integer)) Details.
- set_gap_width(integer)
V2.x API: set(gap_width(integer)) Details.
- set_multiple_edge_gap(integer)
V2.x API: set(multi_edge_gap(integer)) Details.
- set_scale(integer)
V2.x API: menu(view(scale(integer))) Details.
- set_self_refering_edge_radius(integer)
V2.x API: set(self_edge_radius(integer)) Details.
- set_window_position(integer,integer)
V2.x API: window(position(integer,integer)) Details.
- set_window_size(integer,integer)
V2.x API: window(size(integer,integer)) Details.
- set_window_title(string)
V2.x API: window(title(string)) Details.
- show_message(string)
V2.x API: window(show_message(string)) Details.
- show_status(string)
V2.x API: window(show_status(string)) Details.
- show_subgraphs(node_ids)
V2.x API: menu(abstraction(show_subgraph(node_ids))) Details.
daVinci V2.1 Online Documentation - Page update: June 15, 1998