Skip to content

Commit

Permalink
reverting a change regarding radio button for density
Browse files Browse the repository at this point in the history
  • Loading branch information
certara-smouksassi committed Jun 8, 2023
1 parent 5ea5d37 commit 0d430ee
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions inst/shinyapp/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -641,21 +641,23 @@ function(input, output, session) {
)
if (input$histogramaddition != "None" &&
input$histogrambinwidth == "userbinwidth") {
items <- c(
"Match Histo Count" = "histocount",
items
)
}
if (!is.null(input$densityaddition) && input$densityaddition %in% items) {
selected <- input$densityaddition
} else {
selected <- NULL
items <- c(
"Density" = "Density",
"Counts" = "Counts",
"Match Histo Count" = "histocount",
"Scaled Density" = "Scaled Density",
"None" = "None"
)
}
# if (!is.null(input$densityaddition) && input$densityaddition %in% items) {
# selected <- input$densityaddition
# } else {
# selected <- NULL
# }
updateRadioButtons(
session,
"densityaddition",
choices = items,
selected = selected
choices = items
)
}, ignoreInit = TRUE)

Expand Down Expand Up @@ -798,12 +800,12 @@ function(input, output, session) {
if (!is.null(input$catvarin) && (length(input$catvarin ) >=1 )) {
NAMESTOKEEP2<-NAMESTOKEEP2 [ !is.element(NAMESTOKEEP2,input$catvarin) ]
}
if (!is.null(input$catvar2in) && input$catvar2in %in% NAMESTOKEEP2) {
selected <- input$catvar2in
} else {
selected <- NULL
}
selectInput('catvar2in',label = 'Treat as Categories:',choices=NAMESTOKEEP2,multiple=TRUE, selected = selected)
# if (!is.null(input$catvar2in) && input$catvar2in %in% NAMESTOKEEP2) {
# selected <- input$catvar2in
# } else {
# selected <- NULL
# }
selectInput('catvar2in',label = 'Treat as Categories:',choices=NAMESTOKEEP2,multiple=TRUE)
})

output$catvar3 <- renderUI({
Expand All @@ -822,17 +824,16 @@ function(input, output, session) {
}
# names(NAMESTOKEEP2) <- NAMESTOKEEP2
NAMESTOKEEP2 <- c("", NAMESTOKEEP2)
if (!is.null(input$catvar3in) && input$catvar3in %in% NAMESTOKEEP2) {
selected <- input$catvar3in
} else {
selected <- NULL
}
# if (!is.null(input$catvar3in) && input$catvar3in %in% NAMESTOKEEP2) {
# selected <- input$catvar3in
# } else {
# selected <- NULL
# }
selectInput(
"catvar3in",
'Custom cuts of this variable, defaults to min, median, max before any applied filtering:',
choices = NAMESTOKEEP2 ,
multiple = FALSE,
selected = selected
multiple = FALSE #,selected = selected
)
})

Expand Down

0 comments on commit 0d430ee

Please sign in to comment.