let graph_window (main_window: Design.main_window_extension_points) =
let graph = Register.get () in
try
let parent = main_window#main_window in
let height = int_of_float (float parent#default_height *. 3. /. 4.) in
let width = int_of_float (float parent#default_width *. 3. /. 4.) in
let window =
GWindow.window
~position:`CENTER
~height ~width ~title:"Syntactic Callgraph"
~allow_shrink:true ~allow_grow:true ()
in
let _, view =
View.from_graph_with_commands
~packing:window#add
~root:(Service.entry_point ())
~mk_global_view:services_view
graph
in
window#show ();
view#adapt_zoom ()
with DGraphModel.DotError cmd ->
main_window#error "%s failed\n" cmd