Spaces:
Sleeping
Sleeping
Update pages/life_cycle.py
Browse files- pages/life_cycle.py +24 -8
pages/life_cycle.py
CHANGED
|
@@ -8,6 +8,17 @@ from facts import show_fun_fact
|
|
| 8 |
|
| 9 |
st.set_page_config(layout="wide")
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
st.markdown("""
|
| 12 |
<style>
|
| 13 |
.title {
|
|
@@ -105,18 +116,12 @@ config = Config(
|
|
| 105 |
if "clicked_node" not in st.session_state:
|
| 106 |
st.session_state.clicked_node = None
|
| 107 |
|
| 108 |
-
st.markdown("### Click on a node to learn more about each stage, or explore the flow chart for a surprise! :nerd_face:")
|
| 109 |
-
|
| 110 |
clicked_node = agraph(nodes=nodes, edges=edges, config=config)
|
| 111 |
|
| 112 |
if clicked_node:
|
| 113 |
st.session_state.clicked_node = clicked_node
|
| 114 |
|
| 115 |
-
|
| 116 |
-
if clear_button:
|
| 117 |
-
clicked_node = None
|
| 118 |
-
if clicked_node in st.session_state:
|
| 119 |
-
del st.session_state.selected_page
|
| 120 |
|
| 121 |
def load_and_display_content(node_name):
|
| 122 |
page_directory = r"stages"
|
|
@@ -131,7 +136,18 @@ def load_and_display_content(node_name):
|
|
| 131 |
else:
|
| 132 |
pass
|
| 133 |
|
| 134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
|
| 136 |
if display_all_nodes_button:
|
| 137 |
clicked_node = None
|
|
|
|
| 8 |
|
| 9 |
st.set_page_config(layout="wide")
|
| 10 |
|
| 11 |
+
st.markdown("""
|
| 12 |
+
<style>
|
| 13 |
+
.stButton>button {
|
| 14 |
+
width: 100%;
|
| 15 |
+
display: block;
|
| 16 |
+
margin-left: auto;
|
| 17 |
+
margin-right: auto;
|
| 18 |
+
}
|
| 19 |
+
</style>
|
| 20 |
+
""", unsafe_allow_html=True)
|
| 21 |
+
|
| 22 |
st.markdown("""
|
| 23 |
<style>
|
| 24 |
.title {
|
|
|
|
| 116 |
if "clicked_node" not in st.session_state:
|
| 117 |
st.session_state.clicked_node = None
|
| 118 |
|
|
|
|
|
|
|
| 119 |
clicked_node = agraph(nodes=nodes, edges=edges, config=config)
|
| 120 |
|
| 121 |
if clicked_node:
|
| 122 |
st.session_state.clicked_node = clicked_node
|
| 123 |
|
| 124 |
+
st.markdown("### Click on a node to learn more about each stage! :nerd_face:")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
|
| 126 |
def load_and_display_content(node_name):
|
| 127 |
page_directory = r"stages"
|
|
|
|
| 136 |
else:
|
| 137 |
pass
|
| 138 |
|
| 139 |
+
col1, col2 = st.columns(2)
|
| 140 |
+
|
| 141 |
+
with col1:
|
| 142 |
+
clear_button = st.button("Clear Selection")
|
| 143 |
+
|
| 144 |
+
with col2:
|
| 145 |
+
display_all_nodes_button = st.button("Display All Stages")
|
| 146 |
+
|
| 147 |
+
if clear_button:
|
| 148 |
+
clicked_node = None
|
| 149 |
+
if clicked_node in st.session_state:
|
| 150 |
+
del st.session_state.selected_page
|
| 151 |
|
| 152 |
if display_all_nodes_button:
|
| 153 |
clicked_node = None
|