Add docs and change route names
This commit is contained in:
parent
36e622dbd9
commit
b872abfdf5
32
main.py
32
main.py
@ -30,8 +30,8 @@ sidebar = html.Div(
|
||||
dbc.Nav(
|
||||
[
|
||||
dbc.NavLink("Main Dashboard", href="/", active="exact"),
|
||||
dbc.NavLink("Data Explorer", href="/page-1", active="exact"),
|
||||
dbc.NavLink("Documentation", href="/page-2", active="exact"),
|
||||
dbc.NavLink("Data Explorer", href="/explorer", active="exact"),
|
||||
dbc.NavLink("Documentation", href="/docs", active="exact"),
|
||||
],
|
||||
vertical=True,
|
||||
pills=True,
|
||||
@ -106,7 +106,7 @@ def render_page_content(pathname):
|
||||
className="graphs"
|
||||
),
|
||||
]
|
||||
elif pathname == "/page-1":
|
||||
elif pathname == "/explorer":
|
||||
return [
|
||||
html.H1('Data explorer'),
|
||||
dash_table.DataTable(
|
||||
@ -136,20 +136,26 @@ def render_page_content(pathname):
|
||||
style_data={
|
||||
'backgroundColor': 'rgb(50, 50, 50)',
|
||||
'color': 'white'
|
||||
},
|
||||
style_cell={
|
||||
'color': 'white'
|
||||
}
|
||||
)
|
||||
]
|
||||
elif pathname == "/page-2":
|
||||
elif pathname == "/docs":
|
||||
return [
|
||||
html.H1('High School in Iran',
|
||||
style={'textAlign':'center'}),
|
||||
dcc.Graph(id='bargraph',
|
||||
figure=px.bar(df, barmode='group', x='Years',
|
||||
y=['Girls High School', 'Boys High School']))
|
||||
]
|
||||
html.H1('Documentation',
|
||||
style={'textAlign':'center'}),
|
||||
html.P('This dataset contains +150000 observations about cars for sale from otomoto.pl site.'),
|
||||
html.P('Each row describes a single car. There are 7 features:'),
|
||||
html.Ul([
|
||||
html.Li('- mark'),
|
||||
html.Li('- model'),
|
||||
html.Li('- price (in PLN)'),
|
||||
html.Li('- year'),
|
||||
html.Li('- milage (in KM)'),
|
||||
html.Li('- vol_engine (in DM^3)'),
|
||||
html.Li('- fuel (type of fuel)')
|
||||
])
|
||||
]
|
||||
|
||||
# If the user tries to reach a different page, return a 404 message
|
||||
return dbc.Jumbotron(
|
||||
[
|
||||
|
Loading…
Reference in New Issue
Block a user