Skip to content
34 changes: 34 additions & 0 deletions R/helpers.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
pointSymbolChooser <- function(inputId, selected, label = "Style") {
selectInput(inputId = inputId,
label = label,
selected = selected,
choices = c("Square"= "0",
"Circle"="1",
"Triangle point up"="2",
"Plus"="3",
"Cross"="4",
"Diamond"="5",
"Triangle point down"="6",
"Square cross"="7",
"Star"="8",
"Diamond plus"="9",
"Circle plus"="10",
"Triangles up and down"="11",
"Square plus"="12",
"Circle cross"="13",
"Square and Triangle up"="14",
"filled Square"="15",
"filled Circle"="16",
"filled Triangle point up"="17",
"filled Diamond"="18",
"solid Circle"="19",
"Bullet (smaller Circle)"="20",
"filled Circle w/outline"="21",
"Custom"="custom"))
}

customSymbolChooser <- function(inputId, label = "Insert character") {
textInput(inputId = inputId,
label = label,
value = "?")
}
7 changes: 5 additions & 2 deletions R/module_importTab.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
importTab <- function(id, label, accept) {
importTab <- function(id, label, accept, callback = function() NULL) {

## create a namespace function using the provided id
ns <- NS(id)
Expand All @@ -15,6 +15,9 @@ importTab <- function(id, label, accept) {
# import
actionButton(inputId = "import",
label = "Import",
class = "btn btn-success")
class = "btn btn-success"),

## callback function
callback()
)
}
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions inst/shiny/abanico/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ function(input, output, session) {
}

# if custom datapoint style get char from separate input panel
pch<- ifelse(input$pch == "custom", input$custompch, as.integer(input$pch)-1)
pch <- ifelse(input$pch == "custom", input$custompch, as.integer(input$pch))

# if custom datapoint style get char from separate input panel
pch2<- ifelse(input$pch2 == "custom", input$custompch2, as.integer(input$pch2)-1)
pch2 <- ifelse(input$pch2 == "custom", input$custompch2, as.integer(input$pch2))

# create numeric vector of lines
line <- sapply(1:8, function(x) input[[paste0("line", x)]])
Expand Down
68 changes: 9 additions & 59 deletions inst/shiny/abanico/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ function(request) {
actionButton(inputId = "refresh", label = "Refresh",
icon = icon("fas fa-sync"), title = "Redraw the plot.")


),##EndOf::Tab_1


# Tab 2: Statistical information
tabPanel("Statistics",
div(align = "center", h5("Summary")),
Expand Down Expand Up @@ -349,39 +347,15 @@ function(request) {
div(align = "center", h5("Primary data set")),
fluidRow(
column(width = 6,
selectInput(inputId = "pch",
label = "Style",
selected = "17",
choices = c("Square"= "1",
"Circle"="2",
"Triangle point up"="3",
"Plus"="4",
"Cross"="5",
"Diamond"="6",
"Triangle point down"="7",
"Square cross"="8",
"Star"="9",
"Diamond plus"="10",
"Circle plus"="11",
"Triangles up and down"="12",
"Square plus"="13",
"Circle cross"="14",
"Square and Triangle down"="15",
"filled Square"="16",
"filled Circle"="17",
"filled Triangle point up"="18",
"filled Diamond"="19",
"solid Circle"="20",
"Bullet (smaller Circle)"="21",
"Custom"="custom"))
pointSymbolChooser(inputId = "pch",
selected = "16")
),
column(width = 6,
# show only if custom symbol is desired
conditionalPanel(condition = "input.pch == 'custom'",
textInput(inputId = "custompch",
label = "Insert character",
value = "?"))
)
customSymbolChooser(inputId = "custompch")
)
)
),
fluidRow(
column(width = 6,
Expand All @@ -405,38 +379,14 @@ function(request) {
fluidRow(
column(width = 6,
## DATA SET 2
selectInput(inputId = "pch2",
label = "Style",
selected = "17",
choices = c("Square"= "1",
"Circle"="2",
"Triangle point up"="3",
"Plus"="4",
"Cross"="5",
"Diamond"="6",
"Triangle point down"="7",
"Square cross"="8",
"Star"="9",
"Diamond plus"="10",
"Circle plus"="11",
"Triangles up and down"="12",
"Square plus"="13",
"Circle cross"="14",
"Square and Triangle down"="15",
"filled Square"="16",
"filled Circle"="17",
"filled Triangle point up"="18",
"filled Diamond"="19",
"solid Circle"="20",
"Bullet (smaller Circle)"="21",
"Custom"="custom"))
pointSymbolChooser(inputId = "pch2",
selected = "16")
),
column(width = 6,
# show only if custom symbol is desired
conditionalPanel(condition = "input.pch2 == 'custom'",
textInput(inputId = "custompch2",
label = "Insert character",
value = "?"))
customSymbolChooser(inputId = "custompch2")
)
)
),
fluidRow(
Expand Down
22 changes: 7 additions & 15 deletions inst/shiny/convert/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@ function(request) {
# elements
sidebarPanel(width = 5,
# include a tabs in the input panel for easier navigation
tabsetPanel(id = "tabs", type = "pill", selected = "Data",
tabsetPanel(id = "tabs", type = "pill", selected = "Import",
# Tab 1: Data input
tabPanel("Data",

# informational text
div(align = "center", h5("Data upload")),
# file upload button (data set 1)
fileInput(inputId = "file",
label = strong("Measurement file (.bin, .binx)"),
accept="application/octet-stream, .bin, .binx"),
# import
actionButton(inputId = "import", label = "Import", class = "btn btn-success"),
tags$hr(),
RLumShiny:::importTab("import",
"BIN(X) file (.bin, .binx)",
"application/octet-stream, .bin, .binx"
),
tabPanel("Curve Selection",
# dynamic elements depending on input file
fluidRow(
column(width = 6,
Expand All @@ -30,10 +24,8 @@ function(request) {
column(width = 6,
uiOutput("curveTypes")
)
)
),##EndOf::Tab_1
),

tabPanel("Curves",
div(align = "center", h5("(De)select individual curves")),
checkboxGroupInput("curves", "Curves")
),##EndOf::Tab_2
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions inst/shiny/doserecovery/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ function(input, output, session) {
outputOptions(x = output, name = "ylim", suspendWhenHidden = FALSE)

# if custom datapoint style get char from separate input panel
pch <- ifelse(input$pch == "custom", input$custompch, as.integer(input$pch) - 1)
pch2 <- ifelse(input$pch2 == "custom", input$custompch2, as.integer(input$pch2) - 1)
pch <- ifelse(input$pch == "custom", input$custompch, as.integer(input$pch))
pch2 <- ifelse(input$pch2 == "custom", input$custompch2, as.integer(input$pch2))

# if custom datapoint color get RGB code from separate input panel
color <- ifelse(input$color == "custom", input$rgb, color<- input$color)
Expand Down
Loading