Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/update_test_reports.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
§set -e
set -e
vuegen -dir docs/example_data/Basic_example_vuegen_demo_notebook -output_dir tests/report_examples/Basic_example_vuegen_demo_notebook

vuegen -dir docs/example_data/Basic_example_vuegen_demo_notebook -output_dir tests/report_examples/Basic_example_vuegen_demo_notebook/html -rt html
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
A general description of the report.
A general description of the report.

It should test all major components which are available
to be integrated into VueGen.

Check our tests folder for examples of report files used to generate actual reports.
2 changes: 1 addition & 1 deletion src/vuegen/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def _read_description_file(self, folder_path: Path) -> str:
"""
description_file = folder_path / "description.md"
if description_file.exists():
ret = description_file.read_text().strip().replace("\n", "\n ")
ret = description_file.read_text().strip()
return f"{ret}\n"
return ""

Expand Down
2 changes: 1 addition & 1 deletion src/vuegen/quarto_reportview.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def generate_report(self, output_dir: Optional[Path] = None) -> None:

# Add description of the report
if self.report.description:
qmd_content.append(f"""{self.report.description}""")
qmd_content.append(self.report.description)

# If available add the graphical abstract
if self.report.graphical_abstract:
Expand Down
16 changes: 9 additions & 7 deletions src/vuegen/streamlit_reportview.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,17 +424,19 @@ def _format_text(
)

text = text.strip() # get rid of new lines

return textwrap.dedent(
f"""
text = textwrap.indent(text, " ")
ret = textwrap.dedent(
f"""\
st.markdown(
(
"<{tag} style='text-align: {text_align}; "
"color: {color};'>{text}</{tag}>"
),
'''
<{tag} style='text-align: {text_align};
color: {color};'>\n{text}
</{tag}>
''',
unsafe_allow_html=True)
"""
)
return ret

def _generate_home_section(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ report_dir = Path().cwd()

A general description of the report.

It should test all major components which are available
to be integrated into VueGen.

Check our tests folder for examples of report files used to generate actual reports.

# Plots
## Interactive Plots
Optional description for section.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ report_dir = Path().cwd()

A general description of the report.

It should test all major components which are available
to be integrated into VueGen.

Check our tests folder for examples of report files used to generate actual reports.

# Plots
## Interactive Plots
Optional description for section.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ report_dir = Path().cwd()

A general description of the report.

It should test all major components which are available
to be integrated into VueGen.

Check our tests folder for examples of report files used to generate actual reports.

# Plots
## Interactive Plots
Optional description for section.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ report_dir = Path().cwd()

A general description of the report.

It should test all major components which are available
to be integrated into VueGen.

Check our tests folder for examples of report files used to generate actual reports.

# Plots
## Interactive Plots
Optional description for section.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ report_dir = Path().cwd()

A general description of the report.

It should test all major components which are available
to be integrated into VueGen.

Check our tests folder for examples of report files used to generate actual reports.

# Plots
## Interactive Plots
Optional description for section.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ report_dir = Path().cwd()

A general description of the report.

It should test all major components which are available
to be integrated into VueGen.

Check our tests folder for examples of report files used to generate actual reports.

# Plots
## Interactive Plots
Optional description for section.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ report_dir = Path().cwd()

A general description of the report.

It should test all major components which are available
to be integrated into VueGen.

Check our tests folder for examples of report files used to generate actual reports.

# Plots
## Interactive Plots
Optional description for section.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@
df_index = 1
section_dir = Path(__file__).resolve().parent.parent


st.markdown(
(
"<h3 style='text-align: center; "
"color: #023558;'>All Formats</h3>"
),
'''
<h3 style='text-align: center;
color: #023558;'>
All Formats
</h3>
''',
unsafe_allow_html=True)


st.markdown(
(
"<h4 style='text-align: center; "
"color: #2b8cbe;'>Phyla Correlation Network Csv</h4>"
),
'''
<h4 style='text-align: center;
color: #2b8cbe;'>
Phyla Correlation Network Csv
</h4>
''',
unsafe_allow_html=True)

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()
Expand Down Expand Up @@ -53,12 +55,13 @@
mime='text/csv',
key=f"download_button_{df_index}")
df_index += 1

