eliminamos panel de cobertura de datos

tambén se fusionó en una gráfica previa
parent 1d089149
...@@ -161,45 +161,6 @@ app.layout = html.Div(children=[ ...@@ -161,45 +161,6 @@ app.layout = html.Div(children=[
#gráfica #gráfica
html.Div(children=[dcc.Graph(id="cover_series")],) html.Div(children=[dcc.Graph(id="cover_series")],)
],style={'display': 'flex', 'flexDirection': 'row'}, className="wrapper"), ],style={'display': 'flex', 'flexDirection': 'row'}, className="wrapper"),
# segundo 'panel': datos existentes por paciente.
html.Div(children=[
html.H1("Cantidad de datos registrados por paciente", className="header-title2"),
# controles. 1 renglon, dos columnas.
html.Div(children=[
#dropdown etapa. columna izquierda.
html.Div(children=[
html.Div(children="Etapa", className="menu-title"),
dcc.Dropdown(
id="select_etapa_dpp",
options=[
{"label":1, "value":1},
{"label":2, "value":2},
{"label":3, "value":3},
],
value=1,
clearable=False,
searchable=False,
className="dropdown",
),
], className="wrapper"),
# dropdown fuente. columna derecha.
html.Div(children=[
html.Div(children="Fuente", className="menu-title"),
dcc.Dropdown(
id="select_fuente_dpp",
options=[
{"label":"Comidas", "value":1},
{"label":"Glucómetro", "value":2},
],
value=1,
clearable=False,
searchable=False,
className="dropdown",
),
],className="wrapper",),
], style={"display":"flex", "flexDirection": "row"},),
dcc.Graph(id="datos_por_paciente"),
], className="wrapper"),
# cobertura de pacientes por prueba. working. # cobertura de pacientes por prueba. working.
html.Div(children=[ html.Div(children=[
html.H1("Cobertura de pacientes por protocolo.", className="header-title2"), html.H1("Cobertura de pacientes por protocolo.", className="header-title2"),
...@@ -300,41 +261,6 @@ def update_cobertura_series(etapaSel=1, min_comidas=10, min_glucosa=7, distribuc ...@@ -300,41 +261,6 @@ def update_cobertura_series(etapaSel=1, min_comidas=10, min_glucosa=7, distribuc
return multi return multi
@app.callback(
Output("datos_por_paciente", "figure"),
Input("select_etapa_dpp", "value"),
Input("select_fuente_dpp", "value")
)
def update_datos_por_paciente(etapa, fuente):
if fuente == 1:
xs = resumen_comidas.loc[(slice(None),f'e{etapa}')].sort_values()
title = f"Comidas por paciente en la etapa {etapa}"
medCadena = 'comidas'
if fuente == 2:
xs = glucometro_df.loc[glucometro_df["visit_id"] == etapa]["amount_of_days"].sort_values()
title = f'dias de glucómetro por paciente en la etapa {etapa}'
medCadena = 'días de glucómetro'
xs.index = "p_" + xs.index.astype(str)
figura = {
"data": [
{
"x": xs.index,
"y": xs,
"name": "Comidas",
#"orientation": "v",
},
#{ "x": temp["Comidas_e1"], "type": "histogram"},
],
"layout": {
"title": {"text": title},
"xaxis": { "title": {"text": "Paciente"}},
"yaxis": { "title": {"text": f'Número de {medCadena}'}},
"bargap": "0.05"
}
}
return figura
@app.callback( @app.callback(
......
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