-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
66 lines (61 loc) · 1.91 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
# dash
import dash
import dash_mantine_components as dmc
from dash import Dash, dcc, html
# utils
from dotenv import load_dotenv; load_dotenv()
# local packages
from src import callbacks
# app definition
dash_app = Dash(
__name__,
external_stylesheets=['styles.css'],
meta_tags=[{
'name': 'viewport',
'content': 'width=device-width, initial-scale=1.0, maximum-scale=1.2, minimum-scale=0.5, user-scalable=yes'
}],
prevent_initial_callbacks='initial_duplicate',
suppress_callback_exceptions=True,
title='SDG App',
update_title='Loading...',
use_pages=True,
)
app = dash_app.server
# define layout
dash_app.layout = dmc.MantineProvider(
dmc.NotificationsProvider(
children=[
dcc.Location(id='location'),
dcc.Store(id='user-config', storage_type='session'),
dcc.Store(id='session-config', storage_type='session'),
dcc.Interval(
id='interval-component',
interval=1_000 * 10, # in milliseconds
n_intervals=0
),
dash.page_container,
html.Div(id='notifications-container'),
html.Div(id='login-redirect'),
],
autoClose=False,
position='top-center',
),
theme={
'fontFamily': '\'Proxima Nova\', sans-serif',
'headings': {
'fontFamily': 'SohneBreit, \'Proxima Nova\', sans-serif',
'sizes': {
'h1': {'fontSize': '2.938rem'},
'h2': {'fontSize': '2.5rem'},
'h3': {'fontSize': '1.875rem'},
'h4': {'fontSize': '1.563rem'},
'h5': {'fontSize': '1.25rem'},
},
'fontWeight': 'CSSProperties[\'fontWeight\']',
'lineHeight': 'CSSProperties[\'lineHeight\']',
},
},
)
# run the app
if __name__ == '__main__':
dash_app.run_server(host='0.0.0.0', port=8050, debug=True)