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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -12
app.py CHANGED
@@ -579,22 +579,24 @@ try:
579
  printV("Pie1 files written",4)
580
  with col1_1:
581
  printV("Pie1 in col1_1",4)
582
- with open('ascn_pie1.pdf') as f:
583
  printV("Pie1 in file open",4)
584
  st.download_button(
585
  "Save As PDF",
586
  f,
587
  'sonogram-voice-category-'+currPlainName+'.pdf',
 
588
  key='download-pdf1',
589
  on_click="ignore",
590
  )
591
  printV("Pie1 after col1_1",4)
592
  with col1_2:
593
- with open('ascn_pie1.svg') as f:
594
  st.download_button(
595
  "Save As SVG",
596
  f,
597
  'sonogram-voice-category-'+currPlainName+'.svg',
 
598
  key='download-svg1',
599
  on_click="ignore",
600
  )
@@ -623,20 +625,22 @@ try:
623
  fig2.write_image("ascn_pie2.pdf")
624
  fig2.write_image("ascn_pie2.svg")
625
  with col2_1:
626
- with open('ascn_pie2.pdf') as f:
627
  st.download_button(
628
  "Save As PDF",
629
  f,
630
  'sonogram-speaker-percent-'+currPlainName+'.pdf',
 
631
  key='download-pdf2',
632
  on_click="ignore",
633
  )
634
  with col2_2:
635
- with open('ascn_pie2.svg') as f:
636
  st.download_button(
637
  "Save As SVG",
638
  f,
639
  'sonogram-speaker-percent-'+currPlainName+'.svg',
 
640
  key='download-svg2',
641
  on_click="ignore",
642
  )
@@ -673,20 +677,22 @@ try:
673
  fig3_1.write_image("ascn_sunburst.pdf")
674
  fig3_1.write_image("ascn_sunburst.svg")
675
  with col3_1:
676
- with open('ascn_sunburst.pdf') as f:
677
  st.download_button(
678
  "Save As PDF",
679
  f,
680
  'sonogram-speaker-categories-'+currPlainName+'.pdf',
 
681
  key='download-pdf3',
682
  on_click="ignore",
683
  )
684
  with col3_2:
685
- with open('ascn_sunburst.svg') as f:
686
  st.download_button(
687
  "Save As SVG",
688
  f,
689
  'sonogram-speaker-categories-'+currPlainName+'.svg',
 
690
  key='download-svg3',
691
  on_click="ignore",
692
  )
@@ -723,20 +729,22 @@ try:
723
  fig3.write_image("ascn_treemap.pdf")
724
  fig3.write_image("ascn_treemap.svg")
725
  with col4_1:
726
- with open('ascn_treemap.pdf') as f:
727
  st.download_button(
728
  "Save As PDF",
729
  f,
730
  'sonogram-treemap-'+currPlainName+'.pdf',
 
731
  key='download-pdf4',
732
  on_click="ignore",
733
  )
734
  with col4_2:
735
- with open('ascn_treemap.svg') as f:
736
  st.download_button(
737
  "Save As SVG",
738
  f,
739
  'sonogram-treemap-'+currPlainName+'.svg',
 
740
  key='download-svg4',
741
  on_click="ignore",
742
  )
@@ -775,20 +783,22 @@ try:
775
  fig_la.write_image("ascn_timeline.pdf")
776
  fig_la.write_image("ascn_timeline.svg")
777
  with col5_1:
778
- with open('ascn_timeline.pdf') as f:
779
  st.download_button(
780
  "Save As PDF",
781
  f,
782
  'sonogram-timeline-'+currPlainName+'.pdf',
 
783
  key='download-pdf5',
784
  on_click="ignore",
785
  )
786
  with col5_2:
787
- with open('ascn_timeline.svg') as f:
788
  st.download_button(
789
  "Save As SVG",
790
  f,
791
  'sonogram-timeline-'+currPlainName+'.svg',
 
792
  key='download-svg5',
793
  on_click="ignore",
794
  )
@@ -820,20 +830,22 @@ try:
820
  fig_la.write_image("ascn_bar.pdf")
821
  fig_la.write_image("ascn_bar.svg")
822
  with col6_1:
823
- with open('ascn_bar.pdf') as f:
824
  st.download_button(
825
  "Save As PDF",
826
  f,
827
  'sonogram-speaker-time-'+currPlainName+'.pdf',
 
828
  key='download-pdf6',
829
  on_click="ignore",
830
  )
831
  with col6_2:
832
- with open('ascn_bar.svg') as f:
833
  st.download_button(
834
  "Save As SVG",
835
  f,
836
  'sonogram-speaker-time-'+currPlainName+'.svg',
 
837
  key='download-svg6',
838
  on_click="ignore",
839
  )
 
579
  printV("Pie1 files written",4)
580
  with col1_1:
