Skip to content

Commit

Permalink
refactor: aesthetics for tooltip, route ui location and most lintr is…
Browse files Browse the repository at this point in the history
…sues
  • Loading branch information
Gero1999 committed Dec 10, 2024
1 parent bda6ca6 commit 9a3f38a
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions inst/shiny/modules/tab_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ tab_data_ui <- function(id) {
choices = NULL, options = list(placeholder = "Select Column")),
"Matrix"
),
tooltip(
selectizeInput(ns("select_ROUTE"), "ROUTE",
choices = NULL, options = list(placeholder = "Select Column")),
"Route of administration, stating either 'intravascular' or 'extravascular'."
),
tooltip(
selectizeInput(ns("select_AVAL"), "AVAL",
choices = NULL, options = list(placeholder = "Select Column")),
Expand All @@ -87,6 +82,11 @@ tab_data_ui <- function(id) {
choices = NULL, options = list(placeholder = "Select Column")),
"Numeric format."
),
tooltip(
selectizeInput(ns("select_ROUTE"), "ROUTE",
choices = NULL, options = list(placeholder = "Select Column")),
"Route of administration, stating either 'intravascular' or 'extravascular'."
),
tooltip(
selectizeInput(ns("select_DOSEA"), "DOSEA",
choices = NULL, options = list(placeholder = "Select Column")),
Expand Down Expand Up @@ -132,20 +132,20 @@ tab_data_ui <- function(id) {
tooltip(
selectizeInput(ns("select_AVALU"), "AVALU",
choices = NULL, options = list(placeholder = "Select Column")),
"Unit of analysis value. If not available, select the unit used in the dataset
from the manual units."
"Unit of analysis value. If a column is not available, type and select the unit
used in the dataset from the manual units."
),
tooltip(
selectizeInput(ns("select_DOSEU"), "DOSEU",
choices = NULL, options = list(placeholder = "Select Column")),
"Unit of dose amount. If not available, select the unit used in the dataset
from the manual units"
"Unit of dose amount. If a column is not available, type and select the unit
used in the dataset from the manual units"
),
tooltip(
selectizeInput(ns("select_RRLTU"), "RRLTU",
choices = NULL, options = list(placeholder = "Select Column")),
"Unit of time. If not available, select the unit used in the dataset
from the manual units"
"Unit of time. If a column is not available, type and select the unit
used in the dataset from the manual units"
)
)
),
Expand Down Expand Up @@ -230,7 +230,7 @@ tab_data_server <- function(id) {
"PCSPEC", "AVAL", "AVALU", "AFRLT",
"ARRLT", "NRRLT", "NFRLT", "RRLTU",
"ROUTE", "DOSEA", "DOSEU", "DOSNO")

# Define the manual units for concentration, dose, and time in a format recognized by PKNCA
manual_conc_units <- c("mg/L", "µg/mL", "ng/mL", "pg/mL",
"mol/L", "mmol/L", "µmol/L", "nmol/L",
Expand Down Expand Up @@ -260,25 +260,25 @@ tab_data_server <- function(id) {
updateSelectizeInput(session, "select_ADOSEDUR",
choices = c("Select Column" = "", column_names, "NA"),
selected = if ("ADOSEDUR" %in% column_names) "ADOSEDUR" else NULL)

# Special case for Units options

# Update the select input with grouped options
updateSelectizeInput(session, "select_AVALU",
choices = list(
"Dataset Columns" = column_names,
"Manual Units" = manual_conc_units
),
selected = if ("AVALU" %in% column_names) "AVALU" else NULL)

# Update the select input for dose units with grouped options
updateSelectizeInput(session, "select_DOSEU",
choices = list(
"Dataset Columns" = column_names,
"Manual Units" = manual_dose_units
),
selected = if ("DOSEU" %in% column_names) "DOSEU" else NULL)

# Update the select input for time units with grouped options
updateSelectizeInput(session, "select_RRLTU",
choices = list(
Expand Down Expand Up @@ -345,7 +345,7 @@ tab_data_server <- function(id) {
if (input$select_ADOSEDUR == "NA") {
data$ADOSEDUR <- 0
}

# Update dataset columns if manual units are selected
if (input$select_AVALU %in% manual_conc_units) {
data$AVALU <- input$select_AVALU
Expand Down

0 comments on commit 9a3f38a

Please sign in to comment.