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!










share|improve this question

















  • 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














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!










share|improve this question

















  • 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












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!










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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












  • 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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














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





















































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







Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

政党

天津地下鉄3号線