-
Notifications
You must be signed in to change notification settings - Fork 1
/
explorer.py
138 lines (118 loc) · 4.31 KB
/
explorer.py
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
126
127
128
129
130
131
132
133
134
135
136
137
138
import panel as pn
import os
import holoviews as hv
from modules.Home.HomeContent import (
create_home_header,
create_home_main_area,
create_home_output_box,
create_home_warning_box,
create_home_help_area,
create_home_footer,
create_home_plots_area_initial,
# create_floating_plot_demo,
)
from utils.sidebar import create_sidebar
# Initialize panel extension
pn.extension('floatpanel', 'mathjax')
pn.extension('filedropper')
hv.extension('bokeh')
# 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 help box
help_box = create_home_help_area()
# Create the footer
footer = create_home_footer()
# Plots Area
plots_area = create_home_plots_area_initial()
# 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)
plots_container = pn.FlexBox(plots_area, flex_direction='row', align_content='space-evenly', align_items="center", justify_content="center", flex_wrap="wrap")
help_box_container = pn.Column(help_box)
footer_container = pn.Column(footer)
float_panel_container = pn.Column(pn.pane.Markdown("This is not a bug that this container is scrolling, it's a container to hold Floating Plots. You can ignore it completely."))
# Floating Plot Demo
# floating_plot_demo = create_floating_plot_demo(floating_panel_container)
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,
plots_container=plots_container,
float_panel_container=float_panel_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:55, 0:8] = main_area_container
layout.main[10:33, 8:12] = output_box_container
layout.main[33:55, 8:12] = warning_box_container
layout.main[55:100, 0:12] = plots_container
layout.main[100:140, 0:12] = help_box_container
layout.main[140:170, 0:12] = footer_container
layout.main[170:170, 0:12] = float_panel_container
# Serve the layout
layout.servable()