-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.py
72 lines (59 loc) · 2.26 KB
/
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
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
import dash_bootstrap_components as dbc
from dash import Dash, html, dcc
from collections import defaultdict
from callbacks.update_res import *
from components.header import layout as header
from components.progress import layout as tomo_progress
from components.proteins import layout as protein_sts
from components.waitlist import layout as unlabelled_tomos
from components.annotators import layout as ranking
from components.composition import layout as composition
from components.popups import layout as popups
def create_app():
external_stylesheets = [dbc.themes.BOOTSTRAP,
"assets/header-style.css",
"https://codepen.io/chriddyp/pen/bWLwgP.css",
"https://use.fontawesome.com/releases/v5.10.2/css/all.css"]
app = Dash(__name__, external_stylesheets=external_stylesheets)
browser_cache =html.Div(
id="no-display",
children=[
dcc.Interval(
id='interval-component',
interval=20*1000, # clientside check in milliseconds, 10s
n_intervals=0
),
dcc.Store(id='tomogram-index', data=''),
dcc.Store(id='keybind-num', data=''),
dcc.Store(id='run-dt', data=defaultdict(list))
],
)
app.layout = html.Div(
[
header(),
popups(),
dbc.Container(
[
dbc.Row(
[
dbc.Col([tomo_progress(),
unlabelled_tomos()
],
width=3),
dbc.Col(ranking(), width=3),
dbc.Col(composition(), width=3),
dbc.Col(protein_sts(), width=3),
],
justify='center',
className="h-100",
),
],
fluid=True,
),
html.Div(browser_cache)
],
)
return app
if __name__ == "__main__":
dash_app = create_app()
dash_app.run_server(host="0.0.0.0", port=8000, debug=False)