-
Notifications
You must be signed in to change notification settings - Fork 1
/
ui.R
175 lines (151 loc) · 8.5 KB
/
ui.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
library(shiny)
library(shinyWidgets)
library(shinydashboard)
library(shinyalert)
library(dplyr)
library(tidyr)
library(ggplot2)
library(plotly)
library(DT)
source('data-setting.R')
header <- dashboardHeader(title = 'Dashboard PMCP')
sidebar <- dashboardSidebar(
sidebarMenu(
id = 'sidebarmenu',
menuItem('O Cenário', tabName = 'cenario', icon = icon('fas fa-chart-line')),
menuItem('Mortalidade', tabName = 'mortalidade', icon = icon('fas fa-chart-line'),
menuItem('Infantil', tabName = 'infantil', icon = icon('baby')),
menuItem('Materna',tabName = 'materna',icon = icon('female'))#,
# menuItem('c',
# tabName = 'c',
# icon = icon('fas fa-chart-line'))
),
menuItem('Indicadores', tabName = 'indicadores', icon = icon('fa-solid fa-file-medical'),
menuItem('CNES', tabName = 'cnes', icon = icon('fa-solid fa-hospital'))#,
#menuItem('etc',tabName = 'etc',icon = icon('fa-solid fa-hospital'))#,
# menuItem('c',
# tabName = 'c',
# icon = icon('fas fa-chart-line'))
),
menuItem('Sobre', tabName = 'sobre', icon = icon('address-card'))
)
)
body <- dashboardBody(
tabItems(
tabItem(
tabName = "cenario",
fluidRow(
box(title = 'Números para 2019', status = "primary",solidHeader = TRUE, infoBoxOutput("info_box1",width = 4),
infoBoxOutput("info_box2",width = 4),
infoBoxOutput("info_box3",width = 4),
infoBoxOutput("info_box4",width = 4), width = 12)
), # fecha fluid
fluidRow(box(title = 'Mortalidade materna', status = "primary",solidHeader = TRUE, plotOutput('plot1')),
box(title = 'Mortalidade infantil', status = "primary",solidHeader = TRUE, plotOutput('plot2'))),
fluidRow(box(sliderInput("slider_plot1", "Selecione o ano:", 1996, 2019, value = c(2005, 2015))),
box(sliderInput("slider_plot2", "Selecione o ano:", 1996, 2019, value = c(2005, 2015))))
), # tabitem
tabItem(tabName = 'infantil',
fluidRow(
fluidRow(column(12, box(width = 12,
title = 'Números mais recentes', status = "primary",solidHeader = TRUE,
infoBoxOutput("info_box_MI_cidade_ABS"),
infoBoxOutput("info_box_MI_cidade_TAX"),
height = 150
))),
column(12,
fluidRow(
column(width = 6,
fluidRow(box(width = 12, title = "Filtro por cidade e ano", solidHeader = TRUE, status = "primary",
selectInput("select_cidade_infantil", label = NULL,
choices = unique(mortalidade_infantil_municipios_pe$nome_municipio),
selected = 'Araripina'),
sliderInput("slider_cidade_infantil", "Selecione o ano:", 1996, 2019, value = c(1999, 2015))),
box(width = 12, plotOutput("plot_cidade_mi", height="488px", brush = "plot_brush"),
title = "Mortalidade Infantil", solidHeader = TRUE, status = "primary")
),
),
column(width = 6,
box(width = NULL, title = "Mortalidade Infantil - Dados", solidHeader = TRUE, status = "primary",
div(DT::dataTableOutput("tabela_cidade_mi"), style = "font-size:99%"))
)
)
)
)
),
tabItem(tabName = 'materna',
# fluidRow(
# box(title="Ops, essa página ainda está em desenvolvimento!", status = "danger",solidHeader = TRUE,
# div(class=" panel panel-default",
# img(src='development.png', class="img-responsive")
# ))
# )
fluidRow(
fluidRow(column(12, box(width = 12,
title = 'Números mais recentes', status = "primary",solidHeader = TRUE,
infoBoxOutput("info_box_MM_cidade_ABS"),
infoBoxOutput("info_box_MM_cidade_TAX"),
height = 150
))),
column(12,
fluidRow(
column(width = 6,
fluidRow(box(width = 12, title = "Filtro por cidade e ano", solidHeader = TRUE, status = "primary",
selectInput("select_cidade_materna", label = NULL, choices = unique(mortalidade_materna_municipios_pe$nome_municipio),
selected = 'Araripina'),
sliderInput("slider_cidade_materna", "Selecione o ano:", 1996, 2019, value = c(1999, 2015))),
box(width = 12, plotOutput("plot_cidade_mm", height="488px", brush = "plot_brush"),
title = "Mortalidade Materna", solidHeader = TRUE, status = "primary")
),
),
column(width = 6,
box(width = NULL, title = "Mortalidade Materna - Dados", solidHeader = TRUE, status = "primary",
div(DT::dataTableOutput("tabela_cidade_mm"), style = "font-size:99%"))
)
)
)
)
),
## --------------------------------
## Tab de indicadores ##
tabItem(tabName = 'cnes',
fluidRow(
fluidRow(column(12, box(width = 12,
title = 'Números de estabelecimentos CNES em Pernambuco, 2021', status = "primary",solidHeader = TRUE,
infoBoxOutput("info_box_cnes_amb"),
infoBoxOutput("info_box_cnes_hos"),
infoBoxOutput("info_box_cnes_ger"),
height = 150
))),
column(12,
fluidRow(
column(width = 6,
fluidRow(box(width = 12, title = "Filtros", solidHeader = TRUE, status = "primary",
selectInput("cnes_nome_cidade", label = NULL, choices = toupper(unique(dados_long$nome_municipio)),selected = 'ARARIPINA'),
checkboxGroupInput("cnesNivelAtencao_checkGroup", label = h3("Nível de atenção"), choices = list("Ambulatorial" = "Ambulatorial", "Hospitalar" = "Hospitalar"),
selected = "Ambulatorial", inline = TRUE)
),
box(width = 12,
sliderTextInput("cnes_ano","Selecione o ano",choices = sort(unique(dados_long$ano))),
plotlyOutput("cnes_NivelAtencao_barras", height="488px"),
title = "Estabelecimentos por nível de atenção", solidHeader = TRUE, status = "primary"),
box(width = 12,
sliderInput("cnes_slider_ano", "Selecione o ano:", 2005, 2021, value = c(2010, 2020)),
plotlyOutput("cnes_NivelAtencao_linhas", height="488px"),
title = "Estabelecimentos por nível de atenção no tempo", solidHeader = TRUE, status = "primary")
),
),
column(width = 6,
box(width = NULL, title = "Estabelecimentos por nível de atenção - Dados", solidHeader = TRUE, status = "primary",
div(DT::dataTableOutput("cnes_tabela_servicos"), style = "font-size:99%"))
)
)
)
)
),
## --------------------------------
tabItem(tabName = 'sobre', fluidRow(box(width = 12, status = 'info', htmlTemplate('about_page.html')))
)
)# fecha tabItems
)# fecha body
dashboardPage(header, sidebar, body)