Commit 6fe06729 authored by Facundo Muñoz's avatar Facundo Muñoz ®️
Browse files

Interface: add help text and improve labels + summary stats epi-units

parent 37b3e6b8
Package: mapMCDA
Title: Produce an epidemiological risk map by weighting multiple risk factors
Version: 0.3.3
Version: 0.3.4
Date: 2018-06-27
Authors@R: c(
person("Elena", "Arsevska", email = "elena.arsevska@cirad.fr", role = c("ctb")),
......
......@@ -76,6 +76,27 @@ langFileList <- c("Names","Noms")
langBoxLayer <- c("Layers", "Couches")
langHelpFiles <- c(
"Import files, including a vector map with epidemiological units.",
"Importer fichiers, y-compris une carte vectorielle avec des unités épidémiologiques."
)
langHelpLayers <- c(
"Check the epidemiological units layer.",
"Signaler la couche d'unités épidémiologiques."
)
langHelpScale <- c(
"Harmonise the original scales into a common risk-scale. Use the button to reverse the relationship.",
"Harmoniser les échelles originales en une échelle de risque commune. Utiliser le bouton pour inverser la relation."
)
langHelpMatrix <- c(
"The factor in row i is x[i,j] times more important than the factor in column j.",
"Le facteur de la ligne i est x[i, j] fois plus important que le facteur de la colonne j."
)
# Epidemiological unit
langMenuUnit <- c("Epidemiological units","Unit&#233;s &#233;pid&#233;miologiques")
......@@ -87,12 +108,12 @@ langBoxUnitStat <- c("Statistics", "Statistiques")
# Risk factors
langMenuRisk <- c("Risk factors","Facteurs de risque")
langBoxRiskRawMap <- c("Raw", "Brut")
langBoxRiskRawMap <- c("Original scale", "Échelle originale")
langBoxRiskStandRaster <- c("Standardized raster", "Raster standardis&#233;")
langBoxRiskStandRaster <- c("Risk scale", "Échelle de risque")
langRBRiskLayer <- c("Select layer to compute standardized raster:",
"S&#233;lectionnez la couche pour calculer le raster :")
langRBRiskLayer <- c("Scale risk factors",
"Mise en échelle des facteurs de risque")
langABRiskRasterInvert <- c("Invert", "Inverser")
......@@ -102,9 +123,9 @@ langABRiskRasterInvert <- c("Invert", "Inverser")
# Weight
langMenuWeight <- c("Weight","Poids")
langBoxWeightMatrix <- c("Weight Matrix", "Matrice des poids")
langBoxWeightMatrix <- c("Pairwise comparison Matrix", "Matrice de comparaison par paires")
langBoxWeightBar <- c("Weight Histogram", "Histogramme des poids")
langBoxWeightBar <- c("Weights histogram", "Histogramme des poids")
# Results
langMenuResult <- c("Results","R&#233;sultats")
......
......@@ -377,6 +377,34 @@ server <- function(input, output, session) {
})
##### Summary statistics of epid. unit ####
output$unitStatText <- renderText({
epidUnitLayer <- curEpidUnitLayer()
if(is.null(epidUnitLayer)) return(NULL)
if( !is.projected(epidUnitLayer[[indRawLay]])) {
warning("This map is not projected. This can lead to very
inaccurate computations of distances and areas, depending
on the location and size of the region of interest.
Proceed with caution.")
}
# htmlOutput(
paste("N. epidemiological units:", length(epidUnitLayer[[indRawLay]]))
# )
})
output$unitStatDisplay <- renderPlot({
epidUnitLayer <- curEpidUnitLayer()
if(is.null(epidUnitLayer)) return(NULL)
hist(
rgeos::gArea(cmr$cmr_admin3, byid = TRUE),
main = "Distribution of unit-areas",
xlab = "Area (in map units, squared)"
)
})
##### Render for the list of layers in risk tab ####
output$uiRiskLayerList <- renderUI({
......
......@@ -36,114 +36,161 @@ body <- dashboardBody(
tabItem("fileTab",
fluidRow(
box(title = HTML(langBoxFile[indLang]), status = "primary", width = 5, solidHeader = TRUE,
## File load
box(
title = HTML(langBoxFile[indLang]),
status = "primary",
width = 5,
solidHeader = TRUE,
footer = langHelpFiles[indLang],
# To upload shape and raster files
fileInput(inputId = "fiLayer",
label = HTML(langTitleFileInput[indLang]),
multiple = TRUE,
accept = NULL, #acceptLayerType,
width = NULL,
buttonLabel = HTML(langButtonFileInput[[indLang]][1]),
placeholder = HTML(langButtonFileInput[[indLang]][2])),
fileInput(
inputId = "fiLayer",
label = HTML(langTitleFileInput[indLang]),
multiple = TRUE,
accept = NULL,
#acceptLayerType,
width = NULL,
buttonLabel = HTML(langButtonFileInput[[indLang]][1]),
placeholder = HTML(langButtonFileInput[[indLang]][2])
),
# List of all upload files
tableOutput("allFileTable")
),
box(title = HTML(langBoxLayer[indLang]), status = "success", width = 7, solidHeader = TRUE,
# List of layers. Name is editable
rHandsontableOutput("rhLayerTable")
)
)
),
tabItem("unitTab",
uiOutput("unitNameText"),
box(title = HTML(langBoxUnitMap[indLang]), status = "primary", width = 6, solidHeader = TRUE,
plotOutput("unitMapDisplay")
),
box(title = HTML(langBoxUnitStat[indLang]), status = "success", width = 6, solidHeader = TRUE,
),
## Layer table
box(
title = HTML(langBoxLayer[indLang]),
status = "success",
width = 7,
solidHeader = TRUE,
footer = langHelpLayers[indLang],
plotOutput("unitStatDisplay")
# List of layers. Name is editable
rHandsontableOutput("rhLayerTable")
)
)
),
tabItem(
"unitTab",
uiOutput("unitNameText"),
box(
title = HTML(langBoxUnitMap[indLang]),
status = "primary",
width = 6,
solidHeader = TRUE,
plotOutput("unitMapDisplay")
),
box(
title = HTML(langBoxUnitStat[indLang]),
status = "success",
width = 6,
solidHeader = TRUE,
textOutput("unitStatText"),
plotOutput("unitStatDisplay")
)
),
tabItem("riskTab",
uiOutput("uiRiskLayerList"),
tabItem(
"riskTab",
uiOutput("uiRiskLayerList"),
box(
title = HTML(langBoxRiskRawMap[indLang]),
status = "primary",
width = 6,
solidHeader = TRUE,
plotOutput("rawLayerDisplay")
),
box(
title = HTML(langBoxRiskStandRaster[indLang]),
status = "success",
width = 6,
solidHeader = TRUE,
plotOutput("standRasterDisplay")
),
box(
status = "info",
width = 6,
solidHeader = FALSE,
langHelpScale[indLang]
),
actionButton(
inputId = "abInvert",
label = langABRiskRasterInvert[indLang]
)
),
tabItem("weightTab",
box(title = HTML(langBoxRiskRawMap[indLang]), status = "primary", width = 6, solidHeader = TRUE,
fluidRow(
box(
title = HTML(langBoxWeightMatrix[indLang]),
status = "primary",
width = 9,
solidHeader = TRUE,
plotOutput("rawLayerDisplay")
),
box(title = HTML(langBoxRiskStandRaster[indLang]), status = "success", width = 6, solidHeader = TRUE,
rHandsontableOutput("rhWeightTable")#,
# actionButton(inputId = "abWMatrixOK", label = "Valider"),
#
# textOutput("isMatrixOKText")
plotOutput("standRasterDisplay")
),
actionButton(inputId = "abInvert", label = langABRiskRasterInvert[indLang])
),
tabItem("weightTab",
fluidRow(
),
box(title = HTML(langBoxWeightMatrix[indLang]), status = "primary", width = 12, solidHeader = TRUE,
rHandsontableOutput("rhWeightTable")#,
# actionButton(inputId = "abWMatrixOK", label = "Valider"),
#
# textOutput("isMatrixOKText")
)
box(
status = "info",
width = 3,
solidHeader = FALSE,
langHelpMatrix[indLang]
)
),
fluidRow(
box(
title = HTML(langBoxWeightBar[indLang]),
status = "success",
width = 12,
solidHeader = TRUE,
plotOutput("weightBarDisplay")
box(title = HTML(langBoxWeightBar[indLang]), status = "success", width = 12, solidHeader = TRUE,
plotOutput("weightBarDisplay")
)
)
)
),
)),
tabItem("resultTab",
box(title = HTML(langMenuResult[indLang]), status = "primary", width = 6, solidHeader = 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