|
4 | 4 | import dash_bootstrap_components as dbc |
5 | 5 |
|
6 | 6 | # Usage Locally: |
7 | | -# $ python app.py |
| 7 | +# $ poetry run python app.py |
8 | 8 |
|
9 | 9 | # select theme |
10 | 10 | # https://dash-bootstrap-components.opensource.faculty.ai/docs/themes/ |
11 | 11 | external_stylesheets = [dbc.themes.CERULEAN] # CERULEAN, DARKLY, PULSE |
12 | 12 |
|
13 | 13 | server = flask.Flask(__name__) |
14 | 14 |
|
15 | | -app = Dash(__name__, external_stylesheets=external_stylesheets, server=server, use_pages=True) # , suppress_callback_exceptions=True |
| 15 | +app = Dash( |
| 16 | + __name__, |
| 17 | + external_stylesheets=external_stylesheets, |
| 18 | + server=server, |
| 19 | + use_pages=True, |
| 20 | + serve_locally=True, |
| 21 | + suppress_callback_exceptions=True # this is needed because renderer generate callbacks dynamically with per instance uuids |
| 22 | +) |
16 | 23 |
|
17 | 24 | app.layout = dbc.Container([ |
18 | | - html.H1('ISAS Interactive'), |
19 | | - dbc.Nav([ |
20 | | - dbc.NavLink(html.Div(f"{page['name'].lower()}"), href=page["relative_path"], active="exact") |
21 | | - for page in dash.page_registry.values() |
22 | | - ], pills=True, className='bg-light'), |
23 | | - html.P(), |
24 | | - dash.page_container |
25 | | -], fluid=True) |
| 25 | + html.H1('ISAS Interactive', |
| 26 | + style={ |
| 27 | + "caretColor": "transparent", |
| 28 | + "userSelect": "none" |
| 29 | + } |
| 30 | + ), |
| 31 | + dbc.Nav([ |
| 32 | + dbc.NavLink( |
| 33 | + html.Div( |
| 34 | + f"{page['name'].lower()}"), |
| 35 | + href=page["relative_path"], |
| 36 | + active="exact", |
| 37 | + className='rounded-3' |
| 38 | + ) |
| 39 | + for page in dash.page_registry.values() |
| 40 | + ], pills=True, className='bg-light rounded-3'), |
| 41 | + html.P(), |
| 42 | + html.Div(dash.page_container, className="flex-grow-1 d-flex flex-column", id="outer-page-container", style={'minHeight': '0'}) |
| 43 | +], |
| 44 | +fluid=True, |
| 45 | +className="vh-100 d-flex flex-column" |
| 46 | +) |
26 | 47 |
|
27 | 48 | if __name__ == '__main__': |
28 | | - # processes=6, threaded=False, |
29 | | - app.run(debug=True, threaded=True, host='0.0.0.0', port='8080') |
30 | | - # app.run(debug=True, processes=6, threaded=False, host='0.0.0.0', port='8080') |
31 | | - # app.run(debug=True) |
| 49 | + # processes=6, threaded=False, |
| 50 | + app.run(debug=True, threaded=True, host='0.0.0.0', port='8080') |
| 51 | + # app.run(debug=True, processes=6, threaded=False, host='0.0.0.0', port='8080') |
| 52 | + # app.run(debug=True) |
0 commit comments