| 87 | route_to_page(df) |
| 88 | |
| 89 | def create_nav(): |
| 90 | pages = { |
| 91 | "Dashboard": "dashboard", |
| 92 | "Forecast": "forecasting", |
| 93 | "Fairness": "fairness", |
| 94 | "Anomaly": "outliers", |
| 95 | "Grouping": "clustering", |
| 96 | "Categories": "categories" |
| 97 | } |
| 98 | |
| 99 | st.markdown('<div class="nav-bar">', unsafe_allow_html=True) |
| 100 | cols = st.columns(len(pages)) |
| 101 | |
| 102 | current_page = st.session_state.current_page |
| 103 | |
| 104 | for i, (page_name, page_key) in enumerate(pages.items()): |
| 105 | with cols[i]: |
| 106 | if st.button( |
| 107 | page_name, |
| 108 | key=f"nav_{page_key}", |
| 109 | use_container_width=True, |
| 110 | type="primary" if current_page == page_key else "secondary" |
| 111 | ): |
| 112 | st.session_state.current_page = page_key |
| 113 | st.rerun() |
| 114 | |
| 115 | st.markdown('</div>', unsafe_allow_html=True) |
| 116 | |
| 117 | def create_sidebar(): |
| 118 | st.sidebar.title("") |