@@ -56,7 +56,7 @@ def inject_into(plugin)
56
56
data_points . map do |point |
57
57
{
58
58
req : "sentiment_#{ point } " ,
59
- color : point == "positive" ? report . colors [ 1 ] : report . colors [ 3 ] ,
59
+ color : point == "positive" ? report . colors [ :lime ] : report . colors [ :purple ] ,
60
60
label : I18n . t ( "discourse_ai.sentiment.reports.overall_sentiment.#{ point } " ) ,
61
61
data :
62
62
grouped_sentiments . map do |gs |
@@ -105,18 +105,19 @@ def inject_into(plugin)
105
105
threshold : threshold ,
106
106
)
107
107
108
+ return report if grouped_emotions . empty?
109
+
108
110
emotions = %w[ sadness disgust fear anger joy surprise ]
109
111
level_groups = [ [ 0 , 1 ] , [ 2 , 3 , 4 ] ]
110
112
111
- return report if grouped_emotions . empty?
112
-
113
113
report . data =
114
114
level_groups . each_with_index . map do |lg , idx |
115
+ color = idx == 0 ? :turquoise : :lime
115
116
tl_emotion_avgs = grouped_emotions . select { |ge | lg . include? ( ge . trust_level ) }
116
117
117
118
{
118
119
req : "emotion_tl_#{ lg . join } " ,
119
- color : report . colors [ idx ] ,
120
+ color : report . colors [ color ] ,
120
121
label : I18n . t ( "discourse_ai.sentiment.reports.post_emotion.tl_#{ lg . join } " ) ,
121
122
data :
122
123
emotions . map do |e |
0 commit comments