Skip to content

Commit

Permalink
Added inputs to rows
Browse files Browse the repository at this point in the history
  • Loading branch information
gareth-j committed Dec 18, 2023
1 parent cdaa6cd commit 6e93c17
Showing 1 changed file with 31 additions and 19 deletions.
50 changes: 31 additions & 19 deletions R/shiny_meshbuilder.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,29 +89,41 @@ meshbuilder_shiny <- function(
shiny::checkboxInput(inputId = "enable_inputs", label = "Enable customisation", value = enable_inputs),
shiny::h4("Max edge"),
shiny::fluidRow(
shiny::numericInput(
inputId = "max_edge_min",
label = "Min:",
value = default_max_edge_min
shiny::column(
6,
shiny::numericInput(
inputId = "max_edge_min",
label = "Min:",
value = default_max_edge_min
)
),
shiny::numericInput(
inputId = "max_edge_max",
label = "Max:",
value = default_max_edge_max
shiny::column(
6,
shiny::numericInput(
inputId = "max_edge_max",
label = "Max:",
value = default_max_edge_max
)
)
),
shiny::p("Max permitted edge length for a triangle"),
shiny::h4("Offset"),
shiny::fluidRow(
shiny::numericInput(
inputId = "offset_min",
label = "Min:",
value = default_offset_min
shiny::column(
6,
shiny::numericInput(
inputId = "offset_min",
label = "Min:",
value = default_offset_min
),
),
shiny::numericInput(
inputId = "offset_max",
label = "Max:",
value = default_offset_max
shiny::column(
6,
shiny::numericInput(
inputId = "offset_max",
label = "Max:",
value = default_offset_max
)
)
),
shiny::p("Specifies the size of the inner and outer extensions around data locations."),
Expand Down Expand Up @@ -231,13 +243,13 @@ meshbuilder_shiny <- function(

output$mesh_code <- shiny::reactive({
if (input$enable_inputs) {
max_edge_str <- paste0("max.edge = c(", paste0(input$max_edge, collapse = ","), "),")
offset_str <- paste0("offset = c(", paste0(input$offset, collapse = ", "), "),")
max_edge_str <- paste0("max.edge = c(", input$max_edge_min, ",", input$max_edge_max, "),")
cutoff_str <- paste0("cutoff = ", input$cutoff, ",")
offset_str <- paste0("offset = c(", input$offset_min, ",", input$max_edge_max, ")")
} else {
max_edge_str <- "max.edge = NULL,"
offset_str <- "offset = NULL,"
cutoff_str <- "cutoff = NULL,"
offset_str <- "offset = NULL"
}

paste0(
Expand Down

0 comments on commit 6e93c17

Please sign in to comment.