| 115 | st.markdown('</div>', unsafe_allow_html=True) |
| 116 | |
| 117 | def create_sidebar(): |
| 118 | st.sidebar.title("") |
| 119 | st.sidebar.markdown("") |
| 120 | |
| 121 | pages = { |
| 122 | "Dashboard": "dashboard", |
| 123 | "Forecast": "forecasting", |
| 124 | "Fairness": "fairness", |
| 125 | "Anomaly": "outliers", |
| 126 | "Grouping": "clustering", |
| 127 | "Categories": "categories" |
| 128 | } |
| 129 | |
| 130 | current_page = st.session_state.current_page |
| 131 | |
| 132 | for page_name, page_key in pages.items(): |
| 133 | if st.sidebar.button( |
| 134 | page_name, |
| 135 | key=f"sidebar_{page_key}", |
| 136 | use_container_width=True, |
| 137 | type="primary" if current_page == page_key else "secondary" |
| 138 | ): |
| 139 | st.session_state.current_page = page_key |
| 140 | st.rerun() |
| 141 | |
| 142 | @st.cache_data |
| 143 | def load_and_cache_data(): |