Commit ec2ff7ee by Itzel Camacho

Definir el rango del eje y, entre [50-200]

parent 686c6bea
import pandas as pd
from dash import Dash, Input, Output, dcc, html, callback
from dash import Dash, Input, Output, State, dcc, html, callback
import plotly.graph_objects as go
import plotly.express as px
import plotly.figure_factory as ff
......@@ -378,10 +378,10 @@ app.layout = html.Div(children=[
@callback(
Output('glucosa-graph', 'figure'),
[Input('rango', 'value'),
Input('slider-patient', 'value')]
[Input('slider-patient', 'value'),
Input('rango', 'value')],
)
def update_graph(rango_str, selected_pat):
def update_graph(selected_pat, rango_str):
if selected_pat not in df_total['patient']:
return go.Figure()
if not selected_pat or not rango_str:
......@@ -402,6 +402,7 @@ def update_graph(rango_str, selected_pat):
y=filtered_glucosa['value'],
mode='lines',
name='Glucosa paciente visita 1'))
fig.update_layout(yaxis=dict(range=[50,200]))
y_foods = np.interp(patient_foods['FH_reportada'], glucosa['date_time'], glucosa['value']) # interpolar fecha de las comidas con glucosa
distancias = abs((patient_foods['FH_salto'] - patient_foods['FH_reportada']).dt.total_seconds()) / 60
distancias_df = pd.concat([distancias,patient_foods['FH_reportada'], patient_foods['FH_foto']], axis=1, ignore_index=True)
......
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