Spaces:
Build error
Build error
Update app/helpers.py
Browse files- app/helpers.py +4 -4
app/helpers.py
CHANGED
@@ -432,11 +432,11 @@ def make_content_safety_fig(cont_safety_summary):
|
|
432 |
for key in cont_safety_summary:
|
433 |
d['label'] += [' '.join(key.split('_')).title()]
|
434 |
d['severity'] += [cont_safety_summary[key]]
|
435 |
-
d['color'] += ['rgba(107, 43, 214, 1)']
|
436 |
|
437 |
-
# Create the figure (n.b. repetitive color info but was running into plotly bugs)
|
438 |
-
content_fig = px.bar(d, x='severity', y='label',
|
439 |
-
'Crime Violence': 'rgba(107, 43, 214,
|
440 |
'Alcohol': 'rgba(107, 43, 214, 0.1)',
|
441 |
'Accidents': 'rgba(107, 43, 214, 0.1)'})
|
442 |
|
|
|
432 |
for key in cont_safety_summary:
|
433 |
d['label'] += [' '.join(key.split('_')).title()]
|
434 |
d['severity'] += [cont_safety_summary[key]]
|
435 |
+
#d['color'] += ['rgba(107, 43, 214, 1)']
|
436 |
|
437 |
+
# Create the figure (n.b. repetitive color info but was running into plotly bugs) color='color',
|
438 |
+
content_fig = px.bar(d, x='severity', y='label', color_discrete_map={
|
439 |
+
'Crime Violence': 'rgba(107, 43, 214, 1)',
|
440 |
'Alcohol': 'rgba(107, 43, 214, 0.1)',
|
441 |
'Accidents': 'rgba(107, 43, 214, 0.1)'})
|
442 |
|