duongthienz commited on
Commit
75ad8ce
·
verified ·
1 Parent(s): 01639ca

Make visual changes to multi-file summary data

Browse files
Files changed (1) hide show
  1. ui.py +12 -14
ui.py CHANGED
@@ -426,22 +426,20 @@ def render_multifile_summary(plotly_config=None):
426
  st.session_state.categories, st.session_state.categorySelect,
427
  speakerRenames=st.session_state.speakerRenames,
428
  )
429
- st.plotly_chart(
430
- px.bar(df6, x="files", y=allCategories,
431
- title="Time Spoken by Each Speaker/Role in Each File"),
432
- use_container_width=True, config=cfg,
433
- )
434
  st.caption("Note: Overlaps between speakers of the same role are only counted once.")
435
 
436
  df7, _ = utils.build_multifile_voice_df(validNames, st.session_state.summaries)
437
  for sort_cols, ascending, title in [
438
- (["Single Voice", "Multi Voice"], True, "Cross-file Voice Categories sorted for Single Voice"),
439
- (["Multi Voice", "Single Voice"], True, "Cross-file Voice Categories sorted for Multi Voice"),
440
- (["No Voice", "Multi Voice"], False, "Cross-file Voice Categories sorted for Any Voice"),
441
  ]:
442
- st.plotly_chart(
443
- px.bar(df7.sort_values(by=sort_cols, ascending=ascending),
444
- x="files", y=["Single Voice", "Multi Voice", "No Voice"],
445
- title=title),
446
- use_container_width=True, config=cfg,
447
- )
 
426
  st.session_state.categories, st.session_state.categorySelect,
427
  speakerRenames=st.session_state.speakerRenames,
428
  )
429
+ fig6 = px.bar(df6, x="files", y=allCategories,
430
+ title="Proportion of File Duration Spoken by Each Speaker/Role")
431
+ fig6.update_layout(yaxis_title="Proportion of File Duration")
432
+ st.plotly_chart(fig6, use_container_width=True, config=cfg)
 
433
  st.caption("Note: Overlaps between speakers of the same role are only counted once.")
434
 
435
  df7, _ = utils.build_multifile_voice_df(validNames, st.session_state.summaries)
436
  for sort_cols, ascending, title in [
437
+ (["Single Voice", "Multi Voice"], True, "Cross-file Voice Categories sorted by Single Voice (least → most)"),
438
+ (["Multi Voice", "Single Voice"], True, "Cross-file Voice Categories sorted by Multi Voice (least → most)"),
439
+ (["No Voice", "Multi Voice"], False, "Cross-file Voice Categories sorted by No Voice (most → least)"),
440
  ]:
441
+ fig7 = px.bar(df7.sort_values(by=sort_cols, ascending=ascending),
442
+ x="files", y=["Single Voice", "Multi Voice", "No Voice"],
443
+ title=title)
444
+ fig7.update_layout(yaxis_title="Proportion of File Duration")
445
+ st.plotly_chart(fig7, use_container_width=True, config=cfg)