Skip to content

Commit

Permalink
lemur - v0.14.3 conining the bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mpascariu committed Dec 5, 2023
1 parent 19e9ceb commit 1f44fc2
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 103 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: lemur
Title: Life expectancy monitor upscaled in R
Version: 0.14.2
Version: 0.14.3
Authors@R: c(
person("Marius D.", "Pascariu", role = c("aut", "cre", "cph"), email = "rpascariu@outlook.com", comment = c(ORCID = "0000-0002-2568-6489")),
person("Jose Manuel", "Aburto", role = "aut", comment = c(ORCID = "0000-0002-2926-6879")),
Expand Down
6 changes: 3 additions & 3 deletions R/app_process_data.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -------------------------------------------------------------- #
# Author: Marius D. PASCARIU
# Last Update: Wed Nov 15 08:19:45 2023
# Last Update: Tue Dec 5 22:08:41 2023
# -------------------------------------------------------------- #

# ----------------------------------------------------------------------------
Expand Down Expand Up @@ -29,9 +29,9 @@ prepare_data_mode_cod <- function(cod,
logic <- any(cod_change != 0)
if (logic) {
# c1 <- modify_cod_table(c1, cod_change)
c2 <- modify_cod_table(c2, cod_change)
c2 <- modify_cod_table(c1, cod_change)
# l1 <- modify_life_table(l1, c1, cod_change)
l2 <- modify_life_table(l2, c2, cod_change)
l2 <- modify_life_table(l1, c1, cod_change)
}

out <- list(
Expand Down
5 changes: 3 additions & 2 deletions R/app_server.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -------------------------------------------------------------- #
# Author: Marius D. PASCARIU
# Last Update: Wed Nov 15 08:24:24 2023
# Last Update: Tue Dec 5 22:23:04 2023
# -------------------------------------------------------------- #

#' The application server-side
Expand Down Expand Up @@ -290,9 +290,10 @@ app_server <- function(input, output, session) {
})

output$reduction_matrix <- DT::renderDataTable({

data_cod_change() %>%
as_tibble() %>%
mutate(`Age Group` = rownames(.), .before = 1) %>%
mutate(`Age Group` = data_fig()$lt_initial$x.int, .before = 1) %>%
format_datatable(
caption = table_captions()[6]
)
Expand Down
232 changes: 135 additions & 97 deletions R/app_ui_dashboard.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -------------------------------------------------------------- #
# Author: Marius D. PASCARIU
# Last Update: Tue Oct 17 22:41:44 2023
# Last Update: Wed Dec 6 00:19:58 2023
# -------------------------------------------------------------- #

#' UI - dashboard page
Expand Down Expand Up @@ -250,7 +250,7 @@ side_panel <- function() {
label = "NONE",
style = "width:48%;"
)
)
),
),

# Side panel for sdg mode
Expand Down Expand Up @@ -339,122 +339,160 @@ side_panel <- function() {
max = 100,
step = 5
),
)
),

# radioGroupButtons(
# inputId = "stack_charts",
# label = "Stack Charts?!",
# choices = c("NO", "YES"),
# justified = TRUE
# )
)
}


