Skip to content

Commit 946938d

Browse files
committed
Change template to FastGridTemplate
1 parent ccf8dc8 commit 946938d

File tree

1 file changed

+16
-22
lines changed

1 file changed

+16
-22
lines changed

panel/app.py

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,20 @@
99
import pandas as pd
1010
from pandas.io.formats.style import Styler
1111
import panel as pn
12-
from panel.layout.gridstack import GridStack
1312

1413
import simdec as sd
1514
from simdec.visualization import sequential_cmaps, single_color_to_colormap
1615

1716

1817
# panel app
1918
pn.extension("tabulator")
20-
pn.extension("gridstack")
2119

22-
template = pn.template.MaterialTemplate(
20+
pn.config.sizing_mode = "stretch_width"
21+
pn.config.throttled = True
22+
font_size = "12pt"
23+
blue_color = "#4099da"
24+
25+
template = pn.template.FastGridTemplate(
2326
title="Simulation Decomposition Dashboard",
2427
# logo="_static/logo.gif",
2528
favicon="_static/favicon.png",
@@ -28,13 +31,11 @@
2831
"Sensitivity Analysis, Visualization, Data Analysis, Auditing, "
2932
"Factors priorization, Colorization, Histogram"
3033
),
34+
accent=blue_color,
35+
shadow=False,
36+
main_layout=None,
3137
)
3238

33-
pn.config.sizing_mode = "stretch_width"
34-
pn.config.throttled = True
35-
font_size = "12pt"
36-
blue_color = "#0072b5"
37-
3839

3940
@pn.cache
4041
def load_data(text_fname):
@@ -398,35 +399,28 @@ def csv_data(
398399
selector_n_bins,
399400
dummy_color_pickers_bind,
400401
color_pickers,
401-
max_width=350,
402402
sizing_mode="stretch_width",
403403
)
404404

405405
template.sidebar.append(sidebar_area)
406406

407407
# Main window
408-
main_area = GridStack(
409-
name="SimDec Analysis", sizing_mode="stretch_both", min_height=600
410-
)
408+
template.main[0:4, 0:6] = pn.panel(interactive_figure, loading_indicator=True)
411409

412-
main_area[0:3, 0:3] = pn.panel(interactive_figure, loading_indicator=True)
413-
414-
main_area[0:3, 3:5] = pn.Column(
410+
template.main[0:4, 6:12] = pn.Column(
415411
pn.pane.Markdown("## Scenarios", styles={"color": blue_color}),
416412
pn.panel(interactive_tableau, loading_indicator=True),
417413
)
418414

419-
main_area[3:5, 3:5] = pn.Column(
420-
pn.pane.Markdown("## Details on inputs' states", styles={"color": blue_color}),
421-
pn.panel(interactive_tableau_states, loading_indicator=True),
422-
)
423-
424-
main_area[3:5, 0:2] = pn.Column(
415+
template.main[4:7, 0:4] = pn.Column(
425416
pn.pane.Markdown("## Sensitivity Indices", styles={"color": blue_color}),
426417
pn.panel(interactive_sensitivity_indices_table, loading_indicator=True),
427418
)
428419

429-
template.main.append(main_area)
420+
template.main[4:7, 6:12] = pn.Column(
421+
pn.pane.Markdown("## Details on inputs' states", styles={"color": blue_color}),
422+
pn.panel(interactive_tableau_states, loading_indicator=True),
423+
)
430424

431425
# Header
432426
icon_size = "1.5em"

0 commit comments

Comments
 (0)