czyoung commited on
Commit
b795064
·
verified ·
1 Parent(s): 347ca34

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -10
app.py CHANGED
@@ -30,6 +30,11 @@ earlyCleanup = True
30
  # [0,1,2,3,4]
31
  verbosity=4
32
 
 
 
 
 
 
33
  def printV(message,verbosityLevel):
34
  global verbosity
35
  if verbosity>=verbosityLevel:
@@ -601,7 +606,7 @@ try:
601
  on_click="ignore",
602
  )
603
  printV("Pie1 in col1_2",4)
604
- st.plotly_chart(fig1, use_container_width=True)
605
  printV("Pie1 post plotly",4)
606
 
607
  with pie2:
@@ -644,7 +649,7 @@ try:
644
  key='download-svg2',
645
  on_click="ignore",
646
  )
647
- st.plotly_chart(fig2, use_container_width=True)
648
 
649
  with sunburst1:
650
  df5 = st.session_state.summaries[currFileIndex]["df5"]
@@ -696,7 +701,7 @@ try:
696
  key='download-svg3',
697
  on_click="ignore",
698
  )
699
- st.plotly_chart(fig3_1, use_container_width=True)
700
 
701
  with treemap1:
702
  df5 = st.session_state.summaries[currFileIndex]["df5"]
@@ -748,7 +753,7 @@ try:
748
  key='download-svg4',
749
  on_click="ignore",
750
  )
751
- st.plotly_chart(fig3, use_container_width=True)
752
 
753
  # generate plotting window
754
 
@@ -802,7 +807,7 @@ try:
802
  key='download-svg5',
803
  on_click="ignore",
804
  )
805
- st.plotly_chart(fig_la, use_container_width=True)
806
 
807
  with bar1:
808
  df2 = st.session_state.summaries[currFileIndex]["df2"]
@@ -849,7 +854,7 @@ try:
849
  key='download-svg6',
850
  on_click="ignore",
851
  )
852
- st.plotly_chart(fig2_la, use_container_width=True)
853
 
854
  except ValueError:
855
  pass
@@ -894,7 +899,7 @@ if len(st.session_state.results) > 0:
894
  df6_dict[category].append(0)
895
  df6 = pd.DataFrame(df6_dict)
896
  summFig = px.bar(df6, x="files", y=allCategories,title="Time Spoken by Each Speaker in Each File")
897
- st.plotly_chart(summFig, use_container_width=True)
898
 
899
 
900
  voiceNames = ["No Voice","One Voice","Multi Voice"]
@@ -910,13 +915,13 @@ if len(st.session_state.results) > 0:
910
  df7 = pd.DataFrame(df7_dict)
911
  sorted_df7 = df7.sort_values(by=['One Voice', 'Multi Voice'])
912
  summFig2 = px.bar(sorted_df7, x="files", y=["One Voice","Multi Voice","No Voice",],title="Cross-file Voice Categories sorted for One Voice")
913
- st.plotly_chart(summFig2, use_container_width=True)
914
  sorted_df7_3 = df7.sort_values(by=['Multi Voice','One Voice'])
915
  summFig3 = px.bar(sorted_df7_3, x="files", y=["One Voice","Multi Voice","No Voice",],title="Cross-file Voice Categories sorted for Multi Voice")
916
- st.plotly_chart(summFig3, use_container_width=True)
917
  sorted_df7_4 = df7.sort_values(by=['No Voice', 'Multi Voice'],ascending=False)
918
  summFig4 = px.bar(sorted_df7_4, x="files", y=["One Voice","Multi Voice","No Voice",],title="Cross-file Voice Categories sorted for Any Voice")
919
- st.plotly_chart(summFig4, use_container_width=True)
920
 
921
 
922
 
 
30
  # [0,1,2,3,4]
31
  verbosity=4
32
 
33
+ config = {
34
+ 'displayModeBar': True,
35
+ 'modeBarButtonsToRemove':[],
36
+ }
37
+
38
  def printV(message,verbosityLevel):
39
  global verbosity
40
  if verbosity>=verbosityLevel:
 
606
  on_click="ignore",
607
  )
608
  printV("Pie1 in col1_2",4)
609
+ st.plotly_chart(fig1, use_container_width=True,config=config)
610
  printV("Pie1 post plotly",4)
611
 
612
  with pie2:
 
649
  key='download-svg2',
650
  on_click="ignore",
651
  )
652
+ st.plotly_chart(fig2, use_container_width=True,config=config)
653
 
654
  with sunburst1:
655
  df5 = st.session_state.summaries[currFileIndex]["df5"]
 
701
  key='download-svg3',
702
  on_click="ignore",
703
  )
704
+ st.plotly_chart(fig3_1, use_container_width=True,config=config)
705
 
706
  with treemap1:
707
  df5 = st.session_state.summaries[currFileIndex]["df5"]
 
753
  key='download-svg4',
754
  on_click="ignore",
755
  )
756
+ st.plotly_chart(fig3, use_container_width=True,config=config)
757
 
758
  # generate plotting window
759
 
 
807
  key='download-svg5',
808
  on_click="ignore",
809
  )
810
+ st.plotly_chart(fig_la, use_container_width=True,config=config)
811
 
812
  with bar1:
813
  df2 = st.session_state.summaries[currFileIndex]["df2"]
 
854
  key='download-svg6',
855
  on_click="ignore",
856
  )
857
+ st.plotly_chart(fig2_la, use_container_width=True,config=config)
858
 
859
  except ValueError:
860
  pass
 
899
  df6_dict[category].append(0)
900
  df6 = pd.DataFrame(df6_dict)
901
  summFig = px.bar(df6, x="files", y=allCategories,title="Time Spoken by Each Speaker in Each File")
902
+ st.plotly_chart(summFig, use_container_width=True,config=config)
903
 
904
 
905
  voiceNames = ["No Voice","One Voice","Multi Voice"]
 
915
  df7 = pd.DataFrame(df7_dict)
916
  sorted_df7 = df7.sort_values(by=['One Voice', 'Multi Voice'])
917
  summFig2 = px.bar(sorted_df7, x="files", y=["One Voice","Multi Voice","No Voice",],title="Cross-file Voice Categories sorted for One Voice")
918
+ st.plotly_chart(summFig2, use_container_width=True,config=config)
919
  sorted_df7_3 = df7.sort_values(by=['Multi Voice','One Voice'])
920
  summFig3 = px.bar(sorted_df7_3, x="files", y=["One Voice","Multi Voice","No Voice",],title="Cross-file Voice Categories sorted for Multi Voice")
921
+ st.plotly_chart(summFig3, use_container_width=True,config=config)
922
  sorted_df7_4 = df7.sort_values(by=['No Voice', 'Multi Voice'],ascending=False)
923
  summFig4 = px.bar(sorted_df7_4, x="files", y=["One Voice","Multi Voice","No Voice",],title="Cross-file Voice Categories sorted for Any Voice")
924
+ st.plotly_chart(summFig4, use_container_width=True,config=config)
925
 
926
 
927