The unified diff between revisions [9af6e795..] and [594720f0..] is displayed below. It can also be downloaded as a raw diff.

This diff has been restricted to the following files: 'agraph.ml'

#
#
# patch "agraph.ml"
#  from [6eecb1bfd0370d394ea4311512029a3d10676c52]
#    to [5823b36800b8a29b8a9b1105ee4945620526da33]
#
============================================================
--- agraph.ml	6eecb1bfd0370d394ea4311512029a3d10676c52
+++ agraph.ml	5823b36800b8a29b8a9b1105ee4945620526da33
@@ -21,6 +21,9 @@ let ppi = 72.

 let ppi = 72.

+let node_kind agraph id =
+  (NodeMap.find id agraph.nodes).kind
+
 
 (* DOT output *)

@@ -32,9 +35,10 @@ let find_heads agraph =
 	IdSet.add child children)
       agraph.ancestry
       (IdSet.empty, IdSet.empty) in
-  IdSet.diff
+  IdSet.filter
+    (fun id ->
+      not (neighbour_kind (node_kind agraph id)))
     (IdSet.diff children parents)
-    agraph.neighbour_nodes

 let dot_format params agraph =
   let b = Buffer.create 4096 in
@@ -101,11 +105,10 @@ let dot_format params agraph =
       (fun (s, t) kind ->
 	!+ "  %S -> %S" s t ;
 	if kind = SPANNING then !+ " [minlen = 5]" ;
+	if kind = BRANCHING_NEIGH && node_kind agraph t = NEIGHBOUR_OUT
+	then !+ " [weight = 4]" ;
 	if IdSet.mem t heads then !+ " [weight = 2]" ;
-	!+ " ;\n" ;
-	if IdSet.mem t agraph.neighbour_nodes
-	    && not (IdSet.mem s agraph.neighbour_nodes)
-	then !+ "  { rank = same ; %S ; %S }" s t)
+	!+ " ;\n")
       agraph.ancestry
   end ;

@@ -143,7 +146,7 @@ let convert_node agraph nodes node_attr
 let convert_node agraph nodes node_attr id a =
   let this_node_attr = update_node_attr node_attr a in
   try
-    let kind = (NodeMap.find id agraph.nodes).kind in
+    let kind = node_kind agraph id in
     let width  = ppi *. this_node_attr.width in
     let height = ppi *. this_node_attr.height in
     let (x, y) =
@@ -337,10 +340,11 @@ let get_related g rel id =
       | `CHILD ->
 	  get_related_ids g CHILD id
       | `SIBLINGS ->
-	  List.concat
-	    (List.map
-	       (get_related_ids g CHILD)
-	       (get_related_ids g PARENT id))
+	  list_uniq
+	    (List.concat
+	       (List.map
+		  (get_related_ids g CHILD)
+		  (get_related_ids g PARENT id)))
     end

 let get_node g id =