Closed matt-sd-watson closed 1 year ago
The PNG image that I want to add is in a www directory in the base directory of the R package.
I think what you actually want is to place the image under the inst
folder (in a location like inst/assets/app-logo.png
). Then you can explicitly mount that directory by doing shiny::addResourcePath("assets", system.file("assets", package = "app"))
. Just make sure you add the proper prefix to file paths (e.g., img(src="assets/app-logo.png")
).
Thanks for the recommendation! i was able to navigate around this by using imageOutput
and renderImage
for the dashboard title, but I may modify it to implement this way.
System details
Browser Version:
Output of
sessionInfo()
:Example application or steps to reproduce the problem
In a separate
app.R
file in the main package directory, the following function call is made to deploy the application on shinyapps (here app is just the stand-in name for the package name):Describe the problem in detail
I am attempting to add an image as a PNG file for a title in my shiny app using the code above The image does not render when using
shinyApp()
to call the application, but does work when usingrunApp(app())
, to wrap the function call toshinyApp()
inrunApp()
, which has been documented here before.The issue is that
runApp()
calls do not work with shinyapps as documented here, so I am not sure what options are available to me to be able to render these images in my shinyapps.io deployment.In my current configuration, I have a function called
app
that bundles the UI and server components together usingshinyApp()
. The PNG image that I want to add is in awww
directory in the base directory of the R package.If there are any suggestions for how to proceed with being able to render PNG images for apps that will ultimately go to a shinyapps.io deployment, that would be greatly appreciated.