st.markdown(
(
"<h4 style='text-align: center; "
"color: #2b8cbe;'>Abundance Table Example Xls</h4>"
),
'''
<h4 style='text-align: center;
color: #2b8cbe;'>
Abundance Table Example Xls
</h4>
''',
unsafe_allow_html=True)

selected_sheet = 0
Expand Down Expand Up @@ -99,12 +102,13 @@
mime='text/csv',
key=f"download_button_{df_index}")
df_index += 1

st.markdown(
(
"<h4 style='text-align: center; "
"color: #2b8cbe;'>Sample Info Example Txt</h4>"
),
'''
<h4 style='text-align: center;
color: #2b8cbe;'>
Sample Info Example Txt
</h4>
''',
unsafe_allow_html=True)

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()
Expand Down Expand Up @@ -138,12 +142,13 @@
mime='text/csv',
key=f"download_button_{df_index}")
df_index += 1

st.markdown(
(
"<h4 style='text-align: center; "
"color: #2b8cbe;'>Sample Info Example Parquet</h4>"
),
'''
<h4 style='text-align: center;
color: #2b8cbe;'>
Sample Info Example Parquet
</h4>
''',
unsafe_allow_html=True)

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()
Expand Down Expand Up @@ -177,12 +182,13 @@
mime='text/csv',
key=f"download_button_{df_index}")
df_index += 1

st.markdown(
(
"<h4 style='text-align: center; "
"color: #2b8cbe;'>Example Xlsx</h4>"
),
'''
<h4 style='text-align: center;
color: #2b8cbe;'>
Example Xlsx
</h4>
''',
unsafe_allow_html=True)

selected_sheet = 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import streamlit as st

st.markdown(
(
"<p style='text-align: center; "
"color: #000000;'>A general description of the report.</p>"
),
'''
<p style='text-align: center;
color: #000000;'>
A general description of the report.

It should test all major components which are available
to be integrated into VueGen.

Check our tests folder for examples of report files used to generate actual reports.
</p>
''',
unsafe_allow_html=True)

footer = '''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
import streamlit as st
section_dir = Path(__file__).resolve().parent.parent


st.markdown(
(
"<h3 style='text-align: center; "
"color: #023558;'>All Html</h3>"
),
'''
<h3 style='text-align: center;
color: #023558;'>
All Html
</h3>
''',
unsafe_allow_html=True)


st.markdown(
(
"<h4 style='text-align: center; "
"color: #2b8cbe;'>Plot</h4>"
),
'''
<h4 style='text-align: center;
color: #2b8cbe;'>
Plot
</h4>
''',
unsafe_allow_html=True)

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

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


st.markdown(
(
"<h4 style='text-align: center; "
"color: #2b8cbe;'>Ckg Network</h4>"
),
'''
<h4 style='text-align: center;
color: #2b8cbe;'>
Ckg Network
</h4>
''',
unsafe_allow_html=True)


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


st.markdown(
(
"<h4 style='text-align: center; "
"color: #2b8cbe;'>Multiqc Report</h4>"
),
'''
<h4 style='text-align: center;
color: #2b8cbe;'>
Multiqc Report
</h4>
''',
unsafe_allow_html=True)

file_path = (section_dir / '../../../../../docs/example_data/Basic_example_vuegen_demo_notebook/4_Html/1_All_html/3_multiqc_report.html').resolve().as_posix()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
import streamlit as st
section_dir = Path(__file__).resolve().parent.parent


st.markdown(
(
"<h3 style='text-align: center; "
"color: #023558;'>All Markdown</h3>"
),
'''
<h3 style='text-align: center;
color: #023558;'>
All Markdown
</h3>
''',
unsafe_allow_html=True)


st.markdown(
(
"<h4 style='text-align: center; "
"color: #2b8cbe;'>Readme</h4>"
),
'''
<h4 style='text-align: center;
color: #2b8cbe;'>
Readme
</h4>
''',
unsafe_allow_html=True)


Expand Down
Loading