duongthienz commited on
Commit
306c094
·
verified ·
1 Parent(s): b40d148

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +8 -1
utils.py CHANGED
@@ -636,13 +636,20 @@ def build_fig_bar(df2, speakerNames, catColors, speaker_color_map, get_display_n
636
  hovertemplate="<b>%{customdata[0]}</b><br>Total: %{customdata[1]}<br>Multi Voice: %{customdata[2]}<extra></extra>",
637
  ))
638
 
 
 
 
639
  fig.update_layout(
640
  barmode="stack",
641
  title="Time spoken by each speaker",
642
  xaxis_title="Time Spoken",
643
  yaxis_title=None,
644
  showlegend=False,
645
- yaxis={"showticklabels": True, "autorange": "reversed"},
 
 
 
 
646
  xaxis={"showticklabels": False},
647
  **TRANSPARENT_BG,
648
  )
 
636
  hovertemplate="<b>%{customdata[0]}</b><br>Total: %{customdata[1]}<br>Multi Voice: %{customdata[2]}<extra></extra>",
637
  ))
638
 
639
+ # Build ordered category list: reverse so SPEAKER_001 is at bottom
640
+ ordered_speakers = df2["display"].tolist()[::-1]
641
+
642
  fig.update_layout(
643
  barmode="stack",
644
  title="Time spoken by each speaker",
645
  xaxis_title="Time Spoken",
646
  yaxis_title=None,
647
  showlegend=False,
648
+ yaxis=dict(
649
+ showticklabels=True,
650
+ categoryorder="array",
651
+ categoryarray=ordered_speakers,
652
+ ),
653
  xaxis={"showticklabels": False},
654
  **TRANSPARENT_BG,
655
  )