Spaces:
Running
Running
File size: 3,750 Bytes
9924df1 f0e5acf 44c7452 f0e5acf f2ed98e d9ab531 9924df1 f2ed98e 9924df1 771f304 9924df1 3d5e4f6 44c7452 21475e0 3d5e4f6 44c7452 9924df1 d9ab531 44c7452 21475e0 d9ab531 44c7452 d9ab531 44c7452 21475e0 d9ab531 44c7452 21475e0 d9ab531 44c7452 79a213a f0e5acf 9924df1 f2ed98e 9924df1 f2ed98e 9924df1 21475e0 771f304 b270ce6 771f304 9924df1 f0e5acf 44c7452 9924df1 79a213a 9924df1 771f304 9924df1 79a213a 21475e0 79a213a 21475e0 9924df1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
import panel as pn
from modules.Home.HomeContent import (
create_home_header,
create_home_main_area,
create_home_output_box,
create_home_warning_box,
create_home_plots_area,
create_home_help_area,
create_home_footer
)
from utils.sidebar import create_sidebar
# Initialize panel extension
pn.extension()
# Create a boolean status indicator
busy_indicator = pn.indicators.BooleanStatus(
value=True, color="warning", width=30, height=30
)
# Create the header
header = create_home_header()
# Create the main area
main_area = create_home_main_area()
# Create the output box
output_box = create_home_output_box()
# Create the warning box
warning_box = create_home_warning_box()
# Create the plots container
bokeh_plots = create_home_plots_area()
# Create the help box
help_box = create_home_help_area()
# Create the footer
footer = create_home_footer()
# Containers for changing the layouts dynamically
header_container = pn.Column(header)
main_area_container = pn.Column(main_area)
output_box_container = pn.Column(output_box)
warning_box_container = pn.Column(warning_box)
bokeh_plots_container = pn.Column(bokeh_plots)
help_box_container = pn.Column(help_box)
footer_container = pn.Column(footer)
sidebar = create_sidebar(
main_area=main_area_container,
header=header_container,
footer=footer_container,
output_box=output_box_container,
warning_box=warning_box_container,
help_box=help_box_container,
)
# Create a FastGridTemplate layout
layout = pn.template.FastGridTemplate(
# Basic Panel layout components
main=[],
header="Next-Generation Spectral Timing Made Easy",
sidebar=[sidebar],
modal=True,
# Parameters for the FastGridTemplate
site="", # Not shown as already doing in title
site_url="StingrayExplorer",
logo="./assets/images/stingray_explorer.png",
title="Stingray Explorer",
favicon="./assets/images/stingray_explorer.png",
# sidebar_footer="Sidebar Footer",
# config= (TemplateConfig): Contains configuration options similar to pn.config but applied to the current Template only. (Currently only css_files is supported) But css_files are now deprecated.
busy_indicator=busy_indicator,
# For configuring the grid
cols={"lg": 12, "md": 12, "sm": 12, "xs": 4, "xxs": 2},
breakpoints={"lg": 1200, "md": 996, "sm": 768, "xs": 480, "xxs": 0},
row_height=10,
dimensions={"minW": 0, "maxW": float("inf"), "minH": 0, "maxH": float("inf")},
prevent_collision=False,
save_layout=True,
# Styling parameter
theme="default",
theme_toggle=False,
background_color="#FFFFFF",
neutral_color="#D3D3D3",
accent_base_color="#5ead61",
header_background="#000000",
header_color="#c4e1c5",
header_neutral_color="#D3D3D3",
header_accent_base_color="#c4e1c5",
corner_radius=7,
# font="",
# font_url="",
shadow=True,
main_layout="card",
# Layout parameters
collapsed_sidebar=False,
sidebar_width=250,
main_max_width="100%",
# Meta data
meta_description="Stingray Explorer Dashboard",
meta_keywords="Stingray, Explorer, Dashboard, Astronomy, Stingray Explorer, X-ray Astronomy, X-ray Data Analysis",
meta_author="Kartik Mandar",
meta_refresh="",
meta_viewport="width=device-width, initial-scale=1",
base_url="/",
base_target="_self",
)
layout.main[0:10, 0:12] = header_container
layout.main[10:45, 0:8] = main_area_container
layout.main[10:27, 8:12] = output_box_container
layout.main[27:45, 8:12] = warning_box_container
layout.main[45:85, 0:12] = bokeh_plots_container
layout.main[85:120, 0:12] = help_box_container
layout.main[120:150, 0:12] = footer_container
# Serve the layout
layout.servable()
|