(by Mattias Werner, July 13, 1998)


Overview of new features compared to daVinci V2.0.3:
====================================================

  - Fully incremental graph layout
  - Subgraph abstractions using incremental layout
  - Completely rewritten much faster graph layout algorithm
  - Menu "Improve Edges" now optimizes the layout without changing the
    node order. "Improve Selected Nodes" starts the layout algorithm
    for the selected nodes only.
  - Fine-Tuning for all Layout Orientations, Graph Size no longer fixed
    during Fine-Tuning
  - First implementation of Visualization Rules (API)
  - Pop-Up menus for nodes and edges (API)
  - Drag and Drop for nodes and edges (API)
  - All open windows accessible via API commands
  - Some more enhancements to the API
  - Initial API commands can be supplied on command-line
  - New Attributes for Nodes and Edges
  - The appearance of abstracted nodes can be defined via attributes
  - Correct navigation in cyclic graphs
  - Reduced memory footprint
  - Some small bug fixes
  - grapheditor will support all new API features, including drag and drop


What's new in daVinci V2.1:
===========================

  1. Fully incremental graph layout:
  
     Graph updates send to the daVinci API using command graph(update(...))
     are now inserted into the existing graph layout incrementally instead
     of forcing a completely new layout. So the layout before the update
     is preserved as much as possible in order to support layout stability. 
     Of course, after doing some incremental updates, the graph layout may be
     getting worse, so a new global graph layout might be required. The user
     can do this at any time with menu 'Layout/Improve All'.
     
     Existing daVinci applications don't need to be modified to support 
     incremental graph layout. Applications already using API command 
     graph(update(...)) immediately benefit from this new feature. For 
     example, you can connect the graph editor of daVinci V2.0.x to the
     daVinci V2.1.x API and it will use incremental graph layout. But
     there even is a new grapheditor, which supports much more of the
     new features.


  2. Subgraph abstractions using incremental layout:
  
     Abstractions are used in daVinci with menu "Layout/{Hide|Show} Subgraph". 
     In former versions, showing a hidden subgraph after modifying the layout 
     (e.g. by using menu "Layout/Improve All" with hidden subgraphs) messed up 
     the graph layout completely. Now, menu "Layout/Show Subgraph" always uses 
     incremental graph layout for fading in hidden subgraphs in order to 
     preserve layout stability.
     

  3. Completely rewritten much faster graph layout algorithm:
  
     This algorithm is used to calculate the order of nodes and dummy 
     nodes to reduce the number of edge crossings. This algorithm has 
     been completely rewritten in V2.1 in order to:
       
       a) get *much* more performance. For example: When applied to a 
          test graph with about 1000 nodes and 1500 edge, menu function 
          'Layout/Improve All' is about 40 times faster in daVinci V2.1 
          than in V2.0.3. 
       b) calculate a layout with fewer edge crossings. A new optimization
          phase gives slightly better results than in earlier releases.  


  4. Menu "Improve Edges" now optimizes the layout without changing the
     node order. "Improve Selected Nodes" starts the layout algorithm
     for the selected nodes only.
  
     By taking advance of layout constraints available with the rewritten 
     graph layout algorithm, a new layout function has been implemented in 
     menu "Layout/Improve Edges". In opposite to menu "Layout/Improve All"
     which rearranges the nodes and edges to get fewer edge crossings, the 
     new layout function re-routes only the edges, but preserves the given 
     order of nodes at each level. This reduces not all of the unneccessary 
     edge crossings, but the order of nodes is preserved to keep the layout 
     more stable.
     
     With the new menu "Improve Selected Nodes" you can rearrange only the
     selected nodes and the edges (as in "Improve Edges") without changing
     the order of all other nodes. The menu "Improve Visible" has been
     removed.
     

  5. Fine-Tuning for all Layout Orientations, Graph Size no longer fixed
     during Fine-Tuning
  
     In daVinci V2.0.x you could only fine tune your graph in the layout
     orientation "Top Down". Now it is possible to do this in all layout
     orientations. On 24-bit machines the moved node is now displayed
     correctly, instead of a black rectangle in V2.0.x. Additionally, the
     graph size is no longer fixed in fine-tuning. You might have noticed,
     that nodes could not be moved out of the surrounding rectangle of the
     graph in V2.0.x. Now it is possible to enlarge the graph by moving
     nodes.
     
     
  6. First implementation of Visualization Rules (API)
  
     daVinci V2.1 has a new API mechanism to control and maintain the visual 
     appearance of graph nodes and edges more easily. In former versions it 
     was neccessary to specify the visual appearance of each individual node 
     or edge by using attributes in the term representation of a graph. By
     using visualization rules in V2.1, one can specify the attributes for a
     type (or class) of nodes/edges at one single point. Suppose you have a
     graph with four nodes: one root node 1 and three childs 2,3,4. The root 
     has type T1, the childs have type T2 (types are the strings between the
     node/edge ID and the attributes in a term representation or graph 
     update). You can send this example  graph to the daVinci API using the 
     following command (remove line breaks before sending commands to API):
     
         graph(update([new_node ("1","T1",[a("OBJECT","1")]),
		       new_node ("2","T2",[a("OBJECT","2")]),
		       new_node ("3","T2",[a("OBJECT","3")]),
		       new_node ("4","T2",[a("OBJECT","4")])],
	              [new_edge ("1-2","T1",[],"1","2"),
		       new_edge ("1-3","T2",[],"1","3"),
		       new_edge ("1-4","T3",[],"1","4")]))

     Now you can send a visualization rule to the API to draw *all* nodes of
     type T2 in red and another one to draw *all* edges of type T2 in blue:
     
         visual(new_rules([nr("T2",[a("COLOR","red")])]))
         visual(new_rules([er("T2",[a("EDGECOLOR","blue")])]))
         
     A new category "visual" has been introducted in the V2.1 API to work with 
     visualization rules (refer to the V2.0.x online documentation, chapter 
     'Overview -> Reference -> API Reference' for the old V2.0.x syntax):
     
         daVinci_cmd ::=
  	   /* all cases of the V2.0.x API syntax, plus the following: */
         | visual(visual_cmd).
         
         visual_cmd ::=
           new_rules(visual_rules)   /* Specify new rules */
         | add_rules(visual_rules).  /* Add rules or exchange existing ones */
         
         visual_rules ::= [visual_rules1]. 
         visual_rules1 ::= visual_rule | visual_rule,visual_rules1.
	 visual_rule ::=
    	   nr(type , attributes)     /* Rules for all nodes of given type */
 	 | er(type , attributes).    /* Rules for all edges of given type */
 	 
     API command visual(new_rules(...)) removes all existing rules and 
     replaces them by the given ones, whereas visual(add_rules(...)) adds 
     some new rules to the previously defined ones (i.e. it overwrites an 
     old rule for type T if a new rule is added for the same type T). Note
     that in the example above node type T2 is not the same as edge type T2
     (node and edge types don't have to be disjunct), so a visual_rule has
     to use a sort nr(...) or er(...) to declare whether the rule is for a
     node or edge.
     
     Attributes defined by each node/edge individually and attributes defined 
     by a rule (for the type of the node/edge) may co-exist. In the example 
     above, each node has set its own text using attribute OBJECT, but the
     COLOR is shared for all nodes of type T2 by specifying a rule. Usually, 
     the individual attributes of a node/edge overlaps the attributes of a 
     rule, so e.g. if a rule specifies a color of red for a node and the 
     node's attribute says it should be blue, then the node is drawn in blue.
     There is a new option to switch this behaviour using the API:
     
         set_cmd ::=
  	   /* all cases of the V2.0.x API syntax, plus the following: */
         | rules_first(boolean).     /* true if rules should overlap attrs. */
     
     The default setting for this option is false, but by sending API command 
     set(rules_first(true)) the rules will be considered *before* looking at 
     the individual attributes.
     
     To overwrite the default attribute values in daVinci, you can write a 
     rule with the special type "". So for example, by sending the following 
     command to the API, all nodes of *any* type are visualized with a circle
     instead of the default box, unless a rule or individual attribute of a 
     node specifies another object:

         visual(add_rules([nr("",[a("_GO","circle")])]))   

           
  7. Pop-Up menus for nodes and edges:
  
     Graph nodes and edges may now have a pop-up menu which is displayed if
     the mouse pointer is currently over a particular node or edge and 
     the user selects the right mouse button. Pop-up menus should be used
     together with visualization rules (see above) and are implemented with 
     a new kind of node/edge attribute:
     
         attribute ::=
           a(string,string)    /* regular node/edge attribute */
         | m(menus)            /* new in V2.1: pop-up menu for node/edge */
  
     'menus' is the sort for specifying application menus known from daVinci
     V2.0.x, see API reference in V2.0.x online documentation, especially 
     command app_menu(create_menus(menus)). For example: The following API
     command sends a graph to daVinci that contains one node with a pop-up 
     menu (remove line breaks before sending commands to API):
     
         graph(new([l("1",n("T",[a("OBJECT","Node 1"),
       			         m([menu_entry("ID","Entry")])],[]))])) 
     
     When an entry of a pop-up menu is selected by the user, one of the 
     following two new answers is returned by the API (depending whether
     it was the menu of a node or edge):
     
         daVinci_answer ::=
  	   /* all cases of the V2.0.x API syntax, plus the following: */
         | popup_selection_node(node_id,menu_id)  /* pop-up menu selected */
         | popup_selection_edge(edge_id,menu_id)  /* pop-up menu selected */

     To modify the entries of a pop-up menu of a particular node or edge 
     later, one has to exchange the pop-up menu attribute of the node or edge 
     with API command graph(change_attr(...)) completely. Example for the 
     graph above:
     
         graph(change_attr([node("1",[m([menu_entry("ID2","Menu A"),
         				 menu_entry("ID3","Menu B")])])]))
     
     In opposite to application menus (which are added to daVinci's Edit 
     menu) entries of pop-up menus *can't* be enabled resp. disabled with 
     command app_menu(activate_menus(menu_ids)). To get pop-up menus where
     some menu entries are *always* disabled, one can use the following new
     cases in sort menu_entry:

         menu_entry ::=
  	   /* all cases of the V2.0.x API syntax, plus the following: */
         | menu_entry_disabled(menu_id,menu_label)
         | submenu_entry_disabled(menu_id,menu_label,menus)
     
     In a pop-up menu, these entries or submenus are always disabled until
     the pop-up menu attribute of the node or edge is exchanged by another
     menu. Note: When these two new menu entries are used with API command 
     app_menu(create_menus(menus)) (i.e. for the Edit menu), then they are
     treated like a usual menu entry *without* being disabled. Use command
     app_menu(activate_menus(menu_ids)) in order to disable entries of the
     Edit menu. Further, mnemonics are ignored when using the entries
     menu_entry_mne(...) and sub_menu_entry_mne(...) in pop-up menus. Here 
     is an example for the graph above to use pop-up menus with disabled 
     entries:
     
         graph(change_attr([node("1",[m([menu_entry_disabled("ID2","Menu A"),
         			         menu_entry("ID3","Menu B")])])]))
     
     Of course it's very expensive to control the pop-up menus of all nodes
     and edges individually in order to reflect some change of state in an
     application program that uses daVinci. For example, if one function - 
     offered in the pop-up menus of all nodes - becomes unapplicable for 
     a while, then the application has to exchange the pop-up menus in all 
     nodes to reflect the new state. This is of course not a practical 
     solution. So by using visualization rules (see above), pop-up menus 
     should usually be declared for a *type* of nodes or edges instead of 
     each node or edge individually. This way the pop-up menus can be 
     controlled more easily. For example: Here is an API command sending a
     graph with three nodes to daVinci, where two nodes 1 and 2 belong to a
     common type T1 (remove line breaks before sending commands to API):
     
         graph(new([l("1",n("T1",[a("OBJECT","Node 1"),],[])),
                    l("2",n("T1",[a("OBJECT","Node 2"),],[])),
                    l("3",n("T2",[a("OBJECT","Node 3"),],[]))]))
     
     Now you can specify a pop-up menu for *all* nodes of type T1 by sending
     the following rule to the API:
     
         visual(new_rules([nr("T1",[m([menu_entry("ID","Entry")])])]))

     
  8. Drag and Drop for nodes and edges (API)
  
     For a better support of user interaction we have added the drag and drop
     functionality to the daVinci API. With the new commands you can set the
     API into dragging mode. This switches off the two dimensional scrolling
     feature, you achieve normally by pressing the middle mouse button. Than
     you can click with the middle mouse button somewhere in the daVinci
     window and the API is informed, or you can select a node with the middle
     mouse button and drag a line from this node to another node. The
     application is informed if you release the button over a node or over the
     free area. In the final release of V2.1 we will maybe have an additional
     feature in which you can grab a node and drop it on some other node.
    
     A new category "drag_and_drop" has been introducted in the V2.1 API to
     work with drag and drop (refer to the V2.0.x online documentation, chapter 
     'Overview -> Reference -> API Reference' for the old V2.0.x syntax):
     
         daVinci_cmd ::=
  	   /* all cases of the V2.0.x API syntax, plus the following: */
	 | drag_and_drop	(drag_and_drop_cmd)
         
	 drag_and_drop_cmd ::=
	   dragging_on					{switch dragging on}
	 | drag_and_drop_on				{switch drag&drop on}
	 | dragging_off					{switch drag* off}
	 | new_node_at_coord	(node_update)		{insert at coordinate} 
	 | new_edge_and_node_at_coord     
				(node_update,		{dito, plus edge where}
				 edge_update).		{node is the child}
 	 
     API command 'drag_and_drop(dragging_on)' sets the API into the drag and
     drop mode, as described above. API command
     'drag_and_drop(drag_and_drop_on)' will switch the drop mode for nodes on
     in the final version of daVinci but is currently not implemented. You
     can leave the drag and drop mode and return to two dimensional scrolling
     for the middle mouse button with API command 'drag_and_drop(dragging_off)'.
     The other two commands are described below.
     
     When the middle mouse button is pressed in drag and drop mode, one of the 
     following new answers is returned by the API (depending whether
     it was pressed over the free area, over a node or dragged):
     
         daVinci_answer ::=
  	   /* all cases of the V2.0.x API syntax, plus the following: */
	 | create_node					{dragging answer}
	 | create_node_and_edge	(node_id)		{parent ID of new edge}
	 | create_edge		(node_id,node_id)	{node IDs of new edge}
	 | drop_node		((context_id,window_id,node_id),
				 node_id)
				 			{node A dropped on B}
     
     If the middle mouse button is pressed and released over the free area,
     daVinci sends the answer 'create_node'. If it is pressed or released
     over a node and not dragged, you'll get no answer. If it is pressed over
     a node and than dragged, before it is released, we have to distinguish
     two cases: If it is released over the free area, you'll get the answer
     create_node_and_edge with the node_id of the first selected node. If it
     is released over a node, you'll get the answer 'create_edge' with two
     node_id's where the first is the node where the button was pressed and
     the second is the node where the button was released. Both node_id's may
     be identical. The last answer 'drop_node' is currently not implemented
     and will be used in the drop mode for nodes, described above. It will
     only work in the new window API mode, described below.
     
     If you get these answers and want to add a node or an edge or both at the
     selected coordinate, you can use the commands:
       drag_and_drop(new_node_at_coord(...)) to insert a single node at the
         selected coordinate, if you use this command without getting one of
         the above answers before, it will just insert a new node as the
         graph(update(...)) command would do.
       drag_and_drop(new_edge_and_node_at_coord(...)) to insert a single node
         and a single edge (not necessarily connected to the new or selected
         node) at the selected coordinate, if you use this command without
         getting one of the above answers before, it will just insert a new
         node as the graph(update(...)) command would do.
       graph(update([],[new_edge(...)])) as usual, because therefore you don't
         need a coordinate.
         
     If the users drags with the middle mouse button and is over a node, this
     node will be drawn inverted to show a secondary selection. You can test
     this new feature in the grapheditor supplied with this beta distribution.
     If you want to see the communication between daVinci and the grapheditor,
     just start 'daVinci -startappl grapheditor "grapheditor -show_messages"'.
     
  
  9. All open windows accessible via API commands
  
     Many people asked for full access to all open windows in the multi view
     mode of the API. To implement this feature results in a syntax change for
     the API answers. Therefore we make this mode available via a command line
     switch. If you call 'daVinci -window_api ...' you'll get answers in the
     new mode, else everything is like before.
     
     The new answers are:
         daVinci_answer ::=
  	   /* all cases of the V2.0.x API syntax, plus the following: */
	 | context_window	(context_id,window_id)	{context ID +
							 window ID}
	 | open_window					{new window opened}
	 | close_window		(window_id)		{window closed}
     
	 window_id ::= string.                  	{Window ID}

      The major change is, that each answer is preceded by 'context_window' and
      not by 'context' as before. The additional parameter window_id is just
      a string exists of exactly one character and is the unique ID of the
      window in which the event occured. If a window is opened, you'll get the
      daVinci answer 'open_window' preceded by 'context_window' in which you
      can find the new ID. The commands 'menu(view(open_new_view))' and
      'menu(view(open_survey_view))' no longer send 'ok' after successfull
      execution, they now return 'open_window'. You'll get the 'close_window'
      event, if a window has been closed, but there is still at least one
      window open for the context. Otherwise you would get 'close', which
      means, that all windows of the context are closed.
      
      To activate a window and a context, there is one new command:
	 multi_cmd ::=
  	   /* all cases of the V2.0.x API syntax, plus the following: */
	 | set_context		(context_id,window_id)	{switch to context
							 and window}
      
      After sending this command, all following commands are referred to this
      context and this window of the context (window_id must be a window of
      context_id), especially the following commands of category window_cmd:
        position, size, raise
      

  10. Some more enhancements to the API

      There are three new commands in category graph_cmd:
	 graph_cmd ::=
  	   /* all cases of the V2.0.x API syntax, plus the following: */
 	 | update	(mixed_updates)			{send graph updates}
	 | update_and_change_attr (mixed_updates,attr_changes)
	 						{combination of both}
	 | change_type	(type_changes)			{change types}

	 mixed_updates  ::= [mixed_updates1].
	 mixed_updates1 ::= mixed_update | mixed_update,mixed_updates1.
	 mixed_update   ::= node_update | edge_update.
	 
	 type_changes  ::= [type_changes1].
	 type_changes1 ::= type_change | type_change,type_changes1.
	 type_change   ::=
	   node (node_id,type)				{label,type}
	 | edge (edge_id,type).				{label,type}
	 
      With the first two commands, you can mix edge and node updates in one
      list and need not create two lists to distinguish them. The third
      command allows you to change the type of a node, which could be usefull
      if you use visualization rules as described above.
      
      One command in category navigation_menu_cmd has been added to correct
      our poor english in the naming of the V2.0.3 commands. The command
      'select_childs' will be still available but removed from the
      documentation:
	 navigation_menu_cmd ::=
  	   /* all cases of the V2.0.x API syntax, plus the following: */
	| select_children	(node_ids)		{of given nodes}
	
      The layout_menu_cmd category has to be updated during the beta phase of
      V2.1 to reflect the new menu options in the Layout menu. This is reported
      as a bug in the bugreport.
      
     
  11. Initial API commands can be supplied on command-line
  
      With the command line option '-init <file>' you can supply initial API
      commands to daVinci, independent whether you've connected an application
      or not. You can execute all API commands except those of categories
      multi, drag_and_drop and app_menu, which would make no sense, if no
      application is connected. With this feature, you can send for example
      the new visualiziation rules to daVinci or load graphs in the API
      update format to daVinci.
      
     
  12. Logging of API commands and answers in a file supplied on command-line
  
      With the command line oprion '-log <file>' you can supply a file in
      which the API traffic is logged for debugging purposes. All commands
      are preceded by the word "Command:" and all answers are preceded by
      the word "Answer:". This option is only usefull, if an application
      is connected to daVinci.
      
      
  13. New Attributes for Nodes and Edges
  
      Some attributes for nodes and edges have been added or changed. For nodes:
        _GO: new graphical object 'triangle' and 'scissors'
        BORDER: this attribute can be set to 'none', 'double' and 'single', the
          first value is new and especially usefull for _GO icon.
        _CGO, CCOLOR, CICONFILE are new. See below for an explanation of these
          attributes.
      For edges:
        HEAD: With this new attribute you can specify the head of an edge,
          which could only be a solid arrow in V2.0.x and former versions.
          Now the following values are allowed:
            farrow:  default behaviour as before (filled arrow)
            arrow:   arrow only drawn by its border lines
            fcircle: filled circle
            circle:  normal circle not filled
  
  
  14. The appearance of abstracted nodes can be defined via attributes
  
      Up to now the visualization of nodes abstracted by the menu or API
      command "Hide Subgraph" was a scissors-icon with the color of the node.
      Now you can define the appearance of these nodes by setting the
      attributes:
        _CGO: graphical object for abstracted nodes like _GO, default: scissors
        CCOLOR: color of abstracted nodes, default: value of COLOR for the node
        CICONFILE: icon file, if _CGO is 'icon'
        
      Please remember, that it could be very difficult to find out which nodes
      are abstracted, if you make a bad choice for these attributes.
  
  
  15. Correct navigation in cyclic graphs:

     In daVinci V2.0.x, the operations for selecting parents, siblings or 
     childs (menu 'Navigation/Select...') didn't work as expected in 
     cyclic graphs or graphs where the direction of some edges has been
     manipulated manually using edge attribute _DIR. In cyclic graphs, 
     daVinci inverts the direction of some edges automatically in order to
     get an  acyclic graph internally, such that some edges may point in 
     direction bottom-up although the layout orientation is top-down. In 
     previous V2.0.x releases, the selection functions were only based 
     on the internal data structure, so a child was a connected node at the
     next level and a parent was a connected node at the previous level which
     isn't a correct policy for inverted edges.
          
     In daVinci V2.1, the selection functions of menu Navigation now work
     as one might expect from the layout: A child is the node where the arrow
     of an edge is pointing to and a parent is the node where the arrow is
     not pointing to. There are situations where a node is both a parent and
     a child. 


  16. Reduced memory footprint
  
      The layout algorithm and the drawing component have been rewritten, to
      improve performance (see above) and reduce the memory usage of daVinci.
      Especially the resources allocated in the X-server are reduced by 50
      percent, because the pixmap caching mechanism of daVinci now needs
      only one pixmap instead of two for each part of the graph.


  17. Some small bug fixes
  
     When opening a new context in multi-graph mode with API command
     multi(new_context), the values of variables (e.g. scale, entries in 
     Edit menu, layout dimensions etc.) have not been resetted to the 
     default values in daVinci V2.0.x. This is bug 35-V2.0, see bug report.
     In daVinci V2.1, a new context always has the default settings as they
     are specified in the documentation.
     
     Additionally most of the bugs in V2.0.3 are fixed, all others are still
     listed in the bugreport and will be fixed during the beta phase.

    
  18. grapheditor will support all new API features, including drag and drop

     The new grapheditor supports all the new features of the API and all
     new node and edge attributes (except those for abstracted nodes). The
     major improvement is the drag and drop mode, which is the default mode
     of the grapheditor now. In this mode, you can create new nodes by
     clicking in the daVinci window with the middle mouse button and edges
     by dragging the mouse with pressed middle mouse button from one node
     to the other. The drag and drop mode can be switched off via the icon
     bar or a menu. Additionally there are context sensitive pop-up menues for
     all nodes and edges generated with the grapheditor. The grapheditor now
     uses the incremental layout of daVinci and you'll definitely see the
     changes.
     

- END -
