Commit bf7ad3e1 authored by Samuël Weber's avatar Samuël Weber
Browse files

responsive

parent 7b83513d
......@@ -578,7 +578,7 @@ def get_map_component(stations):
def get_about_app_results_component():
component = dbc.Row(
dbc.Col(
width=12, sm=12, md=11, lg=10, xl=9,
width=12,
children=dcc.Markdown(open("how_to.mdwn", "r").read(), dangerously_allow_html=True)
),
justify="center",
......
......@@ -103,75 +103,84 @@ layout = dbc.Container(
# first column
dbc.Col(
id="first-column",
width=2,
sm=12, md=4, xl=3,
children=[
dbc.ListGroup(
id="items-nav",
dbc.Navbar([
dbc.NavbarToggler(id="items-toggler"),
dbc.Collapse(
id="items-collapse",
navbar=True,
children=[
dbc.ListGroupItem(
id="item-rawdata",
dbc.ListGroup(
id="items-nav",
children=[
dbc.ListGroup(
id='item-rawdata-nav',
dbc.ListGroupItem(
id="item-rawdata",
children=[
dbc.ListGroupItemHeading("Raw data"),
dbc.ListGroupItem('Timeserie', id='item-rawdata-timeserie', action=True, n_clicks=0),
dbc.ListGroupItem('Montlhy', id='item-rawdata-monthly', action=True, n_clicks=0),
dbc.ListGroupItem('Seasonal', id='item-rawdata-seasonal', action=True, n_clicks=0),
dbc.ListGroup(
id='item-rawdata-nav',
children=[
dbc.ListGroupItemHeading("Raw data"),
dbc.ListGroupItem('Timeserie', id='item-rawdata-timeserie', action=True, n_clicks=0),
dbc.ListGroupItem('Montlhy', id='item-rawdata-monthly', action=True, n_clicks=0),
dbc.ListGroupItem('Seasonal', id='item-rawdata-seasonal', action=True, n_clicks=0),
]
)
]
)
]
),
dbc.ListGroupItem(
id="item-PMF",
children=[
dbc.ListGroup(
id='item-PMF-nav',
),
dbc.ListGroupItem(
id="item-PMF",
children=[
dbc.ListGroupItemHeading("PMF factor chemistry"),
dbc.ListGroupItem('Profiles', id='item-pmf-profiles', action=True, n_clicks=0),
dbc.ListGroupItem('DeltaTool', id='item-pmf-deltatool', action=True, n_clicks=0),
dbc.ListGroupItem('Uncertainties', id='item-pmf-uncertainties', action=True, n_clicks=0),
dbc.ListGroupItem('Species repartition', id='item-pmf-speciesrepartition', action=True, n_clicks=0),
dbc.ListGroup(
id='item-PMF-nav',
children=[
dbc.ListGroupItemHeading("PMF factor chemistry"),
dbc.ListGroupItem('Profiles', id='item-pmf-profiles', action=True, n_clicks=0),
dbc.ListGroupItem('DeltaTool', id='item-pmf-deltatool', action=True, n_clicks=0),
dbc.ListGroupItem('Uncertainties', id='item-pmf-uncertainties', action=True, n_clicks=0),
dbc.ListGroupItem('Species repartition', id='item-pmf-speciesrepartition', action=True, n_clicks=0),
]
)
]
)
]
),
dbc.ListGroupItem(
id="item-OP",
children=[
dbc.ListGroup(
id='item-OP-nav',
),
dbc.ListGroupItem(
id="item-OP",
children=[
dbc.ListGroupItemHeading("OP model"),
dbc.ListGroupItem('Obs. vs. model', id='item-op-obsvsmodel', action=True, n_clicks=0),
dbc.ListGroupItem('Intrinsic OP', id='item-op-betacoefficient', action=True, n_clicks=0),
dbc.ListGroupItem('OP contribution (all)', id='item-op-contribution', action=True, n_clicks=0),
dbc.ListGroupItem('OP contribution (timeseries)', id='item-op-contribution-ts', action=True, n_clicks=0),
dbc.ListGroup(
id='item-OP-nav',
children=[
dbc.ListGroupItemHeading("OP model"),
dbc.ListGroupItem('Obs. vs. model', id='item-op-obsvsmodel', action=True, n_clicks=0),
dbc.ListGroupItem('Intrinsic OP', id='item-op-betacoefficient', action=True, n_clicks=0),
dbc.ListGroupItem('OP contribution (all)', id='item-op-contribution', action=True, n_clicks=0),
dbc.ListGroupItem('OP contribution (timeseries)', id='item-op-contribution-ts', action=True, n_clicks=0),
]
)
]
)
]
),
dbc.ListGroupItem(
id="help",
children=[
dbc.ListGroup(
id="item-help-nav",
),
dbc.ListGroupItem(
id="help",
children=[
dbc.ListGroupItemHeading("I need help!"),
dbc.ListGroupItem("Don't worry, click here.", id="item-help-help", action=True, n_clicks=0, active=True)
dbc.ListGroup(
id="item-help-nav",
children=[
dbc.ListGroupItemHeading("I need help!"),
dbc.ListGroupItem("Don't worry, click here.", id="item-help-help", action=True, n_clicks=0, active=True)
]
)
]
)
]
)
],
],
),
]
)
])
],
), # end fisrt column
# second column
dbc.Col(
id="graph-component",
width=10,
sm=12, md=8, xl=9,
children=ac.get_about_app_results_component()
)
],
......@@ -181,6 +190,17 @@ layout = dbc.Container(
# end container
)
@app.callback(
Output("items-collapse", "is_open"),
[Input("items-toggler", "n_clicks")],
[State("items-collapse", "is_open")],
)
def toggle_items_collapse(n, is_open):
if n:
return not is_open
return is_open
@app.callback(Output('specie-dropdown', 'options'),
[Input('station-dropdown', 'value')])
def set_specie_option(stations):
......
......@@ -58,7 +58,7 @@ app.layout = html.Div([
),
],
id="nav-logo",
className="ml-auto "
className="ml-auto d-none d-md-block"
)
],
),
......@@ -70,14 +70,6 @@ app.layout = html.Div([
app.title = "OP apportionment"
# external_css = [
# dbc.themes.BOOTSTRAP
# ]
#
# for css in external_css:
# app.css.append_css({"external_url": css})
# =========== Serve pages
@app.callback(
Output('master-page-content', 'children'),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment