Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -61,7 +61,7 @@ def create_3d_correlation_matrix(df):
|
|
61 |
xaxis=dict(title='Variables'),
|
62 |
yaxis=dict(title='Variables'),
|
63 |
zaxis=dict(title='Correlation')))
|
64 |
-
return fig
|
65 |
|
66 |
# Gradio function
|
67 |
def visualize_correlation(selected_series):
|
@@ -77,11 +77,8 @@ def visualize_correlation(selected_series):
|
|
77 |
return "<p style='color:red;'>Failed to fetch data for the selected indicators.</p>"
|
78 |
|
79 |
standardized_df = standardize_data(df)
|
80 |
-
|
81 |
-
|
82 |
-
# Save figure as HTML and return for display
|
83 |
-
fig.write_html("3d_correlation_matrix.html")
|
84 |
-
return "3d_correlation_matrix.html"
|
85 |
|
86 |
# Gradio Interface
|
87 |
interface = gr.Interface(
|
|
|
61 |
xaxis=dict(title='Variables'),
|
62 |
yaxis=dict(title='Variables'),
|
63 |
zaxis=dict(title='Correlation')))
|
64 |
+
return fig.to_html(full_html=False) # Return the HTML content of the plot
|
65 |
|
66 |
# Gradio function
|
67 |
def visualize_correlation(selected_series):
|
|
|
77 |
return "<p style='color:red;'>Failed to fetch data for the selected indicators.</p>"
|
78 |
|
79 |
standardized_df = standardize_data(df)
|
80 |
+
plot_html = create_3d_correlation_matrix(standardized_df)
|
81 |
+
return f"<div>{plot_html}</div>"
|
|
|
|
|
|
|
82 |
|
83 |
# Gradio Interface
|
84 |
interface = gr.Interface(
|