#' @keywords internal
main_panel <- function() {
tagList(
fluidRow(
column(
width = 7,
style = 'padding:0px 0px 0px 18px;',

boxFrame(
style = 'padding:0px',
title = tagList(
tags$div(
"World Map",
style = "display: inline-block; font-weight: bold; padding:0px;"
)
),

leafletOutput(
outputId = "figure1",
height = 381*0.93
)
)
),

column(
width = 5,
style = 'padding:0px;',
# conditionalPanel(
# condition = "input.stack_charts == 'NO'",
tagList(
chart_1(width_ = 7),
chart_2(width_ = 5),
chart_3(width_ = 6),
chart_4(width_ = 6)
)
# )

# conditionalPanel(
# condition = "input.stack_charts == 'YES'",
# tagList(
# fluidRow(chart_1(width_ = 10, height_ = 1.0, offset_ = 1)),
# fluidRow(chart_2(width_ = 10, height_ = 1.1, offset_ = 1)),
# fluidRow(chart_3(width_ = 10, height_ = 1.3, offset_ = 1)),
# fluidRow(chart_4(width_ = 10, height_ = 1.3, offset_ = 1))
# )
# )
}

boxFrame(
title = boxTitleInput(
title = "Difference in Life Expectancy at various ages",
db_style = "padding: 0px 0px 0px 340px;",
selectInput(
inputId = "fig2_x",
label = "Ages to be displayed",
choices = lemur::data_app_input$x,
selected = seq(0, 110, 10),
multiple = TRUE
)
),

plotlyOutput(
outputId = "figure2",
height = 350*0.955
)
#' @keywords internal
chart_1 <- function(width_, height_ = 1, offset_ = 0) {
column(
width = width_,
style = 'padding:0px 0px 0px 18px;',
offset = offset_,

boxFrame(
style = 'padding:0px',
title = tagList(
tags$div(
"World Map",
style = "display: inline-block; font-weight: bold; padding:0px;"
)
),

leafletOutput(
outputId = "figure1",
height = 354.33 * height_
)
),

fluidRow(
column(
width = 6,
style = 'padding-right:0px; padding-top:0px; padding-bottom:0px',

boxFrame(
title = boxTitleInput(
title = "Cause of Death Distribution",
db_style = "padding: 0px 0px 0px 450px;",
radioGroupButtons(
inputId = "fig3_chart_type",
label = "View by:",
choices = c("Bar-plot" = "barplot"),
justified = TRUE,
checkIcon = list(
yes = tags$i(class = "fa fa-circle",
style = "color: black"),
no = tags$i(class = "fa fa-circle-o")),
direction = "vertical"
)
),
)
)
}

plotlyOutput(
outputId = "figure3",
height = 330
)
#' @keywords internal
chart_2 <- function(width_, height_ = 1, offset_ = 0) {
column(
width = width_,
style = 'padding:0px;',
offset = offset_,

boxFrame(
title = boxTitleInput(
title = "Difference in Life Expectancy at various ages",
db_style = "padding: 0px 0px 0px 340px;",
selectInput(
inputId = "fig2_x",
label = "Ages to be displayed",
choices = lemur::data_app_input$x,
selected = seq(0, 110, 10),
multiple = TRUE
)
),

plotlyOutput(
outputId = "figure2",
height = 332.7 * height_
)
)
)
}

column(
width = 6,
style = 'padding:0px;',

boxFrame(
title = boxTitleInput(
title = "Cause of Death / Age Decomposition of the Change in Life Expectancy at Birth",
db_style = "padding: 0px 0px 0px 410px;",
radioGroupButtons(
inputId = "fig4_dim",
label = "View by:",
choices = c("Age-and-COD" = "both",
"Age" = "age",
"COD" = "cod"),
justified = TRUE,
checkIcon = list(
yes = tags$i(class = "fa fa-circle",
style = "color: black"),
no = tags$i(class = "fa fa-circle-o")),
direction = "vertical"
)
),

plotlyOutput(
outputId = "figure4",
height = 330
)
#' @keywords internal
chart_3 <- function(width_, height_ = 1, offset_ = 0) {
column(
width = width_,
style = 'padding-right:0px; padding-top:0px; padding-bottom:0px',
offset = offset_,

boxFrame(
title = boxTitleInput(
title = "Cause of Death Distribution",
db_style = "padding: 0px 0px 0px 450px;",
radioGroupButtons(
inputId = "fig3_chart_type",
label = "View by:",
choices = c("Bar-plot" = "barplot"),
justified = TRUE,
checkIcon = list(
yes = tags$i(class = "fa fa-circle",
style = "color: black"),
no = tags$i(class = "fa fa-circle-o")),
direction = "vertical"
)
),

plotlyOutput(
outputId = "figure3",
height = 330 * height_
)
)
)
}

#' @keywords internal
chart_4 <- function(width_, height_ = 1, offset_ = 0) {
column(
width = width_,
style = 'padding:0px;',
offset = offset_,

boxFrame(
title = boxTitleInput(
title = "Cause of Death / Age Decomposition of the Change in Life Expectancy at Birth",
db_style = "padding: 0px 0px 0px 410px;",
radioGroupButtons(
inputId = "fig4_dim",
label = "View by:",
choices = c("Age-and-COD" = "both",
"Age" = "age",
"COD" = "cod"),
justified = TRUE,
checkIcon = list(
yes = tags$i(class = "fa fa-circle",
style = "color: black"),
no = tags$i(class = "fa fa-circle-o")),
direction = "vertical"
)
),

plotlyOutput(
outputId = "figure4",
height = 330 * height_
)
)
)
}

#' @keywords internal
boxFrame <- function(...,
Expand Down
Binary file added builds/lemur_0.14.3.tar.gz
Binary file not shown.

0 comments on commit 1f44fc2

Please sign in to comment.