Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -530,18 +530,18 @@ try:
|
|
| 530 |
)
|
| 531 |
fig1.add_trace(go.Pie(values=df3["values"],labels=df3["names"],sort=False))
|
| 532 |
|
| 533 |
-
|
| 534 |
fig1.write_image("ascn_pie1.pdf")
|
| 535 |
fig1.write_image("ascn_pie1.svg")
|
| 536 |
with open('ascn_pie1.pdf') as f:
|
| 537 |
-
|
| 538 |
"Save As PDF",
|
| 539 |
f,
|
| 540 |
'sonogram-voice-category-'+currPlainName+'.pdf',
|
| 541 |
key='download-pdf1',
|
| 542 |
)
|
| 543 |
with open('ascn_pie1.svg') as f:
|
| 544 |
-
|
| 545 |
"Save As SVG",
|
| 546 |
f,
|
| 547 |
'sonogram-voice-category-'+currPlainName+'.svg',
|
|
@@ -566,18 +566,18 @@ try:
|
|
| 566 |
)
|
| 567 |
fig2.add_trace(go.Pie(values=df4["values"],labels=df4["names"],sort=False))
|
| 568 |
|
| 569 |
-
|
| 570 |
fig2.write_image("ascn_pie2.pdf")
|
| 571 |
fig2.write_image("ascn_pie2.svg")
|
| 572 |
with open('ascn_pie2.pdf') as f:
|
| 573 |
-
|
| 574 |
"Save As PDF",
|
| 575 |
f,
|
| 576 |
'sonogram-speaker-percent-'+currPlainName+'.pdf',
|
| 577 |
key='download-pdf2',
|
| 578 |
)
|
| 579 |
with open('ascn_pie2.svg') as f:
|
| 580 |
-
|
| 581 |
"Save As SVG",
|
| 582 |
f,
|
| 583 |
'sonogram-speaker-percent-'+currPlainName+'.svg',
|
|
@@ -612,18 +612,18 @@ try:
|
|
| 612 |
paper_bgcolor='rgba(0, 0, 0, 0)',
|
| 613 |
)
|
| 614 |
|
| 615 |
-
|
| 616 |
fig3_1.write_image("ascn_sunburst.pdf")
|
| 617 |
fig3_1.write_image("ascn_sunburst.svg")
|
| 618 |
with open('ascn_sunburst.pdf') as f:
|
| 619 |
-
|
| 620 |
"Save As PDF",
|
| 621 |
f,
|
| 622 |
'sonogram-speaker-categories-'+currPlainName+'.pdf',
|
| 623 |
key='download-pdf3',
|
| 624 |
)
|
| 625 |
with open('ascn_sunburst.svg') as f:
|
| 626 |
-
|
| 627 |
"Save As SVG",
|
| 628 |
f,
|
| 629 |
'sonogram-speaker-categories-'+currPlainName+'.svg',
|
|
@@ -658,18 +658,18 @@ try:
|
|
| 658 |
paper_bgcolor='rgba(0, 0, 0, 0)',
|
| 659 |
)
|
| 660 |
|
| 661 |
-
|
| 662 |
fig3.write_image("ascn_treemap.pdf")
|
| 663 |
fig3.write_image("ascn_treemap.svg")
|
| 664 |
with open('ascn_treemap.pdf') as f:
|
| 665 |
-
|
| 666 |
"Save As PDF",
|
| 667 |
f,
|
| 668 |
'sonogram-treemap-'+currPlainName+'.pdf',
|
| 669 |
key='download-pdf4',
|
| 670 |
)
|
| 671 |
with open('ascn_treemap.svg') as f:
|
| 672 |
-
|
| 673 |
"Save As SVG",
|
| 674 |
f,
|
| 675 |
'sonogram-treemap-'+currPlainName+'.svg',
|
|
@@ -706,18 +706,18 @@ try:
|
|
| 706 |
paper_bgcolor='rgba(0, 0, 0, 0)',
|
| 707 |
)
|
| 708 |
|
| 709 |
-
|
| 710 |
fig_la.write_image("ascn_timeline.pdf")
|
| 711 |
fig_la.write_image("ascn_timeline.svg")
|
| 712 |
with open('ascn_timeline.pdf') as f:
|
| 713 |
-
|
| 714 |
"Save As PDF",
|
| 715 |
f,
|
| 716 |
'sonogram-timeline-'+currPlainName+'.pdf',
|
| 717 |
key='download-pdf5',
|
| 718 |
)
|
| 719 |
with open('ascn_timeline.svg') as f:
|
| 720 |
-
|
| 721 |
"Save As SVG",
|
| 722 |
f,
|
| 723 |
'sonogram-timeline-'+currPlainName+'.svg',
|
|
@@ -747,18 +747,18 @@ try:
|
|
| 747 |
])
|
| 748 |
)
|
| 749 |
|
| 750 |
-
|
| 751 |
fig_la.write_image("ascn_bar.pdf")
|
| 752 |
fig_la.write_image("ascn_bar.svg")
|
| 753 |
with open('ascn_bar.pdf') as f:
|
| 754 |
-
|
| 755 |
"Save As PDF",
|
| 756 |
f,
|
| 757 |
'sonogram-speaker-time-'+currPlainName+'.pdf',
|
| 758 |
key='download-pdf6',
|
| 759 |
)
|
| 760 |
with open('ascn_bar.svg') as f:
|
| 761 |
-
|
| 762 |
"Save As SVG",
|
| 763 |
f,
|
| 764 |
'sonogram-speaker-time-'+currPlainName+'.svg',
|
|
|
|
| 530 |
)
|
| 531 |
fig1.add_trace(go.Pie(values=df3["values"],labels=df3["names"],sort=False))
|
| 532 |
|
| 533 |
+
col1_1, col1_2 = st.columns(2)
|
| 534 |
fig1.write_image("ascn_pie1.pdf")
|
| 535 |
fig1.write_image("ascn_pie1.svg")
|
| 536 |
with open('ascn_pie1.pdf') as f:
|
| 537 |
+
col1_1.download_button(
|
| 538 |
"Save As PDF",
|
| 539 |
f,
|
| 540 |
'sonogram-voice-category-'+currPlainName+'.pdf',
|
| 541 |
key='download-pdf1',
|
| 542 |
)
|
| 543 |
with open('ascn_pie1.svg') as f:
|
| 544 |
+
col1_2.download_button(
|
| 545 |
"Save As SVG",
|
| 546 |
f,
|
| 547 |
'sonogram-voice-category-'+currPlainName+'.svg',
|
|
|
|
| 566 |
)
|
| 567 |
fig2.add_trace(go.Pie(values=df4["values"],labels=df4["names"],sort=False))
|
| 568 |
|
| 569 |
+
col2_1, col2_2 = st.columns(2)
|
| 570 |
fig2.write_image("ascn_pie2.pdf")
|
| 571 |
fig2.write_image("ascn_pie2.svg")
|
| 572 |
with open('ascn_pie2.pdf') as f:
|
| 573 |
+
col2_1.download_button(
|
| 574 |
"Save As PDF",
|
| 575 |
f,
|
| 576 |
'sonogram-speaker-percent-'+currPlainName+'.pdf',
|
| 577 |
key='download-pdf2',
|
| 578 |
)
|
| 579 |
with open('ascn_pie2.svg') as f:
|
| 580 |
+
col2_2.download_button(
|
| 581 |
"Save As SVG",
|
| 582 |
f,
|
| 583 |
'sonogram-speaker-percent-'+currPlainName+'.svg',
|
|
|
|
| 612 |
paper_bgcolor='rgba(0, 0, 0, 0)',
|
| 613 |
)
|
| 614 |
|
| 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 open('ascn_sunburst.pdf') as f:
|
| 619 |
+
col3_1.download_button(
|
| 620 |
"Save As PDF",
|
| 621 |
f,
|
| 622 |
'sonogram-speaker-categories-'+currPlainName+'.pdf',
|
| 623 |
key='download-pdf3',
|
| 624 |
)
|
| 625 |
with open('ascn_sunburst.svg') as f:
|
| 626 |
+
col3_2.download_button(
|
| 627 |
"Save As SVG",
|
| 628 |
f,
|
| 629 |
'sonogram-speaker-categories-'+currPlainName+'.svg',
|
|
|
|
| 658 |
paper_bgcolor='rgba(0, 0, 0, 0)',
|
| 659 |
)
|
| 660 |
|
| 661 |
+
col4_1, col4_2 = st.columns(2)
|
| 662 |
fig3.write_image("ascn_treemap.pdf")
|
| 663 |
fig3.write_image("ascn_treemap.svg")
|
| 664 |
with open('ascn_treemap.pdf') as f:
|
| 665 |
+
col4_1.download_button(
|
| 666 |
"Save As PDF",
|
| 667 |
f,
|
| 668 |
'sonogram-treemap-'+currPlainName+'.pdf',
|
| 669 |
key='download-pdf4',
|
| 670 |
)
|
| 671 |
with open('ascn_treemap.svg') as f:
|
| 672 |
+
col4_2.download_button(
|
| 673 |
"Save As SVG",
|
| 674 |
f,
|
| 675 |
'sonogram-treemap-'+currPlainName+'.svg',
|
|
|
|
| 706 |
paper_bgcolor='rgba(0, 0, 0, 0)',
|
| 707 |
)
|
| 708 |
|
| 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 open('ascn_timeline.pdf') as f:
|
| 713 |
+
col5_1.download_button(
|
| 714 |
"Save As PDF",
|
| 715 |
f,
|
| 716 |
'sonogram-timeline-'+currPlainName+'.pdf',
|
| 717 |
key='download-pdf5',
|
| 718 |
)
|
| 719 |
with open('ascn_timeline.svg') as f:
|
| 720 |
+
col5_2.download_button(
|
| 721 |
"Save As SVG",
|
| 722 |
f,
|
| 723 |
'sonogram-timeline-'+currPlainName+'.svg',
|
|
|
|
| 747 |
])
|
| 748 |
)
|
| 749 |
|
| 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 open('ascn_bar.pdf') as f:
|
| 754 |
+
col6_1.download_button(
|
| 755 |
"Save As PDF",
|
| 756 |
f,
|
| 757 |
'sonogram-speaker-time-'+currPlainName+'.pdf',
|
| 758 |
key='download-pdf6',
|
| 759 |
)
|
| 760 |
with open('ascn_bar.svg') as f:
|
| 761 |
+
col6_2.download_button(
|
| 762 |
"Save As SVG",
|
| 763 |
f,
|
| 764 |
'sonogram-speaker-time-'+currPlainName+'.svg',
|