-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflyingray.py
More file actions
129 lines (116 loc) · 3.36 KB
/
flyingray.py
File metadata and controls
129 lines (116 loc) · 3.36 KB
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
import panel as pn
from src.dashboard.HDF5.h5 import create_h5_generator_tab
from src.dashboard.pipeline.controls import create_pipeline_runner_tab
print(f"Panel version being used: {pn.__version__}")
# --- Set up extensions and CSS ---
#pn.extension('plotly')
pn.extension('plotly')
pn.extension('floatpanel')
custom_css = """
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.hid-card {
border: 1px solid #ddd !important;
border-radius: 8px !important;
box-shadow: 2px 2px 5px rgba(0,0,0,0.1) !important;
padding: 15px !important;
background: #FFFFFF !important;
}
.plot-card-style {
border: 1px solid #ccc !important;
padding: 10px !important;
border-radius: 8px !important;
box-shadow: 2px 2px 5px rgba(0,0,0,0.1) !important;
background: #ffffff !important;
margin: 10px;
}
.header-container {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 40px;
background-color: #ffffff;
border-bottom: 1px solid #e0e0e0;
}
.title-section h1 {
margin: 0;
font-family: 'Georgia', 'Times New Roman', Times, serif;
font-size: 2.1em;
font-weight: 500;
color: #333;
}
"""
pn.config.raw_css.append(custom_css)
header_html = """
<div class="header-container">
<div class="title-section">
<h1>Flyingray</h1>
</div>
<div class="title-section">
<h1>
( The Interactive X-ray Binaries Database ) Built with
<a href="https://github.com/StingraySoftware"
style="color: green; text-decoration: none;"
target="_blank">StingraySoftware</a>
</h1>
</div>
</div>
"""
tels_name = pn.widgets.Select(name="Select Telescope", options=['nicer', 'nustar', 'rxte'], sizing_mode='stretch_width', height=60)
status_pane = pn.pane.Markdown("Status: READY", min_height=100, sizing_mode='stretch_width')
(
plots_header,
plots_and_details,
plot_local_hids_callback,
plot_global_hid_callback,
) = create_h5_generator_tab(telescope_selector_widget=tels_name) # FIX: Use the correct variable name 'tels_name'
# 4. Assemble the final layout.
# 3. Create the Pipeline controls, passing in the shared widgets and callbacks.
pipeline_controls, tels_name = create_pipeline_runner_tab(
status_pane=status_pane,
plot_local_hids_callback=plot_local_hids_callback,
plot_global_hid_callback=plot_global_hid_callback,
)
# LEFT SIDE
left_column = pn.Column(
pn.Card(
pipeline_controls,
title="Pipeline & Plotting Controls",
collapsible=False,
css_classes=['hid-card'],
width=600
),
pn.layout.Spacer(height=20),
pn.Card(
status_pane,
title="Pipeline Status",
collapsible=False,
css_classes=['hid-card'],
width=600
),
)
# RIGHT SIDE
right_column = pn.Column(
plots_header,
pn.layout.Spacer(height=10),
plots_and_details,
sizing_mode='stretch_width'
)
# FINAL ASSEMBLY
main_content = pn.Row(
left_column,
pn.layout.Spacer(width=20),
right_column,
sizing_mode='stretch_width'
)
header_component = pn.pane.HTML(header_html, sizing_mode='stretch_width')
app_layout = pn.Column(
header_component,
pn.layout.Spacer(height=5),
main_content,
sizing_mode='stretch_width',
margin=(0, 20, 20, 20)
)
app_layout.servable()