wanwanlin0521 commited on
Commit
c8be856
Β·
verified Β·
1 Parent(s): 1ab451b

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +30 -30
src/streamlit_app.py CHANGED
@@ -8,36 +8,6 @@ import plotly.express as px
8
  import geopandas as gpd
9
 
10
 
11
- # Set up sidebar menu
12
- menu = st.sidebar.selectbox(
13
- "Select a page",
14
- ["Home", "About", "Data", "Contact"]
15
- )
16
-
17
- # Define what each menu option does
18
- if menu == "Home":
19
- st.title("Welcome to the Home Page")
20
- st.write("This is the home view of your Streamlit app.")
21
-
22
- elif menu == "About":
23
- st.title("About This App")
24
- st.write("This app is hosted on Hugging Face using Streamlit.")
25
-
26
- elif menu == "Data":
27
- st.title("Data Viewer")
28
- st.write("Display some data here.")
29
- # Example: Show a sample dataframe
30
- import pandas as pd
31
- df = pd.DataFrame({
32
- 'Column 1': [1, 2, 3],
33
- 'Column 2': ['A', 'B', 'C']
34
- })
35
- st.dataframe(df)
36
-
37
- elif menu == "Contact":
38
- st.title("Contact Us")
39
- st.write("Email: example@example.com")
40
-
41
  # ── 0. Page configuration ──
42
  st.set_page_config(
43
  page_title="Analyze Crime Distributions",
@@ -207,3 +177,33 @@ alt.Chart(stacked_year_df).mark_bar().encode(
207
  height=400,
208
  title='Stacked Crime Composition by Year (Top 10 Crime Types)'
209
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  import geopandas as gpd
9
 
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  # ── 0. Page configuration ──
12
  st.set_page_config(
13
  page_title="Analyze Crime Distributions",
 
177
  height=400,
178
  title='Stacked Crime Composition by Year (Top 10 Crime Types)'
179
  )
180
+
181
+ # Set up sidebar menu
182
+ menu = st.sidebar.selectbox(
183
+ "Select a page",
184
+ ["Home", "About", "Data", "Contact"]
185
+ )
186
+
187
+ # Define what each menu option does
188
+ if menu == "Home":
189
+ st.title("Welcome to the Home Page")
190
+ st.write("This is the home view of your Streamlit app.")
191
+
192
+ elif menu == "About":
193
+ st.title("About This App")
194
+ st.write("This app is hosted on Hugging Face using Streamlit.")
195
+
196
+ elif menu == "Data":
197
+ st.title("Data Viewer")
198
+ st.write("Display some data here.")
199
+ # Example: Show a sample dataframe
200
+ import pandas as pd
201
+ df = pd.DataFrame({
202
+ 'Column 1': [1, 2, 3],
203
+ 'Column 2': ['A', 'B', 'C']
204
+ })
205
+ st.dataframe(df)
206
+
207
+ elif menu == "Contact":
208
+ st.title("Contact Us")
209
+ st.write("Email: example@example.com")