Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -218,7 +218,7 @@ def plot_sdg(df, title, pred_column, icons_folder='assets/icons/'):
|
|
| 218 |
),
|
| 219 |
margin=dict(l=20, r=30, t=100, b=20), # Increased right margin for icon
|
| 220 |
height=600,
|
| 221 |
-
width=
|
| 222 |
showlegend=False,
|
| 223 |
template="simple_white",
|
| 224 |
xaxis=dict(
|
|
@@ -247,7 +247,7 @@ def plot_sdg(df, title, pred_column, icons_folder='assets/icons/'):
|
|
| 247 |
dict(
|
| 248 |
source='data:image/png;base64,' + encoded_image,
|
| 249 |
xref="paper", yref="paper",
|
| 250 |
-
x=0.4, y=1.
|
| 251 |
sizex=0.2, sizey=0.2, # Size of the icon
|
| 252 |
xanchor="left",
|
| 253 |
yanchor="top",
|
|
@@ -261,7 +261,7 @@ def plot_sdg(df, title, pred_column, icons_folder='assets/icons/'):
|
|
| 261 |
|
| 262 |
def save_figure_as_jpeg(fig, filename):
|
| 263 |
"""Saves the Plotly figure as a high-resolution JPEG."""
|
| 264 |
-
pio.write_image(fig, filename, format='jpeg', width=1000, height=
|
| 265 |
|
| 266 |
# Generate reports (page and sentence levels)
|
| 267 |
def generate_page_report(df_pages, report_file_name):
|
|
|
|
| 218 |
),
|
| 219 |
margin=dict(l=20, r=30, t=100, b=20), # Increased right margin for icon
|
| 220 |
height=600,
|
| 221 |
+
width=800,
|
| 222 |
showlegend=False,
|
| 223 |
template="simple_white",
|
| 224 |
xaxis=dict(
|
|
|
|
| 247 |
dict(
|
| 248 |
source='data:image/png;base64,' + encoded_image,
|
| 249 |
xref="paper", yref="paper",
|
| 250 |
+
x=0.4, y=1.2, # Positioning: slightly to the right and top
|
| 251 |
sizex=0.2, sizey=0.2, # Size of the icon
|
| 252 |
xanchor="left",
|
| 253 |
yanchor="top",
|
|
|
|
| 261 |
|
| 262 |
def save_figure_as_jpeg(fig, filename):
|
| 263 |
"""Saves the Plotly figure as a high-resolution JPEG."""
|
| 264 |
+
pio.write_image(fig, filename, format='jpeg', width=1000, height=700, scale=5)
|
| 265 |
|
| 266 |
# Generate reports (page and sentence levels)
|
| 267 |
def generate_page_report(df_pages, report_file_name):
|