Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -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=
|
| 223 |
height=600,
|
| 224 |
#width=800,
|
| 225 |
showlegend=False,
|
|
@@ -250,7 +250,7 @@ def plot_sdg(df, title, pred_column, icons_folder='assets/icons/'):
|
|
| 250 |
dict(
|
| 251 |
source='data:image/png;base64,' + encoded_image,
|
| 252 |
xref="paper", yref="paper",
|
| 253 |
-
x=
|
| 254 |
sizex=0.2, sizey=0.2, # Size of the icon
|
| 255 |
xanchor="left",
|
| 256 |
yanchor="top",
|
|
@@ -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=700, height=750, scale=
|
| 268 |
|
| 269 |
# Generate reports (page and sentence levels)
|
| 270 |
def generate_page_report(df_pages, report_file_name):
|
|
|
|
| 219 |
title=None,
|
| 220 |
tickfont=dict(size=12)
|
| 221 |
),
|
| 222 |
+
margin=dict(l=20, r=100, t=30, b=20), # Increased right margin for icon
|
| 223 |
height=600,
|
| 224 |
#width=800,
|
| 225 |
showlegend=False,
|
|
|
|
| 250 |
dict(
|
| 251 |
source='data:image/png;base64,' + encoded_image,
|
| 252 |
xref="paper", yref="paper",
|
| 253 |
+
x=1.05, y=0.9, # Positioning: slightly to the right and top
|
| 254 |
sizex=0.2, sizey=0.2, # Size of the icon
|
| 255 |
xanchor="left",
|
| 256 |
yanchor="top",
|
|
|
|
| 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=5, engine="kaleido")
|
| 268 |
|
| 269 |
# Generate reports (page and sentence levels)
|
| 270 |
def generate_page_report(df_pages, report_file_name):
|