-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.py
32 lines (26 loc) · 1.15 KB
/
index.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
from dash.dependencies import Input, Output
from dash import dcc
from dash import html
from app import app, server
from tabs import intro, LungCancerRisk
style = {
'maxWidth': '70%',
'margin': 'auto'}
app.title = 'Lung cancer risk prediction with AI'
app.layout = html.Div([
html.P([html.Img(src='assets/logo.png', style={'width' : '100%', 'margin-bottom': '0px', 'margin-top': '20px'})]),
html.P([
html.Br()]),
dcc.Tabs(id='tabs', value='tab-intro', parent_className='custom-tabs', className='custom-tabs-container', children=[
dcc.Tab(label='About', value='tab-intro', className='custom-tab', selected_className='custom-tab--selected'),
dcc.Tab(label='Lung Cancer Risk', value='tab-LungCancerRisk', className='custom-tab', selected_className='custom-tab--selected'),
]),
html.Div(id='tabs-content-classes'),
], style=style)
@app.callback(Output('tabs-content-classes', 'children'),
[Input('tabs', 'value')])
def render_content(tab):
if tab == 'tab-intro': return intro.layout
elif tab == 'tab-LungCancerRisk': return LungCancerRisk.layout
if __name__ == '__main__':
app.run_server(debug=True)