581
  printV("Pie1 in col1_1",4)
582
+ with open('ascn_pie1.pdf','rb') as f:
583
  printV("Pie1 in file open",4)
584
  st.download_button(
585
  "Save As PDF",
586
  f,
587
  'sonogram-voice-category-'+currPlainName+'.pdf',
588
+ 'application/pdf',
589
  key='download-pdf1',
590
  on_click="ignore",
591
  )
592
  printV("Pie1 after col1_1",4)
593
  with col1_2:
594
+ with open('ascn_pie1.svg','rb') as f:
595
  st.download_button(
596
  "Save As SVG",
597
  f,
598
  'sonogram-voice-category-'+currPlainName+'.svg',
599
+ 'image/svg+xml',
600
  key='download-svg1',
601
  on_click="ignore",
602
  )
 
625
  fig2.write_image("ascn_pie2.pdf")
626
  fig2.write_image("ascn_pie2.svg")
627
  with col2_1:
628
+ with open('ascn_pie2.pdf','rb') as f:
629
  st.download_button(
630
  "Save As PDF",
631
  f,
632
  'sonogram-speaker-percent-'+currPlainName+'.pdf',
633
+ 'application/pdf',
634
  key='download-pdf2',
635
  on_click="ignore",
636
  )
637
  with col2_2:
638
+ with open('ascn_pie2.svg','rb') as f:
639
  st.download_button(
640
  "Save As SVG",
641
  f,
642
  'sonogram-speaker-percent-'+currPlainName+'.svg',
643
+ 'image/svg+xml',
644
  key='download-svg2',
645
  on_click="ignore",
646
  )
 
677
  fig3_1.write_image("ascn_sunburst.pdf")
678
  fig3_1.write_image("ascn_sunburst.svg")
679
  with col3_1:
680
+ with open('ascn_sunburst.pdf','rb') as f:
681
  st.download_button(
682
  "Save As PDF",
683
  f,
684
  'sonogram-speaker-categories-'+currPlainName+'.pdf',
685
+ 'application/pdf',
686
  key='download-pdf3',
687
  on_click="ignore",
688
  )
689
  with col3_2:
690
+ with open('ascn_sunburst.svg','rb') as f:
691
  st.download_button(
692
  "Save As SVG",
693
  f,
694
  'sonogram-speaker-categories-'+currPlainName+'.svg',
695
+ 'image/svg+xml',
696
  key='download-svg3',
697
  on_click="ignore",
698
  )
 
729
  fig3.write_image("ascn_treemap.pdf")
730
  fig3.write_image("ascn_treemap.svg")
731
  with col4_1:
732
+ with open('ascn_treemap.pdf','rb') as f:
733
  st.download_button(
734
  "Save As PDF",
735
  f,
736
  'sonogram-treemap-'+currPlainName+'.pdf',
737
+ 'application/pdf',
738
  key='download-pdf4',
739
  on_click="ignore",
740
  )
741
  with col4_2:
742
+ with open('ascn_treemap.svg','rb') as f:
743
  st.download_button(
744
  "Save As SVG",
745
  f,
746
  'sonogram-treemap-'+currPlainName+'.svg',
747
+ 'image/svg+xml',
748
  key='download-svg4',
749
  on_click="ignore",
750
  )
 
783
  fig_la.write_image("ascn_timeline.pdf")
784
  fig_la.write_image("ascn_timeline.svg")
785
  with col5_1:
786
+ with open('ascn_timeline.pdf','rb') as f:
787
  st.download_button(
788
  "Save As PDF",
789
  f,
790
  'sonogram-timeline-'+currPlainName+'.pdf',
791
+ 'application/pdf',
792
  key='download-pdf5',
793
  on_click="ignore",
794
  )
795
  with col5_2:
796
+ with open('ascn_timeline.svg','rb') as f:
797
  st.download_button(
798
  "Save As SVG",
799
  f,
800
  'sonogram-timeline-'+currPlainName+'.svg',
801
+ 'image/svg+xml',
802
  key='download-svg5',
803
  on_click="ignore",
804
  )
 
830
  fig_la.write_image("ascn_bar.pdf")
831
  fig_la.write_image("ascn_bar.svg")
832
  with col6_1:
833
+ with open('ascn_bar.pdf','rb') as f:
834
  st.download_button(
835
  "Save As PDF",
836
  f,
837
  'sonogram-speaker-time-'+currPlainName+'.pdf',
838
+ 'application/pdf',
839
  key='download-pdf6',
840
  on_click="ignore",
841
  )
842
  with col6_2:
843
+ with open('ascn_bar.svg','rb') as f:
844
  st.download_button(
845
  "Save As SVG",
846
  f,
847
  'sonogram-speaker-time-'+currPlainName+'.svg',
848
+ 'image/svg+xml',
849
  key='download-svg6',
850
  on_click="ignore",
851
  )