nueva versión de la gráfica de cobertura de pruebas

falta afinarla pero ya funciona.
parent 966b39a2
...@@ -249,7 +249,30 @@ app.layout = html.Div(children=[ ...@@ -249,7 +249,30 @@ app.layout = html.Div(children=[
), ),
dcc.Graph(id="multi-visitas"), dcc.Graph(id="multi-visitas"),
], className="wrapper",), ], className="wrapper",),
# cobertura de pacientes por prueba # cobertura de pacientes por prueba. working.
html.Div(children=[
html.H1("Cobertura de pacientes por protocolo.", className="header-title2"),
# selector de etapa
html.Div(children=[
html.Div(children="Etapa", className="menu-title"),
dcc.Dropdown(
id="select_vis_protocolo",
options=[
{"label":1, "value":1},
{"label":2, "value":2},
{"label":3, "value":3},
{"label":4, "value":4}
],
value=1,
clearable=False,
searchable=False,
className="dropdown",
),
], className="wrapper"),
#y gráfica
dcc.Graph(id="cobertura_protocolo"),
], className="wrapper"),
# cobertura de pacientes por prueba. legajo.
html.Div(children=[ html.Div(children=[
html.H1("Cobertura de pacientes por prueba", className="header-title2"), html.H1("Cobertura de pacientes por prueba", className="header-title2"),
# selector de etapa # selector de etapa
...@@ -390,6 +413,33 @@ def update_datos_por_paciente(etapa, fuente): ...@@ -390,6 +413,33 @@ def update_datos_por_paciente(etapa, fuente):
return figura return figura
@app.callback(
Output("cobertura_protocolo","figure"),
Input("select_vis_protocolo", "value")
)
def update_por_protocol(visita):
df1 = visitas_datos[visita-1]
protocolos = {
"pyhsiological" : ["pass", "pad", "ipaq", "stress", "hadsa", "hadsd"],
"tolerance_curves" : ["Pan", "Gelatina", "Glucosa"],
"corporal_composition" : ["mmkg", "mmekg", "mgkg", "mlgkg", "percent_mg", "gv"],
"biochemical" :["hba1c", "glucose", "ct", "tag", "ldl", "hdl", "pcr","alt", "ast","homa", "insuline" ],
"antropometric" : ["imc", "weight", "waist_circunference"]
}
cuentas = 100 * df1.replace("",np.nan).count() / len(df1)
figura = {
"data": [
{
"x": cuentas.index,
"y": cuentas,
"type": "bar",
}
],
}
return figura
@app.callback( @app.callback(
Output("multi-visitas", "figure"), Output("multi-visitas", "figure"),
Output("detalle_pruebas", "figure"), Output("detalle_pruebas", "figure"),
......
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