From 09a180fcd38602e6858852b4591f49476ee7a8b1 Mon Sep 17 00:00:00 2001 From: Stefan Kuethe Date: Sat, 20 Jan 2024 20:12:00 +0100 Subject: [PATCH] Add progress bar --- docs/examples/road_safety/app.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/examples/road_safety/app.py b/docs/examples/road_safety/app.py index c2afed6b..574a72c9 100644 --- a/docs/examples/road_safety/app.py +++ b/docs/examples/road_safety/app.py @@ -72,9 +72,13 @@ def mapylibre(): @reactive.Effect @reactive.event(input.res, ignore_init=True) - async def resolutiom(): + async def resolution(): async with MapContext("mapylibre", session=session) as m: - m.set_data("road-safety", create_h3_grid(input.res())) + with ui.Progress() as p: + p.set(message="H3 calculation in progress") + geojson = create_h3_grid(input.res()) + m.set_data("road-safety", geojson) + p.set(1, message="Calculation finished") app = App(app_ui, server)