Skip to content

Commit

Permalink
Merge pull request #15 from eipm/develop
Browse files Browse the repository at this point in the history
v1.0.0
  • Loading branch information
alexsigaras authored Oct 25, 2024
2 parents ce9b151 + 2d2b8c0 commit b74cce0
Show file tree
Hide file tree
Showing 15 changed files with 534 additions and 95 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,8 @@ cython_debug/
#.idea/

src/.deployment
src/backup
css/backup

transformation
data
13 changes: 13 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ authors:
given-names: Jeff
affiliation: Weill Cornell Medicine (WCM)
orcid: 'https://orcid.org/0009-0006-0366-5050'
- family-names: Bevers
given-names: Isaac
affiliation: Massachusetts Institute of Technology (MIT)
orcid: 'https://orcid.org/0009-0002-0074-0087'
- family-names: Gallois
given-names: Hortense
affiliation: Simon Fraser University
- family-names: Bernier
given-names: Alexander
affiliation: McGill University
- family-names: Bensoussan
given-names: Yaël
affiliation: University of South Florida
- family-names: Bensoussan
given-names: Yaël
affiliation: University of South Florida
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

Docs for the Bridge2AI Voice Project.

[![Github](https://img.shields.io/badge/github-0.4.0-green?style=flat&logo=github)](https://github.com/eipm/bridge2ai-docs) [![Python 3.11.5](https://img.shields.io/badge/python-3.12.0-blue.svg)](https://www.python.org/downloads/release/python-3120/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![DOI](https://zenodo.org/badge/860006845.svg)](https://zenodo.org/doi/10.5281/zenodo.13834653)
[![Github](https://img.shields.io/badge/github-1.0.0-green?style=flat&logo=github)](https://github.com/eipm/bridge2ai-docs) [![Python 3.11.5](https://img.shields.io/badge/python-3.12.0-blue.svg)](https://www.python.org/downloads/release/python-3120/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![DOI](https://zenodo.org/badge/860006845.svg)](https://zenodo.org/doi/10.5281/zenodo.13834653)


## 🤝 License
See [LICENSE](./LICENSE)

## 📚 How to Cite
> Sigaras, A., Zisimopoulos, P., Tang, J., Bensoussan, Y., Ghosh, S. S., Rameau, A., Powell, M. E., Belisle-Pipon, J.-C., Ravitsky, V., Johnson, A., Elemento, O., Dorr, D., … Bridge2AI-Voice. (2024). eipm/bridge2ai-docs. Zenodo. [https://zenodo.org/doi/10.5281/zenodo.13834653](https://zenodo.org/doi/10.5281/zenodo.13834653)
> Sigaras, A., Zisimopoulos, P., Tang, J., Bevers, I., Gallois, H., Bernier, A., Bensoussan, Y., Ghosh, S. S., Rameau, A., Powell, M. E., Belisle-Pipon, J.-C., Ravitsky, V., Johnson, A., Elemento, O., Dorr, D., … Bridge2AI-Voice. (2024). eipm/bridge2ai-docs. Zenodo. [https://zenodo.org/doi/10.5281/zenodo.13834653](https://zenodo.org/doi/10.5281/zenodo.13834653)
## Prerequisites

Expand Down
113 changes: 113 additions & 0 deletions css/dashboard.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
[data-testid="stDecoration"] {
display: none;
}

[data-testid="stAppDeployButton"]{
display: none;
}

[data-testid="stBaseButton-headerNoPadding"] {
display: none;
}

img[data-testid="stLogo"] {
margin-top: -16px;
margin-left: -20px;
height: 3.5rem;
}

/* Set the font size for the tab headers */
button[data-baseweb="tab"] > div[data-testid="stMarkdownContainer"] > p {
font-size: 18px;
white-space: wrap;
word-break: normal;
align-items: flex-start;
}

.stTabs [data-baseweb="tab-highlight"] {
border-bottom: 4px solid rgb(255, 75, 75);
color: black;
}

.stTabs [data-baseweb="tab-list"] > button[data-baseweb="tab"] {
display: flex;
align-items: flex-start;
}

/* Reduce white space on top */
.block-container {
padding-top: 2rem;
}

/* Sticky footer */
footer {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background: linear-gradient(90deg, #d3d3d3, #f0f0f0);
color: black;
display: flex;
height: 30px;
justify-content: center;
padding: 4px;
z-index: 1000;
font-size: smaller;
}

@media screen and (max-width: 1278px) {
.stTabs [data-baseweb="tab-list"] {
padding-bottom: 25px;
}
}

/* set border for plots */
.js-plotly-plot {
background-color: white;
border: 2px solid #d3d3d3;
border-radius: 5px;
margin-right: -5px;
margin-bottom: -5px;
padding: 0;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-testid="stMetric"] {
border: 2px solid #d3d3d3;
margin-right: -5px;
margin-bottom: -5px;
border-radius: 5px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
background-color: white;
}

/* set text and metri in columns to center */
.stMetric > div, [data-testid="stMetricLabel"] {
color: black;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
}

.js-plotly-plot .plotly .modebar-btn {
font-size: 14px;
padding: 0;
margin: 0;
}

.js-plotly-plot .plotly .modebar {
top: -1px;
right: 0;
left: auto;
width: 48px;
}

.legendtext {
transform: translateX(-10px);
}

/* set weight font for plotly title */
.gtitle tspan {
font-weight: 500 !important;
}
Binary file added images/B2AI Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
128 changes: 35 additions & 93 deletions src/dashboard.py
Original file line number Diff line number Diff line change
@@ -1,114 +1,57 @@
import streamlit as st
import pandas as pd
import numpy as np
import plotly.express as px

custom_style = """
<style>
[data-testid="stDecoration"] {
display: none;
}
/* Hide the Streamlit hamburger menu */
#MainMenu {visibility: hidden;}
/* Set the font size for the tab headers */
.stTabs [data-baseweb="tab-list"] button [data-testid="stMarkdownContainer"] p {
font-size: 18px;
}
/* Reduce white space on top */
.block-container {
padding-top: 2rem;
# padding-left: 5px;
# padding-right: 5px;
# padding-bottom: 0;
# margin-left: 0;
# margin-right: 0;
}
/* Sticky footer */
footer {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background-color: #f1f1f1;
display: flex;
height: 30px;
justify-content: center;
padding: 4px;
z-index: 1000;
font-size: smaller;
}
</style>
"""

def coming_soon_message(tab_name):
# Your Streamlit application code
st.title('Bridge2AI Voice Dashboard')
st.write(f"{tab_name} - Coming soon!")

# Add an image to the page
image_path = "images/Wave.png" # Replace with your image file name
st.image(image_path, caption='', use_column_width=True)

def about_page(tab_name):
coming_soon_message(tab_name)

def healthsheet_page(tab_name):
coming_soon_message(tab_name)

def study_dashboard_page(tab_name):
coming_soon_message(tab_name)

def study_metadata_page(tab_name):
coming_soon_message(tab_name)

def dataset_metadata_page(tab_name):
coming_soon_message(tab_name)

def dataset_structure_preview_page(tab_name):
coming_soon_message(tab_name)

def dataset_quality_dashboard_page(tab_name):
coming_soon_message(tab_name)

def dataset_uses_page(tab_name):
coming_soon_message(tab_name)

def create_tabs(tabs_func):
tab_names = list(tabs_func.keys())
tabs = st.tabs(tab_names)
for tab, name in zip(tabs, tab_names):
with tab:
tabs_func[name](name)
from tabs.about import about_page
from tabs.healthsheet import healthsheet_page
from tabs.study_dashboard import study_dashboard_page
from tabs.study_metadata import study_metadata_page
from tabs.dataset_metadata import dataset_metadata_page
from tabs.dataset_structure_preview import dataset_structure_preview_page
from tabs.dataset_quality_dashboard import dataset_quality_dashboard_page
from tabs.dataset_uses import dataset_uses_page

def config_page(version):
st.set_page_config(
page_title="Bridge2AI Voice Dashboard",
page_icon="images/B2AI Logo.ico",
layout="wide")

st.markdown(custom_style, unsafe_allow_html=True)
# Add the CSS file
with open("css/dashboard.css") as f:
st.markdown(f"<style>{f.read()}</style>", unsafe_allow_html=True)

st.logo("images/B2AI Logo.png", )

# Add the footer
footer = f"""
<footer>
© Weill Cornell Medicine | Version {version} &nbsp;|&nbsp;
<a href="https://weill.cornell.edu/notice-privacy-practices" target="_blank" style="color: black">Privacy Policy</a> &nbsp;|&nbsp;
<a href="https://weill.cornell.edu/weill-cornell-medicine-web-terms-use" target="_blank" style="color: black">Terms of Use</a>
<a href="https://weill.cornell.edu/notice-privacy-practices" target="_blank">Privacy Policy</a> &nbsp;|&nbsp;
<a href="https://weill.cornell.edu/weill-cornell-medicine-web-terms-use" target="_blank">Terms of Use</a>
</footer>
"""
st.markdown(footer, unsafe_allow_html=True)

def create_tabs(tabs_func):
tab_names = list(tabs_func.keys())
tabs = st.tabs(tab_names)
for tab, name in zip(tabs, tab_names):
with tab:
tabs_func[name](name)

def main():
# Define the version variable
version = "0.4.0"
# Current version of the app
version = "1.0.0"
# Map tab names to functions
# In this dictionary, the key is the tab name and the value is the function that will be called when the tab is selected
# The function is defined in the respective file
# about_page() is defined in tabs/about.py
# healthsheet_page() is defined in tabs/healthsheet.py
# study_dashboard_page() is defined in tabs/study_dashboard.py
# study_metadata_page() is defined in tabs/study_metadata.py
# dataset_metadata_page() is defined in tabs/dataset_metadata.py
# dataset_structure_preview_page() is defined in tabs/dataset_structure_preview.py
# dataset_quality_dashboard_page() is defined in tabs/dataset_quality_dashboard.py
# dataset_uses_page() is defined in tabs/dataset_uses.py

tab_functions = {
"About": about_page,
"Healthsheet": healthsheet_page,
Expand All @@ -126,5 +69,4 @@ def main():
create_tabs(tab_functions)

if __name__ == "__main__":

main()
main()
5 changes: 5 additions & 0 deletions src/tabs/about.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import streamlit as st
from tabs.utils import coming_soon_message

def about_page(tab_name):
coming_soon_message(tab_name)
6 changes: 6 additions & 0 deletions src/tabs/dataset_metadata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import streamlit as st
from tabs.utils import coming_soon_message

# Define the content of the Dataset Metadata page
def dataset_metadata_page(tab_name):
coming_soon_message(tab_name)
6 changes: 6 additions & 0 deletions src/tabs/dataset_quality_dashboard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import streamlit as st
from tabs.utils import coming_soon_message

# Define the content of the Dataset Quality Dashboard page
def dataset_quality_dashboard_page(tab_name):
coming_soon_message(tab_name)
6 changes: 6 additions & 0 deletions src/tabs/dataset_structure_preview.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import streamlit as st
from tabs.utils import coming_soon_message

# Define the content of the Dataset Structure Preview page
def dataset_structure_preview_page(tab_name):
coming_soon_message(tab_name)
6 changes: 6 additions & 0 deletions src/tabs/dataset_uses.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import streamlit as st
from tabs.utils import coming_soon_message

# Define the content of the Dataset Uses page
def dataset_uses_page(tab_name):
coming_soon_message(tab_name)
6 changes: 6 additions & 0 deletions src/tabs/healthsheet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import streamlit as st
from tabs.utils import coming_soon_message

# Define the content of the Health Sheet page
def healthsheet_page(tab_name):
coming_soon_message(tab_name)
Loading

0 comments on commit b74cce0

Please sign in to comment.