My app is currently functioning where, as the user selects multiple items from the Animals dropdown menu, the list of selections grows longer and pushes the elements below it further down the page.
I am looking to have these elements justified to the bottom of the page so that they remain in place even as more animals are selected.
library(tidyverse)
library(ggplot2)
library(dplyr)
library(shiny)
# Setting up UI for the app
ui <-
fillPage(
fluidRow(
# Selecting Animals
column(2,
selectInput(
inputId = 'FilterFieldSelection',
label = 'Animal Of Choice',
choices = c('Dog','Cat','Inu','Neko','Giraffe','Kirin','Mouse','Nezumi'),
selected = 'Dog',
multiple = TRUE
),
htmlOutput('ActiveFiltersText')
),
# Other Elements
column(2),
# Column with Color Selection
column(2,
selectInput(
inputId = 'ColorChoice',
label = 'Color Of Choice',
choices = c('red','blue','green'),
selected = 'red'
),
# Filtered Well Count Display
htmlOutput('WellCountFilteredText')
)
),
column(10,
plotOutput('myplot')
)
)
server <- function(input, output, session) {
## Active Filters Text Output ----
output$ActiveFiltersText <- renderUI({
full_text <- ""
full_text <- paste0(full_text, '<b>','Selected Animal(s): ','</b><br/>',
paste(input$FilterFieldSelection,collapse="<br/>"),'<br/>'
)
full_text <- HTML(full_text)
})
## Filtered Well Count Text Output ----
output$WellCountFilteredText <- renderUI({
HTML(paste0('<b>','Total Count: ','</b><br/>',150000))
})
## Plot
output$myplot <- renderPlot({
m <- matrix(rnorm(50), ncol = 5)
colnames(m) <- c("a", "b", "c", "d", "e")
as_tibble(m) %>%
ggplot(aes(x=a, y=b) ) +
geom_point(color=input$ColorChoice)
})
}
# Running the App
shinyApp(ui = ui, server = server)
I attempted to keep the elements from shifting by placing them in a different fluidRow, but unfortunately, they still remain top-justified on the page.