-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsolunity.py
67 lines (58 loc) · 2.23 KB
/
solunity.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
import param
import panel as pn
import holoviews as hv
from historname import Historname
from weatherflash import WeatherFlash
from colordropper import ColorDropper
import constant as C
APP_NAMES = ['Historname', 'WeatherFlash', 'ColorDropper']
pn.extension(css_files=[C.PATHS['css']])
hv.renderer('bokeh').theme = 'caliber'
def initialize(event):
progress = pn.widgets.Progress(active=True, sizing_mode='stretch_width',
max_width=500, align='center')
dashboard.objects = [vspace, progress, vspace]
if event.obj.name == 'Historname':
dashboard.objects = [Historname().view()]
elif event.obj.name == 'WeatherFlash':
dashboard.objects = [WeatherFlash().view()]
elif event.obj.name == 'ColorDropper':
dashboard.objects = [ColorDropper().view()]
vspace = pn.layout.VSpacer()
title = pn.pane.Markdown(
'# <center>Solunity</center>',
sizing_mode='stretch_width', margin=(-25, 10)
)
subtitle = pn.pane.Markdown("""
<center><p>Apps designed by Andrew Huang;
click a button below to begin.</p></center>
""", sizing_mode='stretch_width'
)
caption = pn.pane.Markdown("""
<p><center>
<a href="https://github.com/ahuang11/solunity" target="_blank">Source Code</a> |
<a href="https://github.com/ahuang11/" target="_blank">My GitHub</a><br>
Made possible with
<a href="https://www.python.org/" target=_blank">Python</a>,
<a href="https://pandas.pydata.org/" target=_blank">pandas</a>,
<a href="https://xarray.pydata.org/" target=_blank">xarray</a>,
<a href="https://numpy.org/" target=_blank">numpy</a>,
<a href="https://panel.holoviz.org/" target=_blank">panel</a>,
<a href="https://bokeh.org/" target=_blank">bokeh</a>,
<a href="http://holoviews.org/" target=_blank">holoviews</a>, and
<a href="https://dashboard.heroku.com/" target=_blank">Heroku</a>.<br>
</p></center>
""", sizing_mode='stretch_width'
)
buttons = [
pn.widgets.Button(
name=name, align='center', max_width=500
)
for name in APP_NAMES
]
for button in buttons:
button.param.watch(initialize, 'clicks')
dashboard = pn.Column(
vspace, title, subtitle, *buttons, caption, vspace,
sizing_mode='stretch_both'
).servable(title='Solunity')