-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcdec.py
More file actions
63 lines (50 loc) · 1.6 KB
/
cdec.py
File metadata and controls
63 lines (50 loc) · 1.6 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
import datetime as dt
import sys
import panel as pn
pn.extension(
"gridstack", "tabulator", "codeeditor", notifications=True, design="native"
)
from dvue import fullscreen
main_panel = pn.Column(
pn.indicators.LoadingSpinner(
value=True, color="primary", size=50, name="Loading..."
),
sizing_mode="stretch_both",
)
sidebar_panel = pn.Column(
pn.indicators.LoadingSpinner(
value=True, color="primary", size=50, name="Loading..."
),
sizing_mode="stretch_both",
)
template = pn.template.FastListTemplate(
title="CDEC Map Explorer",
sidebar=[sidebar_panel],
main=[main_panel],
sidebar_width=650,
header_background="blue",
meta_viewport="width=device-width, initial-scale=1",
# logo="",
)
def load_explorer():
from cdec_maps import cdecuimgr
te = cdecuimgr.show_cdec_ui()
# Clear existing content first
main_panel.clear()
sidebar_panel.clear()
for obj in te.sidebar.objects:
sidebar_panel.append(obj)
# Add objects individually to ensure proper reactivity
for obj in te.main.objects:
main_panel.append(pn.panel(obj))
# Add the disclaimer text to the modal
template.modal.append(
"""
CDEC Map Explorer: A view onto CDEC data.
Disclaimer:
Information provided by this app is sourced from the California Data Exchange Center (CDEC).
Please don't rely on this data and refere to original CDEC site for verification.
We make not guarantees about the accuracy of this data."""
)
pn.state.onload(load_explorer)
template.servable(title="CDEC Map Explorer")