Skip to content

Commit c8ac5c9

Browse files
committed
🚧 update streamlit tests
🐛 Centering does not work for text after a blank line
1 parent 57967bb commit c8ac5c9

File tree

20 files changed

+413
-340
lines changed

20 files changed

+413
-340
lines changed

tests/report_examples/Basic_example_vuegen_demo_notebook/streamlit_report/sections/Dataframes/All_Formats.py

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,22 @@
66
df_index = 1
77
section_dir = Path(__file__).resolve().parent.parent
88

9-
109
st.markdown(
11-
(
12-
"<h3 style='text-align: center; "
13-
"color: #023558;'>All Formats</h3>"
14-
),
10+
'''
11+
<h3 style='text-align: center;
12+
color: #023558;'>
13+
All Formats
14+
</h3>
15+
''',
1516
unsafe_allow_html=True)
1617

17-
1818
st.markdown(
19-
(
20-
"<h4 style='text-align: center; "
21-
"color: #2b8cbe;'>Phyla Correlation Network Csv</h4>"
22-
),
19+
'''
20+
<h4 style='text-align: center;
21+
color: #2b8cbe;'>
22+
Phyla Correlation Network Csv
23+
</h4>
24+
''',
2325
unsafe_allow_html=True)
2426

2527
file_path = (section_dir / '../../../../../docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/1_phyla_correlation_network_csv.csv').resolve().as_posix()
@@ -53,12 +55,13 @@
5355
mime='text/csv',
5456
key=f"download_button_{df_index}")
5557
df_index += 1
56-
5758
st.markdown(
58-
(
59-
"<h4 style='text-align: center; "
60-
"color: #2b8cbe;'>Abundance Table Example Xls</h4>"
61-
),
59+
'''
60+
<h4 style='text-align: center;
61+
color: #2b8cbe;'>
62+
Abundance Table Example Xls
63+
</h4>
64+
''',
6265
unsafe_allow_html=True)
6366

6467
selected_sheet = 0
@@ -99,12 +102,13 @@
99102
mime='text/csv',
100103
key=f"download_button_{df_index}")
101104
df_index += 1
102-
103105
st.markdown(
104-
(
105-
"<h4 style='text-align: center; "
106-
"color: #2b8cbe;'>Sample Info Example Txt</h4>"
107-
),
106+
'''
107+
<h4 style='text-align: center;
108+
color: #2b8cbe;'>
109+
Sample Info Example Txt
110+
</h4>
111+
''',
108112
unsafe_allow_html=True)
109113

110114
file_path = (section_dir / '../../../../../docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/3_sample_info_example_txt.txt').resolve().as_posix()
@@ -138,12 +142,13 @@
138142
mime='text/csv',
139143
key=f"download_button_{df_index}")
140144
df_index += 1
141-
142145
st.markdown(
143-
(
144-
"<h4 style='text-align: center; "
145-
"color: #2b8cbe;'>Sample Info Example Parquet</h4>"
146-
),
146+
'''
147+
<h4 style='text-align: center;
148+
color: #2b8cbe;'>
149+
Sample Info Example Parquet
150+
</h4>
151+
''',
147152
unsafe_allow_html=True)
148153

149154
file_path = (section_dir / '../../../../../docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/4_sample_info_example_parquet.parquet').resolve().as_posix()
@@ -177,12 +182,13 @@
177182
mime='text/csv',
178183
key=f"download_button_{df_index}")
179184
df_index += 1
180-
181185
st.markdown(
182-
(
183-
"<h4 style='text-align: center; "
184-
"color: #2b8cbe;'>Example Xlsx</h4>"
185-
),
186+
'''
187+
<h4 style='text-align: center;
188+
color: #2b8cbe;'>
189+
Example Xlsx
190+
</h4>
191+
''',
186192
unsafe_allow_html=True)
187193

188194
selected_sheet = 0

tests/report_examples/Basic_example_vuegen_demo_notebook/streamlit_report/sections/Home/Homepage.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import streamlit as st
2-
32
st.markdown(
4-
(
5-
"<p style='text-align: center; "
6-
"color: #000000;'>A general description of the report.</p>"
7-
),
3+
'''
4+
<p style='text-align: center;
5+
color: #000000;'>
6+
A general description of the report.
7+
8+
It should test all major components which are available
9+
to be integrated into VueGen.
10+
11+
Check our tests folder for examples of report files used to generate actual reports.
12+
</p>
13+
''',
814
unsafe_allow_html=True)
915

