]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/matitaMathView.ml
some more work for ng-coercions
[helm.git] / helm / software / matita / matitaMathView.ml
index 255998c4f436884ab1e105136577bcb79528cf0c..7ab9299fb8d1fa7645c21131674ce24544a6ead3 100644 (file)
@@ -1035,14 +1035,30 @@ class cicBrowser_impl ~(history:MatitaTypes.mathViewer_entry MatitaMisc.history)
     win#browserImage#set_file (MatitaMisc.image_path "meegg.png"))
   in
   let load_coerchgraph tred () = 
-      let str = CoercGraph.generate_dot_file () in
+      let module Pp = GraphvizPp.Dot in
       let filename, oc = Filename.open_temp_file "matita" ".dot" in
-      output_string oc str;
+      let fmt = Format.formatter_of_out_channel oc in
+      Pp.header 
+        ~name:"Coercions"
+        ~node_attrs:["fontsize", "9"; "width", ".4"; "height", ".4"]
+        ~edge_attrs:["fontsize", "10"] fmt;
+      let status = (MatitaScript.current ())#grafite_status in
+      NCicCoercion.generate_dot_file status fmt;
+      Pp.trailer fmt;
+      Pp.header 
+        ~name:"OLDCoercions"
+        ~node_attrs:["fontsize", "9"; "width", ".4"; "height", ".4"]
+        ~edge_attrs:["fontsize", "10"] fmt;
+      CoercGraph.generate_dot_file fmt;
+      Pp.trailer fmt;
+      Pp.raw "@." fmt;
       close_out oc;
       if tred then
-        gviz#load_graph_from_file ~gviz_cmd:"tred|dot" filename
+        gviz#load_graph_from_file 
+          ~gviz_cmd:"dot -Txdot | tred |gvpack -gv | dot" filename
       else
-        gviz#load_graph_from_file filename;
+        gviz#load_graph_from_file 
+          ~gviz_cmd:"dot -Txdot | gvpack -gv | dot" filename;
       HExtlib.safe_remove filename
   in
   object (self)