Using images from local folder in Shiny app?
I would like to use images stored in a local project folder in for a Shiny app. Outside of DSS, I can store images in a 'www' folder and call upon them within the app, as outlined in this stackoverflow link: Embedding Image in Shiny App
Let's say I have images stored in a local folder called "images". Is there a way I can deploy an app that accesses the images in the local folder and displays them? If not, what would be the recommended workaround?
Best Answer
-
Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,226 Dataiker
Hi @awdursun
,
To use the img(src='...', align = "right"), you can either:
1) host the image on your end.
2) Add images toto the static web resource :
https://knowledge.dataiku.com/latest/data-viz/webapps/index.html#add-your-image-to-the-static-web-resources
And use the https://DSS-url:port/local/static/path-of-the-image-within-resources.png
Answers
-
Thanks so much for the reply @AlexT
! We are currently not set up to use the static web resource, and hosting the images outside of the project might not be allowed, but I will explore other options. -
@AlexT
, is it possible to write directly to a static web resource folder within an R notebook? I would like to save a ggplot output as a .png file, but I only know how to save it to a local folder using dkuManagedFolderUploadPath