1016
footer = '''

tests/report_examples/Basic_example_vuegen_demo_notebook/streamlit_report/sections/Html/All_Html.py

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,22 @@
33
import streamlit as st
44
section_dir = Path(__file__).resolve().parent.parent
55

6-
76
st.markdown(
8-
(
9-
"<h3 style='text-align: center; "
10-
"color: #023558;'>All Html</h3>"
11-
),
7+
'''
8+
<h3 style='text-align: center;
9+
color: #023558;'>
10+
All Html
11+
</h3>
12+
''',
1213
unsafe_allow_html=True)
1314

14-
1515
st.markdown(
16-
(
17-
"<h4 style='text-align: center; "
18-
"color: #2b8cbe;'>Plot</h4>"
19-
),
16+
'''
17+
<h4 style='text-align: center;
18+
color: #2b8cbe;'>
19+
Plot
20+
</h4>
21+
''',
2022
unsafe_allow_html=True)
2123

2224
file_path = (section_dir / '../../../../../docs/example_data/Basic_example_vuegen_demo_notebook/4_Html/1_All_html/1_plot.html').resolve().as_posix()
@@ -25,12 +27,13 @@
2527

2628
st.components.v1.html(html_content, height=600, scrolling=True)
2729

28-
2930
st.markdown(
30-
(
31-
"<h4 style='text-align: center; "
32-
"color: #2b8cbe;'>Ckg Network</h4>"
33-
),
31+
'''
32+
<h4 style='text-align: center;
33+
color: #2b8cbe;'>
34+
Ckg Network
35+
</h4>
36+
''',
3437
unsafe_allow_html=True)
3538

3639

@@ -53,12 +56,13 @@
5356
# Load HTML into HTML component for display on Streamlit
5457
st.components.v1.html(html_content, height=net_html_height)
5558

56-
5759
st.markdown(
58-
(
59-
"<h4 style='text-align: center; "
60-
"color: #2b8cbe;'>Multiqc Report</h4>"
61-
),
60+
'''
61+
<h4 style='text-align: center;
62+
color: #2b8cbe;'>
63+
Multiqc Report
64+
</h4>
65+
''',
6266
unsafe_allow_html=True)
6367

6468
file_path = (section_dir / '../../../../../docs/example_data/Basic_example_vuegen_demo_notebook/4_Html/1_All_html/3_multiqc_report.html').resolve().as_posix()

tests/report_examples/Basic_example_vuegen_demo_notebook/streamlit_report/sections/Markdown/All_Markdown.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,22 @@
33
import streamlit as st
44
section_dir = Path(__file__).resolve().parent.parent
55

6-
76
st.markdown(
8-
(
9-
"<h3 style='text-align: center; "
10-
"color: #023558;'>All Markdown</h3>"
11-
),
7+
'''
8+
<h3 style='text-align: center;
9+
color: #023558;'>
10+
All Markdown
11+
</h3>
12+
''',
1213
unsafe_allow_html=True)
1314

14-
1515
st.markdown(
16-
(
17-
"<h4 style='text-align: center; "
18-
"color: #2b8cbe;'>Readme</h4>"
19-
),
16+
'''
17+
<h4 style='text-align: center;
18+
color: #2b8cbe;'>
19+
Readme
20+
</h4>
21+
''',
2022
unsafe_allow_html=True)
2123

2224

tests/report_examples/Basic_example_vuegen_demo_notebook/streamlit_report/sections/Networks/Interactive_Networks.py

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,31 @@
33
import streamlit as st
44
section_dir = Path(__file__).resolve().parent.parent
55

6-
76
st.markdown(
8-
(
9-
"<h3 style='text-align: center; "
10-
"color: #023558;'>Interactive Networks</h3>"
11-
),
7+
'''
8+
<h3 style='text-align: center;
9+
color: #023558;'>
10+
Interactive Networks
11+
</h3>
12+
''',
1213
unsafe_allow_html=True)
1314

14-
1515
st.markdown(
16-
(
17-
"<p style='text-align: center; "
18-
"color: #000000;'>Optional description for subsection.</p>"
19-
),
16+
'''
17+
<p style='text-align: center;
18+
color: #000000;'>
19+
Optional description for subsection.
20+
</p>
21+
''',
2022
unsafe_allow_html=True)
2123

22-
2324
st.markdown(
24-
(
25-
"<h4 style='text-align: center; "
26-
"color: #2b8cbe;'>Man Example</h4>"
27-
),
25+
'''
26+
<h4 style='text-align: center;
27+
color: #2b8cbe;'>
28+
Man Example
29+
</h4>
30+
''',
2831
unsafe_allow_html=True)
2932

3033

@@ -47,12 +50,13 @@
4750
# Load HTML into HTML component for display on Streamlit
4851
st.components.v1.html(html_content, height=net_html_height)
4952

50-
5153
st.markdown(
52-
(
53-
"<h4 style='text-align: center; "
54-
"color: #2b8cbe;'>Description</h4>"
55-
),
54+
'''
55+
<h4 style='text-align: center;
56+
color: #2b8cbe;'>
57+
Description
58+
</h4>
59+
''',
5660
unsafe_allow_html=True)
5761

5862

tests/report_examples/Basic_example_vuegen_demo_notebook/streamlit_report/sections/Networks/Static_Networks.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22
import streamlit as st
33
section_dir = Path(__file__).resolve().parent.parent
44

5-
65
st.markdown(
7-
(
8-
"<h3 style='text-align: center; "
9-
"color: #023558;'>Static Networks</h3>"
10-
),
6+
'''
7+
<h3 style='text-align: center;
8+
color: #023558;'>
9+
Static Networks
10+
</h3>
11+
''',
1112
unsafe_allow_html=True)
1213

13-
1414
st.markdown(
15-
(
16-
"<h4 style='text-align: center; "
17-
"color: #2b8cbe;'>Phyla Correlation Network</h4>"
18-
),
15+
'''
16+
<h4 style='text-align: center;
17+
color: #2b8cbe;'>
18+
Phyla Correlation Network
19+
</h4>
20+
''',
1921
unsafe_allow_html=True)
2022

2123
plot_file_path = (section_dir / '../../../../../docs/example_data/Basic_example_vuegen_demo_notebook/3_Networks/2_Static_networks/1_phyla_correlation_network.png').resolve().as_posix()

0 commit comments

Comments
 (0)