-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.py
33 lines (28 loc) · 861 Bytes
/
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
33
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from app import app
from layouts import layout, layout_menu, layout2, layoutEconomy, layoutLE, layoutRevenueLE
app.layout = html.Div([
dcc.Location(id='url', refresh=False),
html.Div(id='page-content')
])
@app.callback(Output('page-content', 'children'),
Input('url', 'pathname'))
def display_page(pathname):
if pathname == '/':
return layout_menu
elif pathname == '/app1':
return layout
elif pathname == '/app2':
return layout2
elif pathname == '/economy':
return layoutEconomy
elif pathname == '/le':
return layoutLE
elif pathname == '/revLE':
return layoutRevenueLE
else:
return '404'
if __name__ == '__main__':
app.run_server()