zrguo commited on
Commit
ebfa2fb
·
unverified ·
2 Parent(s): 5ba9af1 3f63623

Merge pull request #718 from ArnoChenFx/fix-lightrag-viewer

Browse files
lightrag/tools/lightrag_visualizer/graph_visualizer.py CHANGED
@@ -981,13 +981,10 @@ def generate_colors(n: int) -> List[glm.vec3]:
981
 
982
  def show_file_dialog() -> Optional[str]:
983
  """Show a file dialog for selecting GraphML files"""
984
- root = tk.Tk()
985
- root.withdraw() # Hide the main window
986
  file_path = filedialog.askopenfilename(
987
  title="Select GraphML File",
988
  filetypes=[("GraphML files", "*.graphml"), ("All files", "*.*")],
989
  )
990
- root.destroy()
991
  return file_path if file_path else None
992
 
993
 
@@ -1219,8 +1216,13 @@ def main():
1219
 
1220
  runner_params.callbacks.load_additional_fonts = load_font
1221
 
 
 
 
1222
  immapp.run(runner_params)
1223
 
 
 
1224
 
1225
  if __name__ == "__main__":
1226
  main()
 
981
 
982
  def show_file_dialog() -> Optional[str]:
983
  """Show a file dialog for selecting GraphML files"""
 
 
984
  file_path = filedialog.askopenfilename(
985
  title="Select GraphML File",
986
  filetypes=[("GraphML files", "*.graphml"), ("All files", "*.*")],
987
  )
 
988
  return file_path if file_path else None
989
 
990
 
 
1216
 
1217
  runner_params.callbacks.load_additional_fonts = load_font
1218
 
1219
+ tk_root = tk.Tk()
1220
+ tk_root.withdraw() # Hide the main window
1221
+
1222
  immapp.run(runner_params)
1223
 
1224
+ tk_root.destroy() # Destroy the main window
1225
+
1226
 
1227
  if __name__ == "__main__":
1228
  main()