-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
52 lines (46 loc) · 1.35 KB
/
app.py
File metadata and controls
52 lines (46 loc) · 1.35 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
import dash
import flask
from dash import Dash, html
import dash_bootstrap_components as dbc
# Usage Locally:
# $ poetry run python app.py
# select theme
# https://dash-bootstrap-components.opensource.faculty.ai/docs/themes/
external_stylesheets = [dbc.themes.CERULEAN] # CERULEAN, DARKLY, PULSE
server = flask.Flask(__name__)
app = Dash(
__name__,
external_stylesheets=external_stylesheets,
server=server,
use_pages=True,
serve_locally=True,
suppress_callback_exceptions=True # this is needed because renderer generate callbacks dynamically with per instance uuids
)
app.layout = dbc.Container([
html.H1('ISAS Interactive',
style={
"caretColor": "transparent",
"userSelect": "none"
}
),
dbc.Nav([
dbc.NavLink(
html.Div(
f"{page['name'].lower()}"),
href=page["relative_path"],
active="exact",
className='rounded-3'
)
for page in dash.page_registry.values()
], pills=True, className='bg-light rounded-3'),
html.P(),
html.Div(dash.page_container, className="flex-grow-1 d-flex flex-column", id="outer-page-container", style={'minHeight': '0'})
],
fluid=True,
className="vh-100 d-flex flex-column"
)
if __name__ == '__main__':
# processes=6, threaded=False,
app.run(debug=True, threaded=True, host='0.0.0.0', port='8080')
# app.run(debug=True, processes=6, threaded=False, host='0.0.0.0', port='8080')
# app.run(debug=True)