BlakeL commited on
Commit
968b2ad
·
verified ·
1 Parent(s): 3fedd97

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -192,7 +192,7 @@ class SocialMediaAnalyzer:
192
 
193
  # Convert score to angle (0-180 degrees, where 0 is low addiction, 180 is high)
194
  # Map 1-10 score to 0-180 degrees
195
- angle = (predicted_score - 1) * 20 # 20 degrees per unit (180/9)
196
 
197
  # Create the gauge
198
  # Background circle (full range)
@@ -213,7 +213,7 @@ class SocialMediaAnalyzer:
213
  ax.fill_between(high_angle, 0, 1, alpha=0.3, color='red', label='High (7-10)')
214
 
215
  # Add the needle (rotate by -90° to make 0° at left instead of top)
216
- needle_angle = angle * np.pi / 180
217
  ax.plot([needle_angle, needle_angle], [0, 1.2], 'k-', linewidth=4, label=f'Your Score: {predicted_score:.1f}')
218
 
219
  # Add a circle at the needle tip
 
192
 
193
  # Convert score to angle (0-180 degrees, where 0 is low addiction, 180 is high)
194
  # Map 1-10 score to 0-180 degrees
195
+ angle = 90 - (predicted_score - 1) * 20 # 20 degrees per unit (180/9)
196
 
197
  # Create the gauge
198
  # Background circle (full range)
 
213
  ax.fill_between(high_angle, 0, 1, alpha=0.3, color='red', label='High (7-10)')
214
 
215
  # Add the needle (rotate by -90° to make 0° at left instead of top)
216
+ needle_angle = angle
217
  ax.plot([needle_angle, needle_angle], [0, 1.2], 'k-', linewidth=4, label=f'Your Score: {predicted_score:.1f}')
218
 
219
  # Add a circle at the needle tip