Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,6 +5,18 @@ from nomad_data import country_emoji_map, data, terrain_emoji_map
|
|
| 5 |
|
| 6 |
df = pd.DataFrame(data)
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
def style_quality_of_life(val):
|
| 9 |
"""Style the Quality of Life column with color gradient from red to green"""
|
| 10 |
if pd.isna(val):
|
|
@@ -397,4 +409,4 @@ with gr.Blocks(css="""
|
|
| 397 |
|
| 398 |
cost_slider.change(recommend_location, inputs=[priority, cost_slider], outputs=recommendation)
|
| 399 |
|
| 400 |
-
demo.launch()
|
|
|
|
| 5 |
|
| 6 |
df = pd.DataFrame(data)
|
| 7 |
|
| 8 |
+
js_func = """
|
| 9 |
+
function refresh() {
|
| 10 |
+
const url = new URL(window.location);
|
| 11 |
+
|
| 12 |
+
if (url.searchParams.get('__theme') !== 'dark') {
|
| 13 |
+
url.searchParams.set('__theme', 'dark');
|
| 14 |
+
window.location.href = url.href;
|
| 15 |
+
}
|
| 16 |
+
}
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
|
| 20 |
def style_quality_of_life(val):
|
| 21 |
"""Style the Quality of Life column with color gradient from red to green"""
|
| 22 |
if pd.isna(val):
|
|
|
|
| 409 |
|
| 410 |
cost_slider.change(recommend_location, inputs=[priority, cost_slider], outputs=recommendation)
|
| 411 |
|
| 412 |
+
demo.launch(js=js_func)
|