Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -533,20 +533,22 @@ try:
|
|
| 533 |
col1_1, col1_2 = st.columns(2)
|
| 534 |
fig1.write_image("ascn_pie1.pdf")
|
| 535 |
fig1.write_image("ascn_pie1.svg")
|
| 536 |
-
with
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
|
|
|
|
|
|
| 550 |
st.plotly_chart(fig1, use_container_width=True)
|
| 551 |
|
| 552 |
with pie2:
|
|
@@ -569,20 +571,22 @@ try:
|
|
| 569 |
col2_1, col2_2 = st.columns(2)
|
| 570 |
fig2.write_image("ascn_pie2.pdf")
|
| 571 |
fig2.write_image("ascn_pie2.svg")
|
| 572 |
-
with
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
|
|
|
|
|
|
| 586 |
st.plotly_chart(fig2, use_container_width=True)
|
| 587 |
|
| 588 |
with sunburst1:
|
|
@@ -615,20 +619,22 @@ try:
|
|
| 615 |
col3_1, col3_2 = st.columns(2)
|
| 616 |
fig3_1.write_image("ascn_sunburst.pdf")
|
| 617 |
fig3_1.write_image("ascn_sunburst.svg")
|
| 618 |
-
with
|
| 619 |
-
|
| 620 |
-
|
| 621 |
-
|
| 622 |
-
|
| 623 |
-
|
| 624 |
-
|
| 625 |
-
|
| 626 |
-
|
| 627 |
-
|
| 628 |
-
|
| 629 |
-
|
| 630 |
-
|
| 631 |
-
|
|
|
|
|
|
|
| 632 |
st.plotly_chart(fig3_1, use_container_width=True)
|
| 633 |
|
| 634 |
with treemap1:
|
|
@@ -661,20 +667,22 @@ try:
|
|
| 661 |
col4_1, col4_2 = st.columns(2)
|
| 662 |
fig3.write_image("ascn_treemap.pdf")
|
| 663 |
fig3.write_image("ascn_treemap.svg")
|
| 664 |
-
with
|
| 665 |
-
|
| 666 |
-
|
| 667 |
-
|
| 668 |
-
|
| 669 |
-
|
| 670 |
-
|
| 671 |
-
|
| 672 |
-
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
|
| 676 |
-
|
| 677 |
-
|
|
|
|
|
|
|
| 678 |
st.plotly_chart(fig3, use_container_width=True)
|
| 679 |
|
| 680 |
# generate plotting window
|
|
@@ -709,20 +717,22 @@ try:
|
|
| 709 |
col5_1, col5_2 = st.columns(2)
|
| 710 |
fig_la.write_image("ascn_timeline.pdf")
|
| 711 |
fig_la.write_image("ascn_timeline.svg")
|
| 712 |
-
with
|
| 713 |
-
|
| 714 |
-
|
| 715 |
-
|
| 716 |
-
|
| 717 |
-
|
| 718 |
-
|
| 719 |
-
|
| 720 |
-
|
| 721 |
-
|
| 722 |
-
|
| 723 |
-
|
| 724 |
-
|
| 725 |
-
|
|
|
|
|
|
|
| 726 |
st.plotly_chart(fig_la, use_container_width=True)
|
| 727 |
|
| 728 |
with bar1:
|
|
@@ -750,20 +760,22 @@ try:
|
|
| 750 |
col6_1, col6_2 = st.columns(2)
|
| 751 |
fig_la.write_image("ascn_bar.pdf")
|
| 752 |
fig_la.write_image("ascn_bar.svg")
|
| 753 |
-
with
|
| 754 |
-
|
| 755 |
-
|
| 756 |
-
|
| 757 |
-
|
| 758 |
-
|
| 759 |
-
|
| 760 |
-
|
| 761 |
-
|
| 762 |
-
|
| 763 |
-
|
| 764 |
-
|
| 765 |
-
|
| 766 |
-
|
|
|
|
|
|
|
| 767 |
st.plotly_chart(fig2_la, use_container_width=True)
|
| 768 |
|
| 769 |
except ValueError:
|
|
|
|
| 533 |
col1_1, col1_2 = st.columns(2)
|
| 534 |
fig1.write_image("ascn_pie1.pdf")
|
| 535 |
fig1.write_image("ascn_pie1.svg")
|
| 536 |
+
with col1_1:
|
| 537 |
+
with open('ascn_pie1.pdf') as f:
|
| 538 |
+
st.download_button(
|
| 539 |
+
"Save As PDF",
|
| 540 |
+
f,
|
| 541 |
+
'sonogram-voice-category-'+currPlainName+'.pdf',
|
| 542 |
+
key='download-pdf1',
|
| 543 |
+
)
|
| 544 |
+
with col1_2:
|
| 545 |
+
with open('ascn_pie1.svg') as f:
|
| 546 |
+
st.download_button(
|
| 547 |
+
"Save As SVG",
|
| 548 |
+
f,
|
| 549 |
+
'sonogram-voice-category-'+currPlainName+'.svg',
|
| 550 |
+
key='download-svg1',
|
| 551 |
+
)
|
| 552 |
st.plotly_chart(fig1, use_container_width=True)
|
| 553 |
|
| 554 |
with pie2:
|
|
|
|
| 571 |
col2_1, col2_2 = st.columns(2)
|
| 572 |
fig2.write_image("ascn_pie2.pdf")
|
| 573 |
fig2.write_image("ascn_pie2.svg")
|
| 574 |
+
with col2_1:
|
| 575 |
+
with open('ascn_pie2.pdf') as f:
|
| 576 |
+
st.download_button(
|
| 577 |
+
"Save As PDF",
|
| 578 |
+
f,
|
| 579 |
+
'sonogram-speaker-percent-'+currPlainName+'.pdf',
|
| 580 |
+
key='download-pdf2',
|
| 581 |
+
)
|
| 582 |
+
with col2_2:
|
| 583 |
+
with open('ascn_pie2.svg') as f:
|
| 584 |
+
st.download_button(
|
| 585 |
+
"Save As SVG",
|
| 586 |
+
f,
|
| 587 |
+
'sonogram-speaker-percent-'+currPlainName+'.svg',
|
| 588 |
+
key='download-svg2',
|
| 589 |
+
)
|
| 590 |
st.plotly_chart(fig2, use_container_width=True)
|
| 591 |
|
| 592 |
with sunburst1:
|
|
|
|
| 619 |
col3_1, col3_2 = st.columns(2)
|
| 620 |
fig3_1.write_image("ascn_sunburst.pdf")
|
| 621 |
fig3_1.write_image("ascn_sunburst.svg")
|
| 622 |
+
with col3_1:
|
| 623 |
+
with open('ascn_sunburst.pdf') as f:
|
| 624 |
+
st.download_button(
|
| 625 |
+
"Save As PDF",
|
| 626 |
+
f,
|
| 627 |
+
'sonogram-speaker-categories-'+currPlainName+'.pdf',
|
| 628 |
+
key='download-pdf3',
|
| 629 |
+
)
|
| 630 |
+
with col3_2:
|
| 631 |
+
with open('ascn_sunburst.svg') as f:
|
| 632 |
+
st.download_button(
|
| 633 |
+
"Save As SVG",
|
| 634 |
+
f,
|
| 635 |
+
'sonogram-speaker-categories-'+currPlainName+'.svg',
|
| 636 |
+
key='download-svg3',
|
| 637 |
+
)
|
| 638 |
st.plotly_chart(fig3_1, use_container_width=True)
|
| 639 |
|
| 640 |
with treemap1:
|
|
|
|
| 667 |
col4_1, col4_2 = st.columns(2)
|
| 668 |
fig3.write_image("ascn_treemap.pdf")
|
| 669 |
fig3.write_image("ascn_treemap.svg")
|
| 670 |
+
with col4_1:
|
| 671 |
+
with open('ascn_treemap.pdf') as f:
|
| 672 |
+
st.download_button(
|
| 673 |
+
"Save As PDF",
|
| 674 |
+
f,
|
| 675 |
+
'sonogram-treemap-'+currPlainName+'.pdf',
|
| 676 |
+
key='download-pdf4',
|
| 677 |
+
)
|
| 678 |
+
with col4_2:
|
| 679 |
+
with open('ascn_treemap.svg') as f:
|
| 680 |
+
st.download_button(
|
| 681 |
+
"Save As SVG",
|
| 682 |
+
f,
|
| 683 |
+
'sonogram-treemap-'+currPlainName+'.svg',
|
| 684 |
+
key='download-svg4',
|
| 685 |
+
)
|
| 686 |
st.plotly_chart(fig3, use_container_width=True)
|
| 687 |
|
| 688 |
# generate plotting window
|
|
|
|
| 717 |
col5_1, col5_2 = st.columns(2)
|
| 718 |
fig_la.write_image("ascn_timeline.pdf")
|
| 719 |
fig_la.write_image("ascn_timeline.svg")
|
| 720 |
+
with col5_1:
|
| 721 |
+
with open('ascn_timeline.pdf') as f:
|
| 722 |
+
st.download_button(
|
| 723 |
+
"Save As PDF",
|
| 724 |
+
f,
|
| 725 |
+
'sonogram-timeline-'+currPlainName+'.pdf',
|
| 726 |
+
key='download-pdf5',
|
| 727 |
+
)
|
| 728 |
+
with col5_2:
|
| 729 |
+
with open('ascn_timeline.svg') as f:
|
| 730 |
+
st.download_button(
|
| 731 |
+
"Save As SVG",
|
| 732 |
+
f,
|
| 733 |
+
'sonogram-timeline-'+currPlainName+'.svg',
|
| 734 |
+
key='download-svg5',
|
| 735 |
+
)
|
| 736 |
st.plotly_chart(fig_la, use_container_width=True)
|
| 737 |
|
| 738 |
with bar1:
|
|
|
|
| 760 |
col6_1, col6_2 = st.columns(2)
|
| 761 |
fig_la.write_image("ascn_bar.pdf")
|
| 762 |
fig_la.write_image("ascn_bar.svg")
|
| 763 |
+
with col6_1:
|
| 764 |
+
with open('ascn_bar.pdf') as f:
|
| 765 |
+
st.download_button(
|
| 766 |
+
"Save As PDF",
|
| 767 |
+
f,
|
| 768 |
+
'sonogram-speaker-time-'+currPlainName+'.pdf',
|
| 769 |
+
key='download-pdf6',
|
| 770 |
+
)
|
| 771 |
+
with col6_2:
|
| 772 |
+
with open('ascn_bar.svg') as f:
|
| 773 |
+
st.download_button(
|
| 774 |
+
"Save As SVG",
|
| 775 |
+
f,
|
| 776 |
+
'sonogram-speaker-time-'+currPlainName+'.svg',
|
| 777 |
+
key='download-svg6',
|
| 778 |
+
)
|
| 779 |
st.plotly_chart(fig2_la, use_container_width=True)
|
| 780 |
|
| 781 |
except ValueError:
|