Issue with shinydashboard - dashboardSidebar and dashboardBody
up vote
0
down vote
favorite
I am new to Shiny and Shinydashboard. Please consider the following code snippet (small part of huge code):
dbsidebar <- dashboardSidebar(
sidebarMenu(
menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
menuItem("Rank List", icon = icon("th"), tabName = "Widgets1", badgeColor = "green"),
menuItem("Build Your", icon = icon("th"), tabName = "Widgets2", badgeColor = "green"),
menuItem("Groups", icon = icon("th"), tabName = "Widgets3", badgeColor = "green")
)
)
dbBody <- dashboardBody(
tabItems(
tabItem(tabName = "dashboard",
fluidRow(
#Pie Charts
splitLayout(
#cellWidths = c("50%", "50%"),
style = "border: 1px solid silver;",
cellWidths = 450,
cellArgs = list(style = "padding: 6px"),
plotlyOutput("Piechart1", width = "400px", height = "200px"),
plotlyOutput("Piechart2", width = "400px", height = "200px"),
plotlyOutput("Piechart3", width = "400px", height = "200px")
)
)
),
tabItem(tabName = "Widgets1",
#Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
sliderInput("TCScore","TCScore:",min = 0, max = 100, value = c(0,100))
),
# Show a plot of the generated distribution
mainPanel(
tabPanel("Heading", plotlyOutput("tbTable"))
)
),
downloadButton('downloadData', 'Download')
),
tabItem(tabName = "Widgets2", "XX"
# #Data Table
# sidebarLayout(
# sidebarPanel(
# sliderInput("TCCScore","TCCScore:",min = 0, max = 100, value = c(0,100)),
# ),
#
# # Show a plot of the generated distribution
# mainPanel(
# tabPanel("Heading", dataTableOutput("tbTable1"))
# )
#
# ),
# downloadButton('downloadData', 'Download')
),
tabItem(tabName = "Widgets3", "third"
)
)
)
On the dashboardSidebar, I have added 4 tabs - dashboard, Widget1, Widget2, Widget3. Initially for each of these tabs, I used simple text to render the UI dashboardBody and I got the display correctly. I started filling in each of these sections - "dashboard", "Widget1" and the display worked correctly for me. Unfortunately, for "Widget2 - when I removed the "XX" and uncommented the code shown above, the UI got completely distorted. It looks like the main UI elements in the dashboardBody did not get rendered? Can anyone tell me what I am doing wrong? Please help. I am sorry I have not posted the entire working code, but it is far too long, hence I had to put up only a small code snippet.
Thanks in advance! Cheer!
r shiny shinydashboard
add a comment |
up vote
0
down vote
favorite
I am new to Shiny and Shinydashboard. Please consider the following code snippet (small part of huge code):
dbsidebar <- dashboardSidebar(
sidebarMenu(
menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
menuItem("Rank List", icon = icon("th"), tabName = "Widgets1", badgeColor = "green"),
menuItem("Build Your", icon = icon("th"), tabName = "Widgets2", badgeColor = "green"),
menuItem("Groups", icon = icon("th"), tabName = "Widgets3", badgeColor = "green")
)
)
dbBody <- dashboardBody(
tabItems(
tabItem(tabName = "dashboard",
fluidRow(
#Pie Charts
splitLayout(
#cellWidths = c("50%", "50%"),
style = "border: 1px solid silver;",
cellWidths = 450,
cellArgs = list(style = "padding: 6px"),
plotlyOutput("Piechart1", width = "400px", height = "200px"),
plotlyOutput("Piechart2", width = "400px", height = "200px"),
plotlyOutput("Piechart3", width = "400px", height = "200px")
)
)
),
tabItem(tabName = "Widgets1",
#Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
sliderInput("TCScore","TCScore:",min = 0, max = 100, value = c(0,100))
),
# Show a plot of the generated distribution
mainPanel(
tabPanel("Heading", plotlyOutput("tbTable"))
)
),
downloadButton('downloadData', 'Download')
),
tabItem(tabName = "Widgets2", "XX"
# #Data Table
# sidebarLayout(
# sidebarPanel(
# sliderInput("TCCScore","TCCScore:",min = 0, max = 100, value = c(0,100)),
# ),
#
# # Show a plot of the generated distribution
# mainPanel(
# tabPanel("Heading", dataTableOutput("tbTable1"))
# )
#
# ),
# downloadButton('downloadData', 'Download')
),
tabItem(tabName = "Widgets3", "third"
)
)
)
On the dashboardSidebar, I have added 4 tabs - dashboard, Widget1, Widget2, Widget3. Initially for each of these tabs, I used simple text to render the UI dashboardBody and I got the display correctly. I started filling in each of these sections - "dashboard", "Widget1" and the display worked correctly for me. Unfortunately, for "Widget2 - when I removed the "XX" and uncommented the code shown above, the UI got completely distorted. It looks like the main UI elements in the dashboardBody did not get rendered? Can anyone tell me what I am doing wrong? Please help. I am sorry I have not posted the entire working code, but it is far too long, hence I had to put up only a small code snippet.
Thanks in advance! Cheer!
r shiny shinydashboard
2
It seems like there are a lot of duplicated ids in your UI code. Try making every output and input id unique.
– Gregor de Cillia
Nov 10 at 18:42
@George de Cillia, Thanks for your comment. I figured out the problem line of code - downloadButton('downloadData', 'Download') within "Widget2". The ID was repeated. Thanks again!
– ruser
Nov 11 at 0:43
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am new to Shiny and Shinydashboard. Please consider the following code snippet (small part of huge code):
dbsidebar <- dashboardSidebar(
sidebarMenu(
menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
menuItem("Rank List", icon = icon("th"), tabName = "Widgets1", badgeColor = "green"),
menuItem("Build Your", icon = icon("th"), tabName = "Widgets2", badgeColor = "green"),
menuItem("Groups", icon = icon("th"), tabName = "Widgets3", badgeColor = "green")
)
)
dbBody <- dashboardBody(
tabItems(
tabItem(tabName = "dashboard",
fluidRow(
#Pie Charts
splitLayout(
#cellWidths = c("50%", "50%"),
style = "border: 1px solid silver;",
cellWidths = 450,
cellArgs = list(style = "padding: 6px"),
plotlyOutput("Piechart1", width = "400px", height = "200px"),
plotlyOutput("Piechart2", width = "400px", height = "200px"),
plotlyOutput("Piechart3", width = "400px", height = "200px")
)
)
),
tabItem(tabName = "Widgets1",
#Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
sliderInput("TCScore","TCScore:",min = 0, max = 100, value = c(0,100))
),
# Show a plot of the generated distribution
mainPanel(
tabPanel("Heading", plotlyOutput("tbTable"))
)
),
downloadButton('downloadData', 'Download')
),
tabItem(tabName = "Widgets2", "XX"
# #Data Table
# sidebarLayout(
# sidebarPanel(
# sliderInput("TCCScore","TCCScore:",min = 0, max = 100, value = c(0,100)),
# ),
#
# # Show a plot of the generated distribution
# mainPanel(
# tabPanel("Heading", dataTableOutput("tbTable1"))
# )
#
# ),
# downloadButton('downloadData', 'Download')
),
tabItem(tabName = "Widgets3", "third"
)
)
)
On the dashboardSidebar, I have added 4 tabs - dashboard, Widget1, Widget2, Widget3. Initially for each of these tabs, I used simple text to render the UI dashboardBody and I got the display correctly. I started filling in each of these sections - "dashboard", "Widget1" and the display worked correctly for me. Unfortunately, for "Widget2 - when I removed the "XX" and uncommented the code shown above, the UI got completely distorted. It looks like the main UI elements in the dashboardBody did not get rendered? Can anyone tell me what I am doing wrong? Please help. I am sorry I have not posted the entire working code, but it is far too long, hence I had to put up only a small code snippet.
Thanks in advance! Cheer!
r shiny shinydashboard
I am new to Shiny and Shinydashboard. Please consider the following code snippet (small part of huge code):
dbsidebar <- dashboardSidebar(
sidebarMenu(
menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
menuItem("Rank List", icon = icon("th"), tabName = "Widgets1", badgeColor = "green"),
menuItem("Build Your", icon = icon("th"), tabName = "Widgets2", badgeColor = "green"),
menuItem("Groups", icon = icon("th"), tabName = "Widgets3", badgeColor = "green")
)
)
dbBody <- dashboardBody(
tabItems(
tabItem(tabName = "dashboard",
fluidRow(
#Pie Charts
splitLayout(
#cellWidths = c("50%", "50%"),
style = "border: 1px solid silver;",
cellWidths = 450,
cellArgs = list(style = "padding: 6px"),
plotlyOutput("Piechart1", width = "400px", height = "200px"),
plotlyOutput("Piechart2", width = "400px", height = "200px"),
plotlyOutput("Piechart3", width = "400px", height = "200px")
)
)
),
tabItem(tabName = "Widgets1",
#Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
sliderInput("TCScore","TCScore:",min = 0, max = 100, value = c(0,100))
),
# Show a plot of the generated distribution
mainPanel(
tabPanel("Heading", plotlyOutput("tbTable"))
)
),
downloadButton('downloadData', 'Download')
),
tabItem(tabName = "Widgets2", "XX"
# #Data Table
# sidebarLayout(
# sidebarPanel(
# sliderInput("TCCScore","TCCScore:",min = 0, max = 100, value = c(0,100)),
# ),
#
# # Show a plot of the generated distribution
# mainPanel(
# tabPanel("Heading", dataTableOutput("tbTable1"))
# )
#
# ),
# downloadButton('downloadData', 'Download')
),
tabItem(tabName = "Widgets3", "third"
)
)
)
On the dashboardSidebar, I have added 4 tabs - dashboard, Widget1, Widget2, Widget3. Initially for each of these tabs, I used simple text to render the UI dashboardBody and I got the display correctly. I started filling in each of these sections - "dashboard", "Widget1" and the display worked correctly for me. Unfortunately, for "Widget2 - when I removed the "XX" and uncommented the code shown above, the UI got completely distorted. It looks like the main UI elements in the dashboardBody did not get rendered? Can anyone tell me what I am doing wrong? Please help. I am sorry I have not posted the entire working code, but it is far too long, hence I had to put up only a small code snippet.
Thanks in advance! Cheer!
r shiny shinydashboard
r shiny shinydashboard
asked Nov 10 at 17:33
ruser
445
445
2
It seems like there are a lot of duplicated ids in your UI code. Try making every output and input id unique.
– Gregor de Cillia
Nov 10 at 18:42
@George de Cillia, Thanks for your comment. I figured out the problem line of code - downloadButton('downloadData', 'Download') within "Widget2". The ID was repeated. Thanks again!
– ruser
Nov 11 at 0:43
add a comment |
2
It seems like there are a lot of duplicated ids in your UI code. Try making every output and input id unique.
– Gregor de Cillia
Nov 10 at 18:42
@George de Cillia, Thanks for your comment. I figured out the problem line of code - downloadButton('downloadData', 'Download') within "Widget2". The ID was repeated. Thanks again!
– ruser
Nov 11 at 0:43
2
2
It seems like there are a lot of duplicated ids in your UI code. Try making every output and input id unique.
– Gregor de Cillia
Nov 10 at 18:42
It seems like there are a lot of duplicated ids in your UI code. Try making every output and input id unique.
– Gregor de Cillia
Nov 10 at 18:42
@George de Cillia, Thanks for your comment. I figured out the problem line of code - downloadButton('downloadData', 'Download') within "Widget2". The ID was repeated. Thanks again!
– ruser
Nov 11 at 0:43
@George de Cillia, Thanks for your comment. I figured out the problem line of code - downloadButton('downloadData', 'Download') within "Widget2". The ID was repeated. Thanks again!
– ruser
Nov 11 at 0:43
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241614%2fissue-with-shinydashboard-dashboardsidebar-and-dashboardbody%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
It seems like there are a lot of duplicated ids in your UI code. Try making every output and input id unique.
– Gregor de Cillia
Nov 10 at 18:42
@George de Cillia, Thanks for your comment. I figured out the problem line of code - downloadButton('downloadData', 'Download') within "Widget2". The ID was repeated. Thanks again!
– ruser
Nov 11 at 0:43