Create separate module for each plot

I am creating a Shiny app using structure as below:

library(shiny)
library(shinydashboard)

source('./scr/data_preparation.R')

shinyApp(

ui = dashboardPage(

header = dashboardHeader(disable = TRUE),
sidebar = dashboardSidebar(width = 0),

body = dashboardBody(
  tags$head(
    # Note the wrapping of the string in HTML()
    tags$style(
  body {
    background-color: black;
    color: white;
  }
  h2 {
    font-family: 'Yusei Magic', sans-serif;
  }
  .shiny-input-container {
    color: #474747;
  }"))),
  ### changing theme
  shinyDashboardThemes(
    theme = "onenote"
  ),
  
  # 
  fluidRow( 
    column(12, align="center", offset = 0, style='padding:0px;',
           
           div(img(src="Picture2.jpg", height='100%', width='100%'))
    )
    
  ),
  
  # 
  br(),
  box(
    
  ),
  box(
   
  ),
  fluidRow(width = 12,
     
  )),
  
  fluidRow( ),
    
    fluidRow(

    ), 
    fluidRow( 
  )),
  
  
  column(8,  
  box( width = 12, background = NULL,
  fluidRow( background = NULL,
       
       plotlyOutput("plot1"))
  ))))),

server = function(input, output) {

# Create a "data_source" reactive variable
data_intacc <- reactive({
    data <- ind1
    return(data) 

})


output$plot <-renderPlotly({
  
  data <- data_intacc()



    
    
}) 

}
)

I want to organize my code so in the last fluidRow of my UI I will have 2 boxes.

In the left box I need to have a Select box widget. Based on this selection I need in the right box to be shown an interface (other widgets and plot).

Because this interfaces are numerous (different plots) I want each of them in a single module .

I am reading some sources about Shiny modules but still I cannot make it work for my case.

Can you please help with small example?

Regards

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.