|
7 | 7 | import numpy as np |
8 | 8 | import pandas as pd |
9 | 9 | import panel as pn |
| 10 | +from panel.layout.gridstack import GridStack |
10 | 11 |
|
11 | 12 | import simdec as sd |
12 | 13 |
|
13 | 14 |
|
14 | 15 | # panel app |
15 | 16 | pn.extension(template="material") |
16 | 17 | pn.extension("tabulator") |
| 18 | +pn.extension("gridstack") |
17 | 19 |
|
18 | 20 | pn.config.sizing_mode = "stretch_width" |
19 | 21 | pn.config.throttled = True |
@@ -337,34 +339,28 @@ def tableau_states(res, states): |
337 | 339 | ).servable(area="sidebar") |
338 | 340 |
|
339 | 341 |
|
340 | | -pn_app = pn.Column( |
341 | | - pn.Row( |
342 | | - pn.Column( |
343 | | - pn.panel( |
344 | | - pn.pane.Matplotlib( |
345 | | - interactive_figure, |
346 | | - tight=True, |
347 | | - format="svg", |
348 | | - sizing_mode="stretch_both", |
349 | | - max_height=500, |
350 | | - height_policy="min", |
351 | | - ) |
352 | | - ), |
353 | | - pn.Spacer(height=50), |
354 | | - pn.pane.Markdown(si_description, styles={"color": "#0072b5"}), |
355 | | - pn.Column( |
356 | | - interactive_sensitivity_indices_table, |
357 | | - width=400, |
358 | | - max_height=300, |
359 | | - height_policy="min", |
360 | | - ), |
361 | | - ), |
362 | | - pn.Column( |
363 | | - pn.pane.Markdown(table_description, styles={"color": "#0072b5"}), |
364 | | - pn.panel(interactive_tableau), |
365 | | - pn.Spacer(height=125), |
366 | | - pn.pane.Markdown(states_description, styles={"color": "#0072b5"}), |
367 | | - pn.panel(interactive_tableau_states), |
368 | | - ), |
369 | | - ), |
370 | | -).servable(title="Simulation Decomposition Dashboard") |
| 342 | +gstack = GridStack(sizing_mode="stretch_both", min_height=600) |
| 343 | + |
| 344 | +gstack[0:3, 0:3] = pn.pane.Matplotlib( |
| 345 | + interactive_figure, |
| 346 | + tight=True, |
| 347 | + format="svg", |
| 348 | +) |
| 349 | + |
| 350 | +gstack[0:2, 3:5] = pn.Column( |
| 351 | + pn.pane.Markdown(table_description, styles={"color": "#0072b5"}), |
| 352 | + interactive_tableau, |
| 353 | + sizing_mode="stretch_both", |
| 354 | +) |
| 355 | + |
| 356 | +gstack[2:3, 3:5] = pn.Column( |
| 357 | + pn.pane.Markdown(states_description, styles={"color": "#0072b5"}), |
| 358 | + interactive_tableau_states, |
| 359 | +) |
| 360 | + |
| 361 | +gstack[3:5, 0:2] = pn.Column( |
| 362 | + pn.pane.Markdown(si_description, styles={"color": "#0072b5"}), |
| 363 | + interactive_sensitivity_indices_table, |
| 364 | +) |
| 365 | + |
| 366 | +gstack.servable(title="Simulation Decomposition Dashboard") |
0 commit comments