Spaces:
Sleeping
Sleeping
hyoo14
commited on
Commit
·
7d76581
1
Parent(s):
adf30a2
test
Browse files- Hello.py +90 -74
- pages/1_Data_Introduction.py +6 -0
- pages/2_Widget_Exploration.py +27 -0
- pages/3_Other_Tools.py +1 -1
Hello.py
CHANGED
@@ -8,116 +8,132 @@ st.set_page_config(
|
|
8 |
|
9 |
st.sidebar.success("Select a Page")
|
10 |
|
11 |
-
st.title('
|
12 |
|
13 |
-
st.
|
14 |
-
|
|
|
|
|
15 |
|
16 |
-
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
```
|
22 |
|
23 |
-
|
|
|
24 |
|
25 |
-
|
26 |
-
pip install streamlit==1.39.0 altair numpy pandas matplotlib
|
27 |
-
```
|
28 |
|
29 |
-
|
|
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
-
Or you can install with `conda`.
|
36 |
|
37 |
-
Note that the package [Streamlit](https://streamlit.io/) that we will be working with requires we use Python scripts, so JupyterLab and/or Jupyter Notebooks won't work for this process. """)
|
38 |
|
39 |
-
st.markdown("""
|
40 |
-
## Step 2: Clone the App files -- Option 1 (HuggingFace)
|
41 |
|
42 |
-
If you want to be able to deploy this app on HuggingFace, there are some extra steps required for setup (or skip to Option 2 for locally running things).
|
43 |
|
44 |
-
### Step 2.1: Set up a token to use with HuggingFace
|
45 |
|
46 |
-
Next you will create an [access token for your HuggingFace account](https://huggingface.co/docs/hub/en/security-tokens).
|
47 |
|
48 |
-
**Step 2.1.1:** Navigate to the "Access Tokens" page from "Settings" under your username:
|
49 |
-
""")
|
50 |
|
51 |
-
st.image("images/accesskey_p1.png")
|
52 |
|
53 |
-
st.markdown("""
|
54 |
-
**Step 2.1.2:** Create a new finegrained token with read/write access to your personal repositories.
|
55 |
|
56 |
-
First, click on the "Create new token" button on this page.
|
57 |
|
58 |
-
Then select a Finegrained token with read/write access to your personal repos:
|
59 |
-
""")
|
60 |
|
61 |
-
st.image("images/accesskey_p2.png")
|
62 |
|
63 |
-
st.markdown("""
|
64 |
-
**Step 2.1.3:** Generate the Token and *save it somewhere safe*
|
65 |
-
1. Click on `Create Token` at the bottom of the current page
|
66 |
-
2. *Save the token string somewhere safe!* We will be using this token throughout this class.
|
67 |
-
""")
|
68 |
|
69 |
|
70 |
|
71 |
-
st.markdown("""
|
72 |
-
### Step 2.2: Duplicate the HuggingFace App
|
73 |
-
|
74 |
|
75 |
-
st.markdown("""
|
76 |
-
If you want to be able to deploy your own app on your own HuggingFace account,
|
77 |
-
you first need to duplicate this space.
|
78 |
|
79 |
-
To duplicate, right click on the 3 dots to the left of your profile icon: """)
|
80 |
|
81 |
-
st.image("images/duplicateSpace_p1.png")
|
82 |
|
83 |
-
st.markdown("""
|
84 |
-
Make sure your user name is selected, and it is set to `Public` for visibility. Name the space whatever you want:
|
85 |
-
|
86 |
|
87 |
-
st.image("images/duplicateSpace_p2.png")
|
88 |
|
89 |
-
st.markdown("""
|
90 |
-
### Step 2.3: Clone *your duplicated* Space
|
91 |
-
|
92 |
|
93 |
-
st.markdown("""
|
94 |
-
First, be sure that `git-lfs` is installed, and then clone *your* duplicated space repo.
|
95 |
|
96 |
-
You can find instructions for this by once again right-clicking the 3 dots and clicking on "Clone Repository":
|
97 |
-
|
98 |
|
99 |
-
st.image("images/clone_the_repo.png")
|
100 |
|
101 |
-
st.markdown("""
|
102 |
-
Then you will be given this set of instructions (note your repo name will be different!):
|
103 |
-
|
104 |
|
105 |
-
st.image("images/gitclone_hf.png")
|
106 |
|
107 |
-
st.markdown("""
|
108 |
-
|
109 |
|
110 |
-
st.markdown("""
|
111 |
-
Now you should have a repository folder on your local computer that has your repo name and the files for this app.
|
112 |
-
|
113 |
|
114 |
-
st.markdown("""
|
115 |
-
## Step 2: Clone the App files -- Option 2 (GitHub)
|
116 |
-
""")
|
117 |
|
118 |
-
st.markdown("""
|
119 |
-
If you don't want to mess around with HuggingFace and just want to play around with Streamlit locally,
|
120 |
-
you can also download these files from GitHub by [cloning this repository right here](https://github.com/jnaiman/shadisClassApp).
|
121 |
|
122 |
-
For info about using git commands to clone a repository, [see this link right here](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository).
|
123 |
-
|
|
|
8 |
|
9 |
st.sidebar.success("Select a Page")
|
10 |
|
11 |
+
st.title('This is my super fancy app!')
|
12 |
|
13 |
+
st.header("This is a header")
|
14 |
+
st.subheader("This is a subheader")
|
15 |
+
st.markdown("""THis is markdwon,
|
16 |
+
I can **use markdown format** """)
|
17 |
|
18 |
+
st.header("layouts")
|
19 |
|
20 |
+
col1,col2 = st.columns(2)
|
21 |
+
col1.text("I am column 1")
|
22 |
+
col2.text("I am column 2")
|
|
|
23 |
|
24 |
+
st.header("Images")
|
25 |
+
# st.image("data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxAQEBAQDxIQEBAQEBYTFhAXFhAVEhEQFRIWFxUSFRMYHCgiGBomGxUVITEtJSsrLi46Fx8zOD8tQygtOisBCgoKDg0OGhAQGi4mICYvLS0rLi0tLy0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAMIBAwMBEQACEQEDEQH/xAAaAAEAAgMBAAAAAAAAAAAAAAAAAQQCBQYD/8QARRAAAgECAwUFBQQGCAYDAAAAAQIAAxEEEiEFEzFBURVSYZHRBiIycZIUU2KBFjM1QrHwJIKTobKzwdIjVHKD0/FjorT/xAAaAQEBAAMBAQAAAAAAAAAAAAAAAQIDBAYF/8QANREBAAEBBAkEAQMEAgMBAAAAAAECAwQREwUSFCFRUlOB8BUWMUEyImFxNWORsUXRI2KhBv/aAAwDAQACEQMRAD8A7PFbVFNymQkjmCOl58i8aVpsbSaJpmcHwrzpumxtZs9SZweR22v3beYmn1qOSWj3DHTk7bX7tvMS+sx05PcMdOTttfu28xHrUdOT3DHT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EBAQPLFYdaiNTa+VxY2Nj8wesKq9nv8A81i/PDf+GN6LeDwwREppfKihRfU2HMmD+XMYxbbSqD5f5Czzv/JTPnxDy8RhpifPqGxno43Q9TDUVVxFPEGrRU3tYN7pHwgHQzzVvY3mi9TaWVP+XlLxYXyi+VW1jTis9r7R/lU9ZntGkeSPO7PatK8ked2Pae0O6PopxtGkeWPO5tOleSDtPaHdH0U42jSXLHnc2nSvJHnc7T2h3R9FOTaNJcsed02nSvJHnc7T2h3R9FONo0lyx53Np0ryR53O09od0fRTjaNJcsedzadK8kedztPaHdH0U42jSXLHnddp0ryR53O09od0fRTjaNJcsedzadK8kedztPaHdH0U42jSXLHndNp0ryR53O09od0fRTjaNJcsedzadK8kedztPaHdH0U42jSXLHnc2nSvJHnc7T2h3R9FONo0lyx53Np0ryR53O09od0fRTjP0jyx53Np0ryR53O09od0fRTjP0jyx53Np0ryR53O09od0fRTjaNJcsedzadK8kedztPaHdH0U42jSXLHnc2nSvJHnc7T2h3R9FONo0lyx53Np0ryR53O09od0fRTjaNJcsedzadK8kedztPaHdH0U42jSXLHnc2nSvJHnc7T2h3R9FONo0lyx53Np0ryR53O09od0fRTjaNJcsedzadK8kedztPaHdH0U4z9I8sedzadK8kedztPaHdH0U4z9Jcsed12nSvJHnc7T2h3R9FONo0lyx53Np0ryR53O09od0fRTjaNJcsed02nSvJHnc7T2h3R9FONo0lyx53Np0ryR53O09od0fRTjaNJcsedzadK8kedztPaHdH0U4z9I8vn+TadK8kedztPaHdH0U5c/SPLHnddp0ryR53ZDa20RyH0p6xn6R5TatK8ked1bCpXbEb6spu17tpb4LDQfITC62F4qvWbaU4MLjd71Xfc62pw4ttPRvWRE4Md0vQSJgbpeggN0vQQG6XoIDdL0EBul6CA3S9BAbpeggN0vQRuDdL0Ebg3S9BAbpeggN0vQQG6XoIDdL0EBul6CA3S9BAbpeggN0vQQG6XoIDdL0EBul6CA3S9BAbpeggN0vQQG6XoIDdL0EBul6CB4YyrSoo1SqVRF4k+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Ea2LKJiYwbipTpMqfDcU+F6aktm1zMOYXWZYUruQlDD2JzcC3OxYA3uBbmv98mrQm5rDNW5hubid7ewPxD5H+IgZwIMIpbOAD4kDQb4actaSE/3mVV6QICAgICAgICAgICAgICAgICBi0jGqdzV/Y6X24vu6eb7LmzZVzZ95bNe3G2l5hMRi6orq1cMfpcxh9z8xJafi5a1CcjUQQ1lGod7lucuc6XNufKYT8t1UfpXcOPeqf9Q/hMnNHy9jKySIESK//9k=")
|
26 |
|
27 |
+
#####################################
|
|
|
|
|
28 |
|
29 |
+
# st.markdown("""
|
30 |
+
# ## Step 1: Install what you need for this notebook
|
31 |
|
32 |
+
# It is recommended you install into a conda environment:
|
33 |
+
|
34 |
+
# ```
|
35 |
+
# conda create -n DataVizClass python=3.10
|
36 |
+
# conda activate DataVizClass
|
37 |
+
# ```
|
38 |
+
|
39 |
+
# Then you can install the correct packages.
|
40 |
+
|
41 |
+
# ```
|
42 |
+
# pip install streamlit==1.39.0 altair numpy pandas matplotlib
|
43 |
+
# ```
|
44 |
+
|
45 |
+
# To work with the VSCode interface, be sure that `jupyter` is also installed:
|
46 |
+
|
47 |
+
# ```
|
48 |
+
# pip install jupyter
|
49 |
+
# ```
|
50 |
|
51 |
+
# Or you can install with `conda`.
|
52 |
|
53 |
+
# Note that the package [Streamlit](https://streamlit.io/) that we will be working with requires we use Python scripts, so JupyterLab and/or Jupyter Notebooks won't work for this process. """)
|
54 |
|
55 |
+
# st.markdown("""
|
56 |
+
# ## Step 2: Clone the App files -- Option 1 (HuggingFace)
|
57 |
|
58 |
+
# If you want to be able to deploy this app on HuggingFace, there are some extra steps required for setup (or skip to Option 2 for locally running things).
|
59 |
|
60 |
+
# ### Step 2.1: Set up a token to use with HuggingFace
|
61 |
|
62 |
+
# Next you will create an [access token for your HuggingFace account](https://huggingface.co/docs/hub/en/security-tokens).
|
63 |
|
64 |
+
# **Step 2.1.1:** Navigate to the "Access Tokens" page from "Settings" under your username:
|
65 |
+
# """)
|
66 |
|
67 |
+
# st.image("images/accesskey_p1.png")
|
68 |
|
69 |
+
# st.markdown("""
|
70 |
+
# **Step 2.1.2:** Create a new finegrained token with read/write access to your personal repositories.
|
71 |
|
72 |
+
# First, click on the "Create new token" button on this page.
|
73 |
|
74 |
+
# Then select a Finegrained token with read/write access to your personal repos:
|
75 |
+
# """)
|
76 |
|
77 |
+
# st.image("images/accesskey_p2.png")
|
78 |
|
79 |
+
# st.markdown("""
|
80 |
+
# **Step 2.1.3:** Generate the Token and *save it somewhere safe*
|
81 |
+
# 1. Click on `Create Token` at the bottom of the current page
|
82 |
+
# 2. *Save the token string somewhere safe!* We will be using this token throughout this class.
|
83 |
+
# """)
|
84 |
|
85 |
|
86 |
|
87 |
+
# st.markdown("""
|
88 |
+
# ### Step 2.2: Duplicate the HuggingFace App
|
89 |
+
# """)
|
90 |
|
91 |
+
# st.markdown("""
|
92 |
+
# If you want to be able to deploy your own app on your own HuggingFace account,
|
93 |
+
# you first need to duplicate this space.
|
94 |
|
95 |
+
# To duplicate, right click on the 3 dots to the left of your profile icon: """)
|
96 |
|
97 |
+
# st.image("images/duplicateSpace_p1.png")
|
98 |
|
99 |
+
# st.markdown("""
|
100 |
+
# Make sure your user name is selected, and it is set to `Public` for visibility. Name the space whatever you want:
|
101 |
+
# """)
|
102 |
|
103 |
+
# st.image("images/duplicateSpace_p2.png")
|
104 |
|
105 |
+
# st.markdown("""
|
106 |
+
# ### Step 2.3: Clone *your duplicated* Space
|
107 |
+
# """)
|
108 |
|
109 |
+
# st.markdown("""
|
110 |
+
# First, be sure that `git-lfs` is installed, and then clone *your* duplicated space repo.
|
111 |
|
112 |
+
# You can find instructions for this by once again right-clicking the 3 dots and clicking on "Clone Repository":
|
113 |
+
# """)
|
114 |
|
115 |
+
# st.image("images/clone_the_repo.png")
|
116 |
|
117 |
+
# st.markdown("""
|
118 |
+
# Then you will be given this set of instructions (note your repo name will be different!):
|
119 |
+
# """)
|
120 |
|
121 |
+
# st.image("images/gitclone_hf.png")
|
122 |
|
123 |
+
# st.markdown("""
|
124 |
+
# """)
|
125 |
|
126 |
+
# st.markdown("""
|
127 |
+
# Now you should have a repository folder on your local computer that has your repo name and the files for this app.
|
128 |
+
# """)
|
129 |
|
130 |
+
# st.markdown("""
|
131 |
+
# ## Step 2: Clone the App files -- Option 2 (GitHub)
|
132 |
+
# """)
|
133 |
|
134 |
+
# st.markdown("""
|
135 |
+
# If you don't want to mess around with HuggingFace and just want to play around with Streamlit locally,
|
136 |
+
# you can also download these files from GitHub by [cloning this repository right here](https://github.com/jnaiman/shadisClassApp).
|
137 |
|
138 |
+
# For info about using git commands to clone a repository, [see this link right here](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository).
|
139 |
+
# """)
|
pages/1_Data_Introduction.py
CHANGED
@@ -3,3 +3,9 @@ import streamlit as st
|
|
3 |
st.set_page_config(page_title="Introduction to Data", page_icon=":1234:") # not sure what this adds?
|
4 |
st.sidebar.header("Introduction to Data")
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
st.set_page_config(page_title="Introduction to Data", page_icon=":1234:") # not sure what this adds?
|
4 |
st.sidebar.header("Introduction to Data")
|
5 |
|
6 |
+
st.title("Example of reading in data")
|
7 |
+
|
8 |
+
mobility_url = "https://raw.githubusercontent.com/UIUC-iSchool-DataViz/is445_data/main/mobility.csv"
|
9 |
+
import pandas as pd
|
10 |
+
df = pd.read_csv(mobility_url)
|
11 |
+
st.write(df)
|
pages/2_Widget_Exploration.py
CHANGED
@@ -3,3 +3,30 @@ import streamlit as st
|
|
3 |
st.set_page_config(page_title="Widget Exploration", page_icon=":1234:")
|
4 |
st.sidebar.header("Widget Exploration")
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
st.set_page_config(page_title="Widget Exploration", page_icon=":1234:")
|
4 |
st.sidebar.header("Widget Exploration")
|
5 |
|
6 |
+
st.title("interactive Plot")
|
7 |
+
|
8 |
+
mobility_url = "https://raw.githubusercontent.com/UIUC-iSchool-DataViz/is445_data/main/mobility.csv"
|
9 |
+
import pandas as pd
|
10 |
+
df = pd.read_csv(mobility_url)
|
11 |
+
# st.write(df)
|
12 |
+
|
13 |
+
import matplotlib.pyplot as plt
|
14 |
+
|
15 |
+
states_selected = st.multiselect("Which states?",
|
16 |
+
df["State"].unique())
|
17 |
+
|
18 |
+
|
19 |
+
if len(states_selected) > 0:
|
20 |
+
df_subset = df[df['State'].isin(states_selected)]
|
21 |
+
|
22 |
+
fig, ax = plt.subplots()
|
23 |
+
df_subset.groupby("State")["Mobility"].mean().plot(kind='bar',ax=ax)
|
24 |
+
st.pyplot(fig)
|
25 |
+
|
26 |
+
else:
|
27 |
+
fig, ax = plt.subplots()
|
28 |
+
df.groupby("State")["Mobility"].mean().plot(kind='bar',ax=ax)
|
29 |
+
st.pyplot(fig)
|
30 |
+
|
31 |
+
|
32 |
+
|
pages/3_Other_Tools.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
st.set_page_config(page_title="Other Tools", page_icon=":1234:")
|
4 |
-
st.sidebar.header("Other Tools")
|
5 |
|
6 |
st.title("Other cool things to check out")
|
7 |
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
st.set_page_config(page_title="Other Tools", page_icon=":1234:")
|
4 |
+
st.sidebar.header("Other Tools -- hey I changed this!")
|
5 |
|
6 |
st.title("Other cool things to check out")
|
7 |
|