1616
1717
1818# panel app
19- pn .extension (template = "material" )
2019pn .extension ("tabulator" )
2120pn .extension ("gridstack" )
2221
22+ template = pn .template .MaterialTemplate (
23+ title = "Simulation Decomposition Dashboard" ,
24+ # logo="_static/logo.gif",
25+ favicon = "_static/favicon.png" ,
26+ meta_description = "Simulation Decomposition" ,
27+ meta_keywords = (
28+ "Sensitivity Analysis, Visualization, Data Analysis, Auditing, "
29+ "Factors priorization, Colorization, Histogram"
30+ ),
31+ )
32+
2333pn .config .sizing_mode = "stretch_width"
2434pn .config .throttled = True
2535font_size = "12pt"
@@ -369,7 +379,7 @@ def csv_data(
369379# App layout
370380
371381# Sidebar
372- pn_params = pn .layout .WidgetBox (
382+ sidebar_area = pn .layout .WidgetBox (
373383 pn .pane .Markdown ("## Data" , styles = {"color" : blue_color }),
374384 text_fname ,
375385 selector_output ,
@@ -384,33 +394,37 @@ def csv_data(
384394 color_pickers ,
385395 max_width = 350 ,
386396 sizing_mode = "stretch_width" ,
387- ).servable (area = "sidebar" )
397+ )
398+
399+ template .sidebar .append (sidebar_area )
388400
389401# Main window
390- gstack = GridStack (name = "SimDec Analysis" , sizing_mode = "stretch_both" , min_height = 600 )
402+ main_area = GridStack (
403+ name = "SimDec Analysis" , sizing_mode = "stretch_both" , min_height = 600
404+ )
391405
392- gstack [0 :3 , 0 :3 ] = pn .pane .Matplotlib (
406+ main_area [0 :3 , 0 :3 ] = pn .pane .Matplotlib (
393407 interactive_figure ,
394408 tight = True ,
395409 format = "svg" ,
396410)
397411
398- gstack [0 :3 , 3 :5 ] = pn .Column (
412+ main_area [0 :3 , 3 :5 ] = pn .Column (
399413 pn .pane .Markdown ("## Scenarios" , styles = {"color" : blue_color }),
400414 interactive_tableau ,
401415)
402416
403- gstack [3 :5 , 3 :5 ] = pn .Column (
417+ main_area [3 :5 , 3 :5 ] = pn .Column (
404418 pn .pane .Markdown ("## Details on inputs' states" , styles = {"color" : blue_color }),
405419 interactive_tableau_states ,
406420)
407421
408- gstack [3 :5 , 0 :2 ] = pn .Column (
422+ main_area [3 :5 , 0 :2 ] = pn .Column (
409423 pn .pane .Markdown ("## Sensitivity Indices" , styles = {"color" : blue_color }),
410424 interactive_sensitivity_indices_table ,
411425)
412426
413- gstack . servable ( title = "Simulation Decomposition Dashboard" )
427+ template . main . append ( main_area )
414428
415429# Header
416430icon_size = "1.5em"
@@ -458,10 +472,15 @@ def csv_data(
458472logout_button = pn .widgets .Button (name = "Log out" , width = 100 )
459473logout_button .js_on_click (code = """window.location.href = './logout'""" )
460474
461- pn .Row (
475+ header_area = pn .Row (
462476 pn .HSpacer (),
463477 download_file_button ,
464478 info_button ,
465479 issue_button ,
466480 # logout_button,
467- ).servable (area = "header" )
481+ )
482+
483+ template .header .append (header_area )
484+
485+ # serve the template
486+ template .servable ()
0 commit comments