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

better get_component part + css

parent 58792d77
......@@ -50,10 +50,10 @@ ops = ["DTTv", "AAv", "DCFHv", "SD_DTTv", "SD_AAv", "SD_DCFHv"]
SPECIES_ORDER_WO_OP = ["PM10"] + carboneous + ions + organics + metals
SPECIES_ORDER = ["PM10"] + carboneous + ions + organics + metals + ops
BUTTONS = [
"rd_ts", "rd_monthly", "rd_seasonal", "pmf_profiles", "pmf_deltatool",
"pmf_unc", "pmf_sr", "op_beta", "op_obsvsmodel", "op_contrib", "op_contrib_ts", "help",
]
# BUTTONS = [
# "rd_ts", "rd_monthly", "rd_seasonal", "pmf_profiles", "pmf_deltatool",
# "pmf_unc", "pmf_sr", "op_beta", "op_obsvsmodel", "op_contrib", "op_contrib_ts", "help",
# ]
COMPONENTS = collections.OrderedDict({})
COMPONENTS["rd_ts"] = ac.get_rawdata_timeserie_component()
......@@ -124,7 +124,7 @@ layout = dbc.Container(
dbc.NavLink('Seasonal',
href="/results/rd_seasonal", id='item-rd_seasonal', n_clicks=0),
dbc.ListGroupItemHeading("PMF factor chemistry"),
dbc.NavLink('Profiles',
dbc.NavLink('Profiles comparison',
href='/results/pmf_profiles', id='item-pmf_profiles', n_clicks=0),
dbc.NavLink('DeltaTool',
href="/results/pmf_deltatool", id='item-pmf_deltatool', n_clicks=0),
......@@ -306,44 +306,18 @@ def update_op_contribution_ts_station_dropdown(value):
Output('OP-dropdown', 'disabled'),
],
[
Input(f"item-{i}", "n_clicks") for i in PAGES
Input("master-url", "pathname")
]
)
def get_graph_component(rd_ts, rd_monthly, rd_seasonal, pmf_profiles,
pmf_deltatool, pmf_unc, pmf_sr, op_beta, op_obsvsmodel, op_contrib,
op_contrib_ts, help):
def get_graph_component(url):
"""TODO: Docstring for get_graph_component.
:rd_ts: TODO :rd_monthly: TODO :rd_seasonal: TODO :pmf_profiles: TODO
:pmf_deltatool: TODO :pmf_unc: TODO :pmf_sr: TODO :op_beta: TODO
:op_contrib: TODO :returns: TODO
"""
new_button_values = {
"rd_ts": rd_ts,
"rd_monthly": rd_monthly,
"rd_seasonal": rd_seasonal,
"pmf_profiles": pmf_profiles,
"pmf_deltatool": pmf_deltatool,
"pmf_unc": pmf_unc,
"pmf_speciesrepartition": pmf_sr,
"op_beta": op_beta,
"op_obsvsmodel": op_obsvsmodel,
"op_contrib": op_contrib,
"op_contrib_ts": op_contrib_ts,
"help": help,
}
init_val = 0
clicked = "help"
for nth, button in enumerate(BUTTONS):
if new_button_values[button] is None:
continue
if new_button_values[button] > init_val:
init_val = new_button_values[button]
clicked = button
clicked = url.split("/")[-1]
if clicked not in BUTTONS:
raise PreventUpdate
print(clicked)
# ==== Disable drodpown
source_disabled = True
specie_disabled = True
......
......@@ -19,10 +19,10 @@ app.layout = html.Div([
dbc.Collapse(
[
dbc.NavLink("Results", href="/results",
className="btn btn-info"),
className="btn btn-success"),
dbc.NavLink("Estimate your OP", href="/estimate",
className="btn btn-secondary"),
dbc.NavLink("Question & contact", href="/contact"),
className="btn btn-link"),
dbc.NavLink("Question & contact", href="/contact", className="ml-auto"),
],
navbar=True,
id='navbar-collapse'
......@@ -79,9 +79,10 @@ app.title = "OP apportionment"
)
def display_page(pathname):
# return app_single.layout
print(pathname)
if re.search("/.*\/.+", pathname):
raise PreventUpdate()
# Prevent accessing unallowed pages
# if re.search("/.*\/.+", pathname):
# raise PreventUpdate()
if pathname is None or pathname == '/':
return app_deconvolOP.layout
......
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