spider plot enhancement
Browse files- src/app_utils.py +16 -2
src/app_utils.py
CHANGED
|
@@ -270,7 +270,7 @@ def get_spider_plot_fig(df: pd.DataFrame):
|
|
| 270 |
profile_color = 'red'
|
| 271 |
elif avg_strength < 50:
|
| 272 |
profile_color = 'gold'
|
| 273 |
-
elif avg_strength <
|
| 274 |
profile_color = 'blue'
|
| 275 |
else:
|
| 276 |
profile_color = 'green'
|
|
@@ -298,8 +298,22 @@ def get_spider_plot_fig(df: pd.DataFrame):
|
|
| 298 |
name='Median (0.5)'
|
| 299 |
))
|
| 300 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 301 |
legend_text = (
|
| 302 |
-
f"<b>Avg. strength: {avg_strength}</b><br>"
|
| 303 |
"<b>Quantile Scale: 0 to 1</b><br>"
|
| 304 |
"D/E, Beta, and Volatility:<br>"
|
| 305 |
"0 is highest, 1 is lowest<br>"
|
|
|
|
| 270 |
profile_color = 'red'
|
| 271 |
elif avg_strength < 50:
|
| 272 |
profile_color = 'gold'
|
| 273 |
+
elif avg_strength < 60:
|
| 274 |
profile_color = 'blue'
|
| 275 |
else:
|
| 276 |
profile_color = 'green'
|
|
|
|
| 298 |
name='Median (0.5)'
|
| 299 |
))
|
| 300 |
|
| 301 |
+
# Determine strength level text based on score
|
| 302 |
+
if avg_strength < 30:
|
| 303 |
+
strength_level = "very low"
|
| 304 |
+
text_color = "red"
|
| 305 |
+
elif avg_strength < 50:
|
| 306 |
+
strength_level = "low"
|
| 307 |
+
text_color = "gold"
|
| 308 |
+
elif avg_strength < 60:
|
| 309 |
+
strength_level = "medium"
|
| 310 |
+
text_color = "blue"
|
| 311 |
+
else:
|
| 312 |
+
strength_level = "high"
|
| 313 |
+
text_color = "green"
|
| 314 |
+
|
| 315 |
legend_text = (
|
| 316 |
+
f"<b>Avg. strength: {avg_strength}</b> (<span style='color:{text_color}'>{strength_level}</span>)<br><br>"
|
| 317 |
"<b>Quantile Scale: 0 to 1</b><br>"
|
| 318 |
"D/E, Beta, and Volatility:<br>"
|
| 319 |
"0 is highest, 1 is lowest<br>"
|