let graph_window (main_window: Design.main_window_extension_points) =
  let graph = Register.get () in
  try
    let model = Model.from_graph graph in
    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 = services_view ~packing:window#add model in
    window#show ();
    view#adapt_zoom () (* require that the window is displayed for working *)
  with DGraphModel.DotError cmd ->
    main_window#error "%s failed\n" cmd