Update gradio_app.py
Browse files- gradio_app.py +4 -24
gradio_app.py
CHANGED
@@ -205,13 +205,13 @@ def get_criminality_pct_chart(df, authority):
|
|
205 |
|
206 |
def get_footnote_text(dataset):
|
207 |
"""Get footnote text for the dataset."""
|
208 |
-
abbreviations = '"ICE"
|
209 |
-
date_footnote = "*Dates
|
210 |
|
211 |
if dataset == "Arresting Authority":
|
212 |
return f"{abbreviations}\n{date_footnote}"
|
213 |
elif dataset == "Criminality":
|
214 |
-
criminality_footnote = "
|
215 |
return f"{abbreviations}\n{date_footnote}\n{criminality_footnote}"
|
216 |
return ""
|
217 |
|
@@ -319,27 +319,7 @@ def create_app():
|
|
319 |
inputs=[dataset, display, authority],
|
320 |
outputs=[chart, footnote]
|
321 |
)
|
322 |
-
|
323 |
-
# with gr.TabItem("Data"):
|
324 |
-
# gr.Markdown(get_data_info())
|
325 |
-
|
326 |
-
# with gr.Row():
|
327 |
-
# refresh_btn = gr.Button("Refresh Data")
|
328 |
-
# download_btn = gr.DownloadButton(
|
329 |
-
# "Download as CSV",
|
330 |
-
# lambda: download_data() #,
|
331 |
-
# #filename="ice_detention_data.csv"
|
332 |
-
# )
|
333 |
-
|
334 |
-
# data_display = gr.Dataframe(
|
335 |
-
# label="ICE Detention Data",
|
336 |
-
# wrap=True
|
337 |
-
# )
|
338 |
-
|
339 |
-
# refresh_btn.click(refresh_data, outputs=[data_display])
|
340 |
-
|
341 |
-
# # Load data on app start
|
342 |
-
# app.load(lambda: get_detention_data(), outputs=[data_display])
|
343 |
|
344 |
return app
|
345 |
|
|
|
205 |
|
206 |
def get_footnote_text(dataset):
|
207 |
"""Get footnote text for the dataset."""
|
208 |
+
abbreviations = '"ICE": "Immigration and Customs Enforcement". "CBP": "Customs and Border Protection"\n.'
|
209 |
+
date_footnote = "\\n*Dates < 11/15/2021 date ICE posted the data; dates > 11/15/2021 refer to the date the information was current as of."
|
210 |
|
211 |
if dataset == "Arresting Authority":
|
212 |
return f"{abbreviations}\n{date_footnote}"
|
213 |
elif dataset == "Criminality":
|
214 |
+
criminality_footnote = "**\nICE classifies an individual as a convicted criminal if they have been convicted of any criminal violation. Violations can range from serious felonies all the way down to a purely immigration violation (such as illegal entry which is a petty offense under the U.S. Code), or a violation which results in only in a fine such as not keeping a dog on a leash, fishing without a permit, driving a vehicle with a tail light out, etc."
|
215 |
return f"{abbreviations}\n{date_footnote}\n{criminality_footnote}"
|
216 |
return ""
|
217 |
|
|
|
319 |
inputs=[dataset, display, authority],
|
320 |
outputs=[chart, footnote]
|
321 |
)
|
322 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
323 |
|
324 |
return app
|
325 |
|