-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.py
71 lines (65 loc) · 2.59 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
####################################################################
#
# This file is part of libraries-2021 dataexplorer, https://nds.iaea.org/dataexplorer/.
# Copyright (C) 2024 International Atomic Energy Agency (IAEA)
#
# Contact: [email protected]
#
# Change logs:
# First release: 2021-08-20
# Update libraries: 2022-09-05, JENDL4.0 and TENDL2019 have been replced by JENDL5.0 and TENDL2021
#
####################################################################
import dash
from dash import html
import dash_bootstrap_components as dbc
from config import DEVENV
# see dash API reference: https://dash.plotly.com/reference
# Style selection [CERULEAN, COSMO, CYBORG, DARKLY, FLATLY, JOURNAL, LITERA, LUMEN, LUX, MATERIA, MINTY, PULSE, SANDSTONE, SIMPLEX, SKETCHY, SLATE, SOLAR, SPACELAB, SUPERHERO, UNITED, YETI, ZEPHYR]
if DEVENV:
app = dash.Dash(
__name__,
external_stylesheets=[dbc.themes.CERULEAN],
url_base_pathname="/dataexplorer2/",
# routes_pathname_prefix="/", # if Prod
# requests_pathname_prefix="/dataexplorer2/", # if Prod
suppress_callback_exceptions=True,
meta_tags=[
{
"name": "IAEA Nuclear Data Section",
"content": "Nuclear Reaction, Nuclear Data, Cross Section, TALYS, TENDL",
},
{"http-equiv": "X-UA-Compatible", "content": "IE=edge"},
{"name": "viewport", "content": "width=device-width, initial-scale=1.0"},
],
use_pages=True,
)
else:
app = dash.Dash(
__name__,
external_stylesheets=[dbc.themes.CERULEAN],
# url_base_pathname="/dataexplorer2/",
routes_pathname_prefix="/", # if Prod
requests_pathname_prefix="/dataexplorer2/", # if Prod
suppress_callback_exceptions=True,
meta_tags=[
{
"name": "IAEA Nuclear Data Section",
"content": "Nuclear Reaction data plot, LIBRARIES-2022, TALYS",
},
{"http-equiv": "X-UA-Compatible", "content": "IE=edge"},
{"name": "viewport", "content": "width=device-width, initial-scale=1.0"},
],
use_pages=True,
)
server = app.server # for PROD/INT env
app.title = "IAEA Nuclear Reaction Data Explorer"
app.layout = html.Div([dash.page_container])
if __name__ == "__main__":
if DEVENV:
app.run_server(host="0.0.0.0", use_reloader=True, debug=True)
# app.run_server(
# host="127.0.0.1", debug=True, dev_tools_prune_errors=False, use_reloader=True
# )
else:
app.run_server(use_reloader=True)