-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
112 lines (101 loc) · 4.08 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import dash
from dash import dcc, html
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
from datetime import datetime
import dash_bootstrap_components as dbc
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from src import tab3,tab2, tab1, tab0
app = dash.Dash(__name__,
external_stylesheets=[dbc.themes.BOOTSTRAP])
server = app.server
app.title = "Malnutrition and poverty cross the globe"
print("Current working directory set to:", os.getcwd())
app.layout = html.Div([
html.Div([
html.Img(src='assets/logo5.png', height='100%', width='6%', style={'display': 'inline-block', 'vertical-align': 'middle'}),
html.H2("Beyond Borders: Malnutrition & Poverty", style={'display': 'inline-block', 'vertical-align': 'middle', 'font-family':' Georgia', 'font-size': '200%', 'margin': '0 auto','color': 'white'}),
], style={'position': 'relative', 'height': '100%', 'width': '100%', 'background-color': '#293F54', 'display': 'flex', 'justify-content': 'center', 'align-items': 'center'}),
html.Div([
dcc.Tabs(
id='tabs',
value='tab0', # Set the default tab ID here
children=[
dcc.Tab(
label='General',
value='tab0',
children=tab0.create_layout(app),
style={
'font-family': 'Georgia',
'font-size': '120%',
'background-color': 'lightgrey',
'border-width': '0'
},
selected_style={
'font-family': 'Georgia',
'font-size': '120%',
'background-color': '#FAF5F4',
'border-width': '0'
}
),
dcc.Tab(
label='Something About Malnutrition',
value='tab1',
children=tab1.create_layout(app),
style={
'font-family': 'Georgia',
'font-size': '120%',
'background-color': 'lightgrey',
'border-width': '0'
},
selected_style={
'font-family': 'Georgia',
'font-size': '120%',
'background-color': '#FAF5F4',
'border-width': '0'
}
),
dcc.Tab(
label='Facts for Poverty',
value='tab2',
children=tab2.create_layout(app),
style={
'font-family': 'Georgia',
'font-size': '120%',
'background-color': 'lightgrey',
'border-width': '0'
},
selected_style={
'font-family': 'Georgia',
'font-size': '120%',
'background-color': '#FAF5F4',
'border-width': '0'
}
),
dcc.Tab(
label='And...',
value='tab3',
children=tab3.create_layout(app),
style={
'font-family': 'Georgia',
'font-size': '120%',
'background-color': 'lightgrey',
'border-width': '0'
},
selected_style={
'font-family': 'Georgia',
'font-size': '120%',
'background-color': '#FAF5F4',
'border-width': '0'
}
)
]
)
]),
])
server.secret_key = os.environ.get('SECRET_KEY', 'my-secret-key')
if __name__ == '__main__':
app.run_server(host='0.0.0.0', port=8964, debug=True)