Lazy.force load_easter_egg
method private redraw_gviz ?center_on () =
- let tmpfile, oc = Filename.open_temp_file "matita" ".dot" in
- let fmt = Format.formatter_of_out_channel oc in
- MetadataDeps.DepGraph.render fmt gviz_graph;
- close_out oc;
- gviz#load_graph_from_file ~gviz_cmd:"tred | dot" tmpfile;
- (match center_on with
- | None -> ()
- | Some uri -> gviz#center_on_href (UriManager.string_of_uri uri));
- HExtlib.safe_remove tmpfile
+ if Sys.command "which dot" = 0 then
+ let tmpfile, oc = Filename.open_temp_file "matita" ".dot" in
+ let fmt = Format.formatter_of_out_channel oc in
+ MetadataDeps.DepGraph.render fmt gviz_graph;
+ close_out oc;
+ gviz#load_graph_from_file ~gviz_cmd:"tred | dot" tmpfile;
+ (match center_on with
+ | None -> ()
+ | Some uri -> gviz#center_on_href (UriManager.string_of_uri uri));
+ HExtlib.safe_remove tmpfile
+ else
+ MatitaGtkMisc.report_error ~title:"graphviz error"
+ ~message:("Graphviz is not installed but is necessary to render "^
+ "the graph of dependencies amoung objects. Please install it.")
+ ~parent:win#toplevel ()
method private dependencies direction uri () =
let dbd = LibraryDb.instance () in