Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -206,7 +206,7 @@ def plot_sdg(df, title, pred_column, icons_folder='assets/icons/'):
|
|
| 206 |
fig.update_traces(
|
| 207 |
texttemplate='%{x:.2f}%',
|
| 208 |
textposition='auto',
|
| 209 |
-
textfont=dict(size=
|
| 210 |
)
|
| 211 |
|
| 212 |
# Adjust layout for better visibility
|
|
@@ -219,7 +219,7 @@ def plot_sdg(df, title, pred_column, icons_folder='assets/icons/'):
|
|
| 219 |
title=None,
|
| 220 |
tickfont=dict(size=12)
|
| 221 |
),
|
| 222 |
-
margin=dict(l=20, r=30, t=
|
| 223 |
height=600,
|
| 224 |
#width=800,
|
| 225 |
showlegend=False,
|
|
@@ -264,7 +264,7 @@ def plot_sdg(df, title, pred_column, icons_folder='assets/icons/'):
|
|
| 264 |
|
| 265 |
def save_figure_as_jpeg(fig, filename):
|
| 266 |
"""Saves the Plotly figure as a high-resolution JPEG."""
|
| 267 |
-
pio.write_image(fig, filename, format='jpeg', width=
|
| 268 |
|
| 269 |
# Generate reports (page and sentence levels)
|
| 270 |
def generate_page_report(df_pages, report_file_name):
|
|
|
|
| 206 |
fig.update_traces(
|
| 207 |
texttemplate='%{x:.2f}%',
|
| 208 |
textposition='auto',
|
| 209 |
+
textfont=dict(size=11)
|
| 210 |
)
|
| 211 |
|
| 212 |
# Adjust layout for better visibility
|
|
|
|
| 219 |
title=None,
|
| 220 |
tickfont=dict(size=12)
|
| 221 |
),
|
| 222 |
+
margin=dict(l=20, r=30, t=110, b=20), # Increased right margin for icon
|
| 223 |
height=600,
|
| 224 |
#width=800,
|
| 225 |
showlegend=False,
|
|
|
|
| 264 |
|
| 265 |
def save_figure_as_jpeg(fig, filename):
|
| 266 |
"""Saves the Plotly figure as a high-resolution JPEG."""
|
| 267 |
+
pio.write_image(fig, filename, format='jpeg', width=700, height=750, scale=6)
|
| 268 |
|
| 269 |
# Generate reports (page and sentence levels)
|
| 270 |
def generate_page_report(df_pages, report_file_name):
|