ror HF Staff commited on
Commit
ed6addf
·
1 Parent(s): b38ad0f

Added visual hints on summary page

Browse files
Files changed (1) hide show
  1. summary_page.py +6 -1
summary_page.py CHANGED
@@ -48,9 +48,14 @@ def draw_text_and_bar(
48
  """Draw a horizontal bar chart for given stats and its label on the left."""
49
  # Text
50
  label_x = column_left_position - LABEL_OFFSET
 
 
 
 
 
51
  ax.text(
52
  label_x, y_bar, label, ha='right', va='center', color='#CCCCCC', fontsize=LABEL_FONT_SIZE,
53
- fontfamily='monospace', fontweight='normal'
54
  )
55
  # Bar
56
  total = sum(stats.values())
 
48
  """Draw a horizontal bar chart for given stats and its label on the left."""
49
  # Text
50
  label_x = column_left_position - LABEL_OFFSET
51
+ failures_present = any(stats[category] > 0 for category in ['failed', 'error'])
52
+ if failures_present:
53
+ props = dict(boxstyle='round', facecolor=COLORS['failed'], alpha=0.35)
54
+ else:
55
+ props = dict(alpha=0)
56
  ax.text(
57
  label_x, y_bar, label, ha='right', va='center', color='#CCCCCC', fontsize=LABEL_FONT_SIZE,
58
+ fontfamily='monospace', fontweight='normal', bbox=props
59
  )
60
  # Bar
61
  total = sum(stats.values())