Having trouble searching the right words for this particular issue I am having.
I wanted boxes to go around this image of the car, but given the height of the image, it means it shifts the next fluidrow to be even further down. Is there a way to get the boxes to look like where I have drawn the red boxes? But more so the boxes next to the car image on row 3 (I don't expect anyone to code the 4th fluid row!).
I tried to incorporate the vertical layout but it just made everything vertical.
code: and just use any image to replace below
library(shinydashboard)
library(shiny)
library(shinyjs)
ui <- dashboardPage(
dashboardHeader(disable = TRUE),
dashboardSidebar(disable = TRUE),
dashboardBody(
useShinyjs(),
dashboardBody(
# the first row
fluidRow(
box( id = "box1",
h4(strong(textOutput("box1"))),
p(textOutput("box1_sub")),
width = 2,
solidHeader = TRUE
),
box( id = "box2",
h4(strong(textOutput("box2"))),
p(textOutput("box2_sub")),
width = 2,
solidHeader = TRUE,
background = "blue"
),
box( id = "box3",
h4(strong(textOutput("box3"))),
p(textOutput("box3_sub")),
width = 2,
solidHeader = TRUE
),
box( id = "box4",
h4(strong(textOutput("box4"))),
p(textOutput("box4_sub")),
width = 2,
solidHeader = TRUE,
background = "yellow"
),
box( id = "box5",
h4(strong(textOutput("box5"))),
p(textOutput("box5_sub")),
width = 2,
solidHeader = TRUE,
background = "purple"
),
box( id = "box6",
h4(strong(textOutput("box6"))),
p(textOutput("box6_sub")),
width = 2,
solidHeader = TRUE
)
),
br(),
# second row with car image
fluidRow(
box( id = "box7",
h4(strong(textOutput("box7"))),
p(textOutput("box7_sub")),
width = 2,
solidHeader = TRUE,
background = "green"
),
box( id = "box8",
h4(strong(textOutput("box8"))),
p(textOutput("box8_sub")),
width = 2,
solidHeader = TRUE,
background = "green"
),
box( uiOutput("car_image"),
width = 4
),
box( id = "box13",
h4(strong(textOutput("box13"))),
p(textOutput("box13_sub")),
width = 2,
solidHeader = TRUE,
background = "green"
),
box( id = "box14",
h4(strong(textOutput("box14"))),
p(textOutput("box14_sub")),
width = 2,
solidHeader = TRUE,
background = "green"
)
),
br(),
# third row
fluidRow(
box( id = "box10",
h4(strong(textOutput("box10"))),
p(textOutput("box10_sub")),
width = 2,
solidHeader = TRUE
)
),
br(),
# fourth row
fluidRow(
box( id = "box11",
h4(strong(textOutput("box11"))),
p(textOutput("box11_sub")),
width = 2,
solidHeader = TRUE
),
box( id = "box12",
h4(strong(textOutput("box12"))),
p(textOutput("box12_sub")),
width = 2,
solidHeader = TRUE
)))))
server <- function(input, output) {
output$car_image <- renderUI({
img(src='/image.png', width = '100%')})
output$box1 <- renderText({"box1"})
output$box1_sub<- renderText({"box1_sub"})
output$box2 <- renderText({"box2"})
output$box2_sub <- renderText({"box2_sub"})
output$box3 <- renderText({"box3"})
output$box3_sub <-renderText({"box3_sub"})
output$box4<- renderText({"box4"})
output$box4_sub <- renderText({"box4_sub"})
output$box5 <- renderText({"box5"})
output$box5_sub <- renderText({"box5_sub"})
output$box6 <- renderText({"box6_sub"})
output$box6_sub <- renderText({"box6_sub"})
output$box7<- renderText({"box7"})
output$box7_sub <- renderText({"box7_sub"})
output$box8 <- renderText({"box8"})
output$box8_sub <- renderText({"box8_sub"})
output$box9<- renderText({"box9"})
output$box9_sub <- renderText({"box9_sub"})
output$box10<- renderText({"box10"})
output$box10_sub <- renderText({"box10_sub"})
output$box11<- renderText({"box11"})
output$box11_sub <- renderText({"box11_sub"})
output$box12<- renderText({"box12"})
output$box12_sub <- renderText({"box12_sub"})
output$box13<- renderText({"box13"})
output$box13_sub <- renderText({"box13_sub"})
output$box14<- renderText({"box14"})
output$box14_sub <- renderText({"box14_sub"})
}
shinyApp(ui = ui, server = server)

