@@ -200,17 +200,15 @@ def __init__(self, storage):
200200 self .storage = storage
201201 with ui .row ().classes ("w-full h-screen overflow-hidden p-0 m-0" ):
202202 with ui .column ().classes ("w-96 h-full p-1 m-0" ):
203- with ui .link (target = GIT_REPO_URL , new_tab = True ).classes ("w-full" ):
203+ with ui .link (target = GIT_REPO_URL , new_tab = True ).classes (
204+ "w-full p-1 m-0"
205+ ):
204206 ui .image (LOGO_URL )
205- with ui .column ().classes ("w-96 h-full overflow-y-auto p-1 m-0" ):
206- with ui .card ().classes ("w-full" ):
207- self ._init_file_upload ()
208- with ui .card ().classes ("w-full" ):
209- self ._init_lens ()
210- with ui .card ().classes ("w-full" ):
211- self ._init_cover ()
212- with ui .card ().classes ("w-full" ):
213- self ._init_clustering ()
207+ with ui .column ().classes ("w-full h-full overflow-y-auto p-1 m-0" ):
208+ self ._init_file_upload ()
209+ self ._init_lens ()
210+ self ._init_cover ()
211+ self ._init_clustering ()
214212
215213 ui .button (
216214 "Run Mapper" ,
@@ -221,17 +219,22 @@ def __init__(self, storage):
221219 self ._init_plot ()
222220
223221 def _init_file_upload (self ):
224- ui .upload (
225- on_upload = self .upload_file ,
226- auto_upload = True ,
227- label = "Upload CSV File" ,
228- ).classes ("w-full" )
229- with ui .card_section ().classes ("w-full" ):
230- ui .button ("Load" , on_click = self .load_file ).classes ("w-full" )
222+ with ui .card ().tight ().classes ("w-full" ):
223+ ui .upload (
224+ on_upload = self .upload_file ,
225+ auto_upload = True ,
226+ label = "Upload CSV File" ,
227+ ).classes ("w-full" )
228+ with ui .card_section ().classes ("w-full" ):
229+ ui .button ("Load" , on_click = self .load_file ).classes ("w-full" )
231230
232231 def _init_lens (self ):
233- ui .markdown ("#### Lens" )
232+ with ui .card ().tight ().classes ("w-full" ):
233+ with ui .card_section ().classes ("w-full" ):
234+ ui .markdown ("##### 🔎 Lens" ).classes ("w-full" )
235+ self ._init_lens_settings ()
234236
237+ def _init_lens_settings (self ):
235238 self .lens_type = ui .select (
236239 options = [
237240 LENS_IDENTITY ,
@@ -263,13 +266,18 @@ def _init_lens(self):
263266 )
264267
265268 def _init_cover (self ):
266- ui .markdown ("#### Cover" )
267-
268- self .cover_scale = ui .switch (
269- text = "Scale Data" ,
270- value = COVER_SCALE_DATA ,
271- ).classes ("w-full" )
272-
269+ with ui .card ().tight ().classes ("w-full" ):
270+ with ui .card_section ().classes ("w-full" ):
271+ with ui .row ().classes ("w-full" ):
272+ ui .markdown ("##### 🌐 Cover" ).classes ("flex-1" )
273+
274+ self .cover_scale = ui .switch (
275+ text = "Scale Data" ,
276+ value = COVER_SCALE_DATA ,
277+ ).classes ("flex-none" )
278+ self ._init_cover_settings ()
279+
280+ def _init_cover_settings (self ):
273281 self .cover_type = ui .select (
274282 options = [
275283 COVER_CUBICAL ,
@@ -321,13 +329,17 @@ def _init_cover(self):
321329 )
322330
323331 def _init_clustering (self ):
324- ui .markdown ("##### Clustering" )
325-
326- self .clustering_scale = ui .switch (
327- text = "Scale Data" ,
328- value = CLUSTERING_SCALE_DATA ,
329- ).classes ("w-full" )
330-
332+ with ui .card ().tight ().classes ("w-full" ):
333+ with ui .card_section ().classes ("w-full" ):
334+ with ui .row ().classes ("w-full" ):
335+ ui .markdown ("##### 🧮 Clustering" ).classes ("flex-1" )
336+ self .clustering_scale = ui .switch (
337+ text = "Scale Data" ,
338+ value = CLUSTERING_SCALE_DATA ,
339+ ).classes ("flex-none" )
340+ self ._init_clustering_settings ()
341+
342+ def _init_clustering_settings (self ):
331343 self .clustering_type = ui .select (
332344 options = [
333345 CLUSTERING_TRIVIAL ,
@@ -468,18 +480,21 @@ async def async_run_mapper(self):
468480 logger .warning ("No data found. Please upload a file first." )
469481 ui .notify ("No data found. Please upload a file first." , type = "warning" )
470482 return
471- ui .notify ( "Running Mapper..." , type = "info " )
472- with self . plot_container :
473- ui .spinner ( size = "lg" )
483+ notification = ui .notification ( timeout = None , type = "ongoing " )
484+ notification . message = "Running Mapper..."
485+ notification .spinner = True
474486 mapper_config = self .get_mapper_config ()
475487 mapper_fig = await run .cpu_bound (run_mapper , df , ** asdict (mapper_config ))
476488 mapper_fig .layout .width = None
477489 mapper_fig .layout .height = None
478490 mapper_fig .layout .autosize = True
491+ notification .message = "Done!"
492+ notification .spinner = False
479493 self .plot_container .clear ()
480494 with self .plot_container :
481495 logger .info ("Displaying Mapper plot." )
482496 ui .plotly (mapper_fig ).classes ("w-full h-full" )
497+ notification .dismiss ()
483498
484499
485500@ui .page ("/" )
0 commit comments