How to insert a logo in the sidebar panel

6,678 views
Skip to first unread message

Michael Conklin

unread,
Apr 22, 2013, 6:11:03 PM4/22/13
to shiny-...@googlegroups.com
I think this is an easy answer but my lack of experience with Linux is making this difficult.

In my ui.R I have:

shinyUI(pageWithSidebar(
  headerPanel("MOI Demo"),
#
  sidebarPanel(
    img(src="GfK_logo_online.jpg",height=72,width=72),
    fileInput('file1','Choose an SPSS file'),
        uiOutput('DepVar1'),
    uiOutput('DepVar2'),
    uiOutput('SegVar'),
    uiOutput('IDVar'),
    uiOutput('IndVars')
),
mainPanel(
  tabsetPanel(
    tabPanel("Variables By Segments",
    h4(textOutput("caption1")),
    plotOutput("heatmap",height="800px"),
    value=1),
  tabPanel("Segment Map",
            plotOutput("Map",height="800px"),
              value=2),
  id='panelnum'  )
)))

The page shows up as I expect with the image box at the top of the sidebar panel but it shows the "broken image" icon which indicates to me (I could be wrong) that the app cannot find the image file to display.  I have tried putting the image in various places and specifying the full path but with the same result.  Any ideas?

Mike

Joe Cheng

unread,
Apr 22, 2013, 7:13:06 PM4/22/13
to shiny-...@googlegroups.com
The image needs to be in a "www" subdirectory of the application directory. (But don't put "www" in the img tag's src attribute.)

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Michael Conklin

unread,
Apr 22, 2013, 9:05:41 PM4/22/13
to shiny-...@googlegroups.com
Perfect



--
You received this message because you are subscribed to a topic in the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/shiny-discuss/jPnUC-ufN6o/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to shiny-discus...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages