Skip to content

Commit cf67335

Browse files
committed
Added about tab. Improved widgets positioning
1 parent 1d667f2 commit cf67335

File tree

1 file changed

+38
-11
lines changed

1 file changed

+38
-11
lines changed

app/streamlit_app.py

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
REPORT_BUG = f'{GIT_REPO_URL}/issues'
5151

52-
ABOUT = f'{GIT_REPO_URL}/README.md'
52+
ABOUT = f'{GIT_REPO_URL}/blob/main/README.md'
5353

5454
# V_* are reusable values for widgets
5555

@@ -111,6 +111,31 @@
111111

112112
S_RESULTS = 'stored_results'
113113

114+
APP_DESC = f"""
115+
### Welcome to **tda-mapper app**
116+
117+
This app is a powerful tool for data exploration, leveraging the *Mapper algorithm* from Topological Data Analysis (TDA).
118+
Whether you’re a seasoned data scientist or just curious about exploring your data, this app provides an efficient and intuitive way to gain insights.
119+
120+
### Core Functionalities:
121+
122+
* 🔎 Use the Mapper algorithm to analyze your dataset and uncover hidden patterns.
123+
* ⚡ Our Python package offers a simple and efficient implementation of the Mapper algorithm.
124+
* 🌐 Represent your data as a network, allowing you to visualize relationships and structures.
125+
126+
### Getting Started:
127+
128+
1. 📊 Begin by choosing the dataset you want to explore.
129+
2. ⚙️ Fiddle with the settings to customize your analysis.
130+
3. 🚀 Execute the Mapper algorithm and observe the results.
131+
4. 🎨 Explore hidden patterns by changing the colors of the Mapper graph.
132+
133+
Explore, discover, and enjoy the fascinating world of topological data analysis with this app!
134+
For more details and more advanced use cases, check out the project:
135+
136+
**{GIT_REPO_URL}**.
137+
"""
138+
114139

115140
class Results:
116141

@@ -265,10 +290,6 @@ def add_download_graph():
265290
disabled=mapper_graph is None,
266291
use_container_width=True,
267292
file_name=f'mapper_graph_{int(time.time())}.json.gzip')
268-
if mapper_graph is not None:
269-
nodes_num = mapper_graph.number_of_nodes()
270-
edges_num = mapper_graph.number_of_edges()
271-
st.caption(f'{nodes_num} nodes, {edges_num} edges')
272293

273294

274295
def add_data_source_csv():
@@ -334,7 +355,7 @@ def add_mapper_settings():
334355
add_clustering_settings()
335356
df_X = st.session_state[S_RESULTS].df_X
336357
st.button(
337-
' Run',
358+
'🚀 Run',
338359
use_container_width=True,
339360
disabled=df_X is None,
340361
on_click=compute_mapper)
@@ -564,11 +585,15 @@ def add_graph_plot():
564585
mapper_graph = st.session_state[S_RESULTS].mapper_graph
565586
if mapper_graph is None:
566587
return
588+
nodes_num = mapper_graph.number_of_nodes()
589+
edges_num = mapper_graph.number_of_edges()
590+
st.caption(f'{nodes_num} nodes, {edges_num} edges')
567591
mapper_fig = st.session_state['mapper_fig']
568592
st.plotly_chart(
569593
mapper_fig,
570594
use_container_width=False,
571595
config={'scrollZoom': True})
596+
add_download_graph()
572597

573598

574599
def main():
@@ -580,20 +605,22 @@ def main():
580605
'Report a bug': REPORT_BUG,
581606
'About': ABOUT
582607
})
583-
st.sidebar.title('🍩 tda-mapper app')
608+
st.sidebar.markdown('# 🍩 tda-mapper app')
584609
if S_RESULTS not in st.session_state:
585610
st.session_state[S_RESULTS] = Results()
586611
with st.sidebar:
587-
tab_data_source, tab_mapper_settings, tab_draw = st.tabs([
588-
'## 📊 Data Source',
589-
'## ⚙️ Mapper Settings',
612+
tab_about, tab_data_source, tab_mapper_settings, tab_draw = st.tabs([
613+
'## ℹ️ About',
614+
'## 📊 Data',
615+
'## ⚙️ Settings',
590616
'## 🎨 Draw'])
617+
with tab_about:
618+
st.markdown(APP_DESC)
591619
with tab_data_source:
592620
add_data_source()
593621
add_data_display()
594622
with tab_mapper_settings:
595623
add_mapper_settings()
596-
add_download_graph()
597624
with tab_draw:
598625
add_data_tools()
599626
add_plot_setting()

0 commit comments

Comments
 (0)