Delete streamlit_app.py
Browse files- streamlit_app.py +0 -46
streamlit_app.py
DELETED
@@ -1,46 +0,0 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
import backend as be
|
3 |
-
import footnotes
|
4 |
-
|
5 |
-
st.title("US Immigration Enforcement Data")
|
6 |
-
|
7 |
-
graph_tab, data_tab, about_tab = st.tabs(["📈 Graphs", "📋 Data", "ℹ️ About"])
|
8 |
-
with graph_tab:
|
9 |
-
col1, col2, col3 = st.columns(3)
|
10 |
-
with col1:
|
11 |
-
dataset = st.selectbox("Dataset", ["Arresting Authority", "Criminality"])
|
12 |
-
with col2:
|
13 |
-
display = st.selectbox("Display", ["Count", "Percent"])
|
14 |
-
with col3:
|
15 |
-
# In the original dataset the "Criminality" table has 3 tables. This lets
|
16 |
-
# you see how the criminality of detainees varies by arresting authority.
|
17 |
-
if dataset == "Criminality":
|
18 |
-
authority = st.selectbox("Arresting Authority", ["All", "ICE", "CBP"])
|
19 |
-
else:
|
20 |
-
authority = None
|
21 |
-
|
22 |
-
fig = be.get_graph(dataset, display, authority)
|
23 |
-
st.plotly_chart(fig, use_container_width=True)
|
24 |
-
# Each dataset has different footnotes.
|
25 |
-
st.markdown(footnotes.get_footnote(dataset), unsafe_allow_html=True)
|
26 |
-
with data_tab:
|
27 |
-
st.write(open("data.md").read())
|
28 |
-
df = be.get_detention_data()
|
29 |
-
st.dataframe(df, hide_index=True)
|
30 |
-
st.download_button(
|
31 |
-
label="Download as CSV",
|
32 |
-
data=df.to_csv(index=False),
|
33 |
-
file_name="ice_detention_data.csv",
|
34 |
-
mime="text/csv",
|
35 |
-
)
|
36 |
-
with about_tab:
|
37 |
-
st.write(open("about.md").read())
|
38 |
-
|
39 |
-
st.markdown(
|
40 |
-
"""
|
41 |
-
---
|
42 |
-
:small[Created by [Ari Lamstein](https://arilamstein.com/).
|
43 |
-
View the source code
|
44 |
-
[here](https://github.com/arilamstein/immigration_enforcement).]
|
45 |
-
"""
|
46 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|