-
Notifications
You must be signed in to change notification settings - Fork 3
/
run.py
76 lines (60 loc) · 1.82 KB
/
run.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
from __future__ import annotations
import logging
import panel as pn
from holoviews import opts as hvopts
from ruamel.yaml import YAML
import thalassa_server.ui
yaml = YAML(typ="safe", pure=True)
# configure logging
logger = logging.getLogger()
with open("config.yml", "rb") as fd:
config = yaml.load(fd.read())
logging.config.dictConfig(config["logging"])
logger.debug(logging.getLogger("thalassa").handlers)
# load bokeh
# hv.extension("bokeh")
# pn.extension(sizing_mode="scale_width")
# pn.config.sizing_mode="fixed"
# pn.config.sizing_mode="stretch_width"
# pn.config.sizing_mode="scale_width"
# pn.config.frame_width=800
# pn.config.width_policy="fit"
# Set some defaults for the visualization of the graphs
hvopts.defaults(
hvopts.Curve(
height=300,
responsive=True,
# show_title=True,
tools=["hover"],
active_tools=["pan", "wheel_zoom"],
),
hvopts.Image(
height=500,
responsive=True,
# width_policy="max",
# height_policy="max",
# frame_width=1500,
show_title=True,
tools=["hover"],
active_tools=["pan", "wheel_zoom"],
),
)
ui = thalassa_server.ui.ThalassaUI()
# https://panel.holoviz.org/reference/templates/Bootstrap.html
# template = pn.template.FastListTemplate(
# template = pn.template.ReactTemplate(
# template = pn.template.BootstrapTemplate(
template = pn.template.MaterialTemplate(
# site="example.com",
title="Thalassa Server",
# theme="dark",
# logo="thalassa_server/static/logo.png",
# favicon="thalassa_server/static/favicon.png",
sidebar=[ui.sidebar],
# sidebar_width=350, # in pixels! must be an integer!
# main_max_width="1350px", # must be a string!
main=[ui.main],
# main_layout = "",
)
template.header_background = "#2A6589"
_ = template.servable()