I tried the same in very static way where all imageOutput are written separately.
Two ways to put images side by side-
TabBox and Column Based.
For Column based I have taken a small picture.128*128
For TabBox you can choose any size picture.
Both case you can use width and height parameter to change as per your requirement.
Please let me know if that solves your problem.
ui.R
library(shiny)
library(shinydashboard)
dashboardPage(
dashboardHeader(title = "Basic dashboard"),
dashboardSidebar(),
dashboardBody(
fluidRow(
column(1,imageOutput("img1")),
column(1,imageOutput("img2")),
column(1,imageOutput("img3")),
column(1,imageOutput("img4")),
column(1,imageOutput("img5")),
column(1,imageOutput("img6")),
column(1,imageOutput("img7")),
column(1,imageOutput("img8")),
column(1,imageOutput("img9")),
column(1,imageOutput("img10")),
column(1,imageOutput("img11"))
),
fluidRow(
tabBox(
tabPanel("Tab 1",
fluidRow(
column(6,
imageOutput("tabimg1_1")
),
column(6,
imageOutput("tabimg1_2")
)
)
),
tabPanel("Tab 2",imageOutput("tabimg2")),
tabPanel("Tab 3",imageOutput("tabimg3")),
tabPanel("Tab 4",imageOutput("tabimg4")),
tabPanel("Tab 5",imageOutput("tabimg5")),
tabPanel("Tab 6",imageOutput("tabimg6")),
tabPanel("Tab 7",imageOutput("tabimg7")),
tabPanel("Tab 8",imageOutput("tabimg8")),
tabPanel("Tab 9",imageOutput("tabimg9")),
tabPanel("Tab 10",imageOutput("tabimg10")),
tabPanel("Tab 11",imageOutput("tabimg11"))
)
)
)
)
Server.R
library(shiny)
library(shinydashboard)
shinyServer(function(input,output){
filename <- normalizePath(file.path('./www/images','rstudio.png'))
tabfilename<-normalizePath(file.path('./www/images','studio logo.jpg'))
output$img1<-renderImage({
list(src = filename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$img2<-renderImage({
list(src = filename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$img3<-renderImage({
list(src = filename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$img4<-renderImage({
list(src = filename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$img5<-renderImage({
list(src = filename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$img6<-renderImage({
list(src = filename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$img7<-renderImage({
list(src = filename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$img8<-renderImage({
list(src = filename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$img9<-renderImage({
list(src = filename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$img10<-renderImage({
list(src = filename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$img11<-renderImage({
list(src = filename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$tabimg1_1<-renderImage({
list(src = tabfilename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$tabimg1_2<-renderImage({
list(src = tabfilename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$tabimg2<-renderImage({
list(src = tabfilename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$tabimg3<-renderImage({
list(src = tabfilename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$tabimg4<-renderImage({
list(src = tabfilename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$tabimg5<-renderImage({
list(src = tabfilename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$tabimg6<-renderImage({
list(src = tabfilename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$tabimg7<-renderImage({
list(src = tabfilename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$tabimg8<-renderImage({
list(src = tabfilename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$tabimg9<-renderImage({
list(src = tabfilename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$tabimg10<-renderImage({
list(src = tabfilename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
output$tabimg11<-renderImage({
list(src = tabfilename,
contentType = 'image/png',
alt = "This is alternate text")
}, deleteFile = FALSE)
})
