]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/extlib/graphvizPp.ml
Naif version of the union find
[helm.git] / helm / software / components / extlib / graphvizPp.ml
index 4804699e0a7ef048dae9851641411e7e768be6e5..ed5bbdc54c69c1d1557a43635d72bd4c2a4f1ca3 100644 (file)
@@ -30,6 +30,7 @@ type attribute = string * string  (* <key, value> pair *)
 module type GraphvizFormatter =
   sig
     val header:
+      ?graph_type:string -> 
       ?name:string -> ?graph_attrs:(attribute list) ->
       ?node_attrs:(attribute list) -> ?edge_attrs:(attribute list) ->
       Format.formatter ->
@@ -55,8 +56,8 @@ module Dot =
       attributes attrs fmt;
       fprintf fmt "];@]@,"
 
-    let header ?(name = "g") ?(graph_attrs = []) ?node_attrs ?edge_attrs fmt =
-      fprintf fmt "@[<hv2>strict digraph %s {@," name;
+    let header ?(graph_type = "digraph") ?(name = "g") ?(graph_attrs = []) ?node_attrs ?edge_attrs fmt =
+      fprintf fmt "@[<hv2>%s %s {@," graph_type name;
       List.iter (fun (k, v) -> fprintf fmt "@[<hv2>%s=@,%s;@]@," k v)
         graph_attrs;
       (match node_attrs with
@@ -68,7 +69,7 @@ module Dot =
 
     let node = node ~quote:true
     let edge name1 name2 ?(attrs = []) fmt =
-      fprintf fmt "@[<hov2>\"%s\" ->@ \"%s\"@ [" name1 name2;
+      fprintf fmt "@[<hov2>%s ->@ %s@ [" name1 name2;
       attributes attrs fmt;
       fprintf fmt "];@]@,"
     let raw s fmt = pp_print_string fmt s