-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
40 lines (30 loc) · 916 Bytes
/
app.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
import panel as pn
from tracker import SETTINGS, __version__
from tracker.dashboard import (
SIDEBAR,
DURATION_PLTOS,
SUNBURST,
KPI_TAGS,
CONTROLLER,
)
from tracker.db import Controller
pn.extension(
'plotly',
sizing_mode="stretch_both",
notifications=True,
)
if "controller" in pn.state.cache:
controller = pn.state.cache["controller"]
else:
pn.state.cache["controller"] = controller = Controller()
template = pn.template.ReactTemplate(title=f"{SETTINGS.app_name} v{__version__}")
template.sidebar.append(SIDEBAR)
template.main[:3, :8] = DURATION_PLTOS.create_plot_1
template.main[:3, 8:] = SUNBURST.create_plot
template.main[3:5, :8] = DURATION_PLTOS.create_plot_2
template.main[3:5, 8:] = KPI_TAGS.create_plot
template.main[5:, :] = CONTROLLER
template.sidebar_width = 380
template.sidebar_height = 1000
template.header_background = "#428bca"
template.servable()