Spaces:
Runtime error
Runtime error
add heading
Browse files- app.py +3 -3
- py_code_analyzer/imports_graph_visualizer.py +2 -0
app.py
CHANGED
@@ -45,8 +45,8 @@ def generate_imports_graph(python_files):
|
|
45 |
|
46 |
|
47 |
@conditonal_decorator(time_function, DEV)
|
48 |
-
def generate_graph_visualization_file(imports_graph):
|
49 |
-
ImportsGraphVisualizer().visualize(imports_graph)
|
50 |
|
51 |
|
52 |
@conditonal_decorator(time_function, DEV)
|
@@ -62,7 +62,7 @@ if clicked_ok_button and owner and repo:
|
|
62 |
imports_graph = generate_imports_graph(python_files)
|
63 |
|
64 |
with st.spinner("Generating graph visualization file..."):
|
65 |
-
generate_graph_visualization_file(imports_graph)
|
66 |
|
67 |
with st.spinner("Showing the graph..."):
|
68 |
graph_visualization_file = read_graph_visualization_file()
|
|
|
45 |
|
46 |
|
47 |
@conditonal_decorator(time_function, DEV)
|
48 |
+
def generate_graph_visualization_file(imports_graph, heading):
|
49 |
+
ImportsGraphVisualizer().visualize(imports_graph, heading=heading)
|
50 |
|
51 |
|
52 |
@conditonal_decorator(time_function, DEV)
|
|
|
62 |
imports_graph = generate_imports_graph(python_files)
|
63 |
|
64 |
with st.spinner("Generating graph visualization file..."):
|
65 |
+
generate_graph_visualization_file(imports_graph, f"{owner}/{repo}/{path}")
|
66 |
|
67 |
with st.spinner("Showing the graph..."):
|
68 |
graph_visualization_file = read_graph_visualization_file()
|
py_code_analyzer/imports_graph_visualizer.py
CHANGED
@@ -10,6 +10,7 @@ class ImportsGraphVisualizer:
|
|
10 |
def visualize(
|
11 |
cls,
|
12 |
imports_graph: nx.Graph,
|
|
|
13 |
directed: bool = True,
|
14 |
layout: bool = False, # Use hierarchical if True
|
15 |
neighborhood_highlight: bool = True,
|
@@ -24,6 +25,7 @@ class ImportsGraphVisualizer:
|
|
24 |
height=f"{height}px",
|
25 |
directed=directed,
|
26 |
layout=layout,
|
|
|
27 |
neighborhood_highlight=neighborhood_highlight,
|
28 |
select_menu=select_menu,
|
29 |
)
|
|
|
10 |
def visualize(
|
11 |
cls,
|
12 |
imports_graph: nx.Graph,
|
13 |
+
heading: str = "",
|
14 |
directed: bool = True,
|
15 |
layout: bool = False, # Use hierarchical if True
|
16 |
neighborhood_highlight: bool = True,
|
|
|
25 |
height=f"{height}px",
|
26 |
directed=directed,
|
27 |
layout=layout,
|
28 |
+
heading=heading,
|
29 |
neighborhood_highlight=neighborhood_highlight,
|
30 |
select_menu=select_menu,
|
31 |
)
|