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
fb997d2e
Commit
fb997d2e
authored
Jun 06, 2025
by
Jose Luis Gordillo Ruiz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prueba de concepto de multi bullets + scatter
para fusionar nuestras dos secciones en una sola, más informativa.
parent
08e417e5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
dinamyc.py
+56
-0
No files found.
dinamyc.py
View file @
fb997d2e
...
@@ -8,6 +8,61 @@ import numpy as np
...
@@ -8,6 +8,61 @@ import numpy as np
import
flask
import
flask
import
test_ch_2_b
import
test_ch_2_b
def
update_cobertura_series
(
etapaSel
=
1
,
min_comidas
=
10
,
min_glucosa
=
7
):
gauges
=
{
'shape'
:
"bullet"
,
'axis'
:
{
'range'
:
[
None
,
100
]},
'steps'
:
[
{
'range'
:
[
0
,
25
],
'color'
:
"lightcyan"
},
{
'range'
:
[
25
,
50
],
'color'
:
"lightblue"
},
{
'range'
:
[
50
,
75
],
'color'
:
"skyblue"
},
{
'range'
:
[
75
,
100
],
'color'
:
"steelblue"
}],
'bar'
:
{
'color'
:
"blue"
},
}
numbers
=
{
'suffix'
:
'
%
'
,
'valueformat'
:
'.2f'
}
modes
=
"number+gauge"
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
)
# 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
,
domain
=
{
'x'
:
[
0.25
,
1
],
'y'
:
[
0.70
,
0.8
]},
title
=
{
'text'
:
"Comidas"
},
mode
=
modes
,
number
=
numbers
,
gauge
=
gauges
,
))
multi
.
add_trace
(
go
.
Indicator
(
value
=
100
*
glucosa_data
.
sum
()
/
N_etapa
,
domain
=
{
'x'
:
[
0.25
,
1
],
'y'
:
[
0.9
,
1.0
]},
title
=
{
'text'
:
"Glucómetro"
},
mode
=
modes
,
number
=
numbers
,
gauge
=
gauges
))
multi
.
add_trace
(
go
.
Indicator
(
value
=
100
*
microbiota_data
/
N_etapa
,
domain
=
{
'x'
:
[
0.25
,
1
],
'y'
:
[
0.5
,
0.6
]},
title
=
{
'text'
:
"Microbiota"
},
mode
=
modes
,
number
=
numbers
,
gauge
=
gauges
))
multi
.
add_trace
(
go
.
Scatter
(
x
=
glucosa_scatter
.
index
,
y
=
glucosa_scatter
)
)
return
multi
def
get_visit_data
(
visitnumber
):
def
get_visit_data
(
visitnumber
):
url_visitas
=
url
+
"/visits/"
+
str
(
visitnumber
)
+
"/patients-data"
url_visitas
=
url
+
"/visits/"
+
str
(
visitnumber
)
+
"/patients-data"
...
@@ -95,6 +150,7 @@ app = Dash(__name__, external_stylesheets=external_stylesheets, server=server, u
...
@@ -95,6 +150,7 @@ app = Dash(__name__, external_stylesheets=external_stylesheets, server=server, u
app
.
title
=
"NutrINDmex. Inventario de datos"
app
.
title
=
"NutrINDmex. Inventario de datos"
app
.
layout
=
html
.
Div
(
children
=
[
app
.
layout
=
html
.
Div
(
children
=
[
html
.
Div
(
children
=
[
dcc
.
Graph
(
figure
=
update_cobertura_series
())],
className
=
"wrapper"
),
#encabezado
#encabezado
html
.
Div
(
children
=
[
html
.
Div
(
children
=
[
html
.
P
(
children
=
"🥑"
,
className
=
"header-emoji"
),
html
.
P
(
children
=
"🥑"
,
className
=
"header-emoji"
),
...
...
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