Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
inventario
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jose Luis Gordillo Ruiz
inventario
Commits
495a5ee8
Commit
495a5ee8
authored
Jun 06, 2025
by
Jose Luis Gordillo Ruiz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agregamos el selector de distribución y la linea mínima
parent
57935106
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
8 deletions
+32
-8
dinamyc.py
+32
-8
No files found.
dinamyc.py
View file @
495a5ee8
...
...
@@ -145,6 +145,18 @@ app.layout = html.Div(children=[
value
=
7
,
marks
=
{
1
:
"1"
,
7
:
"7"
,
14
:
"14"
,
28
:
"28"
,
42
:
"+42"
}
),
html
.
Div
(
children
=
"Distribución"
,
className
=
"menu-title"
),
dcc
.
Dropdown
(
id
=
"distribucion_serie"
,
options
=
[
{
"label"
:
"Comidas por paciente"
,
"value"
:
1
},
{
"label"
:
"Días de glucómetro por paciente"
,
"value"
:
2
},
],
value
=
1
,
clearable
=
False
,
searchable
=
False
,
className
=
"dropdown"
,
),
]),
#gráfica
html
.
Div
(
children
=
[
dcc
.
Graph
(
id
=
"cover_series"
)],)
...
...
@@ -256,9 +268,10 @@ app.layout = html.Div(children=[
Output
(
"cover_series"
,
"figure"
),
Input
(
"etapas_serie"
,
"value"
),
Input
(
"min_comidas_serie"
,
"value"
),
Input
(
"min_glucosa_serie"
,
"value"
)
Input
(
"min_glucosa_serie"
,
"value"
),
Input
(
"distribucion_serie"
,
"value"
)
)
def
update_cobertura_series
(
etapaSel
=
1
,
min_comidas
=
10
,
min_glucosa
=
7
):
def
update_cobertura_series
(
etapaSel
=
1
,
min_comidas
=
10
,
min_glucosa
=
7
,
distribucion
=
1
):
gauges
=
{
'shape'
:
"bullet"
,
'axis'
:
{
'range'
:
[
None
,
100
]},
...
...
@@ -275,14 +288,21 @@ def update_cobertura_series(etapaSel=1, min_comidas=10, min_glucosa=7):
comidas_data
=
resumen_comidas
.
loc
[(
slice
(
None
),
f
'e{etapaSel}'
)]
>
min_comidas
glucosa_data
=
glucometro_df
.
loc
[
glucometro_df
[
"visit_id"
]
==
etapaSel
,
"amount_of_days"
]
>
min_glucosa
microbiota_data
=
num_secuencias
[
etapaSel
-
1
]
glucosa_scatter
=
glucometro_df
.
loc
[
glucometro_df
[
"visit_id"
]
==
etapaSel
][
"amount_of_days"
]
.
sort_values
()
glucosa_scatter
.
index
=
glucosa_scatter
.
index
.
astype
(
str
)
if
distribucion
==
1
:
xs
=
resumen_comidas
.
loc
[(
slice
(
None
),
f
'e{etapaSel}'
)]
.
sort_values
()
title
=
f
"Comidas por paciente en la etapa {etapaSel}"
medCadena
=
'comidas'
minimo
=
min_comidas
if
distribucion
==
2
:
xs
=
glucometro_df
.
loc
[
glucometro_df
[
"visit_id"
]
==
etapaSel
][
"amount_of_days"
]
.
sort_values
()
title
=
f
'dias de glucómetro por paciente en la etapa {etapaSel}'
medCadena
=
'días de glucómetro'
minimo
=
min_glucosa
xs
.
index
=
xs
.
index
.
astype
(
str
)
# microbiota_data = visitas_datos[etapaSel-1]["muestra"].count()
# La N de la etapa debe ser el número de participantes que cumplieron la etapa.
# esto es diferente al número de participantes que asistieron a la visita N o N+1.
N_etapa
=
len
(
participantes
.
loc
[
participantes
[
"finished_periods"
]
.
isin
(
range
(
etapaSel
,
4
))]
.
index
)
multi
=
make_subplots
(
rows
=
2
,
cols
=
1
,
specs
=
[[{
"type"
:
"indicator"
}],[{}]])
multi
.
add_trace
(
go
.
Indicator
(
value
=
100
*
comidas_data
.
sum
()
/
N_etapa
,
...
...
@@ -309,9 +329,13 @@ def update_cobertura_series(etapaSel=1, min_comidas=10, min_glucosa=7):
gauge
=
gauges
))
multi
.
add_trace
(
go
.
Scatter
(
x
=
glucosa_scatter
.
index
,
y
=
glucosa_scatter
)
go
.
Scatter
(
x
=
xs
.
index
,
y
=
xs
)
)
multi
.
update_xaxes
(
title_text
=
f
'{N_etapa} pacientes'
,
row
=
2
,
col
=
1
)
multi
.
update_yaxes
(
title_text
=
medCadena
,
row
=
2
,
col
=
1
)
multi
.
add_shape
(
go
.
layout
.
Shape
(
type
=
'line'
,
yref
=
'y1'
,
xref
=
'x1'
,
x0
=
0
,
x1
=
800
,
xsizemode
=
'pixel'
,
y0
=
minimo
,
y1
=
minimo
,
line
=
dict
(
color
=
'red'
,
width
=
1
,
dash
=
'dot'
)))
return
multi
@app.callback
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment