Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -28,27 +28,33 @@ def select(df, data: gr.SelectData):
|
|
28 |
with gr.Blocks() as demo:
|
29 |
gr.Markdown("# 🗺️ Explore AI Data Maps with Gradio and Folium\n"
|
30 |
"Install this custom component with `pip install gradio_folium` - wheel files in this directory")
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
# Select box for CSV files
|
33 |
-
csv_files = list_csv_files()
|
34 |
-
csv_selector = gr.Dropdown(label="Select CSV File", choices=csv_files)
|
35 |
|
36 |
# Dataframe and map components
|
37 |
# data = gr.Dataframe()
|
38 |
# map_component = Folium(height=400)
|
39 |
|
40 |
|
41 |
-
map = Folium(value=Map(location=[25.7617, -80.1918]), height=400)
|
42 |
-
data = gr.DataFrame(value=df, height=200)
|
43 |
-
data.select(select, data, map)
|
44 |
|
45 |
# Button to reload data and map
|
46 |
-
reload_button = gr.Button("🔄 Reload", elem_id="reload_button")
|
47 |
|
48 |
# Interaction logic
|
49 |
-
csv_selector.change(update_map, inputs=csv_selector, outputs=[data, map_component])
|
50 |
-
data.select(select, inputs=data, outputs=map_component)
|
51 |
-
reload_button.click(update_map, inputs=csv_selector, outputs=[data, map_component])
|
52 |
|
53 |
# Launch the app
|
54 |
demo.launch()
|
|
|
28 |
with gr.Blocks() as demo:
|
29 |
gr.Markdown("# 🗺️ Explore AI Data Maps with Gradio and Folium\n"
|
30 |
"Install this custom component with `pip install gradio_folium` - wheel files in this directory")
|
31 |
+
map = Folium(value=Map(location=[25.7617, -80.1918]), height=400)
|
32 |
+
data = gr.DataFrame(value=df, height=200)
|
33 |
+
data.select(select, data, map)
|
34 |
+
|
35 |
+
demo.launch()
|
36 |
+
|
37 |
|
38 |
# Select box for CSV files
|
39 |
+
#csv_files = list_csv_files()
|
40 |
+
#csv_selector = gr.Dropdown(label="Select CSV File", choices=csv_files)
|
41 |
|
42 |
# Dataframe and map components
|
43 |
# data = gr.Dataframe()
|
44 |
# map_component = Folium(height=400)
|
45 |
|
46 |
|
47 |
+
#map = Folium(value=Map(location=[25.7617, -80.1918]), height=400)
|
48 |
+
#data = gr.DataFrame(value=df, height=200)
|
49 |
+
#data.select(select, data, map)
|
50 |
|
51 |
# Button to reload data and map
|
52 |
+
#reload_button = gr.Button("🔄 Reload", elem_id="reload_button")
|
53 |
|
54 |
# Interaction logic
|
55 |
+
#csv_selector.change(update_map, inputs=csv_selector, outputs=[data, map_component])
|
56 |
+
#data.select(select, inputs=data, outputs=map_component)
|
57 |
+
#reload_button.click(update_map, inputs=csv_selector, outputs=[data, map_component])
|
58 |
|
59 |
# Launch the app
|
60 |
demo.launch()
|